crc32_noasm.go 682 B

12345678910111213141516171819202122232425262728293031323334
  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) hash {
  9. panic("no assembler")
  10. }
  11. // crc32sseAll should never be called.
  12. func crc32sseAll(a []byte, dst []hash) {
  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. // h must be at least 256 entries in length,
  22. // and must be cleared before calling this function.
  23. func histogram(b []byte, h []int32) {
  24. for _, t := range b {
  25. h[t]++
  26. }
  27. }