-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use smaller limb size for small stints #146
Comments
Is there a benefit though? For operations, they will be zero-extended to the machine word size, and so far |
consider
the aim is to make the implementation ABI-compatible with |
Is ABI compatibility necessary for size > 64? Because it won't be on big-endian architecture. That goal was abandoned in the rewrite because it's quite noisy on the code flow for no advantage. |
well, That said, this issue is focused on smaller limb sizes for which ABI compatibility is easy to define (round limb size upwards to the nearest power-of-2, up to the pointer size). |
these practically don't exist anymore, so the focus is on little-endian - the rest can follow if ever there's a usecase. |
https://github.com/status-im/nim-stint/blob/master/stint/private/datatypes.nim#L16C8-L16C8 - currently,
Word
is used for all stint sizes, ieStint[16]
takes 8 bytes on a 64-bit system.With bit sizes less than the
Word
size, we should be using the next-power-of-2 approach, ie bothstint[15]
andstint[16]
should take up 2 bytes of space like anint16
.The text was updated successfully, but these errors were encountered: