Jose Ricardo Ziviani
f539fbe337
host-utils: Implement unsigned quadword left/right shift and unit tests
...
Implements 128-bit left shift and right shift as well as their
testcases. By design, shift silently mods by 128, so the caller is
responsible to assert the shift range if necessary.
Left shift sets the overflow flag if any non-zero digit is shifted out.
Examples:
ulshift(&low, &high, 250, &overflow);
equivalent: n << 122
urshift(&low, &high, -2);
equivalent: n << 126
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[dwg: Added test-shift128 to .gitignore]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-31 10:10:14 +11:00
..
2016-07-12 16:19:16 +02:00
2016-03-22 22:20:15 +01:00
2017-01-20 13:22:17 +01:00
2016-02-04 17:01:04 +00:00
2016-05-19 16:42:28 +02:00
2016-09-14 12:25:14 +02:00
2016-02-04 17:01:04 +00:00
2016-06-07 18:19:24 +03:00
2016-09-29 14:13:39 +02:00
2016-09-29 14:13:39 +02:00
2016-09-29 14:13:39 +02:00
2016-02-04 17:01:04 +00:00
2016-09-13 19:09:45 +02:00
2016-02-04 17:01:04 +00:00
2016-05-26 11:31:30 +05:30
2017-01-16 17:52:35 +01:00
2017-01-16 17:52:35 +01:00
2016-02-04 17:01:04 +00:00
2016-02-04 17:01:04 +00:00
2017-01-26 10:25:01 +08:00
2016-04-06 09:52:07 +08:00
2017-01-31 10:10:14 +11:00
2016-03-22 22:20:17 +01:00
2016-08-03 18:44:57 +02:00
2017-01-16 13:25:18 +00:00
2016-09-14 22:52:44 +02:00
2017-01-31 10:10:14 +11:00
2016-06-16 18:39:03 +02:00
2017-01-24 23:26:53 +03:00
2016-10-07 14:14:06 +02:00
2016-02-04 17:01:04 +00:00
2016-07-13 13:26:02 +02:00
2016-11-22 10:56:01 +00:00
2017-01-24 23:26:53 +03:00
2016-03-22 22:20:17 +01:00
2016-08-03 18:44:56 +02:00
2016-10-07 13:34:07 +02:00
2016-07-13 13:26:02 +02:00
2016-09-05 19:06:48 +02:00
2016-07-13 13:26:02 +02:00
2017-01-09 13:30:52 +01:00
2016-11-01 16:06:57 +01:00
2016-02-04 17:01:04 +00:00
2016-04-28 08:18:56 +02:00
2016-02-04 17:01:04 +00:00
2017-01-23 15:32:46 +00:00
2017-01-20 16:42:07 +00:00
2017-01-20 16:42:07 +00:00
2016-02-04 17:01:04 +00:00
2016-10-06 18:04:13 +02:00
2016-07-04 16:49:33 +03:00
2016-10-24 11:30:56 +02:00
2016-03-22 22:20:17 +01:00
2016-08-05 09:59:06 +01:00
2016-05-18 15:04:27 +03:00
2017-01-16 13:25:18 +00:00
2016-03-22 22:20:17 +01:00
2017-01-24 23:26:52 +03:00
2016-09-23 11:42:52 +08:00