From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BYvTE-0001q0-1y for qemu-devel@nongnu.org; Fri, 11 Jun 2004 19:30:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BYvTD-0001po-ID for qemu-devel@nongnu.org; Fri, 11 Jun 2004 19:29:59 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BYvTD-0001pl-F3 for qemu-devel@nongnu.org; Fri, 11 Jun 2004 19:29:59 -0400 Received: from [67.43.0.32] (helo=cell03.cell03.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BYvSR-0000a3-4Q for qemu-devel@nongnu.org; Fri, 11 Jun 2004 19:29:11 -0400 Received: from digitale by cell03.cell03.com with local (Exim 4.24) id 1BYvSQ-00043f-Va for qemu-devel@nongnu.org; Fri, 11 Jun 2004 19:29:10 -0400 From: "EricNorthup" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Message-Id: Date: Fri, 11 Jun 2004 19:29:10 -0400 Subject: [Qemu-devel] patch: add support for ffree opcodes Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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, ®_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);