cmd/compile: intrinsify Ctz, Bswap, and some atomics on ARM64

Change-Id: Ia5bf72b70e6f6522d6fb8cd050e78f862d37b5ae
Reviewed-on: https://go-review.googlesource.com/27936
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Cherry Zhang 2016-08-29 16:26:57 -04:00
parent daa7c607d2
commit 4354ffd38b
12 changed files with 801 additions and 71 deletions

View file

@ -1189,8 +1189,10 @@ func (s *regAllocState) regalloc(f *Func) {
// Before we pick a register for the output value, allow input registers
// to be deallocated. We do this here so that the output can use the
// same register as a dying input.
s.nospill = 0
s.advanceUses(v) // frees any registers holding args that are no longer live
if !opcodeTable[v.Op].resultNotInArgs {
s.nospill = 0
s.advanceUses(v) // frees any registers holding args that are no longer live
}
// Dump any registers which will be clobbered
s.freeRegs(regspec.clobbers)
@ -1264,6 +1266,12 @@ func (s *regAllocState) regalloc(f *Func) {
}
}
// deallocate dead args, if we have not done so
if opcodeTable[v.Op].resultNotInArgs {
s.nospill = 0
s.advanceUses(v) // frees any registers holding args that are no longer live
}
// Issue the Value itself.
for i, a := range args {
v.SetArg(i, a) // use register version of arguments