From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-devel] [PATCH 0/2] target-arm: inline abs, 64-bit negate
Date: Thu, 18 Oct 2012 18:26:42 +0100 [thread overview]
Message-ID: <1350581204-24456-1-git-send-email-peter.maydell@linaro.org> (raw)
Two minor patches which inline some operations rather than using helper
functions. The 64 bit negate is a no-brainer since there's a simple
TCG op for it. For abs we implement in terms of movcond:
movi_i32 tmp6,$0x0
neg_i32 tmp7,tmp5
movcond_i32 tmp5,tmp5,tmp6,tmp5,tmp7,gt
which the x86-64 backend turns into:
0x603b53a7: mov %ebp,%ebx
0x603b53a9: neg %ebx
0x603b53ab: mov %ebp,%r12d
0x603b53ae: test %ebp,%ebp
0x603b53b0: cmovle %ebx,%r12d
Not sure why it felt the need to use an extra move there, but
for ARM this isn't in a particularly performance critical bit
of the instruction set (it's a Neon operation) so I'm not too
worried.
(A fully native TCG abs op would be able to use the fact that
neg sets flags to avoid the test as well.)
Peter Maydell (2):
target-arm: Use TCG operation for Neon 64 bit negation
target-arm: Implement abs_i32 inline rather than as a helper
target-arm/helper.c | 5 -----
target-arm/helper.h | 2 --
target-arm/neon_helper.c | 6 ------
target-arm/translate.c | 14 +++++++++++---
4 files changed, 11 insertions(+), 16 deletions(-)
--
1.7.9.5
next reply other threads:[~2012-10-18 17:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 17:26 Peter Maydell [this message]
2012-10-18 17:26 ` [Qemu-devel] [PATCH 1/2] target-arm: Use TCG operation for Neon 64 bit negation Peter Maydell
2012-10-18 17:26 ` [Qemu-devel] [PATCH 2/2] target-arm: Implement abs_i32 inline rather than as a helper Peter Maydell
2012-10-18 17:40 ` malc
2012-10-18 17:50 ` Peter Maydell
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=1350581204-24456-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).