* [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion @ 2011-09-11 13:29 Blue Swirl 2011-09-12 6:26 ` Paolo Bonzini 0 siblings, 1 reply; 5+ messages in thread From: Blue Swirl @ 2011-09-11 13:29 UTC (permalink / raw) To: qemu-devel After this patch set, only load and store op helpers remain in op_helper.c. I have some patches for those but they need more thought. I was too lazy to attach the patches. Instead, the patch set can be found in: git://repo.or.cz/qemu/blueswirl.git http://repo.or.cz/r/qemu/blueswirl.git Blue Swirl (15): Sparc: fix coding style Sparc: split helper.c Sparc: move trivial functions from op_helper.c Sparc: avoid AREG0 for raise_exception and helper_debug Sparc: fix coding style Sparc: split FPU and VIS op helpers Sparc: avoid AREG0 for float and VIS ops Sparc: split lazy condition code handling op helpers Sparc: avoid AREG0 for lazy condition code helpers Sparc: split CWP and PSTATE op helpers Sparc: avoid AREG0 for CWP and PSTATE helpers Sparc: avoid AREG0 for softint op helpers and Leon cache control Sparc: avoid AREG0 for division op helpers Sparc: fix coding style in helper.c Sparc: split MMU helpers Makefile.target | 5 + target-sparc/cc_helper.c | 485 ++++++++ target-sparc/cpu.h | 36 +- target-sparc/cpu_init.c | 848 ++++++++++++++ target-sparc/fop_helper.c | 394 +++++++ target-sparc/helper.c | 1929 ++------------------------------ target-sparc/helper.h | 226 ++-- target-sparc/int_helper.c | 356 ++++++ target-sparc/mmu_helper.c | 877 +++++++++++++++ target-sparc/op_helper.c | 2748 +++++++-------------------------------------- target-sparc/translate.c | 366 +++--- target-sparc/vis_helper.c | 406 +++++++ target-sparc/win_helper.c | 407 +++++++ 13 files changed, 4612 insertions(+), 4471 deletions(-) create mode 100644 target-sparc/cc_helper.c create mode 100644 target-sparc/cpu_init.c create mode 100644 target-sparc/fop_helper.c create mode 100644 target-sparc/int_helper.c create mode 100644 target-sparc/mmu_helper.c create mode 100644 target-sparc/vis_helper.c create mode 100644 target-sparc/win_helper.c ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion 2011-09-11 13:29 [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion Blue Swirl @ 2011-09-12 6:26 ` Paolo Bonzini 2011-09-12 8:01 ` Richard Henderson 0 siblings, 1 reply; 5+ messages in thread From: Paolo Bonzini @ 2011-09-12 6:26 UTC (permalink / raw) To: Blue Swirl; +Cc: qemu-devel On 09/11/2011 03:29 PM, Blue Swirl wrote: > After this patch set, only load and store op helpers remain in > op_helper.c. I have some patches for those but they need more thought. Have you benchmarked it? Paolo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion 2011-09-12 6:26 ` Paolo Bonzini @ 2011-09-12 8:01 ` Richard Henderson 2011-09-12 8:13 ` Paolo Bonzini 0 siblings, 1 reply; 5+ messages in thread From: Richard Henderson @ 2011-09-12 8:01 UTC (permalink / raw) To: Paolo Bonzini; +Cc: Blue Swirl, qemu-devel On 09/12/2011 07:26 AM, Paolo Bonzini wrote: > On 09/11/2011 03:29 PM, Blue Swirl wrote: >> After this patch set, only load and store op helpers remain in >> op_helper.c. I have some patches for those but they need more thought. > > Have you benchmarked it? Asking for a benchmark without full conversion is pointless. r~ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion 2011-09-12 8:01 ` Richard Henderson @ 2011-09-12 8:13 ` Paolo Bonzini 2011-09-12 20:04 ` Blue Swirl 0 siblings, 1 reply; 5+ messages in thread From: Paolo Bonzini @ 2011-09-12 8:13 UTC (permalink / raw) To: Richard Henderson; +Cc: Blue Swirl, qemu-devel On 09/12/2011 10:01 AM, Richard Henderson wrote: > > > After this patch set, only load and store op helpers remain in > > > op_helper.c. I have some patches for those but they need more thought. > > > > Have you benchmarked it? > > Asking for a benchmark without full conversion is pointless. Agreed. But I would not push these patches without having tried them out on a prototype of a full conversion (i.e. with the load/store helpers converted, for which Blue Swirl said he has patches, and with the environment not pinned to AREG0 in TCG code). So I hoped that he did have such a prototype, or alternatively that he benchmarked them and showed only minor degradations. Paolo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion 2011-09-12 8:13 ` Paolo Bonzini @ 2011-09-12 20:04 ` Blue Swirl 0 siblings, 0 replies; 5+ messages in thread From: Blue Swirl @ 2011-09-12 20:04 UTC (permalink / raw) To: Paolo Bonzini; +Cc: qemu-devel, Richard Henderson On Mon, Sep 12, 2011 at 8:13 AM, Paolo Bonzini <pbonzini@redhat.com> wrote: > On 09/12/2011 10:01 AM, Richard Henderson wrote: >> >> > > After this patch set, only load and store op helpers remain in >> > > op_helper.c. I have some patches for those but they need more >> > > thought. >> > >> > Have you benchmarked it? >> >> Asking for a benchmark without full conversion is pointless. > > Agreed. But I would not push these patches without having tried them out on > a prototype of a full conversion (i.e. with the load/store helpers > converted, for which Blue Swirl said he has patches, and with the > environment not pinned to AREG0 in TCG code). The load/store helpers are tricky. Some Sparc64 helpers now need five 32/64 bit arguments, that may be a problem on some hosts. Changing functions like tlb_fill() and do_unaligned_access() to use passed CPUState pointer instead of AREG0 needs global changes. The template system for generating the load/store functions is interesting. Then there are __ldb_mmu() and friends, called from TCG generated code. It would be highly desirable to limit the changes to only Sparc translator but I don't think global changes can be avoided. > So I hoped that he did have such a prototype, or alternatively that he > benchmarked them and showed only minor degradations. I don't see any slowdown. Maybe a real benchmark is needed. Looking at the code, there are only minor differences. On amd64 host, r14 is now available but does not get used for the new code, so that doesn't help. On i386 there are larger differences, but that is mostly because ebp is normally used for the frame pointer. Using it for a global register needs -fomit-frame-pointer. Disregarding the frame pointer issues, the changes are minor. For example i386 host, unpatched, op_helper.o: 00000dc0 <helper_udiv>: dc0: 83 ec 1c sub $0x1c,%esp dc3: 65 8b 0d 14 00 00 00 mov %gs:0x14,%ecx dca: 89 4c 24 0c mov %ecx,0xc(%esp) dce: 31 c9 xor %ecx,%ecx dd0: 8b 44 24 20 mov 0x20(%esp),%eax dd4: 8b 54 24 24 mov 0x24(%esp),%edx dd8: 8b 4c 24 0c mov 0xc(%esp),%ecx ddc: 65 33 0d 14 00 00 00 xor %gs:0x14,%ecx de3: 75 0a jne def <helper_udiv+0x2f> de5: 31 c9 xor %ecx,%ecx de7: 83 c4 1c add $0x1c,%esp dea: e9 f1 fe ff ff jmp ce0 <helper_udiv_common> def: e8 fc ff ff ff call df0 <helper_udiv+0x30> df4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi dfa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi Patched, function in helper.o: 000002a0 <helper_udiv>: 2a0: 55 push %ebp 2a1: 89 e5 mov %esp,%ebp 2a3: 53 push %ebx 2a4: 83 ec 14 sub $0x14,%esp 2a7: 8b 45 08 mov 0x8(%ebp),%eax 2aa: 65 8b 1d 14 00 00 00 mov %gs:0x14,%ebx 2b1: 89 5d f4 mov %ebx,-0xc(%ebp) 2b4: 31 db xor %ebx,%ebx 2b6: 8b 55 0c mov 0xc(%ebp),%edx 2b9: 8b 4d 10 mov 0x10(%ebp),%ecx 2bc: 8b 5d f4 mov -0xc(%ebp),%ebx 2bf: 65 33 1d 14 00 00 00 xor %gs:0x14,%ebx 2c6: 75 11 jne 2d9 <helper_udiv+0x39> 2c8: c7 45 08 00 00 00 00 movl $0x0,0x8(%ebp) 2cf: 83 c4 14 add $0x14,%esp 2d2: 5b pop %ebx 2d3: 5d pop %ebp 2d4: e9 e7 fe ff ff jmp 1c0 <helper_udiv_common> 2d9: e8 fc ff ff ff call 2da <helper_udiv+0x3a> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-12 20:04 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-09-11 13:29 [Qemu-devel] [PATCH 00/15] Sparc AREG0 conversion Blue Swirl 2011-09-12 6:26 ` Paolo Bonzini 2011-09-12 8:01 ` Richard Henderson 2011-09-12 8:13 ` Paolo Bonzini 2011-09-12 20:04 ` Blue Swirl
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).