public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Georg-Johann Lay <avr@gjlay.de>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, Denis Chertykov <chertykov@gmail.com>,
	 Anatoly Sokolov <aesok@post.ru>,
	"Eric B. Weddington" <eric.weddington@atmel.com>,
	 Richard Henderson <rth@redhat.com>
Subject: Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n
Date: Mon, 20 Jun 2011 14:31:00 -0000	[thread overview]
Message-ID: <4DFF573D.2000807@gjlay.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1106200957250.9594@digraph.polyomino.org.uk>

Joseph S. Myers schrieb:
> On Fri, 17 Jun 2011, Georg-Johann Lay wrote:
> 
>> So here is my question: Would it be big deal to teach optabs to
>> expand plus:di, minus:di as libcall?  Maybe even compare is
>> feasible? Like so:
> 
> I don't know what the best approach would be, but for just about
> any operation supported by GCC it makes sense to support expanding
> it as a libcall if that's the most efficient approach for a given
> target.

Using a libcall for + resp. + would we way more efficient than
expanding all the carry computations inline.

> Some of the generic optabs code could probably do with having
> target hooks added to make it work better for the less common
> targets.

A libcall could be added in TARGET_INIT_LIBCALLS, so a new hook is not
needed.  All that's needed is that optabs tests for presence of such
an entry and prefers it over inline expansion (and prefers insn over
libcall).  It appears that + and - are assumed to be cheaps or inline
expansion is always cheap.

It might already help if optabs expanded to SImode and the target
could chose if expansion of some op uses word_mode or some other, more
efficient mode.

The big targets do not need that complexity, and who cares for tiny
targets...?

Johann

  reply	other threads:[~2011-06-20 14:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 16:08 Georg-Johann Lay
2011-06-16 17:08 ` Joseph S. Myers
2011-06-17 11:04   ` Georg-Johann Lay
2011-06-17 13:06     ` Joseph S. Myers
2011-06-17 19:03       ` Georg-Johann Lay
2011-06-17 19:14         ` Georg-Johann Lay
2011-06-20 10:53         ` Joseph S. Myers
2011-06-20 14:31           ` Georg-Johann Lay [this message]
2011-06-20 15:39             ` Richard Henderson
2011-06-20 16:52               ` Georg-Johann Lay

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=4DFF573D.2000807@gjlay.de \
    --to=avr@gjlay.de \
    --cc=aesok@post.ru \
    --cc=chertykov@gmail.com \
    --cc=eric.weddington@atmel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=rth@redhat.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).