From: hjl@lucon.org (H.J. Lu)
To: ian@airs.com (Ian Lance Taylor)
Cc: borchert@mathematik.uni-ulm.de, gas2@cygnus.com
Subject: Re: Bug of gas (binutils-2.9.1.0.23): Wrong code for SETHI on SPARC
Date: Fri, 02 Apr 1999 16:42:00 -0000 [thread overview]
Message-ID: <m10TEVU-000ErMC@ocean.lucon.org> (raw)
In-Reply-To: <19990403003707.1536.qmail@comton.airs.com>
>
> From: hjl@lucon.org (H.J. Lu)
> Date: Fri, 2 Apr 1999 16:10:48 -0800 (PST)
>
> > gas out of binutils-2.9.1.0.23 (and older versions) has a severe bug
> > for the SPARC platform (sparc-sun-solaris2.6), i.e. it generates
> > wrong code for
> >
> > sethi 0x4000,%i0
> >
> > (and probably in all other cases where sethi is used without the
> > %hi(...)-construct).
> >
> > The sethi instruction has following suggested assembly syntax
> > (see SPARC Architecture Manual):
> >
> > sethi const22,reg
> >
> > const22 is a 22-bit constant that is placed by sethi in the most
> > significant 22 bits of reg (while it zeroes the 10 least significant
> > bits of reg). Therefore we would expect the value 0x100000 in %i0
> > after the execution of ``sethi 16384''. Instead of this, gas
> > modifies the given constant such that 0x4000 will be found in %i0
> > afterwards. This would have been equivalent to
> >
> > sethi %hi(0x4000),%i0
>
> Here is a new patch. Please discard my last patch to tc-sparc.c.
> Let me know what you get.
>
> Thanks.
>
>
> H.J.
> ---
> Fri Apr 2 16:05:25 1999 H.J. Lu (hjl@gnu.org)
>
> * sparc-opc.c: Change "sethi" from "h,d" to "n,d".
>
> I don't think that can be right. I think it will do the wrong thing
> for
> sethi foo,%i0
>
You are right. That shows I know nothing about Sparc. Do you have
a fix for the bug?
Thanks.
--
H.J. Lu (hjl@gnu.org)
next prev parent reply other threads:[~1999-04-02 16:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-02 8:04 Andreas Borchert
1999-04-02 11:49 ` H.J. Lu
1999-04-02 16:10 ` H.J. Lu
1999-04-02 16:42 ` Ian Lance Taylor
1999-04-02 16:42 ` H.J. Lu [this message]
1999-04-02 16:42 ` Ian Lance Taylor
1999-04-02 17:27 ` H.J. Lu
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=m10TEVU-000ErMC@ocean.lucon.org \
--to=hjl@lucon.org \
--cc=borchert@mathematik.uni-ulm.de \
--cc=gas2@cygnus.com \
--cc=ian@airs.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).