public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Chung-Lin Tang <cltang@codesourcery.com>
To: Dmitry Plotnikov <dplotnikov@ispras.ru>
Cc: gcc-patches@gcc.gnu.org, rearnsha@arm.com, dm@ispras.ru
Subject: Re: [PATCH, ARM] Thumb-2 12-bit immediates in ADD and SUB instructions
Date: Fri, 20 May 2011 12:29:00 -0000	[thread overview]
Message-ID: <4DD69188.9080205@codesourcery.com> (raw)
In-Reply-To: <4DD63839.7040806@ispras.ru>

On 2011/5/20 11:45 AM, Dmitry Plotnikov wrote:
> This patch adds support for 12-bit immediate values for Thumb-2 in ADD and
> SUB instructions.  We added two new alternatives for *arm_addsi3 which
> make use of two new constraints for 12-bit values.  Also we modified
> costs of PLUS rtx expression.
> This patch reduces size of libevas by 1788 bytes (from 464916 to
> 463128), and sqlite by 54 bytes (from 266156 to 266052).
> Regtested with Cortex-A8 QEMU.
> 
> Ok for trunk?
> 

Andrew Stubbs seem to have another patch related to ADDW/SUBW support,
which I think is not yet committed to trunk. I have not yet studied how
this patch and Andrew's relate.

That aside, I think the style of adding new alternatives for this
purpose is a little unneeded. I suggest:

1) Abstract out const_ok_for_arm() into const_ok_for_arm_outer() with an
OUTER rtx code argument, and a const_ok_for_arm() with OUTER passed 0.

2) Within const_ok_for_arm_outer(), test for OUTER==PLUS and
TARGET_THUMB2 as needed.

3) Migrate from const_ok_for_arm() to const_ok_for_arm_outer() as
needed: in pattern conditions, etc.

I'll also note here that ADD/SUB are not the only instructions with
12-bit immediate under Thumb-2; so does AND, ORR, etc.

Chung-Lin

  reply	other threads:[~2011-05-20 10:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 11:41 Dmitry Plotnikov
2011-05-20 12:29 ` Chung-Lin Tang [this message]
2011-05-20 12:49   ` Richard Earnshaw
2011-05-20 13:13     ` Chung-Lin Tang
2011-05-20 13:25   ` Chung-Lin Tang
2011-05-20 13:13 ` Andrew Stubbs
2011-05-31 16:39   ` Dmitry Plotnikov
2011-06-01  8:57     ` Andrew Stubbs
2011-06-02  8:31     ` Ramana Radhakrishnan

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=4DD69188.9080205@codesourcery.com \
    --to=cltang@codesourcery.com \
    --cc=dm@ispras.ru \
    --cc=dplotnikov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rearnsha@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).