Conversation
small example for regression testing
Comments are now aligned in the assembly output which improves readability. Example: ``` add r10, rbp ;TAC_LOAD_LOCAL_ADDR mov r10, qword [r10] ;TAC_LOAD call r10 ;TAC_ICALL ``` resolves #118
MUL stores the result in r0:r1, but it was not moved into the result register. Fix that and added some more testcases.
curiosity example/testcase.
previously, it used to be e.g. ``` int8 x = 3; [0x100] = x; x = [0x32]; ``` and the width of the load/store would be implicit. But thats not safe against refactoring of the type of 'x' for example. Also makes it hard to handle cases like ``` [0x100] = (0x38 + x); ``` where the width of the expression on the right-hand side is not known at compile-time. So, modify the mdirect expr to have a constant for the width of the load/store. ``` [0x100, 1] = 0x38; uint16 y = [0x200, 1]; ```
This testcase of call with parameter is covered by the gen TAC testcases anyways, and it was unimplemented.
remove an outdated TODO from compiler/main/avr_code_gen/compile_ir/compile_tac_load.c about load/store width, which is now part of 'struct TAC'
Previous, this function used to access 'tac' without any knowledge of its kind. Refactor it to return the correct value based on 'tac->kind'. This is inconsequential for this function as the relevant IR temporary indices should be 0-initialized anyways. But this way it looks cooler and will cause an error at runtime if a case is not implemented.
✅ Deploy Preview for espl1000 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
extract function 'assignop_to_op'
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.
No description provided.