Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for isPowerOfTwo8 (0.47 sec)

  1. src/cmd/compile/internal/ssa/_gen/generic.rules

    (Or(8|16|32|64) <t> (Com(8|16|32|64) x) (Com(8|16|32|64) y)) => (Com(8|16|32|64) (And(8|16|32|64) <t> x y))
    
    // Convert multiplication by a power of two to a shift.
    (Mul8  <t> n (Const8  [c])) && isPowerOfTwo8(c) => (Lsh8x64  <t> n (Const64 <typ.UInt64> [log8(c)]))
    (Mul16 <t> n (Const16 [c])) && isPowerOfTwo16(c) => (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(c)]))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 22:21:05 UTC 2024
    - 135.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssa/rewritegeneric.go

    		return true
    	}
    	// match: (Div8 n (Const8 [c]))
    	// cond: isNonNegative(n) && isPowerOfTwo8(c)
    	// result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log8(c)]))
    	for {
    		n := v_0
    		if v_1.Op != OpConst8 {
    			break
    		}
    		c := auxIntToInt8(v_1.AuxInt)
    		if !(isNonNegative(n) && isPowerOfTwo8(c)) {
    			break
    		}
    		v.reset(OpRsh8Ux64)
    		v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:24:47 UTC 2024
    - 812.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/rewrite.go

    // Rounds down.
    func log2uint32(n int64) int64 {
    	return int64(bits.Len32(uint32(n))) - 1
    }
    
    // isPowerOfTwoX functions report whether n is a power of 2.
    func isPowerOfTwo8(n int8) bool {
    	return n > 0 && n&(n-1) == 0
    }
    func isPowerOfTwo16(n int16) bool {
    	return n > 0 && n&(n-1) == 0
    }
    func isPowerOfTwo32(n int32) bool {
    	return n > 0 && n&(n-1) == 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)
Back to top