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

Removing macros #1614

Merged
merged 18 commits into from
Feb 14, 2025
Merged

Removing macros #1614

merged 18 commits into from
Feb 14, 2025

Conversation

stephenberry
Copy link
Owner

@stephenberry stephenberry commented Feb 14, 2025

Removing macros for the sake of C++20 modules and easier debugging.

@stephenberry stephenberry changed the title Replacing GLZ_INVALID_END macro Removing macros Feb 14, 2025
@msqr1
Copy link

msqr1 commented Feb 14, 2025

This is looking good! Also, I'm just curious: Is it because bool fits in a register so compiler can optimize it well with a mov and a jmp without any additional checking or loading from memory? @stephenberry

@stephenberry
Copy link
Owner Author

I think it is because the boolean is simpler for the compiler to see through. It is easy for the compiler to see that a boolean is being checked twice (to achieve a single path) and merge it into a single check. It is more complicated if a register is being modified, because there could be other side effects.

@stephenberry
Copy link
Owner Author

I'm merging in these changes. @msqr1, let me know if there are more macros that I ought to eliminate.

@stephenberry stephenberry merged commit 19a189e into main Feb 14, 2025
12 checks passed
@stephenberry stephenberry deleted the remove_macros branch February 14, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants