Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for MakeInt64 (0.27 sec)

  1. src/go/constant/example_test.go

    	}
    
    	// Output:
    	//
    	// Frame
    	// Z
    	// a
    	// bacon
    	// defer
    	// go
    }
    
    func ExampleSign() {
    	zero := constant.MakeInt64(0)
    	one := constant.MakeInt64(1)
    	negOne := constant.MakeInt64(-1)
    
    	mkComplex := func(a, b constant.Value) constant.Value {
    		b = constant.MakeImag(b)
    		return constant.BinaryOp(a, token.ADD, b)
    	}
    
    	vs := []constant.Value{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ir/const.go

    }
    
    // NewInt returns an OLITERAL representing v as an untyped integer.
    func NewInt(pos src.XPos, v int64) Node {
    	return NewBasicLit(pos, types.UntypedInt, constant.MakeInt64(v))
    }
    
    // NewString returns an OLITERAL representing s as an untyped string.
    func NewString(pos src.XPos, s string) Node {
    	return NewBasicLit(pos, types.UntypedString, constant.MakeString(s))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 18:53:26 UTC 2023
    - 4K bytes
    - Viewed (0)
  3. tensorflow/compiler/jit/increase_dynamism_for_auto_jit_pass.cc

                                           const SliceInputs& slice_inputs) {
      SliceInputs result;
      result.input = slice_inputs.input;
      result.begin = MakeInt64(host_scope, "begin", slice_inputs.begin);
      result.size = MakeInt64(host_scope, "size", slice_inputs.size);
      result.size_as_vector = slice_inputs.size_as_vector;
      return result;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 12 06:33:33 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/builtins.go

    		var val constant.Value
    		switch t := arrayPtrDeref(under(x.typ)).(type) {
    		case *Basic:
    			if isString(t) && id == _Len {
    				if x.mode == constant_ {
    					mode = constant_
    					val = constant.MakeInt64(int64(len(constant.StringVal(x.val))))
    				} else {
    					mode = value
    				}
    			}
    
    		case *Array:
    			mode = value
    			// spec: "The expressions len(s) and cap(s) are constants
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  5. src/go/types/builtins.go

    		var val constant.Value
    		switch t := arrayPtrDeref(under(x.typ)).(type) {
    		case *Basic:
    			if isString(t) && id == _Len {
    				if x.mode == constant_ {
    					mode = constant_
    					val = constant.MakeInt64(int64(len(constant.StringVal(x.val))))
    				} else {
    					mode = value
    				}
    			}
    
    		case *Array:
    			mode = value
    			// spec: "The expressions len(s) and cap(s) are constants
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/switch.go

    		return false // 64-bit switches on 32-bit archs
    	}
    	min := cc[0].lo.Val()
    	max := cc[len(cc)-1].hi.Val()
    	width := constant.BinaryOp(constant.BinaryOp(max, token.SUB, min), token.ADD, constant.MakeInt64(1))
    	limit := constant.MakeInt64(int64(len(cc)) * minDensity)
    	if constant.Compare(width, token.GTR, limit) {
    		// We disable jump tables if we use less than a minimum fraction of the entries.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  7. src/go/constant/value_test.go

    		}
    	}
    }
    
    func TestUnknown(t *testing.T) {
    	u := MakeUnknown()
    	var values = []Value{
    		u,
    		MakeBool(false), // token.ADD ok below, operation is never considered
    		MakeString(""),
    		MakeInt64(1),
    		MakeFromLiteral("''", token.CHAR, 0),
    		MakeFromLiteral("-1234567890123456789012345678901234567890", token.INT, 0),
    		MakeFloat64(1.2),
    		MakeImag(MakeFloat64(1.2)),
    	}
    	for _, val := range values {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 15.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/universe.go

    	name string
    	kind BasicKind
    	val  constant.Value
    }{
    	{"true", UntypedBool, constant.MakeBool(true)},
    	{"false", UntypedBool, constant.MakeBool(false)},
    	{"iota", UntypedInt, constant.MakeInt64(0)},
    }
    
    func defPredeclaredConsts() {
    	for _, c := range predeclaredConsts {
    		def(NewConst(nopos, nil, c.name, Typ[c.kind], c.val))
    	}
    }
    
    func defPredeclaredNil() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  9. src/go/types/universe.go

    	name string
    	kind BasicKind
    	val  constant.Value
    }{
    	{"true", UntypedBool, constant.MakeBool(true)},
    	{"false", UntypedBool, constant.MakeBool(false)},
    	{"iota", UntypedInt, constant.MakeInt64(0)},
    }
    
    func defPredeclaredConsts() {
    	for _, c := range predeclaredConsts {
    		def(NewConst(nopos, nil, c.name, Typ[c.kind], c.val))
    	}
    }
    
    func defPredeclaredNil() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/builtin.go

    	// delayed until now to preserve side effects.
    	t := n.X.Type()
    
    	if t.IsPtr() {
    		t = t.Elem()
    	}
    	if t.IsArray() {
    		safeExpr(n.X, init)
    		con := ir.NewConstExpr(constant.MakeInt64(t.NumElem()), n)
    		con.SetTypecheck(1)
    		return con
    	}
    	return n
    }
    
    // walkMakeChan walks an OMAKECHAN node.
    func walkMakeChan(n *ir.MakeExpr, init *ir.Nodes) ir.Node {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
Back to top