Reduced usage of temporary registers
This commit is contained in:
parent
3c189a025f
commit
75a8823b13
6 changed files with 13 additions and 25 deletions
|
@ -1,8 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/asm"
|
||||
"git.akyoto.dev/cli/q/src/build/config"
|
||||
"git.akyoto.dev/cli/q/src/build/cpu"
|
||||
|
@ -37,10 +35,9 @@ func (f *Function) SaveRegister(register cpu.Register) {
|
|||
f.cpu.Reserve(newRegister)
|
||||
|
||||
if config.Comments {
|
||||
f.Comment(fmt.Sprintf("save %s to %s", register, newRegister))
|
||||
f.Comment("save %s to %s", register, newRegister)
|
||||
}
|
||||
|
||||
f.RegisterRegister(asm.MOVE, newRegister, register)
|
||||
f.cpu.Free(register)
|
||||
variable.Register = newRegister
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue