regmask_amd64.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package flate
  2. const (
  3. // Masks for shifts with register sizes of the shift value.
  4. // This can be used to work around the x86 design of shifting by mod register size.
  5. // It can be used when a variable shift is always smaller than the register size.
  6. // reg8SizeMaskX - shift value is 8 bits, shifted is X
  7. reg8SizeMask8 = 7
  8. reg8SizeMask16 = 15
  9. reg8SizeMask32 = 31
  10. reg8SizeMask64 = 63
  11. // reg16SizeMaskX - shift value is 16 bits, shifted is X
  12. reg16SizeMask8 = reg8SizeMask8
  13. reg16SizeMask16 = reg8SizeMask16
  14. reg16SizeMask32 = reg8SizeMask32
  15. reg16SizeMask64 = reg8SizeMask64
  16. // reg32SizeMaskX - shift value is 32 bits, shifted is X
  17. reg32SizeMask8 = reg8SizeMask8
  18. reg32SizeMask16 = reg8SizeMask16
  19. reg32SizeMask32 = reg8SizeMask32
  20. reg32SizeMask64 = reg8SizeMask64
  21. // reg64SizeMaskX - shift value is 64 bits, shifted is X
  22. reg64SizeMask8 = reg8SizeMask8
  23. reg64SizeMask16 = reg8SizeMask16
  24. reg64SizeMask32 = reg8SizeMask32
  25. reg64SizeMask64 = reg8SizeMask64
  26. // regSizeMaskUintX - shift value is uint, shifted is X
  27. regSizeMaskUint8 = reg8SizeMask8
  28. regSizeMaskUint16 = reg8SizeMask16
  29. regSizeMaskUint32 = reg8SizeMask32
  30. regSizeMaskUint64 = reg8SizeMask64
  31. )