From: Avi Kivity Subject: [PATCH kvm-unit-tests 08/12] realmode: test movsx/movzx Date: Wed, 27 Jun 2012 11:36:37 +0300 Message-ID: <1340786201-27881-9-git-send-email-avi@redhat.com> References: <1340786201-27881-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22549 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003Ab2F0Ig6 (ORCPT ); Wed, 27 Jun 2012 04:36:58 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5R8awcO003514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 27 Jun 2012 04:36:58 -0400 In-Reply-To: <1340786201-27881-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Avi Kivity --- x86/realmode.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/x86/realmode.c b/x86/realmode.c index a2cc8a9..29f3461 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -1344,6 +1344,18 @@ static void test_lahf(void) report("lahf", R_AX, (outregs.eax >> 8) == inregs.eax); } +static void test_movzx_movsx(void) +{ + MK_INSN(movsx, "movsx %al, %ebx"); + MK_INSN(movzx, "movzx %al, %ebx"); + + inregs.eax = 0x1234569c; + exec_in_big_real_mode(&insn_movsx); + report("movsx", R_BX, outregs.ebx == (signed char)inregs.eax); + exec_in_big_real_mode(&insn_movzx); + report("movzx", R_BX, outregs.ebx == (unsigned char)inregs.eax); +} + void realmode_start(void) { test_null(); @@ -1381,6 +1393,7 @@ void realmode_start(void) test_ss_base_for_esp_ebp(); test_sgdt_sidt(); test_lahf(); + test_movzx_movsx(); exit(0); } -- 1.7.11