From: Richard Henderson <rth@redhat.com>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, AArch64] Use MOVN to generate 64-bit negative immediates where sensible
Date: Thu, 07 Aug 2014 19:33:00 -0000 [thread overview]
Message-ID: <53E3D467.2020509@redhat.com> (raw)
In-Reply-To: <53E3779C.1020709@arm.com>
On 08/07/2014 02:57 AM, Kyrill Tkachov wrote:
> + if (one_match > zero_match)
> + {
> + /* Set either first three quarters or all but the third. */
> + mask = 0xffffll << (16 - first_not_ffff_match);
> + emit_insn (gen_rtx_SET (VOIDmode, dest,
> + GEN_INT (val | mask | 0xffffffff00000000ull)));
> +
> + /* Now insert other two quarters. */
> + for (i = first_not_ffff_match + 16, mask <<= (first_not_ffff_match << 1);
> + i < 64; i += 16, mask <<= 16)
> {
> if ((val & mask) != mask)
> + emit_insn (gen_insv_immdi (dest, GEN_INT (i),
> + GEN_INT ((val >> i) & 0xffff)));
> }
> + return;
> }
>
> if (zero_match == 2)
You should not place this three instruction sequence before the two instruction
sequences that follow. I.e. place this just before simple_sequence.
I do wonder if we should be memo-izing these computations so that we only have
to do the complex search for a sequence only once for each constant...
r~
next prev parent reply other threads:[~2014-08-07 19:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 17:36 Ian Bolton
2014-05-16 9:17 ` Ian Bolton
2014-05-16 12:35 ` Richard Earnshaw
2014-08-07 11:32 ` Kyrill Tkachov
2014-08-07 12:46 ` Richard Earnshaw
2014-08-07 12:57 ` Kyrill Tkachov
2014-08-07 13:31 ` Richard Earnshaw
2014-08-07 19:33 ` Richard Henderson [this message]
2014-08-13 15:30 ` Kyrill Tkachov
2014-08-14 17:31 ` Richard Henderson
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=53E3D467.2020509@redhat.com \
--to=rth@redhat.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@arm.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).