mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compiler/internal/ssa: Add auxint field
Add an additional int64 auxiliary field to Value. There are two main reasons for doing this: 1) Ints in interfaces require allocation, and we store ints in Aux a lot. 2) I'd like to have both *gc.Sym and int offsets included in lots of operations (e.g. MOVQloadidx8). It will be more efficient to store them as separate fields instead of a pointer to a sym/int pair. It also simplifies a bunch of code. This is just the refactoring. I'll start using this some more in a subsequent changelist. Change-Id: I1ca797ff572553986cf90cab3ac0a0c1d01ad241 Reviewed-on: https://go-review.googlesource.com/10929 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
0ad9c8c720
commit
8f22b5292f
20 changed files with 756 additions and 1003 deletions
|
|
@ -28,14 +28,14 @@ func makeConstShiftFunc(c *Config, amount int64, op Op, typ Type) fun {
|
|||
ptyp := &TypeImpl{Size_: 8, Ptr: true, Name: "ptr"}
|
||||
fun := Fun(c, "entry",
|
||||
Bloc("entry",
|
||||
Valu("mem", OpArg, TypeMem, ".mem"),
|
||||
Valu("FP", OpFP, TypeUInt64, nil),
|
||||
Valu("argptr", OpOffPtr, ptyp, int64(8), "FP"),
|
||||
Valu("resptr", OpOffPtr, ptyp, int64(16), "FP"),
|
||||
Valu("load", OpLoad, typ, nil, "argptr", "mem"),
|
||||
Valu("c", OpConst, TypeUInt64, amount),
|
||||
Valu("shift", op, typ, nil, "load", "c"),
|
||||
Valu("store", OpStore, TypeMem, nil, "resptr", "shift", "mem"),
|
||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||
Valu("FP", OpFP, TypeUInt64, 0, nil),
|
||||
Valu("argptr", OpOffPtr, ptyp, 8, nil, "FP"),
|
||||
Valu("resptr", OpOffPtr, ptyp, 16, nil, "FP"),
|
||||
Valu("load", OpLoad, typ, 0, nil, "argptr", "mem"),
|
||||
Valu("c", OpConst, TypeUInt64, amount, nil),
|
||||
Valu("shift", op, typ, 0, nil, "load", "c"),
|
||||
Valu("store", OpStore, TypeMem, 0, nil, "resptr", "shift", "mem"),
|
||||
Exit("store")))
|
||||
Compile(fun.f)
|
||||
return fun
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue