// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
packagemain
vargenericOps=[]opData{
// 2-input arithmetic
// Types must be consistent with Go typing. Add, for example, must take two values
// of the same type and produces that same type.
{name:"Add"},// arg0 + arg1
{name:"Sub"},// arg0 - arg1
{name:"Mul"},// arg0 * arg1
{name:"Lsh"},// arg0 << arg1
{name:"Rsh"},// arg0 >> arg1 (signed/unsigned depending on signedness of type)
// 2-input comparisons
{name:"Less"},// arg0 < arg1
// Data movement
{name:"Phi"},// select an argument based on which predecessor block we came from
{name:"Copy"},// output = arg0
// constants. Constant values are stored in the aux field.
// booleans have a bool aux field, strings have a string aux
// field, and so on. All integer types store their value
// in the aux field as an int64 (including int, uint64, etc.).
// We could store int8 as an int8, but that won't work for int,
// as it may be different widths on the host and target.
{name:"Const"},
// Constant-like things
{name:"Arg"},// address of a function parameter/result. Memory input is an arg called ".mem". aux is a string (TODO: make it something other than a string?)
{name:"Global"},// the address of a global variable aux.(*gc.Sym)
{name:"SP"},// stack pointer
{name:"FP"},// frame pointer
{name:"Func"},// entry address of a function
// Memory operations
{name:"Load"},// Load from arg0+aux.(int64). arg1=memory
{name:"Store"},// Store arg1 to arg0+aux.(int64). arg2=memory. Returns memory.