From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C3e4Y-0006vt-9T for qemu-devel@nongnu.org; Sat, 04 Sep 2004 13:11:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C3e4X-0006ty-3T for qemu-devel@nongnu.org; Sat, 04 Sep 2004 13:11:29 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C3e4W-0006tb-Sd for qemu-devel@nongnu.org; Sat, 04 Sep 2004 13:11:28 -0400 Received: from [143.106.7.31] (helo=maceio.ic.unicamp.br) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C3dyy-0006uO-Lk for qemu-devel@nongnu.org; Sat, 04 Sep 2004 13:05:45 -0400 Received: from aracaju.ic.unicamp.br (aracaju.ic.unicamp.br [143.106.7.27]) by maceio.ic.unicamp.br (8.11.6/8.11.6) with ESMTP id i84H5er27165 for ; Sat, 4 Sep 2004 14:05:40 -0300 Received: from ip6-localhost (manaus.ic.unicamp.br [143.106.7.33]) by aracaju.ic.unicamp.br (8.11.6/8.11.6) with ESMTP id i84H5dd13374 for ; Sat, 4 Sep 2004 14:05:39 -0300 From: Rafael =?iso-8859-1?q?=C1vila_de_Esp=EDndola?= Date: Sat, 4 Sep 2004 14:09:35 -0300 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2944569.5b5F9Re5RQ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200409041409.50470.rafael.espindola@ic.unicamp.br> Subject: [Qemu-devel] [patch] mnemonic asm names and clobber list 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 --nextPart2944569.5b5F9Re5RQ Content-Type: multipart/mixed; boundary="Boundary-01=_QbfOBaD1T0E4+0s" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_QbfOBaD1T0E4+0s Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The attached patch changes the "%n" in the inline asm used with CODE_COPY t= o=20 the more readable format %[mnemonic]. The patch also adds some missing=20 registers to the clobber list. Rafael --Boundary-01=_QbfOBaD1T0E4+0s Content-Type: text/x-diff; charset="us-ascii"; name="qemu.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qemu.patch" Index: cpu-exec.c =================================================================== RCS file: /cvsroot/qemu/qemu/cpu-exec.c,v retrieving revision 1.38 diff -u -r1.38 cpu-exec.c --- cpu-exec.c 14 Jul 2004 17:20:55 -0000 1.38 +++ cpu-exec.c 4 Sep 2004 15:59:52 -0000 @@ -471,60 +471,61 @@ asm(".globl exec_loop\n" "\n" "debug1:\n" + " movl %[FUNC], %%eax\n" " pushl %%ebp\n" - " fs movl %10, %9\n" - " fs movl %11, %%eax\n" + " fs movl %%eax, %[TMP0]\n" + " fs movl %[DFR], %%eax\n" " andl $0x400, %%eax\n" - " fs orl %8, %%eax\n" + " fs orl %[CCSRC], %%eax\n" " pushl %%eax\n" " popf\n" - " fs movl %%esp, %12\n" - " fs movl %0, %%eax\n" - " fs movl %1, %%ecx\n" - " fs movl %2, %%edx\n" - " fs movl %3, %%ebx\n" - " fs movl %4, %%esp\n" - " fs movl %5, %%ebp\n" - " fs movl %6, %%esi\n" - " fs movl %7, %%edi\n" - " fs jmp *%9\n" + " fs movl %%esp, %[SESP]\n" + " fs movl %[EAX], %%eax\n" + " fs movl %[ECX], %%ecx\n" + " fs movl %[EDX], %%edx\n" + " fs movl %[EBX], %%ebx\n" + " fs movl %[ESP], %%esp\n" + " fs movl %[EBP], %%ebp\n" + " fs movl %[ESI], %%esi\n" + " fs movl %[EDI], %%edi\n" + " fs jmp *%[TMP0]\n" "exec_loop:\n" - " fs movl %%esp, %4\n" - " fs movl %12, %%esp\n" - " fs movl %%eax, %0\n" - " fs movl %%ecx, %1\n" - " fs movl %%edx, %2\n" - " fs movl %%ebx, %3\n" - " fs movl %%ebp, %5\n" - " fs movl %%esi, %6\n" - " fs movl %%edi, %7\n" + " fs movl %%esp, %[ESP]\n" + " fs movl %[SESP], %%esp\n" + " fs movl %%eax, %[EAX]\n" + " fs movl %%ecx, %[ECX]\n" + " fs movl %%edx, %[EDX]\n" + " fs movl %%ebx, %[EBX]\n" + " fs movl %%ebp, %[EBP]\n" + " fs movl %%esi, %[ESI]\n" + " fs movl %%edi, %[EDI]\n" " pushf\n" " popl %%eax\n" " movl %%eax, %%ecx\n" " andl $0x400, %%ecx\n" " shrl $9, %%ecx\n" " andl $0x8d5, %%eax\n" - " fs movl %%eax, %8\n" + " fs movl %%eax, %[CCSRC]\n" " movl $1, %%eax\n" " subl %%ecx, %%eax\n" - " fs movl %%eax, %11\n" - " fs movl %9, %%ebx\n" /* get T0 value */ + " fs movl %%eax, %[DFR]\n" + " fs movl %[TMP0], %[T0]\n" /* T0 must match the value present in env->tmp0*/ " popl %%ebp\n" - : - : "m" (*(uint8_t *)offsetof(CPUState, regs[0])), - "m" (*(uint8_t *)offsetof(CPUState, regs[1])), - "m" (*(uint8_t *)offsetof(CPUState, regs[2])), - "m" (*(uint8_t *)offsetof(CPUState, regs[3])), - "m" (*(uint8_t *)offsetof(CPUState, regs[4])), - "m" (*(uint8_t *)offsetof(CPUState, regs[5])), - "m" (*(uint8_t *)offsetof(CPUState, regs[6])), - "m" (*(uint8_t *)offsetof(CPUState, regs[7])), - "m" (*(uint8_t *)offsetof(CPUState, cc_src)), - "m" (*(uint8_t *)offsetof(CPUState, tmp0)), - "a" (gen_func), - "m" (*(uint8_t *)offsetof(CPUState, df)), - "m" (*(uint8_t *)offsetof(CPUState, saved_esp)) - : "%ecx", "%edx" + : [T0] "=b" (T0) + : [EAX] "m" (*(uint8_t *)offsetof(CPUState, regs[R_EAX])), + [ECX] "m" (*(uint8_t *)offsetof(CPUState, regs[R_ECX])), + [EDX] "m" (*(uint8_t *)offsetof(CPUState, regs[R_EDX])), + [EBX] "m" (*(uint8_t *)offsetof(CPUState, regs[R_EBX])), + [ESP] "m" (*(uint8_t *)offsetof(CPUState, regs[R_ESP])), + [EBP] "m" (*(uint8_t *)offsetof(CPUState, regs[R_EBP])), + [ESI] "m" (*(uint8_t *)offsetof(CPUState, regs[R_ESI])), + [EDI] "m" (*(uint8_t *)offsetof(CPUState, regs[R_EDI])), + [CCSRC] "m" (*(uint8_t *)offsetof(CPUState, cc_src)), + [TMP0] "m" (*(uint8_t *)offsetof(CPUState, tmp0)), + [DFR] "m" (*(uint8_t *)offsetof(CPUState, df)), + [SESP] "m" (*(uint8_t *)offsetof(CPUState, saved_esp)), + [FUNC] "m" (gen_func) + : "%eax", "%ecx", "%edx", "%ebp", "%edi", "%esi", "memory" ); } } --Boundary-01=_QbfOBaD1T0E4+0s-- --nextPart2944569.5b5F9Re5RQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBOfbeLlrfGJ8JUHwRAlVjAJ9pfvylBfTnr5D2gcNniKhcUUFF3wCghhpH vMwO/VnQWkrSf54PxtnFoAs= =gTj+ -----END PGP SIGNATURE----- --nextPart2944569.5b5F9Re5RQ--