public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: gcc-patches@gcc.gnu.org, ebotcazou@adacore.com,
	       ro@cebitec.uni-bielefeld.de
Subject: Re: [PATCH v3] Add support for sparc compare-and-branch
Date: Mon, 12 Nov 2012 17:56:00 -0000	[thread overview]
Message-ID: <50A13845.6030300@redhat.com> (raw)
In-Reply-To: <20121022.233923.1683656545305450956.davem@davemloft.net>

On 10/22/2012 08:39 PM, David Miller wrote:
> +  /* Compare and Branch is limited to +-2KB.  If it is too far away,
> +     change
> +
> +     cxbne X, Y, .LC30
> +
> +     to
> +
> +     cxbe X, Y, .+12
> +     ba,pt xcc, .LC30
> +      nop  */

Based on your no-control-after cbcond comment at the top
of the patch, surely this should contain another nop as well.

> +  *p++ = '\t';
> +  *p++ = '%';
> +  *p++ = '1';
> +  *p++ = ',';
> +  *p++ = ' ';
> +  *p++ = '%';
> +  *p++ = '2';
> +  *p++ = ',';
> +  *p++ = ' ';

And surely all this code isn't so performance sensitive that
it needs to be written in such an unreadable way.

  p = stpcpy (p, "\t%1, %2, ");

is at least a little better.

Though really there's just 3 variable portions of the pattern, so
I wonder if a lesser number of snprintf calls might be good enough.

  if (far)
    {
      if (veryfar)
        snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, .+16\n\t"
		  "b\t%%l3\n\t nop", size_char, cond_str);
      else
        snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, .+16\n\t"
		  "ba,pt\t%%xcc,%%l3\n\t nop", size_char, cond_str);
    }
  else
    snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, %%l3", size_char, cond_str);


r~

  parent reply	other threads:[~2012-11-12 17:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23  4:55 David Miller
2012-10-25 18:28 ` David Miller
2012-10-26  9:23   ` Rainer Orth
2012-11-13  2:46     ` David Miller
2012-11-15 14:29       ` Rainer Orth
2012-10-26  9:13 ` Eric Botcazou
2012-10-26  9:31   ` David Miller
2012-11-11 22:30 ` Eric Botcazou
2012-11-11 23:16   ` David Miller
2012-11-12  8:38     ` Eric Botcazou
2012-11-12 14:39       ` Rainer Orth
2012-11-12 15:37         ` Eric Botcazou
2012-11-12 15:46           ` Rainer Orth
2012-11-12 19:35             ` David Miller
2012-11-13 19:34               ` Eric Botcazou
2012-11-13 19:41                 ` David Miller
2012-11-13 21:52                   ` Eric Botcazou
2012-11-13 21:58                     ` David Miller
2012-11-12 19:37       ` David Miller
2012-11-12 17:56 ` Richard Henderson [this message]
2012-11-12 19:38   ` David Miller

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=50A13845.6030300@redhat.com \
    --to=rth@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    /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).