native: add support for enums of different types#23786
Merged
Merged
Conversation
|
Connected to Huly®: V_0.6-22197 |
spytheman
reviewed
Feb 22, 2025
| c.g.write8(i32(0x45) + far_var_offset) | ||
| // Generate N in `[rbp-N]` | ||
| if is_far_var { | ||
| c.g.write32(i32((0xffffffff - i64(n) + 1) % 0x100000000)) |
Contributor
There was a problem hiding this comment.
hm, why % 0x100000000, instead of masking with & (0x100000000 - 1) ?
Member
Author
There was a problem hiding this comment.
I did not touch this part of the code as I dont know much about machine code addressing
spytheman
approved these changes
Feb 22, 2025
spytheman
left a comment
Contributor
There was a problem hiding this comment.
Good work, but in general, please keep in mind, that it is better to split refactoring PRs (especially ones that affect a lot of code), from ones that add functional changes/features/bugfixes.
Mixing too many things in the same one, makes many things harder than they could be otherwise, and increases the chances of conflicts with other PRs.
Member
Author
|
Okay I'll keep that in mind. |
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.
Add support for enums with a user-chosen type like
enum MyEnum as u8Instead of duplicating functions for u64 and i64, use a sumtype
Add tests for enums of different types