Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] parisc asm questions
@ 2000-10-21 20:39 Randolph Chung
  0 siblings, 0 replies; only message in thread
From: Randolph Chung @ 2000-10-21 20:39 UTC (permalink / raw)
  To: parisc-linux

would someone please enlighten me about why this is happening?

i have a simple fetch-add asm loop:

/* arg0 is a pointer to a buffer, %arg1 is the length, %r4 == %arg1>>2 */
$loop:
	ldws,ma		4(%arg0), %r3
	addc		%ret0, %r3, %ret0
	addib,<>	-1, %r4, $loop
	addi		-4, %arg1, %arg1

i notice that the sum returned is sometimes off by a certain amount from
what i was expecting.  while i was tracing this down, i added a line to 
the loop so that it's:

$loop:
	add		%r0, %r3, %r3	/* isn't this equivalent to a nop? */
	ldws,ma		4(%arg0), %r3
	addc		%ret0, %r3, %ret0
	addib,<>	-1, %r4, $loop
	addi		-4, %arg1, %arg1

and i get fairly different behavior. I think I'm not understanding how
the carry bit gets updated or something. any hints will be much appreciated.

randolph
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-10-21 20:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-21 20:39 [parisc-linux] parisc asm questions Randolph Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox