Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 965 for add64 (0.08 sec)

  1. src/math/bits/bits_test.go

    		{12345, 67890, 1, 80236, 0},
    		{_M64, 1, 0, 0, 1},
    		{_M64, 0, 1, 0, 1},
    		{_M64, 1, 1, 1, 1},
    		{_M64, _M64, 0, _M64 - 1, 1},
    		{_M64, _M64, 1, _M64, 1},
    	} {
    		test("Add64", Add64, a.x, a.y, a.c, a.z, a.cout)
    		test("Add64 symmetric", Add64, a.y, a.x, a.c, a.z, a.cout)
    		test("Sub64", Sub64, a.z, a.x, a.c, a.y, a.cout)
    		test("Sub64 symmetric", Sub64, a.z, a.y, a.c, a.x, a.cout)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 22 20:11:06 UTC 2020
    - 32.5K bytes
    - Viewed (0)
  2. src/math/bits/example_math_test.go

    func ExampleAdd64() {
    	// First number is 33<<64 + 12
    	n1 := []uint64{33, 12}
    	// Second number is 21<<64 + 23
    	n2 := []uint64{21, 23}
    	// Add them together without producing carry.
    	d1, carry := bits.Add64(n1[1], n2[1], 0)
    	d0, _ := bits.Add64(n1[0], n2[0], carry)
    	nsum := []uint64{d0, d1}
    	fmt.Printf("%v + %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
    
    	// First number is 1<<64 + 9223372036854775808
    	n1 = []uint64{1, 0x8000000000000000}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 11 21:27:05 UTC 2021
    - 6.3K bytes
    - Viewed (0)
  3. src/crypto/internal/edwards25519/field/fe_generic.go

    // bits.Mul64 and bits.Add64 intrinsics.
    type uint128 struct {
    	lo, hi uint64
    }
    
    // mul64 returns a * b.
    func mul64(a, b uint64) uint128 {
    	hi, lo := bits.Mul64(a, b)
    	return uint128{lo, hi}
    }
    
    // addMul64 returns v + a * b.
    func addMul64(v uint128, a, b uint64) uint128 {
    	hi, lo := bits.Mul64(a, b)
    	lo, c := bits.Add64(lo, v.lo, 0)
    	hi, _ = bits.Add64(hi, v.hi, c)
    	return uint128{lo, hi}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 27 01:16:19 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/_gen/generic.rules

    // See issue 37881.
    // Note: we don't need to handle any (x-C) cases because we already rewrite
    // (x-C) to (x+(-C)).
    
    // x + (C + z) -> C + (x + z)
    (Add64 (Add64 i:(Const64 <t>) z) x) && (z.Op != OpConst64 && x.Op != OpConst64) => (Add64 i (Add64 <t> z x))
    (Add32 (Add32 i:(Const32 <t>) z) x) && (z.Op != OpConst32 && x.Op != OpConst32) => (Add32 i (Add32 <t> z x))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 22:21:05 UTC 2024
    - 135.3K bytes
    - Viewed (0)
  5. src/math/trig_reduce.go

    	// Multiply mantissa by the digits and extract the upper two digits (hi, lo).
    	z2hi, _ := bits.Mul64(z2, ix)
    	z1hi, z1lo := bits.Mul64(z1, ix)
    	z0lo := z0 * ix
    	lo, c := bits.Add64(z1lo, z2hi, 0)
    	hi, _ := bits.Add64(z0lo, z1hi, c)
    	// The top 3 bits are j.
    	j = hi >> 61
    	// Extract the fraction and find its magnitude.
    	hi = hi<<3 | lo>>61
    	lz := uint(bits.LeadingZeros64(hi))
    	e := uint64(bias - (lz + 1))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  6. src/math/fma.go

    	zm1, zm2 = shrcompress(zm1, zm2, uint(pe-ze))
    
    	// Compute resulting significands, normalizing if necessary.
    	var m, c uint64
    	if ps == zs {
    		// Adding (pm1:pm2) + (zm1:zm2)
    		pm2, c = bits.Add64(pm2, zm2, 0)
    		pm1, _ = bits.Add64(pm1, zm1, c)
    		pe -= int32(^pm1 >> 63)
    		pm1, m = shrcompress(pm1, pm2, uint(64+pm1>>63))
    	} else {
    		// Subtracting (pm1:pm2) - (zm1:zm2)
    		// TODO: should we special-case cancellation?
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 05 22:05:30 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  7. src/net/netip/uint128.go

    // subOne returns u - 1.
    func (u uint128) subOne() uint128 {
    	lo, borrow := bits.Sub64(u.lo, 1, 0)
    	return uint128{u.hi - borrow, lo}
    }
    
    // addOne returns u + 1.
    func (u uint128) addOne() uint128 {
    	lo, carry := bits.Add64(u.lo, 1, 0)
    	return uint128{u.hi + carry, lo}
    }
    
    // halves returns the two uint64 halves of the uint128.
    //
    // Logically, think of it as returning two uint64s.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 07 21:28:44 UTC 2022
    - 2.2K bytes
    - Viewed (1)
  8. src/crypto/internal/nistec/p256_asm.go

    	return int(b)
    }
    
    // p256Add sets res = x + y.
    func p256Add(res, x, y *p256Element) {
    	var c, b uint64
    	t1 := make([]uint64, 4)
    	t1[0], c = bits.Add64(x[0], y[0], 0)
    	t1[1], c = bits.Add64(x[1], y[1], c)
    	t1[2], c = bits.Add64(x[2], y[2], c)
    	t1[3], c = bits.Add64(x[3], y[3], c)
    	t2 := make([]uint64, 4)
    	t2[0], b = bits.Sub64(t1[0], p256P[0], 0)
    	t2[1], b = bits.Sub64(t1[1], p256P[1], b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  9. src/math/cmplx/tan.go

    	// Multiply mantissa by the digits and extract the upper two digits (hi, lo).
    	z2hi, _ := bits.Mul64(z2, ix)
    	z1hi, z1lo := bits.Mul64(z1, ix)
    	z0lo := z0 * ix
    	lo, c := bits.Add64(z1lo, z2hi, 0)
    	hi, _ := bits.Add64(z0lo, z1hi, c)
    	// Find the magnitude of the fraction.
    	lz := uint(bits.LeadingZeros64(hi))
    	e := uint64(bias - (lz + 1))
    	// Clear implicit mantissa bit and shift into place.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 8.5K bytes
    - Viewed (0)
  10. src/math/bits/bits.go

    	sum = uint32(sum64)
    	carryOut = uint32(sum64 >> 32)
    	return
    }
    
    // Add64 returns the sum with carry of x, y and carry: sum = x + y + carry.
    // The carry input must be 0 or 1; otherwise the behavior is undefined.
    // The carryOut output is guaranteed to be 0 or 1.
    //
    // This function's execution time does not depend on the inputs.
    func Add64(x, y, carry uint64) (sum, carryOut uint64) {
    	sum = x + y + carry
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 17.9K bytes
    - Viewed (0)
Back to top