Skip to content

Instantly share code, notes, and snippets.

@quasilyte
Created September 3, 2018 23:59
Show Gist options
  • Select an option

  • Save quasilyte/f82db4b5c65a8577f4620e2d2b57cf5b to your computer and use it in GitHub Desktop.

Select an option

Save quasilyte/f82db4b5c65a8577f4620e2d2b57cf5b to your computer and use it in GitHub Desktop.
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
hash/crc32/crc32_s390x.go:81:14: len(p) & ^vxAlignMask
net/internal/socktest/switch_posix.go:41:14: uint(sotype) & ^uint(0xff)
os/file_plan9.go:94:10: flag & ^O_CREATE
runtime/trace.go:1087:13: traceEv & ^traceFutileWakeup
runtime/netpoll_solaris.go:155:13: old & ^clear
runtime/syscall_windows_test.go:738:14: mask & ^(1 << uint(i))
strings/strings.go:335:8: wasSpace & ^isSpace
syscall/netlink_linux.go:13:9: (msglen + NLMSG_ALIGNTO - 1) & ^(NLMSG_ALIGNTO - 1)
syscall/netlink_linux.go:19:9: (attrlen + RTA_ALIGNTO - 1) & ^(RTA_ALIGNTO - 1)
syscall/sockcmsg_unix.go:22:9: (salen + salign - 1) & ^(salign - 1)
syscall/syscall_linux.go:41:5: flags & ^(_AT_SYMLINK_NOFOLLOW | _AT_EACCESS)
syscall/route_bsd.go:42:9: (salen + salign - 1) & ^(salign - 1)
quasilyte src $ gogrep -x '$x &^ $y' ./...
archive/tar/common.go:568:14: os.FileMode(fi.h.Mode) &^ 07777
archive/tar/tar_test.go:251:13: h.Mode &^ c_ISGID
cmd/asm/internal/arch/arm.go:212:11: bits &^ 0xf
cmd/asm/internal/arch/arm.go:238:12: bits &^ arm.C_SCOND
cmd/compile/internal/gc/align.go:24:9: (o + r - 1) &^ (r - 1)
cmd/compile/internal/gc/bv.go:182:14: x &^ src2.b[i]
cmd/compile/internal/gc/esc.go:380:6: e &^ EscMask
cmd/compile/internal/gc/esc.go:388:11: e &^ EscMask
cmd/compile/internal/gc/esc.go:1599:10: e &^ (bitsMaskForTag << shift)
cmd/compile/internal/gc/iimport.go:418:9: n &^ 1
cmd/compile/internal/gc/plive.go:222:11: v1.regs &^ v2.regs
cmd/compile/internal/ssa/debug.go:656:12: last.Registers &^ (1 << reg)
cmd/compile/internal/ssa/debug.go:732:25: last.Registers &^ (1 << uint8(vReg.num))
cmd/compile/internal/ssa/regalloc.go:378:5: mask &^ s.used
cmd/compile/internal/ssa/regalloc.go:379:18: mask &^ s.used
cmd/compile/internal/ssa/regalloc.go:421:7: s.compatRegs(v2.Type) &^ s.used &^ s.tmpused &^ (regMask(1) << r)
cmd/compile/internal/ssa/regalloc.go:421:7: s.compatRegs(v2.Type) &^ s.used &^ s.tmpused
cmd/compile/internal/ssa/regalloc.go:421:7: s.compatRegs(v2.Type) &^ s.used
cmd/compile/internal/ssa/regalloc.go:961:10: s.values[a.ID].regs &^ phiUsed
cmd/compile/internal/ssa/regalloc.go:993:11: s.compatRegs(a.Type) &^ s.used &^ phiUsed
cmd/compile/internal/ssa/regalloc.go:993:11: s.compatRegs(a.Type) &^ s.used
cmd/compile/internal/ssa/regalloc.go:1024:10: s.compatRegs(v.Type) &^ phiUsed &^ s.used
cmd/compile/internal/ssa/regalloc.go:1024:10: s.compatRegs(v.Type) &^ phiUsed
cmd/compile/internal/ssa/regalloc.go:1282:31: mask &^ s.used
cmd/compile/internal/ssa/regalloc.go:1290:9: mask &^ desired.avoid
cmd/compile/internal/ssa/regalloc.go:1333:9: s.compatRegs(v.Args[0].Type) &^ s.used
cmd/compile/internal/ssa/regalloc.go:1376:8: m &^ desired.avoid
cmd/compile/internal/ssa/regalloc.go:1404:14: out.regs & s.allocatable &^ used
cmd/compile/internal/ssa/regalloc.go:1420:37: mask &^ s.used
cmd/compile/internal/ssa/regalloc.go:1436:30: mask &^ s.used
cmd/compile/internal/ssa/regalloc.go:1443:9: mask &^ desired.avoid
cmd/compile/internal/ssa/regalloc.go:1546:10: s.compatRegs(v.Type) &^ s.used
cmd/compile/internal/ssa/regalloc.go:1547:8: m &^ desired.avoid
cmd/compile/internal/ssa/regalloc.go:2221:7: m &^ e.usedRegs
cmd/compile/internal/ssa/regalloc.go:2225:6: m &^ e.uniqueRegs &^ e.finalRegs
cmd/compile/internal/ssa/regalloc.go:2225:6: m &^ e.uniqueRegs
cmd/compile/internal/ssa/regalloc.go:2229:6: m &^ e.uniqueRegs
cmd/compile/internal/ssa/rewrite.go:840:6: v &^ 0xff
cmd/compile/internal/ssa/rewriteARM.go:4299:14: d &^ c
cmd/compile/internal/ssa/writebarrier.go:353:9: (o + r - 1) &^ (r - 1)
cmd/gofmt/gofmt_test.go:40:11: scanner.GoTokens &^ scanner.SkipComments
cmd/internal/buildid/note.go:18:10: (sz + 3) &^ 3
cmd/internal/buildid/note.go:144:15: (nameSize + 3) &^ 3
cmd/internal/buildid/note.go:145:14: (valSize + 3) &^ 3
cmd/internal/buildid/note.go:152:18: (off + align - 1) &^ (align - 1)
cmd/internal/buildid/rewrite.go:36:10: (len(id) + 127) &^ 127
cmd/internal/gcprog/gcprog.go:207:13: x &^ 0x80
cmd/internal/gcprog/gcprog.go:212:17: x &^ 0x80
cmd/internal/gcprog/gcprog.go:234:14: c &^ 0x80
cmd/internal/obj/arm/asm5.go:385:10: (p.Pc + 15) &^ 15
cmd/internal/obj/arm/asm5.go:431:13: (int64(origPC) + 15) &^ 15
cmd/internal/obj/arm/asm5.go:459:15: out[0] &^ 0x3000
cmd/internal/obj/arm/asm5.go:1046:6: v &^ 0xff
cmd/internal/obj/arm/asm5.go:1061:34: v &^ m
cmd/internal/obj/arm/asm5.go:2115:10: p.From.Offset &^ 0xf
cmd/internal/obj/arm/asm5.go:2869:9: p.From.Offset &^ 0xf
cmd/internal/obj/arm64/asm7.go:128:9: o &^ (3 << 22)
cmd/internal/obj/arm64/asm7.go:1213:17: 63 &^ (period<<1 - 1)
cmd/internal/obj/arm64/asm7.go:1363:7: uint64(v) &^ (uint64(0xFFFF) << uint(s))
cmd/internal/obj/arm64/asm7.go:3088:6: hi &^ 0xFFF000
cmd/internal/obj/arm64/asm7.go:3132:6: hi &^ 0xFFF000
cmd/internal/obj/arm64/asm7.go:3198:13: v &^ (3 << 19)
cmd/internal/obj/arm64/asm7.go:3218:13: v &^ (3 << 19)
cmd/internal/obj/arm64/asm7.go:3226:7: uint64(p.From.Offset) &^ uint64(0xF)
cmd/internal/obj/arm64/asm7.go:3437:7: p.From.Offset &^ int64(SYSARG4(0x7, 0xF, 0xF, 0x7))
cmd/internal/obj/arm64/asm7.go:3534:6: nzcv &^ 0xF
cmd/internal/obj/mips/obj0.go:579:21: (p.To.Reg - REG_F0) &^ 1
cmd/internal/obj/mips/obj0.go:585:21: (p.From.Reg - REG_F0) &^ 1
cmd/internal/obj/ppc64/asm9.go:3072:16: v &^ t
cmd/internal/obj/ppc64/asm9.go:3090:16: v &^ t
cmd/link/internal/amd64/asm.go:43:9: x &^ 0x80000000
cmd/link/internal/arm/asm.go:451:6: v &^ 0xff
cmd/link/internal/arm64/asm.go:337:37: (s.Value + int64(r.Off)) &^ 0xfff
cmd/link/internal/ld/dwarf.go:1276:12: new_stmt &^ 1
cmd/link/internal/ld/lib.go:1445:5: magic &^ 1
cmd/link/internal/ld/lib.go:1445:31: magic &^ 0x01000000
cmd/link/internal/ld/macho_combine_dwarf.go:174:20: (linkseg.Addr + linkseg.Memsz + 1<<pageAlign - 1) &^ (1<<pageAlign - 1)
cmd/link/internal/ld/pe.go:1355:17: addr &^ pageMask
cmd/link/internal/ld/symtab.go:493:16: (s.Size + int64(s.Align) - 1) &^ (int64(s.Align) - 1)
cmd/link/internal/loadmacho/ldmacho.go:442:5: binary.BigEndian.Uint32(hdr[:]) &^ 1
cmd/link/internal/loadmacho/ldmacho.go:444:12: binary.LittleEndian.Uint32(hdr[:]) &^ 1
cmd/link/internal/mips/asm.go:93:31: uint32(t>>2) &^ 0xfc000000
cmd/link/internal/mips64/asm.go:161:32: uint32(t>>2) &^ 0xfc000000
cmd/link/internal/ppc64/asm.go:685:22: uint32(t) &^ 0xfc000003
cmd/link/internal/ppc64/asm.go:698:11: val &^ 0xffff
crypto/aes/gcm_s390x.go:109:9: len(data) &^ 0xf
crypto/md5/md5.go:153:8: len(p) &^ (chunk - 1)
crypto/rsa/rsa.go:627:39: lookingForIndex &^ equals0
crypto/rsa/rsa.go:630:5: firstByteIsZero & lHash2Good &^ invalid &^ lookingForIndex
crypto/rsa/rsa.go:630:5: firstByteIsZero & lHash2Good &^ invalid
crypto/sha1/sha1.go:143:8: len(p) &^ (chunk - 1)
crypto/sha256/sha256.go:216:8: len(p) &^ (chunk - 1)
crypto/sha512/sha512.go:279:8: len(p) &^ (chunk - 1)
debug/macho/file.go:240:9: Magic32 &^ 1
debug/macho/file.go:241:7: be &^ 1
debug/macho/file.go:244:7: le &^ 1
encoding/json/encode.go:209:57: src[i+2] &^ 1
encoding/json/indent.go:31:57: src[i+2] &^ 1
go/constant/value.go:1060:8: a &^ b
go/internal/gcimporter/iimport.go:390:9: n &^ 1
go/types/stmt.go:113:11: ctxt &^ fallthroughOk
go/types/stmt.go:308:11: ctxt &^ (fallthroughOk | finalSwitchCase)
internal/poll/fd_mutex.go:182:11: old &^ mutexBit
math/abs.go:13:25: Float64bits(x) &^ (1 << 63)
math/copysign.go:11:25: Float64bits(x) &^ sign
math/big/arith.go:145:16: (xi | yi) &^ zi
math/big/arith.go:164:8: yi &^ xi
math/big/arith.go:183:7: xi &^ zi
math/big/arith.go:201:8: zi &^ xi
math/big/nat.go:925:10: x[i] &^ y[i]
math/big/float_test.go:562:11: x &^ (1<<(64-prec) - 1)
math/big/float_test.go:597:11: x &^ (1<<(63-prec) - 1)
math/big/float_test.go:640:19: x &^ (1<<(52-prec) - 1)
os/file_plan9.go:105:10: flag &^ O_APPEND
os/file_plan9.go:209:11: odir.Mode &^ chmodMask
os/file_plan9.go:384:11: odir.Mode &^ chmodMask
os/file_windows.go:290:42: a &^ syscall.FILE_ATTRIBUTE_READONLY
os/os_unix_test.go:224:46: mode &^ ModePerm
reflect/type.go:532:9: (n + a - 1) &^ (a - 1)
reflect/value.go:427:9: (off + a - 1) &^ (a - 1)
reflect/value.go:471:10: (off + a - 1) &^ (a - 1)
reflect/value.go:633:9: (x + n - 1) &^ (n - 1)
reflect/value.go:2457:13: ret.flag &^ flagAddr
reflect/value.go:2464:13: ret.flag &^ flagAddr
reflect/value.go:2471:13: ret.flag &^ flagAddr
regexp/backtrack.go:247:7: syntax.EmptyOp(inst.Arg) &^ i.context(pos)
regexp/exec.go:280:6: syntax.EmptyOp(i.Arg) &^ cond
regexp/exec.go:338:17: syntax.EmptyOp(inst.Arg) &^ flag
regexp/exec.go:386:7: syntax.EmptyOp(inst.Arg) &^ flag
regexp/all_test.go:527:4: syntax.Perl &^ syntax.OneLine
regexp/syntax/parse.go:111:32: p.flags &^ FoldCase
regexp/syntax/parse.go:116:14: p.flags &^ FoldCase
regexp/syntax/simplify_test.go:141:39: Perl &^ OneLine
runtime/float.go:34:25: float64bits(x) &^ sign
runtime/float.go:41:25: float64bits(x) &^ sign
runtime/map.go:965:11: h.flags &^ (iterator | oldIterator)
runtime/mbarrier.go:201:53: asize &^ (sys.PtrSize - 1)
runtime/mbitmap.go:210:16: (sfreeindex + 64) &^ (64 - 1)
runtime/mbitmap.go:1360:12: *hbitp &^ (bitPointer | bitScan | (bitPointer|bitScan)<<heapBitsShift)
runtime/mbitmap.go:1387:14: *h.bitp &^ ((bitPointer | bitScan | (bitPointer|bitScan)<<heapBitsShift) << (2 * heapBitsShift))
runtime/mbitmap.go:1413:14: *h.bitp &^ (bitPointer | bitScan | (bitPointer|bitScan)<<heapBitsShift)
runtime/mbitmap.go:1933:16: x &^ 0x80
runtime/mcentral.go:139:18: s.freeindex &^ (64 - 1)
runtime/mem_linux.go:73:11: uintptr(v) &^ (s - 1)
runtime/mem_linux.go:77:11: (uintptr(v) + n - 1) &^ (s - 1)
runtime/mem_linux.go:121:10: (uintptr(v) + (s - 1)) &^ (s - 1)
runtime/mem_linux.go:123:10: (uintptr(v) + n) &^ (s - 1)
runtime/mgcmark.go:724:9: readgstatus(gp) &^ _Gscan
runtime/mheap.go:1088:12: (start + physPageSize - 1) &^ (physPageSize - 1)
runtime/mheap.go:1127:12: (start + physPageSize - 1) &^ (physPageSize - 1)
runtime/panic.go:140:20: (deferHeaderSize + 15) &^ 15
runtime/panic.go:843:5: status &^ _Gscan
runtime/proc.go:649:5: status &^ _Gscan
runtime/proc.go:794:16: oldval &^ _Gscan
runtime/proc.go:889:16: readgstatus(gp) &^ _Gscan
runtime/proc.go:1000:30: s &^ _Gscan
runtime/proc.go:2162:5: status &^ _Gscan
runtime/proc.go:2676:5: status &^ _Gscan
runtime/proc.go:3320:8: (siz + 7) &^ 7
runtime/proc.go:4251:10: s &^ _Gscan
runtime/profbuf.go:488:16: bw &^ profWriteExtra
runtime/signal_sighandler.go:53:12: flags &^ _SigPanic
runtime/signal_sighandler.go:120:63: readgstatus(_g_.m.curg) &^ _Gscan
runtime/stack.go:1047:5: gstatus &^ _Gscan
runtime/stubs.go:296:9: (n + a - 1) &^ (a - 1)
runtime/traceback.go:725:5: readgstatus(gp) &^ _Gscan
runtime/traceback.go:948:21: readgstatus(gp) &^ _Gscan
runtime/vdso_linux.go:287:12: *k.ptr &^ (physPageSize - 1)
runtime/lock_sema.go:74:31: v &^ locked
runtime/lock_sema.go:106:18: v &^ locked
runtime/mem_plan9.go:121:9: (p + _PAGESIZE - 1) &^ (_PAGESIZE - 1)
runtime/mksizeclasses.go:154:15: (psize / (psize / c.size)) &^ (largeSizeDiv - 1)
runtime/os3_plan9.go:55:12: flags &^ _SigPanic
runtime/os_windows.go:867:32: (uintptr(unsafe.Pointer(&rbuf[15]))) &^ 15
runtime/malloc_test.go:163:10: uintptr(p) &^ 7
runtime/runtime_mmap_test.go:19:30: ^uintptr(0) &^ (runtime.GetPhysPageSize() - 1)
runtime/internal/atomic/atomic_arm.go:149:37: uaddr &^ 3
runtime/internal/atomic/atomic_arm.go:163:37: uaddr &^ 3
runtime/pprof/elf.go:94:30: (nameSize + 3) &^ 3
runtime/pprof/elf.go:95:26: (descSize + 3) &^ 3
strconv/quote.go:495:40: i &^ 1
strconv/quote.go:504:39: i &^ 1
strconv/makeisprint.go:74:34: i &^ 1
strconv/makeisprint.go:83:33: i &^ 1
syscall/syscall_linux.go:115:5: flags &^ _AT_SYMLINK_NOFOLLOW
syscall/fs_nacl.go:562:12: ip.Mode &^ 0777
syscall/fs_nacl.go:573:17: f.inode.Mode &^ 0777
syscall/syscall_dragonfly.go:68:9: (16 + namlen + 1 + 7) &^ 7
text/scanner/scanner_test.go:290:14: GoTokens &^ SkipComments
text/scanner/scanner_test.go:311:11: GoTokens &^ SkipComments
time/time.go:865:11: t.wall &^ nsecMask
unicode/letter.go:233:27: (r - rune(cr.Lo)) &^ 1
unicode/utf8/utf8.go:161:10: rune(p[0]) &^ mask
unicode/utf8/utf8.go:209:10: rune(s[0]) &^ mask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment