On 04/08/16 09:50, Segher Boessenkool wrote:
Hi Bill,

On Thu, Apr 07, 2016 at 04:04:30PM -0500, Bill Seurer wrote:
On 04/05/16 21:27, David Edelsohn wrote:
On Tue, Apr 5, 2016 at 3:36 PM, Bill Seurer <seu...@linux.vnet.ibm.com>
         * config/rs6000/rs6000-c.c (altivec_overloaded_builtins,
         altivec_resolve_overloaded_builtin): Remove
         ALTIVEC_BUILTIN_VEC_ADDE
         from altivec_overloaded_builtins structure.  Add support for it
         to
         altivec_resolve_overloaded_builtin function.

A total nit, but...  If you change one thing in one places, and another
in another, put them in the changelog separately.

OK.

+         /* for {un}signed ints,
+            vec_adde (va, vb, carryv) == vec_add (vec_add (va, vb),
carryv) */

Same.

Also sentences start with a capital letter.

What is the definition of the builtin?  The machine insn does
va + vb + (carryv & 1); your implementation skips the AND.

From the ABI document:
Purpose:
Returns a vector containing the result of adding each set of the corresponding elements of ARG1 and ARG2 with a carry (that has a value of either 0 or 1) specified as the ARG3 vector.
Result value:
The value of each element of the result is produced by adding the corresponding elements of ARG1 and ARG2 and a carry specified in ARG3 (1 if there is a carry, 0 otherwise).


It's not really clear what should be done if the carry is not 1 or 0 from that description because it specifies that the carry IS 1 or 0.

I tried it and the instruction (for __int128's only) does indeed do the and which means it will add a 0 if the "carry" is something like 2. I will change the test case to include "bad" values.

I can add an and easily enough.

--- gcc/testsuite/gcc.target/powerpc/vec-adde-int128.c  (revision 0)
+++ gcc/testsuite/gcc.target/powerpc/vec-adde-int128.c  (working copy)
@@ -0,0 +1,78 @@
+/* { dg-do run { target { powerpc64le-*-* } } } */

Will powerpc64 (i.e. BE) not work?

No, it does work. The other test cases I was using as models only targeted LE (though on inspection most if not all of them would also work on BE). I suppose there's no reason to do that here, though.
--

-Bill Seurer

Reply via email to