Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for int64Val (0.5 sec)

  1. src/cmd/compile/internal/walk/expr.go

    	bits := int32(8 * n.Type().Size())
    
    	if ir.IsSmallIntConst(n) {
    		v := ir.Int64Val(n)
    		return 0 <= v && v < max
    	}
    
    	switch n.Op() {
    	case ir.OAND, ir.OANDNOT:
    		n := n.(*ir.BinaryExpr)
    		v := int64(-1)
    		switch {
    		case ir.IsSmallIntConst(n.X):
    			v = ir.Int64Val(n.X)
    		case ir.IsSmallIntConst(n.Y):
    			v = ir.Int64Val(n.Y)
    			if n.Op() == ir.OANDNOT {
    				v = ^v
    				if !sign {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/shift/shift.go

    		return
    	}
    
    	v := pass.TypesInfo.Types[y].Value
    	if v == nil {
    		return
    	}
    	u := constant.ToInt(v) // either an Int or Unknown
    	amt, ok := constant.Int64Val(u)
    	if !ok {
    		return
    	}
    	t := pass.TypesInfo.Types[x].Type
    	if t == nil {
    		return
    	}
    	var structuralTypes []types.Type
    	switch t := aliases.Unalias(t).(type) {
    	case *types.TypeParam:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/const.go

    		return s
    	}
    
    	switch {
    	case isInteger(typ):
    		x := constant.ToInt(x)
    		if x.Kind() != constant.Int {
    			return false
    		}
    		if rounded != nil {
    			*rounded = x
    		}
    		if x, ok := constant.Int64Val(x); ok {
    			switch typ.kind {
    			case Int:
    				var s = uint(sizeof(typ)) * 8
    				return int64(-1)<<(s-1) <= x && x <= int64(1)<<(s-1)-1
    			case Int8:
    				const s = 8
    				return -1<<(s-1) <= x && x <= 1<<(s-1)-1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  4. src/go/types/const.go

    		return s
    	}
    
    	switch {
    	case isInteger(typ):
    		x := constant.ToInt(x)
    		if x.Kind() != constant.Int {
    			return false
    		}
    		if rounded != nil {
    			*rounded = x
    		}
    		if x, ok := constant.Int64Val(x); ok {
    			switch typ.kind {
    			case Int:
    				var s = uint(sizeof(typ)) * 8
    				return int64(-1)<<(s-1) <= x && x <= int64(1)<<(s-1)-1
    			case Int8:
    				const s = 8
    				return -1<<(s-1) <= x && x <= 1<<(s-1)-1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/typecheck/expr.go

    	n.Cap = DefaultLit(Expr(n.Cap), types.Types[types.TINT])
    
    	if ir.IsConst(n.Len, constant.Int) && ir.Int64Val(n.Len) < 0 {
    		base.Fatalf("len for OSLICEHEADER must be non-negative")
    	}
    
    	if ir.IsConst(n.Cap, constant.Int) && ir.Int64Val(n.Cap) < 0 {
    		base.Fatalf("cap for OSLICEHEADER must be non-negative")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  6. src/go/types/index.go

    		return
    	}
    
    	if x.mode != constant_ {
    		return x.typ, -1
    	}
    
    	if x.val.Kind() == constant.Unknown {
    		return
    	}
    
    	v, ok := constant.Int64Val(x.val)
    	assert(ok)
    	if max >= 0 && v >= max {
    		check.errorf(&x, InvalidIndex, invalidArg+"index %s out of bounds [0:%d]", x.val.String(), max)
    		return
    	}
    
    	// 0 <= v [ && v < max ]
    	return x.typ, v
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/typexpr.go

    		}
    		return -1
    	}
    
    	if isUntyped(x.typ) || isInteger(x.typ) {
    		if val := constant.ToInt(x.val); val.Kind() == constant.Int {
    			if representableConst(val, check, Typ[Int], nil) {
    				if n, ok := constant.Int64Val(val); ok && n >= 0 {
    					return n
    				}
    			}
    		}
    	}
    
    	var msg string
    	if isInteger(x.typ) {
    		msg = "invalid array length %s"
    	} else {
    		msg = "array length %s must be integer"
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  8. src/go/types/typexpr.go

    		}
    		return -1
    	}
    
    	if isUntyped(x.typ) || isInteger(x.typ) {
    		if val := constant.ToInt(x.val); val.Kind() == constant.Int {
    			if representableConst(val, check, Typ[Int], nil) {
    				if n, ok := constant.Int64Val(val); ok && n >= 0 {
    					return n
    				}
    			}
    		}
    	}
    
    	var msg string
    	if isInteger(x.typ) {
    		msg = "invalid array length %s"
    	} else {
    		msg = "array length %s must be integer"
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  9. src/go/types/stmt.go

    	// and string values, so only create Go values for these
    	// types.
    	switch val.Kind() {
    	case constant.Int:
    		if x, ok := constant.Int64Val(val); ok {
    			return x
    		}
    		if x, ok := constant.Uint64Val(val); ok {
    			return x
    		}
    	case constant.Float:
    		if x, ok := constant.Float64Val(val); ok {
    			return x
    		}
    	case constant.String:
    		return constant.StringVal(val)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/stmt.go

    	// and string values, so only create Go values for these
    	// types.
    	switch val.Kind() {
    	case constant.Int:
    		if x, ok := constant.Int64Val(val); ok {
    			return x
    		}
    		if x, ok := constant.Uint64Val(val); ok {
    			return x
    		}
    	case constant.Float:
    		if x, ok := constant.Float64Val(val); ok {
    			return x
    		}
    	case constant.String:
    		return constant.StringVal(val)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
Back to top