qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] patch: add support for ffree opcodes


From: EricNorthup
Subject: [Qemu-devel] patch: add support for ffree opcodes
Date: Fri, 11 Jun 2004 19:29:10 -0400

Hi,

Sun's Java VM emits the ffree st(n) opcodes, which are not currently
supported in qemu.  This is not the Right Way to add them, but it works:

--Eric

bash-2.05b$ diff -u target-i386/translate.c.~1.27.~ target-i386/translate.c
--- target-i386/translate.c.~1.27.~     2004-05-29 04:08:52.000000000 -0700
+++ target-i386/translate.c     2004-06-11 16:15:23.192179000 -0700
@@ -2826,6 +2826,35 @@
         mod = (modrm >> 6) & 3;
         rm = modrm & 7;
         op = ((b & 7) << 3) | ((modrm >> 3) & 7);
+       if (b == 0xdd && (modrm >= 0xC0) && (modrm <=0xC7)) {
+           switch (modrm) {
+           case 0xC0:
+               gen_op_ffree_STN(0);
+               break;
+           case 0xC1:
+               gen_op_ffree_STN(1);
+               break;
+           case 0xC2:
+               gen_op_ffree_STN(2);
+               break;
+           case 0xC3:
+               gen_op_ffree_STN(3);
+               break;
+           case 0xC4:
+               gen_op_ffree_STN(4);
+               break;
+           case 0xC5:
+               gen_op_ffree_STN(5);
+               break;
+           case 0xC6:
+               gen_op_ffree_STN(6);
+               break;
+           case 0xC7:
+               gen_op_ffree_STN(7);
+               break;
+           }
+           break;
+       }
         if (mod != 3) {
             /* memory op */
             gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);




bash-2.05b$ diff -u target-i386/op.c.orig target-i386/op.c
--- target-i386/op.c.orig       2004-06-11 16:16:15.389773000 -0700
+++ target-i386/op.c    2004-06-11 15:44:32.016520000 -0700
@@ -2013,6 +2013,11 @@
     env->fptags[7] = 1;
 }
  
+void OPPROTO op_ffree_STN(void)
+{
+    env->fptags[(env->fpstt + (PARAM1)) & 7] = 1;
+}
+
 void OPPROTO op_fnstenv_A0(void)
 {
     helper_fstenv((uint8_t *)A0, PARAM1);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]