Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See discussion here:
https://discordapp.com/channels/432891584451706892/1477002783616925808
TL:DR adds
__frameset_bto the CRT to be emitted by the compiler in the future at-Oz.__frameset_b
Most calls to
__framesetallocate between 4-256 bytes on the stack (it is faster/smaller to use__frameset0to allocate 1-3 bytes on the stack). We can save 2 bytes per call to__framesetif we didld a, -42instead ofld hl, -42.Overall, it saves 2 bytes and is 2F slower, which is a fair tradeoff for
-Oz. It can also tail call the existing__framesetroutine (although I have__frameset_bin a separate file for now).frameset sizes used in khicas:
optimal frameset code
Here are some snippets of the smallest frameset code for a given size