Implement signed and unsigned 16-bit arithmetic on top of the primitives provided by the CairoVM. It needs to provide the following operations, and must behave as expected for performing the same operations in a standard hardware CPU model:
+
-
*
/
%
** (exponentiation)
abs
shr
shl
negate
extend
divmod
comparison
This can likely draw heavily on the experience implementing 8-bit arithmetic (#32).
Description
Implement signed and unsigned 16-bit arithmetic on top of the primitives provided by the CairoVM. It needs to provide the following operations, and must behave as expected for performing the same operations in a standard hardware CPU model:
+
-
*
/
%
**
(exponentiation)abs
shr
shl
divmod
This can likely draw heavily on the experience implementing 8-bit arithmetic (#32).