-
Notifications
You must be signed in to change notification settings - Fork 81
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
lcc: optimisations #70
Comments
Low priority |
Two ideas to reduce the number of thunk functions in rt.py:
No need to let code do this: do this as a 1-byte segment somewhere in the .gt1 file (near the end?). Pixels then run from 0x60 to 0xff while code can live at offset 0 instead of 0xa0. This eliminates the need for thunk1. Adjust PutChar, Newline and ClearScreen accordingly. Actually, these become slightly simpler because testing for end of line is now simpler.
In essence, the above eliminates four zero page bytes and one helper function. |
(Sometimes the compiler even juggles the order of SUBW operands...) |
Simplify. Same for CNSTI2(0) and MULU2, DIVXX etc |
|
Still gives an .gt1 file of more than 4 KB in size. It seems that references from other functions are not purged (e.g. div in rt.py references divu, and divu is never purged because of this?) Also some references come from the data space, such as the flush methods in the FILE objects of stdin.c/stdout.c). |
See this comment for an example: #76 (comment) |
|
This issue should be closed since glcc already does such optimizations (when they make sense in the new code) |
[Note: This issue is an aggregation for optimisations of the emitted code. I want to park all ideas here for future reference. Regarding priorities in LCC the order should be 1. Correctness, 2. Usability, 3. Optimisations.]
Ideas (some simpler than others. some realistic, some are nonsense):
The text was updated successfully, but these errors were encountered: