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

m2isar.backends.etiss.instruction_writer: Generatation of literals > 64bit #26

Open
PhilippvK opened this issue Apr 4, 2024 · 2 comments
Assignees

Comments

@PhilippvK
Copy link
Member

C does only provide literal suffices for up to 64 bit large constants (ULL).

We sometimes need bitmasks which are 65 bits or larger: 0x1ffffffffffffffff

The only workaround I have in mind for this is building the literal in an etiss_int128 temp variable manually...

@wysiwyng
Copy link
Collaborator

wysiwyng commented Apr 4, 2024

We could add generation code that splits a > 64 bit literal into two 64 bit literals and combines them back together. Alternatively, a hacky solution would be this: https://stackoverflow.com/a/33331273.

@wysiwyng
Copy link
Collaborator

wysiwyng commented Apr 4, 2024

In C++ this exists: https://en.cppreference.com/w/cpp/language/user_literal. Irrelevant for us unfortunately as the JIT is only C.

@PhilippvK PhilippvK self-assigned this Mar 2, 2025
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

No branches or pull requests

2 participants