Simplified code
This commit is contained in:
parent
abba962455
commit
eeee4d5496
30 changed files with 105 additions and 69 deletions
|
@ -1,24 +0,0 @@
|
|||
package z
|
||||
|
||||
import (
|
||||
"git.akyoto.dev/cli/q/src/build/asm"
|
||||
"git.akyoto.dev/cli/q/src/build/cpu"
|
||||
)
|
||||
|
||||
func (f *Compiler) RegisterRegister(mnemonic asm.Mnemonic, a cpu.Register, b cpu.Register) {
|
||||
if mnemonic == asm.MOVE && a == b {
|
||||
return
|
||||
}
|
||||
|
||||
if f.CurrentScope().IsUsed(a) && isDestructive(mnemonic) {
|
||||
f.SaveRegister(a)
|
||||
}
|
||||
|
||||
f.Assembler.RegisterRegister(mnemonic, a, b)
|
||||
|
||||
if mnemonic == asm.MOVE {
|
||||
f.CurrentScope().Use(a)
|
||||
}
|
||||
|
||||
f.postInstruction()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue