All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mohammed Gamal <m.gamal005@gmail.com>
To: avi@redhat.com
Cc: kvm@vger.kernel.org, Mohammed Gamal <m.gamal005@gmail.com>
Subject: [PATCH] test: Add realmode test for 2 op imul instruction (0x0f 0xaf)
Date: Wed, 18 Aug 2010 20:41:37 +0300	[thread overview]
Message-ID: <1282153297-4449-1-git-send-email-m.gamal005@gmail.com> (raw)

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
 x86/realmode.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/x86/realmode.c b/x86/realmode.c
index 603fd1f..63ee868 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1004,6 +1004,14 @@ void test_imul()
 			"mov $4, %ecx\n\t"
 			"imul %ecx\n\t");
 
+	MK_INSN(imul16_3, "mov $2, %bx\n\t"
+			  "mov $4, %cx\n\t"
+			  "imul %bx, %cx\n\t");
+
+	MK_INSN(imul32_3, "mov $2, %ebx\n\t"
+			 "mov $4, %ecx\n\t"
+			 "imul %ebx, %ecx\n\t");
+
 	exec_in_big_real_mode(&inregs, &outregs,
 			      insn_imul8_1,
 			      insn_imul8_1_end - insn_imul8_1);
@@ -1058,6 +1066,24 @@ void test_imul()
 		print_serial("imul Test 6: FAIL\n");
 	else
 		print_serial("imul Test 6: PASS\n");
+
+	exec_in_big_real_mode(&inregs, &outregs,
+                              insn_imul16_3,
+                              insn_imul16_3_end - insn_imul16_3);
+
+        if (!regs_equal(&inregs, &outregs, R_BX | R_CX) || outregs.ecx != 8)
+                print_serial("imul Test 7: FAIL\n");
+        else
+                print_serial("imul Test 7: PASS\n");
+
+        exec_in_big_real_mode(&inregs, &outregs,
+                              insn_imul32_3,
+                              insn_imul32_3_end - insn_imul32_3);
+
+        if (!regs_equal(&inregs, &outregs, R_BX | R_CX) || outregs.ecx != 8)
+                print_serial("imul Test 8: FAIL\n");
+        else
+                print_serial("imul Test 8: PASS\n");
 }
 
 void test_mul()
-- 
1.7.0.4


             reply	other threads:[~2010-08-18 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 17:41 Mohammed Gamal [this message]
2010-08-23 23:33 ` [PATCH] test: Add realmode test for 2 op imul instruction (0x0f 0xaf) Marcelo Tosatti
2010-08-24  2:24   ` Mohammed Gamal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282153297-4449-1-git-send-email-m.gamal005@gmail.com \
    --to=m.gamal005@gmail.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.