From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 10 Mar 2005 13:49:17 -0500 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] got it In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Topicbox-Message-UUID: 224b5c76-ead0-11e9-9d60-3106f5b1d025 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 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 >