9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Ronald G. Minnich" <rminnich@lanl.gov>
To: 9fans@cse.psu.edu
Subject: [9fans] got it
Date: Thu, 10 Mar 2005 11:34:44 -0700	[thread overview]
Message-ID: <Pine.LNX.4.58.0503101129220.12217@enigma.lanl.gov> (raw)


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


             reply	other threads:[~2005-03-10 18:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-10 18:34 Ronald G. Minnich [this message]
2005-03-10 18:49 ` Russ Cox
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=Pine.LNX.4.58.0503101129220.12217@enigma.lanl.gov \
    --to=rminnich@lanl.gov \
    --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).