Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for TrailingZeros16 (0.88 sec)

  1. src/math/bits/example_test.go

    	fmt.Printf("TrailingZeros8(%08b) = %d\n", 14, bits.TrailingZeros8(14))
    	// Output:
    	// TrailingZeros8(00001110) = 1
    }
    
    func ExampleTrailingZeros16() {
    	fmt.Printf("TrailingZeros16(%016b) = %d\n", 14, bits.TrailingZeros16(14))
    	// Output:
    	// TrailingZeros16(0000000000001110) = 1
    }
    
    func ExampleTrailingZeros32() {
    	fmt.Printf("TrailingZeros32(%032b) = %d\n", 14, bits.TrailingZeros32(14))
    	// 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)
  2. src/math/bits/make_examples.go

    			in:   1,
    			out:  [4]any{bits.LeadingZeros8(1), bits.LeadingZeros16(1), bits.LeadingZeros32(1), bits.LeadingZeros64(1)},
    		},
    		{
    			name: "TrailingZeros",
    			in:   14,
    			out:  [4]any{bits.TrailingZeros8(14), bits.TrailingZeros16(14), bits.TrailingZeros32(14), bits.TrailingZeros64(14)},
    		},
    		{
    			name: "OnesCount",
    			in:   14,
    			out:  [4]any{bits.OnesCount8(14), bits.OnesCount16(14), bits.OnesCount32(14), bits.OnesCount64(14)},
    		},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 3K bytes
    - Viewed (0)
  3. test/codegen/mathbits.go

    	// arm:"CLZ"
    	// arm64:"RBITW","CLZW"
    	// s390x:"FLOGR","MOVWZ"
    	// ppc64x/power8:"ANDN","POPCNTW"
    	// ppc64x/power9: "CNTTZW"
    	// wasm:"I64Ctz"
    	return bits.TrailingZeros32(n)
    }
    
    func TrailingZeros16(n uint16) int {
    	// amd64:"BSFL","ORL\\t\\$65536"
    	// 386:"BSFL\t"
    	// arm:"ORR\t\\$65536","CLZ",-"MOVHU\tR"
    	// arm64:"ORR\t\\$65536","RBITW","CLZW",-"MOVHU\tR",-"RBIT\t",-"CLZ\t"
    	// s390x:"FLOGR","OR\t\\$65536"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:51:17 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  4. src/math/bits/bits.go

    }
    
    // TrailingZeros8 returns the number of trailing zero bits in x; the result is 8 for x == 0.
    func TrailingZeros8(x uint8) int {
    	return int(ntz8tab[x])
    }
    
    // TrailingZeros16 returns the number of trailing zero bits in x; the result is 16 for x == 0.
    func TrailingZeros16(x uint16) int {
    	if x == 0 {
    		return 16
    	}
    	// see comment in TrailingZeros64
    	return int(deBruijn32tab[uint32(x&-x)*deBruijn32>>(32-5)])
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 17.9K bytes
    - Viewed (0)
  5. api/go1.9.txt

    pkg math/bits, func RotateLeft32(uint32, int) uint32
    pkg math/bits, func RotateLeft64(uint64, int) uint64
    pkg math/bits, func RotateLeft8(uint8, int) uint8
    pkg math/bits, func TrailingZeros(uint) int
    pkg math/bits, func TrailingZeros16(uint16) int
    pkg math/bits, func TrailingZeros32(uint32) int
    pkg math/bits, func TrailingZeros64(uint64) int
    pkg math/bits, func TrailingZeros8(uint8) int
    pkg mime, var ErrInvalidMediaParameter error
    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

    				}
    				if got != want {
    					t.Fatalf("TrailingZeros8(%#02x) == %d; want %d", x, got, want)
    				}
    			}
    
    			if x <= 1<<16-1 {
    				got := TrailingZeros16(uint16(x))
    				if x == 0 {
    					want = 16
    				}
    				if got != want {
    					t.Fatalf("TrailingZeros16(%#04x) == %d; want %d", x, got, want)
    				}
    			}
    
    			if x <= 1<<32-1 {
    				got := TrailingZeros32(uint32(x))
    				if x == 0 {
    					want = 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/rewrite.go

    // ntzX returns the number of trailing zeros.
    func ntz64(x int64) int { return bits.TrailingZeros64(uint64(x)) }
    func ntz32(x int32) int { return bits.TrailingZeros32(uint32(x)) }
    func ntz16(x int16) int { return bits.TrailingZeros16(uint16(x)) }
    func ntz8(x int8) int   { return bits.TrailingZeros8(uint8(x)) }
    
    func oneBit(x int64) bool   { return x&(x-1) == 0 && x != 0 }
    func oneBit8(x int8) bool   { return x&(x-1) == 0 && x != 0 }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 19:02:52 UTC 2024
    - 64.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssagen/ssa.go

    		},
    		sys.MIPS)
    	addF("math/bits", "TrailingZeros16",
    		func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
    			return s.newValue1(ssa.OpCtz16, types.Types[types.TINT], args[0])
    		},
    		sys.AMD64, sys.I386, sys.ARM, sys.ARM64, sys.Wasm)
    	addF("math/bits", "TrailingZeros16",
    		func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
    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

    		{"RotateLeft32", Func, 9},
    		{"RotateLeft64", Func, 9},
    		{"RotateLeft8", Func, 9},
    		{"Sub", Func, 12},
    		{"Sub32", Func, 12},
    		{"Sub64", Func, 12},
    		{"TrailingZeros", Func, 9},
    		{"TrailingZeros16", Func, 9},
    		{"TrailingZeros32", Func, 9},
    		{"TrailingZeros64", Func, 9},
    		{"TrailingZeros8", Func, 9},
    		{"UintSize", Const, 9},
    	},
    	"math/cmplx": {
    		{"Abs", Func, 0},
    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