Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for ReverseBytes16 (1.07 sec)

  1. src/math/bits/make_examples.go

    		{
    			name: "Reverse",
    			in:   19,
    			out:  [4]any{bits.Reverse8(19), bits.Reverse16(19), bits.Reverse32(19), bits.Reverse64(19)},
    		},
    		{
    			name: "ReverseBytes",
    			in:   15,
    			out:  [4]any{nil, bits.ReverseBytes16(15), bits.ReverseBytes32(15), bits.ReverseBytes64(15)},
    		},
    		{
    			name: "Len",
    			in:   8,
    			out:  [4]any{bits.Len8(8), bits.Len16(8), bits.Len32(8), bits.Len64(8)},
    		},
    	} {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 3K bytes
    - Viewed (0)
  2. src/math/bits/example_test.go

    	// 1100100000000000000000000000000000000000000000000000000000000000
    }
    
    func ExampleReverseBytes16() {
    	fmt.Printf("%016b\n", 15)
    	fmt.Printf("%016b\n", bits.ReverseBytes16(15))
    	// Output:
    	// 0000000000001111
    	// 0000111100000000
    }
    
    func ExampleReverseBytes32() {
    	fmt.Printf("%032b\n", 15)
    	fmt.Printf("%032b\n", bits.ReverseBytes32(15))
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:16:09 UTC 2019
    - 5.3K bytes
    - Viewed (0)
  3. src/math/bits/bits.go

    	if UintSize == 32 {
    		return uint(ReverseBytes32(uint32(x)))
    	}
    	return uint(ReverseBytes64(uint64(x)))
    }
    
    // ReverseBytes16 returns the value of x with its bytes in reversed order.
    //
    // This function's execution time does not depend on the inputs.
    func ReverseBytes16(x uint16) uint16 {
    	return x>>8 | x<<8
    }
    
    // ReverseBytes32 returns the value of x with its bytes in reversed order.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 17.9K bytes
    - Viewed (0)
  4. test/codegen/mathbits.go

    	// s390x:"MOVWBR"
    	// arm64:"REVW"
    	// ppc64x/power10: "BRW"
    	return bits.ReverseBytes32(n)
    }
    
    func ReverseBytes16(n uint16) uint16 {
    	// amd64:"ROLW"
    	// arm64:"REV16W",-"UBFX",-"ORR"
    	// arm/5:"SLL","SRL","ORR"
    	// arm/6:"REV16"
    	// arm/7:"REV16"
    	// ppc64x/power10: "BRH"
    	return bits.ReverseBytes16(n)
    }
    
    // --------------------- //
    //    bits.RotateLeft    //
    // --------------------- //
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:51:17 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  5. api/go1.9.txt

    pkg math/bits, func Reverse32(uint32) uint32
    pkg math/bits, func Reverse64(uint64) uint64
    pkg math/bits, func Reverse8(uint8) uint8
    pkg math/bits, func ReverseBytes(uint) uint
    pkg math/bits, func ReverseBytes16(uint16) uint16
    pkg math/bits, func ReverseBytes32(uint32) uint32
    pkg math/bits, func ReverseBytes64(uint64) uint64
    pkg math/bits, func RotateLeft(uint, int) uint
    pkg math/bits, func RotateLeft16(uint16, int) uint16
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 04 20:20:20 UTC 2021
    - 10.7K bytes
    - Viewed (0)
  6. src/math/bits/bits_test.go

    		testReverseBytes(t, test.r, test.x)
    	}
    }
    
    func testReverseBytes(t *testing.T, x64, want64 uint64) {
    	x16 := uint16(x64)
    	got16 := ReverseBytes16(x16)
    	want16 := uint16(want64 >> (64 - 16))
    	if got16 != want16 {
    		t.Fatalf("ReverseBytes16(%#04x) == %#04x; want %#04x", x16, got16, want16)
    	}
    
    	x32 := uint32(x64)
    	got32 := ReverseBytes32(x32)
    	want32 := uint32(want64 >> (64 - 32))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 22 20:11:06 UTC 2020
    - 32.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/_gen/PPC64Ops.go

    		{name: "BRW", argLength: 1, reg: gp11, asm: "BRW"},                                              // reversebytes32(arg0)
    		{name: "BRH", argLength: 1, reg: gp11, asm: "BRH"},                                              // reversebytes16(arg0)
    		{name: "FNEG", argLength: 1, reg: fp11, asm: "FNEG"},                                            // -arg0 (floating point)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:59:38 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssagen/ssa.go

    	// ReverseBytes inlines correctly, no need to intrinsify it.
    	// Nothing special is needed for targets where ReverseBytes16 lowers to a rotate
    	// On Power10, 16-bit rotate is not available so use BRH instruction
    	if buildcfg.GOPPC64 >= 10 {
    		addF("math/bits", "ReverseBytes16",
    			func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
    				return s.newValue1(ssa.OpBswap16, types.Types[types.TUINT], args[0])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Rem64", Func, 14},
    		{"Reverse", Func, 9},
    		{"Reverse16", Func, 9},
    		{"Reverse32", Func, 9},
    		{"Reverse64", Func, 9},
    		{"Reverse8", Func, 9},
    		{"ReverseBytes", Func, 9},
    		{"ReverseBytes16", Func, 9},
    		{"ReverseBytes32", Func, 9},
    		{"ReverseBytes64", Func, 9},
    		{"RotateLeft", Func, 9},
    		{"RotateLeft16", Func, 9},
    		{"RotateLeft32", Func, 9},
    		{"RotateLeft64", Func, 9},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top