From: Richard Sandiford <rsandifo@redhat.com>
To: cgd@broadcom.com
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>, binutils@sources.redhat.com
Subject: Re: [patch] MIPS: Fix synthesized doubleword transfers (ping)
Date: Fri, 25 Feb 2005 13:36:00 -0000 [thread overview]
Message-ID: <87bra9h94e.fsf@firetop.home> (raw)
In-Reply-To: <yov5ll9d1ti3.fsf@xl-sj1-01.sj.broadcom.com> (cgd@broadcom.com's message of "24 Feb 2005 14:29:56 -0800")
cgd@broadcom.com writes:
> At Thu, 24 Feb 2005 22:20:30 +0000, Richard Sandiford wrote:
>> cgd@broadcom.com writes:
>> > At Thu, 24 Feb 2005 21:05:49 +0000 (UTC), "Richard Sandiford" wrote:
>> >> I suppose bad things could happen if you composed an aligned
>> >> address from an unaligned symbol and an unaligned offset,
>> >> but is that allowed?
>> >
>> > yes, at least as far as the ISA is concerned.
>>
>> I don't follow. The ISA has no concept of symbols vs. offsets.
>
> right, but to some degree symbol + offset -> base reg + offset, since
> the offsets in the base regs come directly from the relocs.
Not really. ld is the equivalent of:
lui tmp,%hi(foo)
lw w1,%lo(foo)(tmp)
lw w2,%lo(foo+4)(tmp)
where the base register (tmp) is the high part of "sym + offset"
(lowest 16 bits all 0). We don't load the symbol part into a
temporary register and then add the offset.
For example, the linker will generate the same output for:
foo = sym + offset, sym = 0x10004, offset = 4
foo = sym + offset, sym = 0x10008, offset = 0
Richard
next prev parent reply other threads:[~2005-02-24 22:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-24 22:30 Maciej W. Rozycki
2005-02-24 22:57 ` Richard Sandiford
[not found] ` <mailpost.1109279149.22995@news-sj1-1>
2005-02-24 23:42 ` cgd
2005-02-25 0:04 ` Richard Sandiford
2005-02-25 1:23 ` Richard Sandiford
2005-02-25 2:17 ` cgd
2005-02-25 13:36 ` Richard Sandiford [this message]
2005-02-26 0:02 ` Maciej W. Rozycki
2005-02-25 20:25 ` Maciej W. Rozycki
2005-02-25 16:12 ` Richard Sandiford
2005-02-26 0:10 ` Maciej W. Rozycki
2005-03-02 2:22 ` Thiemo Seufer
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=87bra9h94e.fsf@firetop.home \
--to=rsandifo@redhat.com \
--cc=binutils@sources.redhat.com \
--cc=cgd@broadcom.com \
--cc=macro@linux-mips.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 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).