Skip to content

Instantly share code, notes, and snippets.

View quasilyte's full-sized avatar
🕵️

quasilyte quasilyte

🕵️
View GitHub Profile

Given this data.txt file that includes all encodings from new end2end tests:

c5f970ffb1
c4e37bf010ff
c4e3fbf010ff
c5f970d1ff
c5fd70d1ff
c5fa70d1ff
c5fe70d1ff
c5fb70d1ff
xed conventional filename
AVX512BW_128 AVX512BW+AVX512VL avx512bw
AVX512BW_128N AVX512BW+AVX512VL avx512bw
AVX512BW_256 AVX512BW+AVX512VL avx512bw
AVX512BW_512 AVX512BW avx512bw
AVX512BW_KOP AVX512BW avx512bw
AVX512CD_128 AVX512CD+AVX512VL avx512cd
AVX512CD_256 AVX512CD+AVX512VL avx512cd
AVX512CD_512 AVX512CD avx512cd
AVX512DQ_128 AVX512DQ+AVX512VL avx512dq
$GOROOT/src/net/http/socks_bundle.go:106:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:425:4: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:430:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:434:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:438:3: append-combine: can combine chain of 3 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:443:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:448:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/dist/test.go:605:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/dist/test.go:674:4: append-combine: can combine chain of 2 appends into one
$GOROOT/src/net/dnsclient.go:30:3: append-combine: can combine chain of 4 appends into one
$GOROOT/src/strings/replace.go:450:22: unslice: could simplify s[:] to s
$GOROOT/src/strings/replace.go:148:2: elseif: should rewrite if-else to switch statement
$GOROOT/src/strings/replace.go:156:3: elseif: should rewrite if-else to switch statement
$GOROOT/src/strings/replace.go:219:3: elseif: should rewrite if-else to switch statement
$GOROOT/src/strings/replace.go:370:1: paramTypeCombine: func(pattern string, value string) *singleStringReplacer could be replaced with func(pattern, value string) *singleStringReplacer
$GOROOT/src/strings/replace.go:259:2: rangeExprCopy: copy of r.mapping (256 bytes) can be avoided with &r.mapping
$GOROOT/src/strings/replace.go:264:2: rangeExprCopy: copy of r.mapping (256 bytes) can be avoided with &r.mapping
$GOROOT/src/strings/strings.go:791:1: paramTypeCombine: func(s string, cutset string) string could be replaced with func(s, cutset string) string
$GOROOT/src/strings/strings.go:800:1: paramTypeCombine: func(s string, cutset string) string could be replaced with func(s,
diff --git a/src/cmd/compile/internal/amd64/ssa.go b/src/cmd/compile/internal/amd64/ssa.go
index 307cdc5e83..dc1ab4161a 100644
--- a/src/cmd/compile/internal/amd64/ssa.go
+++ b/src/cmd/compile/internal/amd64/ssa.go
@@ -149,6 +149,17 @@ func duff(size int64) (int64, int64) {
func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
switch v.Op {
+ case ssa.OpAMD64FMASD:
+ p := s.Prog(v.Op.Asm())
quasilyte src $ gogrep -x '$x & ^$y' ./...
bytes/bytes.go:294:8: wasSpace & ^isSpace
cmd/internal/src/pos.go:407:14: uint(x) & ^uint(xlogueMax<<xlogueShift)
cmd/internal/src/pos.go:415:14: uint(x) & ^uint(isStmtMax<<isStmtShift)
crypto/elliptic/p256.go:1058:11: pIsNoninfiniteMask & ^nIsInfinityMask
crypto/elliptic/p256.go:1139:10: pIsNoninfiniteMask & ^nIsInfinityMask
crypto/tls/conn.go:818:20: payloadBytes & ^(blockSize - 1)
hash/crc32/crc32_ppc64le.go:42:14: len(p) & ^vecAlignMask
hash/crc32/crc32_ppc64le.go:79:14: len(p) & ^vecAlignMask
hash/crc32/crc32_s390x.go:50:14: len(p) & ^vxAlignMask
@quasilyte
quasilyte / channels.go
Created November 8, 2018 09:44
Channel vs mutex vs atomic for synchronized counter
package benchmark
import (
"context"
"runtime"
"sync"
"sync/atomic"
"testing"
"time"
)
@quasilyte
quasilyte / no_preempt.go
Last active June 8, 2022 13:02
Example of a deadlock due to the lack of a better preemption in go scheduler
package main
import (
"fmt"
"runtime"
"time"
)
// Запускать через "go run no_preempt.go".
// См. также: https://github.com/golang/go/issues/10958.
package main
import "sync"
// Запустите с помощью "go run -race datarace.go".
var globalX int
func main() {
var wg sync.WaitGroup

Project manifest

This document exists to make it clear what fits gocritic project and what is not.
In a sense, this manifest describes project philosophy.

This document may change over time.
Contributors and maintainers are encouraged to discuss it and propose changes.

What gocritic is