All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] Add plain udivsi3 (not _i4*) for gcc-4.1 and lower.
Date: Fri, 05 Dec 2008 07:14:29 +0000	[thread overview]
Message-ID: <4938D4D5.7040900@renesas.com> (raw)
In-Reply-To: <49389A5D.5040107@renesas.com>

Takashi Yoshii wrote:
> As shown in arch/sh/lib/udivsi3.S (and -Os.S),
> 
>   .global __udivsi3_i4i
>   .global __udivsi3_i4
>   .global __udivsi3
> __udivsi3_i4i:
>   ...
> 
> Three symbols are sharing one code, which is actually udivsi3_i4i.
> But, this results unwanted code with gcc 4.1.
> 
> In gcc, these three are treated as pseudo instructions that have own
>  clobber list apart from usual calling convention.
> According to sh's machine description. The clobber list is like below.
>  - udivsi3_i4i : t,r1,pr,mach,macl
>  - udivsi3_i4  : t,r0,r1,r4,r5,pr,dr0,dr2,dr4
>  - udivsi3     : t,r4,pr
> I don't think udivsi3_i4 is used in kernel, though.
> Caller of udivsi3 will be trouble with broken r1 and mac*.
> 
> gcc-4.1.x and older(at least to 3.4) generate udivsi3.
> # ST's gcc-4.1.1 seems to be OK because it has _i4i.
> 
> I checked git:lethal/master for ap325rxa.
>  the one compiled by gcc 4.1.2 was NG (No output to console),
>  while gcc 4.2.4 was OK
> I have added plain udivsi3 as a patch below.
> After that, both gcc 4.1.2 and 4.2.4 are OK
> 
> The patch is big because I renamed udivsi3*.S to udivsi3_i4i*.S.
> Another idea is giving new name to old udivsi3, like
>  udivsi3_gcc41x_and_lower.S
> 
> Any comment?
> /yoshii
> 
>  We chan't share code for udivsi3 and udivsi3_i4, because they have
>  different clobber list. Copied udivsi3 from gcc-4.1.2.
> 
> Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>
> ---
>  arch/sh/lib/Makefile         |    7 +-
>  arch/sh/lib/udivsi3-Os.S     |  151 ----------
>  arch/sh/lib/udivsi3.S        |  667 +++---------------------------------------
>  arch/sh/lib/udivsi3_i4i-Os.S |  149 ++++++++++
>  arch/sh/lib/udivsi3_i4i.S    |  666 +++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 862 insertions(+), 778 deletions(-)
>  delete mode 100644 arch/sh/lib/udivsi3-Os.S
>  create mode 100644 arch/sh/lib/udivsi3_i4i-Os.S
>  create mode 100644 arch/sh/lib/udivsi3_i4i.S
> 
Please use -C option.

Best regards,
 Nobuhiro

  parent reply	other threads:[~2008-12-05  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05  3:05 [PATCH] Add plain udivsi3 (not _i4*) for gcc-4.1 and lower Takashi Yoshii
2008-12-05  4:23 ` morimoto.kuninori
2008-12-05  7:14 ` Nobuhiro Iwamatsu [this message]
2008-12-05  9:32 ` Takashi Yoshii
2008-12-05 11:41 ` Paul Mundt

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=4938D4D5.7040900@renesas.com \
    --to=iwamatsu.nobuhiro@renesas.com \
    --cc=linux-sh@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.