generated from saxbophone/CPP20-Cross-Platform-Template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Uint<WIDTH> and Sint<WIDTH> arbitrary fixed-width types #82
Labels
enhancement
New feature or request
Comments
Yes, but the ripple-carry needs to be handled separately. Initial XOR and AND of input bits can be done with bitset's operators, and possibly the rest of the processing of the results after the ripple-carry is handled too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed-width unsigned and signed arithmetic types where the width they're fixed to is variable at compile-time, something like:
The exact naming will probably change, but it could be a nice idea.
Also, it'd be handy to specify some arithmetic operators as returning the smallest type big enough to store the largest possible result without over/underflow, so e.g.
Uint<32> * Uint<32> -> Uint<64>
andUint<32> + Uint<32> = Uint<33>
If we're going to do that, we should definitely provide some convenient conversion functionality between the various different sizes of
Uint<>
andSint<>
...Another efficiency idea could be to specialise instances of
Uint<>
/Sint<>
for integer types smaller and equal to those supported natively on the target system, for efficiency. Doing so would require somewhat complicated template logic, but it should be looked into...The text was updated successfully, but these errors were encountered: