Add support for 128-bit arithmetic
authorAvi Kivity <avi@redhat.com>
Sun, 16 Oct 2011 11:13:05 +0000 (13:13 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 16 Oct 2011 11:13:05 +0000 (13:13 +0200)
commit963a0997b53a904adb13562a9222bcf82302c160
tree22b607d838b98141ba62c9aad059f5147a90a913
parent00851d882099db6ffde0b0360fa677835be14c13
Add support for 128-bit arithmetic

The memory API supports 64-bit buses (e.g. PCI).  A size on such a bus cannot
be represented with a 64-bit data type, if both 0 and the entire address
space size are to be represented.  Futhermore, any address arithemetic may
overflow and return unexpected results.

Introduce a 128-bit signed integer type for use in such cases.  Addition,
subtraction, and comparison are the only operations supported.

Signed-off-by: Avi Kivity <avi@redhat.com>
int128.h [new file with mode: 0644]