File: swap64_default.go

package info (click to toggle)
golang-github-segmentio-asm 1.2.0%2Bgit20231107.1cfacc8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 932 kB
  • sloc: asm: 6,093; makefile: 32
file content (13 lines) | stat: -rw-r--r-- 237 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
//go:build purego || !amd64
// +build purego !amd64

package bswap

import "encoding/binary"

func swap64(b []byte) {
	for i := 0; i < len(b); i += 8 {
		u := binary.BigEndian.Uint64(b[i:])
		binary.LittleEndian.PutUint64(b[i:], u)
	}
}