aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-09-20 11:04:52 +0200
committerJan Beulich <jbeulich@suse.com>2013-09-20 11:04:52 +0200
commit3abe8efb431d171e824f593615ad4a8efbdbbcf1 (patch)
tree8bfa5876287806938a721eadb33bacf7afdc3306 /tools
parent86781624f8df1d50eb4185cfc2ddce926798f7aa (diff)
downloadxen-3abe8efb431d171e824f593615ad4a8efbdbbcf1.tar.gz
xen-3abe8efb431d171e824f593615ad4a8efbdbbcf1.tar.bz2
xen-3abe8efb431d171e824f593615ad4a8efbdbbcf1.zip
x86_emulate: fix flag setting for 8-bit signed multiplication
We really need to check for a signed overflow of 8 bits, while the previous check compared the sign-extended 8-bit result with the zero-extended 16-bit one (which was wrong for all negative results). Once at it - also adjust the 16-bit comparison for symmetry - improve the 8-bit multiplication (no need to zero-extend to 32-bits the sign-extended to 16 bits original 8-bit value) - fold both signed multiplication variants Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/tests/x86_emulator/x86_emulate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/tests/x86_emulator/x86_emulate.c b/tools/tests/x86_emulator/x86_emulate.c
index f18f615209..b157adef51 100644
--- a/tools/tests/x86_emulator/x86_emulate.c
+++ b/tools/tests/x86_emulator/x86_emulate.c
@@ -1,3 +1,4 @@
+#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
@@ -8,6 +9,7 @@
typedef bool bool_t;
#define BUG() abort()
+#define ASSERT assert
#define cpu_has_amd_erratum(nr) 0
#define mark_regs_dirty(r) ((void)(r))