- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for Bswap64 (0.1 sec)
-
test/intrinsic.dir/main.go
for i := range A { x := A[i] y := B[i] X := T.Bswap64(x) // ERROR "intrinsic substitution for Bswap64" Y := T.Bswap64(y) // ERROR "intrinsic substitution for Bswap64" if y != X { logf("Bswap64(0x%08x) expected 0x%08x but got 0x%08x\n", x, y, X) } if x != Y { logf("Bswap64(0x%08x) expected 0x%08x but got 0x%08x\n", y, x, Y) } x32 := uint32(X) y32 := uint32(Y >> 32)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 18 18:06:27 UTC 2022 - 2.6K bytes - Viewed (0) -
src/runtime/internal/sys/intrinsics_test.go
if got := sys.TrailingZeros32(x); got != i { t.Errorf("TrailingZeros32(%d)=%d, want %d", x, got, i) } } } func TestBswap64(t *testing.T) { x := uint64(0x1122334455667788) y := sys.Bswap64(x) if y != 0x8877665544332211 { t.Errorf("Bswap(%x)=%x, want 0x8877665544332211", x, y) } } func TestBswap32(t *testing.T) { x := uint32(0x11223344) y := sys.Bswap32(x) if y != 0x44332211 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 17 23:34:11 UTC 2023 - 984 bytes - Viewed (0) -
src/runtime/internal/sys/intrinsics.go
// Len8 returns the minimum number of bits required to represent x; the result is 0 for x == 0. func Len8(x uint8) int { return int(len8tab[x]) } // Bswap64 returns its input with byte order reversed // 0x0102030405060708 -> 0x0807060504030201 func Bswap64(x uint64) uint64 { c8 := uint64(0x00ff00ff00ff00ff) a := x >> 8 & c8 b := (x & c8) << 8 x = a | b c16 := uint64(0x0000ffff0000ffff) a = x >> 16 & c16
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 14 08:10:45 UTC 2023 - 7.4K bytes - Viewed (0)