mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.simd] cmd/compile: make regalloc simd aware on copy
When making a temporary copy, regalloc should be aware of the SIMD-ness of the type; otherwise it might generate invalid moves. Change-Id: I722c3a0111d0990af32d84c6aaa151f1ac8c1f00 Reviewed-on: https://go-review.googlesource.com/c/go/+/685895 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
dfd75f82d4
commit
d8fa853b37
1 changed files with 8 additions and 0 deletions
|
|
@ -898,6 +898,14 @@ func (s *regAllocState) compatRegs(t *types.Type) regMask {
|
||||||
if t.IsTuple() || t.IsFlags() {
|
if t.IsTuple() || t.IsFlags() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
if t.IsSIMD() {
|
||||||
|
if t.Size() > 8 {
|
||||||
|
return s.f.Config.fpRegMask & s.allocatable
|
||||||
|
} else {
|
||||||
|
// K mask
|
||||||
|
return s.f.Config.gpRegMask & s.allocatable
|
||||||
|
}
|
||||||
|
}
|
||||||
if t.IsFloat() || t == types.TypeInt128 {
|
if t.IsFloat() || t == types.TypeInt128 {
|
||||||
if t.Kind() == types.TFLOAT32 && s.f.Config.fp32RegMask != 0 {
|
if t.Kind() == types.TFLOAT32 && s.f.Config.fp32RegMask != 0 {
|
||||||
m = s.f.Config.fp32RegMask
|
m = s.f.Config.fp32RegMask
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue