Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation suggestion #43

Closed
oziphantom opened this issue Jan 29, 2020 · 1 comment
Closed

Optimisation suggestion #43

oziphantom opened this issue Jan 29, 2020 · 1 comment

Comments

@oziphantom
Copy link

Given

#if CBM_64 || CBM_264
    set_bg_color(white)
#endif
#if CBM_64 || CBM_264 || ZX_SPECTRUM
    set_border(red)
#endif

which becomes

;line:135:c64_vic.mfk
    LDA #1
    STA $D021
;line:139:c64_vic.mfk
    LDA #2
    STA $D020

could be

LDX #1
STX $D021
INX
STX $D020
@KarolS
Copy link
Owner

KarolS commented Feb 27, 2020

Thanks for the suggestion.

The optimization has been added as an extra optimization pass, running only after the function has been deemed to not be inlined, as it could conflict with other optimizations otherwise. Other similarly risky optimizations could be added in that pass too in the future.

@KarolS KarolS closed this as completed Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants