mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: make modified Aux type for OpArgXXXX pass ssa/check
For #40724. Change-Id: I7d1e76139d187cd15a6e0df9d19542b7200589f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/297911 Trust: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
9f33dc3ca1
commit
3e524ee65a
5 changed files with 32 additions and 25 deletions
|
|
@ -182,6 +182,12 @@ func checkFunc(f *Func) {
|
||||||
f.Fatalf("value %v has Aux type %T, want *AuxCall", v, v.Aux)
|
f.Fatalf("value %v has Aux type %T, want *AuxCall", v, v.Aux)
|
||||||
}
|
}
|
||||||
canHaveAux = true
|
canHaveAux = true
|
||||||
|
case auxNameOffsetInt8:
|
||||||
|
if _, ok := v.Aux.(*AuxNameOffset); !ok {
|
||||||
|
f.Fatalf("value %v has Aux type %T, want *AuxNameOffset", v, v.Aux)
|
||||||
|
}
|
||||||
|
canHaveAux = true
|
||||||
|
canHaveAuxInt = true
|
||||||
case auxSym, auxTyp:
|
case auxSym, auxTyp:
|
||||||
canHaveAux = true
|
canHaveAux = true
|
||||||
case auxSymOff, auxSymValAndOff, auxTypSize:
|
case auxSymOff, auxSymValAndOff, auxTypSize:
|
||||||
|
|
|
||||||
|
|
@ -336,8 +336,8 @@ var genericOps = []opData{
|
||||||
|
|
||||||
// Like Arg, these are generic ops that survive lowering. AuxInt is a register index, and the actual output register for each index is defined by the architecture.
|
// Like Arg, these are generic ops that survive lowering. AuxInt is a register index, and the actual output register for each index is defined by the architecture.
|
||||||
// AuxInt = integer argument index (not a register number). ABI-specified spill loc obtained from function
|
// AuxInt = integer argument index (not a register number). ABI-specified spill loc obtained from function
|
||||||
{name: "ArgIntReg", aux: "Int8", zeroWidth: true}, // argument to the function in an int reg.
|
{name: "ArgIntReg", aux: "NameOffsetInt8", zeroWidth: true}, // argument to the function in an int reg.
|
||||||
{name: "ArgFloatReg", aux: "Int8", zeroWidth: true}, // argument to the function in a float reg.
|
{name: "ArgFloatReg", aux: "NameOffsetInt8", zeroWidth: true}, // argument to the function in a float reg.
|
||||||
|
|
||||||
// The address of a variable. arg0 is the base pointer.
|
// The address of a variable. arg0 is the base pointer.
|
||||||
// If the variable is a global, the base pointer will be SB and
|
// If the variable is a global, the base pointer will be SB and
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,7 @@ const (
|
||||||
auxFloat32 // auxInt is a float32 (encoded with math.Float64bits)
|
auxFloat32 // auxInt is a float32 (encoded with math.Float64bits)
|
||||||
auxFloat64 // auxInt is a float64 (encoded with math.Float64bits)
|
auxFloat64 // auxInt is a float64 (encoded with math.Float64bits)
|
||||||
auxFlagConstant // auxInt is a flagConstant
|
auxFlagConstant // auxInt is a flagConstant
|
||||||
|
auxNameOffsetInt8 // aux is a &struct{Name ir.Name, Offset int64}; auxInt is index in parameter registers array
|
||||||
auxString // aux is a string
|
auxString // aux is a string
|
||||||
auxSym // aux is a symbol (a *gc.Node for locals, an *obj.LSym for globals, or nil for none)
|
auxSym // aux is a symbol (a *gc.Node for locals, an *obj.LSym for globals, or nil for none)
|
||||||
auxSymOff // aux is a symbol, auxInt is an offset
|
auxSymOff // aux is a symbol, auxInt is an offset
|
||||||
|
|
|
||||||
|
|
@ -35445,14 +35445,14 @@ var opcodeTable = [...]opInfo{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ArgIntReg",
|
name: "ArgIntReg",
|
||||||
auxType: auxInt8,
|
auxType: auxNameOffsetInt8,
|
||||||
argLen: 0,
|
argLen: 0,
|
||||||
zeroWidth: true,
|
zeroWidth: true,
|
||||||
generic: true,
|
generic: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ArgFloatReg",
|
name: "ArgFloatReg",
|
||||||
auxType: auxInt8,
|
auxType: auxNameOffsetInt8,
|
||||||
argLen: 0,
|
argLen: 0,
|
||||||
zeroWidth: true,
|
zeroWidth: true,
|
||||||
generic: true,
|
generic: true,
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ func (v *Value) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Value) AuxInt8() int8 {
|
func (v *Value) AuxInt8() int8 {
|
||||||
if opcodeTable[v.Op].auxType != auxInt8 {
|
if opcodeTable[v.Op].auxType != auxInt8 && opcodeTable[v.Op].auxType != auxNameOffsetInt8 {
|
||||||
v.Fatalf("op %s doesn't have an int8 aux field", v.Op)
|
v.Fatalf("op %s doesn't have an int8 aux field", v.Op)
|
||||||
}
|
}
|
||||||
return int8(v.AuxInt)
|
return int8(v.AuxInt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue