cmd/compile: implement simple register results

at least for ints and strings

includes simple test

For #40724.

Change-Id: Ib8484e5b957b08f961574a67cfd93d3d26551558
Reviewed-on: https://go-review.googlesource.com/c/go/+/295309
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
David Chase 2021-02-22 21:51:35 -05:00
parent 2d30c94874
commit 9d88a9e2bf
7 changed files with 164 additions and 23 deletions

View file

@ -830,6 +830,9 @@ func (s *regAllocState) regspec(v *Value) regInfo {
return *ac.Reg(&opcodeTable[op].reg, s.f.Config)
}
}
if op == OpMakeResult && s.f.OwnAux.reg != nil {
return *s.f.OwnAux.ResultReg(s.f.Config)
}
return opcodeTable[op].reg
}