public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix __builtin_altivec_cmp{l,g}t
@ 2009-09-22  8:19 Jakub Jelinek
  2009-09-22 13:01 ` David Edelsohn
  2009-09-23  0:09 ` Michael Meissner
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2009-09-22  8:19 UTC (permalink / raw)
  To: David Edelsohn, Michael Meissner; +Cc: gcc-patches

Hi!

testVMX testsuite fails a couple of tests since the power7 merge, apparently
because 4 of the CODE_FOR_vector_* values are set incorrectly.
CODE_FOR_vector_gt* values go first all unsigned, then all signed, but the
actual builtins and their codes go by increasing element sizes.
So, e.g. vec_cmpgt on signed char vectors actually compares unsigned short
vectors, etc.

Fixed thusly, ok for trunk?

2009-09-22  Jakub Jelinek  <jakub@redhat.com>

	* config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes
	for __builtin_altivec_vcmpgt{sb,uh,sh,uw}.

--- gcc/config/rs6000/rs6000.c.jj	2009-09-14 20:18:49.000000000 +0200
+++ gcc/config/rs6000/rs6000.c	2009-09-22 09:43:00.151404015 +0200
@@ -8607,10 +8607,10 @@ static struct builtin_description bdesc_
   { MASK_ALTIVEC, CODE_FOR_vector_eqv4sf, "__builtin_altivec_vcmpeqfp", ALTIVEC_BUILTIN_VCMPEQFP },
   { MASK_ALTIVEC, CODE_FOR_vector_gev4sf, "__builtin_altivec_vcmpgefp", ALTIVEC_BUILTIN_VCMPGEFP },
   { MASK_ALTIVEC, CODE_FOR_vector_gtuv16qi, "__builtin_altivec_vcmpgtub", ALTIVEC_BUILTIN_VCMPGTUB },
-  { MASK_ALTIVEC, CODE_FOR_vector_gtuv8hi, "__builtin_altivec_vcmpgtsb", ALTIVEC_BUILTIN_VCMPGTSB },
-  { MASK_ALTIVEC, CODE_FOR_vector_gtuv4si, "__builtin_altivec_vcmpgtuh", ALTIVEC_BUILTIN_VCMPGTUH },
-  { MASK_ALTIVEC, CODE_FOR_vector_gtv16qi, "__builtin_altivec_vcmpgtsh", ALTIVEC_BUILTIN_VCMPGTSH },
-  { MASK_ALTIVEC, CODE_FOR_vector_gtv8hi, "__builtin_altivec_vcmpgtuw", ALTIVEC_BUILTIN_VCMPGTUW },
+  { MASK_ALTIVEC, CODE_FOR_vector_gtv16qi, "__builtin_altivec_vcmpgtsb", ALTIVEC_BUILTIN_VCMPGTSB },
+  { MASK_ALTIVEC, CODE_FOR_vector_gtuv8hi, "__builtin_altivec_vcmpgtuh", ALTIVEC_BUILTIN_VCMPGTUH },
+  { MASK_ALTIVEC, CODE_FOR_vector_gtv8hi, "__builtin_altivec_vcmpgtsh", ALTIVEC_BUILTIN_VCMPGTSH },
+  { MASK_ALTIVEC, CODE_FOR_vector_gtuv4si, "__builtin_altivec_vcmpgtuw", ALTIVEC_BUILTIN_VCMPGTUW },
   { MASK_ALTIVEC, CODE_FOR_vector_gtv4si, "__builtin_altivec_vcmpgtsw", ALTIVEC_BUILTIN_VCMPGTSW },
   { MASK_ALTIVEC, CODE_FOR_vector_gtv4sf, "__builtin_altivec_vcmpgtfp", ALTIVEC_BUILTIN_VCMPGTFP },
   { MASK_ALTIVEC, CODE_FOR_altivec_vctsxs, "__builtin_altivec_vctsxs", ALTIVEC_BUILTIN_VCTSXS },

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix __builtin_altivec_cmp{l,g}t
  2009-09-22  8:19 [PATCH] Fix __builtin_altivec_cmp{l,g}t Jakub Jelinek
@ 2009-09-22 13:01 ` David Edelsohn
  2009-09-23  0:09 ` Michael Meissner
  1 sibling, 0 replies; 3+ messages in thread
From: David Edelsohn @ 2009-09-22 13:01 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Michael Meissner, gcc-patches

On Tue, Sep 22, 2009 at 4:01 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> testVMX testsuite fails a couple of tests since the power7 merge, apparently
> because 4 of the CODE_FOR_vector_* values are set incorrectly.
> CODE_FOR_vector_gt* values go first all unsigned, then all signed, but the
> actual builtins and their codes go by increasing element sizes.
> So, e.g. vec_cmpgt on signed char vectors actually compares unsigned short
> vectors, etc.
>
> Fixed thusly, ok for trunk?
>
> 2009-09-22  Jakub Jelinek  <jakub@redhat.com>
>
>        * config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes
>        for __builtin_altivec_vcmpgt{sb,uh,sh,uw}.

Okay.

Thanks, David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix __builtin_altivec_cmp{l,g}t
  2009-09-22  8:19 [PATCH] Fix __builtin_altivec_cmp{l,g}t Jakub Jelinek
  2009-09-22 13:01 ` David Edelsohn
@ 2009-09-23  0:09 ` Michael Meissner
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Meissner @ 2009-09-23  0:09 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: David Edelsohn, Michael Meissner, gcc-patches

On Tue, Sep 22, 2009 at 10:01:05AM +0200, Jakub Jelinek wrote:
> Hi!
> 
> testVMX testsuite fails a couple of tests since the power7 merge, apparently
> because 4 of the CODE_FOR_vector_* values are set incorrectly.
> CODE_FOR_vector_gt* values go first all unsigned, then all signed, but the
> actual builtins and their codes go by increasing element sizes.
> So, e.g. vec_cmpgt on signed char vectors actually compares unsigned short
> vectors, etc.
> 
> Fixed thusly, ok for trunk?

Thanks for finding this.  Sorry about that.

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-22 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-22  8:19 [PATCH] Fix __builtin_altivec_cmp{l,g}t Jakub Jelinek
2009-09-22 13:01 ` David Edelsohn
2009-09-23  0:09 ` Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).