Re: 64-bit subtract from vector unsigned int
On Tue, Apr 07, 2020 at 05:51:54AM -0400, Jeffrey Walton wrote:
> Hi Everyone,
>
> I'm porting a 64-bit algorithm to 32-bit PowerPC (an old PowerMac).
> The algorithm is simple when 64-bit is available, but it gets a little
> ugly under 32-bit.
>
> PowerPC has a "Vector Subtract Carryout Unsigned Word" (vsubcuw),
> https://www.nxp.com/docs/en/reference-manual/ALTIVECPEM.pdf. The
> altivec intrinsics are vec_vsubcuw and vec_subc.
>
> The problem is, I don't know how to use it. I've been experimenting
> with it but I don't see the use (yet).
>
> How does one use vsubcuw to implement a subtract with borrow?
Does your 32 bit powerpc have altivec? A lot do not. It is certainly
not a universal feature. As far as I remember, G4 and G5 powermacs have
it, but nothing older.
--
Len Sorensen
Reply to: