From: Peter Maydell <peter.maydell@linaro.org>
To: Alexander Graf <agraf@suse.de>
Cc: QEMU-devel Developers <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 16/17] s390x: translate engine for s390x CPU
Date: Tue, 29 Mar 2011 10:17:52 +0100 [thread overview]
Message-ID: <AANLkTimrMZPDyRG2KZ89Pa3B=NiSLHyHH6aCJfcrHuVe@mail.gmail.com> (raw)
In-Reply-To: <C16DAE8B-1532-418B-8AF7-A80D37D106C2@suse.de>
On 29 March 2011 09:55, Alexander Graf <agraf@suse.de> wrote:
>
> On 28.03.2011, at 17:40, Peter Maydell wrote:
>
>> On 24 March 2011 15:58, Alexander Graf <agraf@suse.de> wrote:
>>> diff --git a/target-s390x/translate.c b/target-s390x/translate.c
>>> + case 0x4: /* LMG R1,R3,D2(B2) [RSE] */
>>> + case 0x24: /* STMG R1,R3,D2(B2) [RSE] */
>>> + case 0x26: /* STMH R1,R3,D2(B2) [RSE] */
>>> + case 0x96: /* LMH R1,R3,D2(B2) [RSE] */
>>> + /* Apparently, unrolling lmg/stmg of any size gains performance -
>>> + even for very long ones... */
>>
>> Doesn't this take you over MAX_OP_PER_INSTR for some cases?
>
> I haven't encountered any case where it does.
Really? MAX_OP_PER_INSTR's only 96, so if you have 16 registers
in your loop then it only needs 6 ops per register to hit that,
and the op 0x96 case looks like it must generate more than that.
I have an item on my todo list to see if I can add an assert()
check for this limit, because there are cases for Neon load/stores
that apparently hit it.
>>> + tmp2 = tcg_const_i64((((uint64_t)i2) << 48) | 0x0000ffffffffffffULL);
>>
>> This line is over 80 chars, as are a handful of others in this file.
>
> Yeah, I generally see the 80 char limit as soft limit and make it
> hard on ~90. If a line is only over it by very little, readability
> doesn't improve by breaking it up. So far, everyone agreed to that
> approach :).
>80 chars reduces readability for me because I have emacs configured
to make long lines look very ugly so I don't write them :-)
Also, if we want the standard to be 'soft 80, hard 90' we should
say so in CODING_STYLE...
>>> + case 0xa: /* SVC I [RR] */
>>> + insn = ld_code2(s->pc);
>>> + debug_insn(insn);
>>> + i = insn & 0xff;
>>> +#ifdef CONFIG_USER_ONLY
>>> + s->pc += 2;
>>> +#endif
>>> + update_psw_addr(s);
>>> + gen_op_calc_cc(s);
>>
>> Why do we only need to update s->pc if CONFIG_USER_ONLY?
>> Not saying it's wrong, but it could use an explanatory comment...
>
> The user code needs to know where it jumps back to, while the
> exception generation code needs to get the exact position it was
> in to generate some more metadata.
Ah. For ARM we do this by advancing env->regs[15] in linux-user/main.c
cpu_loop() when we get an EXCP_SWI. It looks like we do it that way
for MIPS and SPARC at least too, so I guess it would be better for
s390 to follow that pattern.
-- PMM
next prev parent reply other threads:[~2011-03-29 9:17 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 15:58 [Qemu-devel] [PATCH 00/17] s390x emulation support Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 01/17] Only build ivshmem when CONFIG_PCI && CONFIG_KVM Alexander Graf
2011-03-24 21:46 ` [Qemu-devel] " Juan Quintela
2011-03-25 11:04 ` Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 02/17] virtio: use generic name when possible Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 03/17] s390x: Enable disassembler for s390x Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 04/17] s390x: Enable nptl " Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 05/17] s390x: enable CPU_QuadU Alexander Graf
2011-03-24 16:52 ` Peter Maydell
2011-03-24 16:54 ` Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 06/17] s390x: s390x-linux-user support Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 07/17] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 08/17] s390x: Enable s390x-softmmu target Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 09/17] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 10/17] s390x: Adjust GDB stub Alexander Graf
2011-03-25 12:07 ` Nathan Froyd
2011-03-25 12:16 ` Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 11/17] s390x: virtio machine storage keys Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 12/17] s390x: Prepare cpu.h for emulation Alexander Graf
2011-03-28 14:54 ` Peter Maydell
2011-03-29 10:14 ` Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 13/17] s390x: helper functions for system emulation Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 14/17] s390x: Implement opcode helpers Alexander Graf
2011-03-24 17:29 ` Peter Maydell
2011-03-24 17:41 ` Richard Henderson
2011-03-24 18:09 ` Alexander Graf
2011-03-24 18:13 ` Alexander Graf
2011-03-28 17:23 ` Alexander Graf
2011-03-28 17:42 ` Richard Henderson
2011-03-28 17:55 ` Peter Maydell
2011-03-29 9:04 ` Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 15/17] s390x: Adjust internal kvm code Alexander Graf
2011-03-24 15:58 ` [Qemu-devel] [PATCH 16/17] s390x: translate engine for s390x CPU Alexander Graf
2011-03-28 15:40 ` Peter Maydell
2011-03-29 8:55 ` Alexander Graf
2011-03-29 9:17 ` Peter Maydell [this message]
2011-03-29 9:25 ` Alexander Graf
2011-03-29 9:56 ` Peter Maydell
2011-03-29 10:40 ` Alexander Graf
2011-03-31 10:37 ` Peter Maydell
2011-03-24 15:58 ` [Qemu-devel] [PATCH 17/17] s390x: build s390x by default Alexander Graf
2011-03-28 14:20 ` [Qemu-devel] [PATCH 00/17] s390x emulation support Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTimrMZPDyRG2KZ89Pa3B=NiSLHyHH6aCJfcrHuVe@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).