From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33169 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKKsf-0003xj-4D for qemu-devel@nongnu.org; Thu, 03 Jun 2010 20:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKKse-0000bO-0z for qemu-devel@nongnu.org; Thu, 03 Jun 2010 20:35:25 -0400 Received: from are.twiddle.net ([75.149.56.221]:42625) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKKsd-0000ay-Qz for qemu-devel@nongnu.org; Thu, 03 Jun 2010 20:35:23 -0400 From: Richard Henderson Date: Thu, 3 Jun 2010 17:35:16 -0700 Message-Id: <1275611718-32630-1-git-send-email-rth@twiddle.net> References: <1275524816-4187-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 0/2] tcg-i386: merge 64-bit, guest_base improvement List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net This patch series is dependent on the "tcg cleanups, part 4" patch series. The first patch merges the 64-bit code generator with the cleaned-up 32-bit code generator. I think the result is going to be easier to maintain than the two generators separately. I've spot-checked the code for 32-bit at -O2; I think the compiler has done a good job compiling away the 64-bit parts. The second patch uses the segmentation registers to implement GUEST_BASE. This is only a mild space-savings for 32-bit (3 bytes per guest access), but for 64-bit it can be very helpful. Consider the new -R option for reserving an address-space: Reserved 0x80000000 bytes of guest address space host mmap_min_addr=0x1000 guest_base 0x7fff74be1000 The area the OS reserved for us often turns out to be in high memory. Before this patch, we wind up emitting movq $large,%rax addq %addr,%rax The reduction by using a segment register is 11 bytes (and 2 insns) per guest access. r~ Richard Henderson (2): tcg-i386: Merge 64-bit generation. tcg-i386: Use segment registers to implement GUEST_BASE. configure | 2 + tcg/i386/tcg-target.c | 1276 ++++++++++++++++++++++++++++++----------- tcg/i386/tcg-target.h | 61 ++- tcg/x86_64/tcg-target.c | 1445 ----------------------------------------------- tcg/x86_64/tcg-target.h | 101 ---- 5 files changed, 996 insertions(+), 1889 deletions(-) delete mode 100644 tcg/x86_64/tcg-target.c delete mode 100644 tcg/x86_64/tcg-target.h