You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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> and Uint<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<> and Sint<>...
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:
Implementation consideration: for addition and subtraction, maybe a method based on std::bitset<> and its bitwise operators could be used, for efficiency?
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.
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: