Probably the hardest part of this would be generalizing things so that a value can be split across registers?
Addition, subtraction, and multiplication are easy. Addition/subtraction can be done in two packets, even, I think ({add lo; add hi; compute carry}, {add in carry}).
Division is more painful. gcc emits calls to libgcc and libgcc's code cites TAOCP.
It would be nice to support 64-bit integer types
Probably the hardest part of this would be generalizing things so that a value can be split across registers?
Addition, subtraction, and multiplication are easy. Addition/subtraction can be done in two packets, even, I think ({add lo; add hi; compute carry}, {add in carry}).
Division is more painful. gcc emits calls to libgcc and libgcc's code cites TAOCP.