public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Zbigniew Chamski <zbigniew.chamski@gmail.com>
Cc: laurent <laurent.poche@gmail.com>,
	Ian Lance Taylor <iant@google.com>,
	gcc-help@gcc.gnu.org, jiri@gaisler.com, konrad@gaisler.com,
	lvcargnini@gmail.com, jorge.perez@invia.fr
Subject: Re: [Bug target/46208] Sparc calling conventions (and overheads) in the embedded context
Date: Sat, 12 Mar 2011 13:03:00 -0000	[thread overview]
Message-ID: <201103121358.28896.ebotcazou@adacore.com> (raw)
In-Reply-To: <AANLkTimZYZyUW5U=CXFecCg73Q3O5YB8n4rzN6NY_cC8@mail.gmail.com>

> I'm picking up on the thread related to caller/caller side casting on
> Sparc, your patch to target/46208, your comments in
> http://gcc.gnu.org/ml/gcc-bugs/2010-10/msg02390.html and the ABI
> issues in the embedded context.
>
> To be compliant with the existing ABI, we clearly need to pass char
> and short values as reg-wide ints.  With your (revised) patch for
> 46208, this is taken care of at the caller side only, meaning that the
> cast code is replicated at call sites.

Missing "still" here: "the cast code is still replicated at call sites".  The 
patch doesn't change that since, at you pointed out, this is the ABI.

> * solution 1 (partial): by optimizing the generation of type promotion
> code, cf. your comments in
> http://gcc.gnu.org/ml/gcc-bugs/2010-10/msg02390.html

Not clear what is this solution.  You still need to extend at the caller site 
as per the ABI, either at the prototype level or at a lower level.  GCC 4.5 
does the former whereas GCC 4.6 will do the latter; the code is identical on 
the caller side, only the caller side change.

> * solution 2 (partial): by reviewing and optimizing the inlining
> settings to enable the inlining of  very small functions (there's a
> lead in http://gcc.gnu.org/ml/gcc-help/2010-11/msg00170.html)

This is somewhat orthogonal, but inlining can be tuned indeed.

> * solution 3 (radical): by consciously creating an ABI which would be
> more friendly to the embedded world.

I'm not convinced this would necessary improve things.  SPARC is a 32-bit
architecture, all instructions operate on 32-bit so you'll need to extend
the values at some point.

> Solution 1 could significantly reduce the per-call-site overhead,
> without eliminating it completely.  As you point out, it will require
> work on the expand and emit code to make sure that in the end the
> compiler emits sensible sequences of insns at each call site.

As I already mentioned several times, the code at the caller side is already 
sensible except for the case of volatile objects.  Optimizing this volatile 
case is largely orthogonal to the calling conventions problem, it's a more 
general (and more delicate) problem.

-- 
Eric Botcazou

      reply	other threads:[~2011-03-12 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11  9:49 Zbigniew Chamski
2011-03-12 13:03 ` Eric Botcazou [this message]

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=201103121358.28896.ebotcazou@adacore.com \
    --to=ebotcazou@adacore.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=jiri@gaisler.com \
    --cc=jorge.perez@invia.fr \
    --cc=konrad@gaisler.com \
    --cc=laurent.poche@gmail.com \
    --cc=lvcargnini@gmail.com \
    --cc=zbigniew.chamski@gmail.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).