-
Notifications
You must be signed in to change notification settings - Fork 24
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
Why is sextend a part of the word interface? #4
Comments
There are two sextend: The one you have in mind (which goes from one word size to another word size) and the one currently in here (which ignores the upper bits of the input word). Both have valid use cases. |
I understand, but why is it in the word interface? |
Would you prefer to implement sextend in terms of "more fundamental" operations like testbit, bitwise and, shift, etc? This should work, the question is just whether some day we care about performance of evaluating word expressions and find a super efficient word representation with a native sextend, then it would be better to have it in the interface. Not sure though how relevant that scenario is but that's what I had in mind when I was working on the interface. |
I think my main concern is that sextend does not seem like a natural word operation to me, in that its input is not clearly of the same type of as the output. Thus I would define it as an operation that does work on words, but is not a required part of the word interface. |
@samuelgruetter
As sign extension goes from one word size to another word size, shouldn't it be a derived function from a word of one size to a word of another size?
The text was updated successfully, but these errors were encountered: