Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for TrailingZeros32 (0.3 sec)

  1. test/intrinsic.dir/main.go

    	}
    
    	if i <= 32 {
    		x32 := uint32(x)
    		t32 := T.TrailingZeros32(x32) // ERROR "intrinsic substitution for TrailingZeros32"
    		if i != t32 {
    			logf("TrailingZeros32(0x%x) expected %d but got %d\n", x32, i, t32)
    		}
    		x32 = -x32
    		t32 = T.TrailingZeros32(x32) // ERROR "intrinsic substitution for TrailingZeros32"
    		if i != t32 {
    			logf("TrailingZeros32(0x%x) expected %d but got %d\n", x32, i, t32)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 18 18:06:27 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  2. src/runtime/internal/sys/intrinsics_test.go

    			t.Errorf("TrailingZeros64(%d)=%d, want %d", x, got, i)
    		}
    	}
    }
    func TestTrailingZeros32(t *testing.T) {
    	for i := 0; i <= 32; i++ {
    		x := uint32(5) << uint(i)
    		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 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 984 bytes
    - Viewed (0)
  3. src/math/bits/example_test.go

    	// Output:
    	// TrailingZeros16(0000000000001110) = 1
    }
    
    func ExampleTrailingZeros32() {
    	fmt.Printf("TrailingZeros32(%032b) = %d\n", 14, bits.TrailingZeros32(14))
    	// Output:
    	// TrailingZeros32(00000000000000000000000000001110) = 1
    }
    
    func ExampleTrailingZeros64() {
    	fmt.Printf("TrailingZeros64(%064b) = %d\n", 14, bits.TrailingZeros64(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)
  4. src/cmd/compile/internal/test/inl_test.go

    	}
    	if runtime.GOARCH != "386" {
    		// As explained above, TrailingZeros64 and TrailingZeros32 are not Go code on 386.
    		// The same applies to Bswap32.
    		want["runtime/internal/sys"] = append(want["runtime/internal/sys"], "TrailingZeros64")
    		want["runtime/internal/sys"] = append(want["runtime/internal/sys"], "TrailingZeros32")
    		want["runtime/internal/sys"] = append(want["runtime/internal/sys"], "Bswap32")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  5. src/internal/fuzz/pcg.go

    			prod = uint64(v) * uint64(n)
    			low = uint32(prod)
    		}
    	}
    	return uint32(prod >> 32)
    }
    
    // exp2 generates n with probability 1/2^(n+1).
    func (r *pcgRand) exp2() int {
    	return bits.TrailingZeros32(r.uint32())
    }
    
    // bool generates a random bool.
    func (r *pcgRand) bool() bool {
    	return r.uint32()&1 == 0
    }
    
    // noCopy may be embedded into structs which must not be copied
    // after the first use.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:28:14 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  6. src/runtime/internal/sys/intrinsics.go

    	"\x05\x00\x01\x00\x02\x00\x01\x00\x03\x00\x01\x00\x02\x00\x01\x00" +
    	"\x04\x00\x01\x00\x02\x00\x01\x00\x03\x00\x01\x00\x02\x00\x01\x00"
    
    // TrailingZeros32 returns the number of trailing zero bits in x; the result is 32 for x == 0.
    func TrailingZeros32(x uint32) int {
    	if x == 0 {
    		return 32
    	}
    	// see comment in TrailingZeros64
    	return int(deBruijn32tab[(x&-x)*deBruijn32>>(32-5)])
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 14 08:10:45 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  7. src/math/bits/make_examples.go

    		},
    		{
    			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)
  8. src/math/bits/bits.go

    	if x == 0 {
    		return 16
    	}
    	// see comment in TrailingZeros64
    	return int(deBruijn32tab[uint32(x&-x)*deBruijn32>>(32-5)])
    }
    
    // TrailingZeros32 returns the number of trailing zero bits in x; the result is 32 for x == 0.
    func TrailingZeros32(x uint32) int {
    	if x == 0 {
    		return 32
    	}
    	// see comment in TrailingZeros64
    	return int(deBruijn32tab[(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)
  9. test/codegen/mathbits.go

    	return bits.TrailingZeros64(1 - n)
    }
    
    func TrailingZeros32(n uint32) int {
    	// amd64/v1,amd64/v2:"BTSQ\\t\\$32","BSFQ"
    	// amd64/v3:"TZCNTL"
    	// 386:"BSFL"
    	// 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 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:51:17 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  10. api/go1.9.txt

    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
    pkg mime/multipart, type FileHeader struct, Size int64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 04 20:20:20 UTC 2021
    - 10.7K bytes
    - Viewed (0)
Back to top