crc32_noasm.go 667 B

1234567891011121314151617181920212223242526272829303132333435
  1. //+build !amd64 noasm appengine
  2. // Copyright 2015, Klaus Post, see LICENSE for details.
  3. package flate
  4. func init() {
  5. useSSE42 = false
  6. }
  7. // crc32sse should never be called.
  8. func crc32sse(a []byte) uint32 {
  9. panic("no assembler")
  10. }
  11. // crc32sseAll should never be called.
  12. func crc32sseAll(a []byte, dst []uint32) {
  13. panic("no assembler")
  14. }
  15. // matchLenSSE4 should never be called.
  16. func matchLenSSE4(a, b []byte, max int) int {
  17. panic("no assembler")
  18. return 0
  19. }
  20. // histogram accumulates a histogram of b in h.
  21. //
  22. // len(h) must be >= 256, and h's elements must be all zeroes.
  23. func histogram(b []byte, h []int32) {
  24. h = h[:256]
  25. for _, t := range b {
  26. h[t]++
  27. }
  28. }