Subject: Re: about powerpc version of in{,4}_cksum
To: enami tsugutomo <>
From: Simon Burge <>
List: port-powerpc
Date: 07/31/2002 09:26:47
On Wed, Jul 31, 2002 at 12:05:15AM +0900, enami tsugutomo wrote:

> `addic rD, rA, SIMMM' is defined as (as far as according to my
> manual):
> 	rD <- (rA) + EXTS(SIMM)
> So, no carry is added (but carry is affected), and if SIMM is zero,
> carry bit always cleared.  So, addic 0,0,0 should be nop except that
> it clears carry bit.  Am I losing something?

Ah, no, you are correct.  Even looking at the manual, I still managed
to confuse "addic" (add immediate carrying) thinking that it added the
carry bit in as well as setting it.  "adde" appears to be the instruction
that does this.

As you said in another email - many thanks to tsubai!

> Please read the rs6000.h.  The differnce is whether r0 can be used or
> not.  And if you read my diff, you will notoice that forcing r0 for
> the variable `n' is no longer necessary.

Yes, that all makes sense now too.

> Could you please provide me your test case?  As I wrote in my mail, I
> just test only single pattern.

I'll put my test code on a bit latter today.  I do
have a static binary (static because it uses a soft-float libc) at

Thanks again for this!

Simon Burge                                   <>
NetBSD Development, Support and Service: