Improved assembler performance
This commit is contained in:
@ -15,12 +15,12 @@ func (a *Assembler) CanSkip(mnemonic Mnemonic, left cpu.Register, right cpu.Regi
|
||||
last := a.Instructions[len(a.Instructions)-1]
|
||||
|
||||
if mnemonic == MOVE && last.Mnemonic == MOVE {
|
||||
lastData, isRegReg := last.Data.(*RegisterRegister)
|
||||
|
||||
if !isRegReg {
|
||||
if last.Type != TypeRegisterRegister {
|
||||
return false
|
||||
}
|
||||
|
||||
lastData := a.Param.RegisterRegister[last.Index]
|
||||
|
||||
if lastData.Destination == right && lastData.Source == left {
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user