Improved code generation
This commit is contained in:
parent
6e22febc01
commit
3c189a025f
23 changed files with 201 additions and 95 deletions
|
@ -4,10 +4,6 @@ import "git.akyoto.dev/cli/q/src/build/cpu"
|
|||
|
||||
// unnecessary returns true if the register/register operation can be skipped.
|
||||
func (a *Assembler) unnecessary(mnemonic Mnemonic, left cpu.Register, right cpu.Register) bool {
|
||||
if mnemonic == MOVE && left == right {
|
||||
return true
|
||||
}
|
||||
|
||||
if len(a.Instructions) == 0 {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue