From: Russ Cox <russcox@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] got it
Date: Thu, 10 Mar 2005 13:49:17 -0500 [thread overview]
Message-ID: <ee9e417a05031010495f14704a@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0503101129220.12217@enigma.lanl.gov>
i have tried a few things and cannot reproduce this.
can you post a short c program and a short sequence
of commands that turns the c program into the assembly?
$y-260(SP) means -260(SP) with a comment that
that's expected to be "y". -260 is just the offset of y
in the stack frame.
russ
On Thu, 10 Mar 2005 11:34:44 -0700 (MST), Ronald G. Minnich
<rminnich@lanl.gov> wrote:
>
> an optimization is dumping onto another, it seems.
>
> on arm.
>
> ulong *x, y[64];
>
> x = y;
> *x++ = 1;
> *x++ = 2;
>
> assembly gives:
>
> MOVW $y-260(SP),R3
> MOVW $1, R2
> MOVW.P R2, $4(R3)
>
> so the 260 puts you two words before the first element of Y, I'm guessing
> (otherwise it would be y-252, right? 63*4). Then it does a pre-increment
> and offset by 4, which puts you right at the first element of y.
>
> Which all fails badly if you're setting x to a constant, as in constant
> page table value in memory for startup.
>
> That's my reading anyway.
>
> I'm still unsure, all I know is the .s code looks wrong to me for the l.s
> changes I'm making. (I'm too lazy to write assembly, I try to have C
> compilers do it for me. Usually works. Maybe not this time.)
>
> ron
>
next prev parent reply other threads:[~2005-03-10 18:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-10 18:34 Ronald G. Minnich
2005-03-10 18:49 ` Russ Cox [this message]
2005-03-10 21:00 ` Ronald G. Minnich
2005-03-10 21:10 ` Ronald G. Minnich
2005-03-10 18:39 Ben Huntsman
2005-03-10 20:58 ` Ronald G. Minnich
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=ee9e417a05031010495f14704a@mail.gmail.com \
--to=russcox@gmail.com \
--cc=9fans@cse.psu.edu \
/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 NNTP newsgroup(s).