Skip to content

Commit

Permalink
amd64: add missing xor function
Browse files Browse the repository at this point in the history
  • Loading branch information
bwesterb committed Jul 24, 2024
1 parent a9e633f commit 271a9ce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions and_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ func or(dst, a, b []byte) {
orGeneric(dst[l:], a[l:], b[l:])
}

func xor(dst, a, b []byte) {
l := uint64(0)
if hasAVX2() {
l = uint64(len(a)) >> 8
if l != 0 {
xorAVX2(&dst[0], &a[0], &b[0], l)
}
l <<= 8
}
xorGeneric(dst[l:], a[l:], b[l:])
}

func andNot(dst, a, b []byte) {
l := uint64(0)
if hasAVX2() {
Expand Down

0 comments on commit 271a9ce

Please sign in to comment.