This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: altivec predicates
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 02 Feb 2002 23:09:18 -0500
- Subject: Re: altivec predicates
>>>>> Aldy Hernandez writes:
Aldy> How about this interface:
Aldy> __builtin_altivec_predicate_vcmpeqfp (__CR6_blah, a1, a2);
Aldy> __builtin_altivec_predicate_vcmpequwp (__CR6_blah, a1, a2);
Aldy> __builtin_altivec_predicate_vcmpequhp (__CR6_blah, a1, a2);
Aldy> __builtin_altivec_predicate_vcmpequbp (__CR6_blah, a1, a2);
Aldy> __builtin_altivec_predicate_vcmpeqswp (__CR6_blah, a1, a2);
Aldy> __builtin_altivec_predicate_vcmpeqshp (__CR6_blah, a1, a2);
Aldy> __builtin_altivec_predicate_vcmpeqsbp (__CR6_blah, a1, a2);
Aldy> where __CR6_blah is one of:
Aldy> #define __CR6_LT 0
Aldy> #define __CR6_EQ 1
Aldy> #define __CR6_LT_REV 2
Aldy> #define __CR6_EQ_REV 3
Aldy> and two more sets for GT and GE for a total of 21 new builtins.
Aldy> Btw, did we settle on "_predicate_", "_compare_", or another name?
If you want to pass EQ, GT, and GE as #defines instead of defining
multiple builtins, that would be fine with me. In other words:
__builtin_altivec_predicate_vcmpfp (__COND, __CR6, a1, a2);
with an output template like
"vcmp%V0fp"
or even something more efficient like what Geoff implemented for PowerPC
conditional branches. It just seems like you could have a few patterns in
the MD file calling a C function to actually build up the right PowerPC
instruction mnemonic.
__builtin_altivec_predicate (__MODE, __COND, __CR6, a1, a2);
Also, if the Altivec documentation wants predicate, we might as
well follow the terminology.
Thanks, David