From 3abe8efb431d171e824f593615ad4a8efbdbbcf1 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 20 Sep 2013 11:04:52 +0200 Subject: 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 Acked-by: Keir Fraser --- tools/tests/x86_emulator/x86_emulate.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools') 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 #include #include #include @@ -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)) -- cgit v1.2.3