Skip to content

Instantly share code, notes, and snippets.

//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc
// This file contains the specialisation of Decoder.Decompress4X
// that uses an asm implementation of its main loop.
package huff0
import (
"errors"
"fmt"
package main
//go:generate go run gen.go -out decompress_amd64_avo.s -stubs delme.go -pkg=huff0
import (
"flag"
"io/ioutil"
"os"
"path/filepath"
"strconv"
@klauspost
klauspost / gen.go
Last active March 16, 2022 18:24
zstd decomp - avo
package main
//go:generate go run gen.go -out seqdec_amd64-avo.s -stubs delme.go -pkg=zstd
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
#include "textflag.h"
#include "funcdata.h"
#include "go_asm.h"
#define mask $0x7ff // up to 11 bits, according to the spec
#define bufoff 256 // see decompress.go, we're using [4][256]byte
//func decompress4x_main_loop_bmi1(pbr0, pbr1, pbr2, pbr3 *bitReaderShifted,
// peekBits uint8, buf *byte, tbl *dEntrySingle) (int, bool)
TEXT ·decompress4x_main_loop_bmi1(SB), NOSPLIT, $0
package operand
// CalcLogTern will calculate VPTERNLOGD/VPTERNLOGD based on a function.
// Argument order is AT&T, a being *mm3, b being *mm2, c being *mm1 and destination.
// This can be used directly in VPTERNLOGD(a, b, c, CalcLogTern(...))
func CalcLogTern(fn func(a, b, c bool) bool) U8 {
var res U8
for ai, av := range []bool{false, true} {
for bi, bv := range []bool{false, true} {
for ci, cv := range []bool{false, true} {
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
package main
// Adapted from : https://gist.github.com/arnehormann/65421048f56ac108f6b5
import (
"encoding/binary"
"flag"
"fmt"
"io"
"io/ioutil"
2019/10/12 13:17:16 process finished successfully
2019/10/12 13:17:16 Running fuzzing with: ./fuzzer -print_final_stats=1 -exact_artifact_path=./artifact -error_exitcode=76 -max_total_time=3600 corpus seed -rss_limit_mb=1984
FUZZER: INFO: Seed: 1948056531
FUZZER: INFO: 65536 Extra Counters
FUZZER: INFO: 557 files found in corpus
FUZZER: INFO: 588 files found in seed
FUZZER: INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes
FUZZER: INFO: seed corpus: files: 1145 min: 1b max: 1048576b total: 113712584b rss: 776Mb
FUZZER: #256 pulse ft: 1565 corp: 92/921b lim: 4 exec/s: 85 rss: 776Mb
FUZZER: #512 pulse ft: 2480 corp: 215/5035b lim: 4 exec/s: 73 rss: 776Mb
//+build ignore
package main
// Adapted from : https://gist.github.com/arnehormann/65421048f56ac108f6b5
import (
"bufio"
"encoding/binary"
"flag"