Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZ6xB-0001QC-RA for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:54:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZ6x9-0001PE-UE for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:54:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZ6x9-0001P8-O6 for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:54:43 -0400 Received: from [68.230.240.35] (helo=eastrmmtao04.cox.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FZ704-0007Rt-Pv for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:57:44 -0400 Received: from eastrmwml05.mgt.cox.net ([172.18.52.68]) by eastrmmtao04.cox.net (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060427135441.VAXA9931.eastrmmtao04.cox.net@eastrmwml05.mgt.cox.net> for ; Thu, 27 Apr 2006 09:54:41 -0400 Message-ID: <27221773.1146146082060.JavaMail.root@eastrmwml05.mgt.cox.net> Date: Thu, 27 Apr 2006 9:54:42 -0400 From: Ben Taylor Subject: PATCH: was Re: [Qemu-devel] Where is this change coming from? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1322_32623706.1146146082019" Reply-To: sol10x86@cox.net, 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 ------=_Part_1322_32623706.1146146082019 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit This patch fixes correctly the size of the string (which happens to explain why all of the functions in op.h had the exact same format ) as well as fixes a stack adjustment that op_pavgb_xmm exceeds. Ben ---- Ben Taylor wrote: > Compile environment - Solaris 9/Ultra 10 workstation > > > this is code generated by a 0.7.2-solaris port of dyngen for i386-softmmu/op.h for the function > > case INDEX_op_imulb_AL_T0: { > extern void op_imulb_AL_T0(); > extern char __dot_umul __asm__(".umul"); > memcpy(gen_code_ptr, (void *)((char *)&op_imulb_AL_T0+4), 76); > *(uint32_t *)(gen_code_ptr + 16) = ((*(uint32_t *)(gen_code_ptr + 16)) & ~0x3fffffff) | (((((long)(&__dot_umul) + 0) - (long)(gen_code_ptr + 16))>>2) & 0x3fffffff); > gen_code_ptr += 76; > } > break; > > > this is the function generated by the 0.8.0-cvs code > > case INDEX_op_imulb_AL_T0: { > extern void op_imulb_AL_T0(); > extern char __dot_umul __asm__(".umul"); > memcpy(gen_code_ptr, (void *)((char *)&op_imulb_AL_T0+4), 76); > *(uint32_t *)(gen_code_ptr + 16) = ((*(uint32_t *)(gen_code_ptr + 16)) & ~0x3fffffff) | (((((lo + 0) - (long)(gen_code_ptr + 16))>>2) > & 0x3fffffff); > gen_code_ptr += 76; > } > break; > > This is the compile sequence for the 0.8.0-cvs with the error message: > > gcc -Wall -O2 -g -fno-strict-aliasing -m32 -ffixed-g2 -ffixed-g3 -I. -I.. -I/export/src/qemu/qemu-solaris-9/target-i386 -I/export/src/qemu/qemu-solaris-9 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/export/src/qemu/qemu-solaris-9/fpu -DHAS_AUDIO -I/export/src/qemu/qemu-solaris-9/slirp -c -o translate-op.o /export/src/qemu/qemu-solaris-9/translate-op.c > In file included from /export/src/qemu/qemu-solaris-9/translate-op.c:36: > ./op.h: In function `dyngen_code': > ./op.h:896: error: `lo' undeclared (first use in this function) > ./op.h:896: error: (Each undeclared identifier is reported only once > ./op.h:896: error: for each function it appears in.) > ./op.h:896: error: syntax error before ';' token > ./op.h:904: error: `op_cmpneqsd' undeclared (first use in this function) > ./op.h:905: error: `param1' undeclared (first use in this function) > ./op.h:906: error: `param2' undeclared (first use in this function) > ./op.h:894: warning: unused variable `__dot_umul' > > > looking carefully between the two generated functions, I see that they are slightly > different. The first one (0.7.2) compiles cleanly and runs. The second one (0.8.0-cvs) > does not compiile cleanly, and it appears that the function call has been > left off the line of code. > > *(uint32_t *)(gen_code_ptr + 16) = ((*(uint32_t *)(gen_code_ptr + 16)) & ~0x3fffffff) | (((((long)(&__dot_umul) + 0) - (long)(gen_code_ptr + 16))>>2) & 0x3fffffff); > > *(uint32_t *)(gen_code_ptr + 16) = ((*(uint32_t *)(gen_code_ptr + 16)) & ~0x3fffffff) | (((((lo + 0) - (long)(gen_code_ptr + 16))>>2) > > The specific difference in the working copy has > > (((((long)(&__dot_umul) + 0) > > while the compile failling copy has > > (((((lo + 0) ------=_Part_1322_32623706.1146146082019 Content-Type: text/x-patch; name=solaris-dyngen-patch.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=solaris-dyngen-patch.diff --- dyngen.c.ORIG 2006-04-27 09:43:06.062910000 -0400 +++ dyngen.c 2006-04-27 09:48:47.958122000 -0400 @@ -1196,7 +1196,7 @@ } else { #ifdef HOST_SPARC if (sym_name[0] == '.') - snprintf(name, sizeof(name), + snprintf(name, name_size, "(long)(&__dot_%s)", sym_name + 1); else @@ -1451,7 +1451,8 @@ if ((start_insn & ~0x1fff) == 0x9de3a000) { p_start += 0x4; start_offset += 0x4; - if ((int)(start_insn | ~0x1fff) < -128) + // Why -128? op_pavgb_xmm adjust the stack by -0x110 == -272 + if ((int)(start_insn | ~0x1fff) < -272) error("Found bogus save at the start of %s", name); if (end_insn1 != 0x81c7e008 || end_insn2 != 0x81e80000) error("ret; restore; not found at end of %s", name); ------=_Part_1322_32623706.1146146082019--