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

Support 32-bit platforms #53

Open
raehik opened this issue Mar 8, 2024 · 2 comments
Open

Support 32-bit platforms #53

raehik opened this issue Mar 8, 2024 · 2 comments

Comments

@raehik
Copy link
Collaborator

raehik commented Mar 8, 2024

We assume native word size to be 64-bit in a few places:

  • primitives: Basic.Integers.any(Word|Int), where we increment our parsing address by a constant 8 without checking word size
  • some combinators with efficient "bulk" operations (byteString, isolateToNextNull)
  • maybe some other places

I've just learned you can #include "MachDeps.h" and then access WORD_SIZE_IN_BITS. We could check this at the various locations where we assume native word size, and provide 32-bit versions as well as existing 64-bit ones.

This would introduce some amount of ugliness for a usecase that I don't think is popular (heck I don't even know how to build a 32-bit GHC). If it still seems reasonable, I'd gladly start on it.

@AndrasKovacs
Copy link
Owner

I agree It's a good idea to replace literals with MachDeps constants.

@raehik
Copy link
Collaborator Author

raehik commented Mar 15, 2024

Relevant to this, I learned that WORDS_BIGENDIAN is defined in MachDeps.h too, but we never #include it. Fix over at #55 .

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