utils_le.go 546 B

1234567891011121314151617181920212223
  1. //go:build 386 || amd64 || amd64p32 || arm || arm64 || mipsle || mips64le || mips64p32le || ppc64le || riscv || riscv64 || wasm
  2. // +build 386 amd64 amd64p32 arm arm64 mipsle mips64le mips64p32le ppc64le riscv riscv64 wasm
  3. package yu_base64
  4. import (
  5. "unsafe"
  6. )
  7. //go:nosplit
  8. func bswap32(ptr uintptr) uint32 {
  9. return reverseBytes32(*(*uint32)(unsafe.Pointer(ptr)))
  10. }
  11. //go:nosplit
  12. func stou32(cp uintptr, x uint32) {
  13. *(*uint32)(unsafe.Pointer(cp)) = x
  14. }
  15. //go:nosplit
  16. func ctou32(cp uintptr) uint32 {
  17. return *(*uint32)(unsafe.Pointer(cp))
  18. }