mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/asm: refine some APIs related to Prog.RestArgs[]
Before this CL, we use GetFrom3&SetFrom3 to get or set a source operand which not fit into Prog.Reg. Those APIs operate the first element in Prog.RestArgs without checking the type so they're fragile to break if we have more than one different type of operands in the slice, which will be a common case in Arm64. This CL deprecates & renames some APIs related to Prog.RestArgs to make those APIs more reasonable and robust than before. Change-Id: I70d56edc1f23ccfffbcd6df34844e2cef2288432 Reviewed-on: https://go-review.googlesource.com/c/go/+/493355 Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com>
This commit is contained in:
parent
bdc5533f39
commit
cf624a6127
12 changed files with 99 additions and 105 deletions
|
|
@ -282,7 +282,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
|
|||
p := s.Prog(v.Op.Asm())
|
||||
p.From.Type = obj.TYPE_CONST
|
||||
p.From.Offset = v.AuxInt >> 8
|
||||
p.SetFrom3Const(v.AuxInt & 0xff)
|
||||
p.AddRestSourceConst(v.AuxInt & 0xff)
|
||||
p.Reg = v.Args[0].Reg()
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
|
|
@ -302,7 +302,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
|
|||
p := s.Prog(arm.ABFC)
|
||||
p.From.Type = obj.TYPE_CONST
|
||||
p.From.Offset = int64(width)
|
||||
p.SetFrom3Const(int64(lsb))
|
||||
p.AddRestSourceConst(int64(lsb))
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue