xorbytes_amd64.go 828 B

1234567891011121314151617181920212223242526272829
  1. // xorbytes_amd64.go - AMD64 optimized xorBytes32.
  2. //
  3. // To the extent possible under law, Yawning Angel has waived all copyright
  4. // and related or neighboring rights to lioness, using the Creative
  5. // Commons "CC0" public domain dedication. See LICENSE or
  6. // <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
  7. // +build amd64,!gccgo,!appengine
  8. package lioness
  9. //go:noescape
  10. func xorBytes32Amd64SSE2(dest, a, b *byte)
  11. func xorBytes32Amd64(dst, a, b []byte) {
  12. // This is basically a pointless microoptimization, and only
  13. // helps the 33 byte by 0.8 MB/s on my craptop. Using AVX2
  14. // is essentially totally pointless, so I didn't do it.
  15. if len(dst) != 32 {
  16. panic("lioness: xorBytes32Amd64() len != 32")
  17. }
  18. xorBytes32Amd64SSE2(&dst[0], &a[0], &b[0])
  19. }
  20. func init() {
  21. xorBytes32 = xorBytes32Amd64
  22. }