public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH, testsuite]: Fix fallout from vperm tests
@ 2009-11-27  9:29 Uros Bizjak
  2009-11-27 15:46 ` Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Uros Bizjak @ 2009-11-27  9:29 UTC (permalink / raw)
  To: gcc-patches

Hello!

>>    If I understand it correctly, you can only run those tests if your
>>    assembler supports those those insns.


> Humph.  I'd really prefer that we force the use of a newer assembler,
> at least for gcc developers.  I really really don't want those tests
> to silently break, just because e.g. no one actually has AVX or XOP
> hardware and so can't pass the effective-target test.

I have latest _released_ assembler and it certainly doesn't support
XOP. Current practice (from ssse3 introduction) is to check toolchain
if it can compile a representative instruction from ISA. IMO, forcing
latest-and-greatest assembler is kind of rude to (i.e.) middle-end
folks that are scratching their heads if their change introduced the
failure. See perhaps [1]. And sooner or latter, everybody will have
toolchain with full support for new ISA, automatically detected by
testsuite.

> But adding the -msse2 for the v4sf test was *really* wrong.  That
> one's really supposed to work with only sse1 support.

Hm, followinfg is the reason for the change:

gcc.target/i386/vperm-v4sf-1.c:

/* { dg-do run } */
/* { dg-options "-O -msse" } */
...
#define TEST(E0, E1, E2, E3) \
  b.v = __builtin_ia32_vec_perm_v4sf (i[0].v, i[1].v, (IV){E0, E1, E2, E3}); \

gcc/config/i386.c:

  { OPTION_MASK_ISA_SSE2, CODE_FOR_nothing,
"__builtin_ia32_vec_perm_v4sf", IX86_BUILTIN_VEC_PERM_V4SF, UNKNOWN,
(int) V4SF_FTYPE_V4SF_V4SF_V4SI },

This will work in x86_64 since it implies -msse2 (even when only -msse
is added to compile flags), but the test will break on i686 with:

~/gcc-build/gcc/xgcc -B ~/gcc-build/gcc -O -m32 -msse vperm-v4sf-1.c
In file included from vperm-v4sf-1.c:25:0:
vperm-4-1.inc: In function 'check0':
vperm-4-1.inc:5:3: error: incompatible types when assigning to type
'V' from type 'int'
vperm-4-1.inc:6:3: error: incompatible types when assigning to type
'V' from type 'int'
vperm-4-1.inc:7:3: error: incompatible types when assigning to type
'V' from type 'int'
...

[1] http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01495.html

Uros.

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

* Re: [PATCH, testsuite]: Fix fallout from vperm tests
  2009-11-27  9:29 [PATCH, testsuite]: Fix fallout from vperm tests Uros Bizjak
@ 2009-11-27 15:46 ` Richard Henderson
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 2009-11-27 15:46 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On 11/27/2009 12:32 AM, Uros Bizjak wrote:
>    { OPTION_MASK_ISA_SSE2, CODE_FOR_nothing,
> "__builtin_ia32_vec_perm_v4sf", IX86_BUILTIN_VEC_PERM_V4SF, UNKNOWN,
> (int) V4SF_FTYPE_V4SF_V4SF_V4SI },

I could have sworn I changed that line to be OPTION_MASK_ISA_SSE...
Sorry for the noise about the flag; I'll change them back both at
the same time.


r~

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

* Re: [PATCH, testsuite]: Fix fallout from vperm tests
  2009-11-27  1:08     ` Richard Henderson
@ 2009-11-27  1:10       ` H.J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H.J. Lu @ 2009-11-27  1:10 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Thu, Nov 26, 2009 at 5:03 PM, Richard Henderson <rth@redhat.com> wrote:
> On 11/26/2009 04:51 PM, H.J. Lu wrote:
>>
>> If I understand it correctly, you can only run those tests if your
>> assembler supports those those insns.
>
> Humph.  I'd really prefer that we force the use of a newer assembler,
> at least for gcc developers.  I really really don't want those tests
> to silently break, just because e.g. no one actually has AVX or XOP
> hardware and so can't pass the effective-target test.
>
> But adding the -msse2 for the v4sf test was *really* wrong.  That
> one's really supposed to work with only sse1 support.
>

Most of effective target directives just check if the insn can be assembled.



-- 
H.J.

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

* Re: [PATCH, testsuite]: Fix fallout from vperm tests
  2009-11-27  1:03   ` H.J. Lu
@ 2009-11-27  1:08     ` Richard Henderson
  2009-11-27  1:10       ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2009-11-27  1:08 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On 11/26/2009 04:51 PM, H.J. Lu wrote:
> If I understand it correctly, you can only run those tests if your
> assembler supports those those insns.

Humph.  I'd really prefer that we force the use of a newer assembler,
at least for gcc developers.  I really really don't want those tests
to silently break, just because e.g. no one actually has AVX or XOP
hardware and so can't pass the effective-target test.

But adding the -msse2 for the v4sf test was *really* wrong.  That
one's really supposed to work with only sse1 support.


r~

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

* Re: [PATCH, testsuite]: Fix fallout from vperm tests
  2009-11-27  0:51 ` Richard Henderson
@ 2009-11-27  1:03   ` H.J. Lu
  2009-11-27  1:08     ` Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2009-11-27  1:03 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

2009/11/26 Richard Henderson <rth@redhat.com>:
> On 11/26/2009 03:24 PM, Uros Bizjak wrote:
>>
>> Hello!
>>
>> 2009-11-27 Uros Bizjak <ubizjak@gmail.com>
>>
>> * gcc.target/i386/vperm-v4sf-1.c (dg-options): Use -msse2.
>> * gcc.target/i386/vperm-v4sf-2.c: Require effective target ssse3.
>> * gcc.target/i386/vperm-v4si-2.c: Ditto.
>> * gcc.target/i386/vperm-v4si-2x.c: Require effective target xop.
>
> No.  That's what isa-check.h does.  And you're preventing
> the compile-time test from being run.
>

If I understand it correctly, you can only run those tests if your
assembler supports those those insns.



-- 
H.J.

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

* Re: [PATCH, testsuite]: Fix fallout from vperm tests
  2009-11-27  0:48 Uros Bizjak
@ 2009-11-27  0:51 ` Richard Henderson
  2009-11-27  1:03   ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2009-11-27  0:51 UTC (permalink / raw)
  To: gcc-patches

On 11/26/2009 03:24 PM, Uros Bizjak wrote:
> Hello!
>
> 2009-11-27 Uros Bizjak <ubizjak@gmail.com>
>
> * gcc.target/i386/vperm-v4sf-1.c (dg-options): Use -msse2.
> * gcc.target/i386/vperm-v4sf-2.c: Require effective target ssse3.
> * gcc.target/i386/vperm-v4si-2.c: Ditto.
> * gcc.target/i386/vperm-v4si-2x.c: Require effective target xop.

No.  That's what isa-check.h does.  And you're preventing
the compile-time test from being run.


r~

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

* [PATCH, testsuite]: Fix fallout from vperm tests
@ 2009-11-27  0:48 Uros Bizjak
  2009-11-27  0:51 ` Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Uros Bizjak @ 2009-11-27  0:48 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

Hello!

2009-11-27  Uros Bizjak <ubizjak@gmail.com>

     * gcc.target/i386/vperm-v4sf-1.c (dg-options): Use -msse2.
     * gcc.target/i386/vperm-v4sf-2.c: Require effective target ssse3.
     * gcc.target/i386/vperm-v4si-2.c: Ditto.
     * gcc.target/i386/vperm-v4si-2x.c: Require effective target xop.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline.

Uros.

[-- Attachment #2: t.diff.txt --]
[-- Type: text/plain, Size: 1205 bytes --]

Index: vperm-v4si-2x.c
===================================================================
--- vperm-v4si-2x.c	(revision 154689)
+++ vperm-v4si-2x.c	(working copy)
@@ -1,3 +1,4 @@
 /* { dg-do run } */
+/* { dg-require-effective-target xop } */
 /* { dg-options "-O -mxop" } */
 #include "vperm-v4si-2.c"
Index: vperm-v4sf-2.c
===================================================================
--- vperm-v4sf-2.c	(revision 154689)
+++ vperm-v4sf-2.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-require-effective-target ssse3 } */
 /* { dg-options "-O -mssse3" } */
 
 #include "isa-check.h"
Index: vperm-v4si-2.c
===================================================================
--- vperm-v4si-2.c	(revision 154689)
+++ vperm-v4si-2.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-require-effective-target ssse3 } */
 /* { dg-options "-O -mssse3" } */
 
 #include "isa-check.h"
Index: vperm-v4sf-1.c
===================================================================
--- vperm-v4sf-1.c	(revision 154689)
+++ vperm-v4sf-1.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O -msse" } */
+/* { dg-options "-O -msse2" } */
 
 #include "isa-check.h"
 

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

end of thread, other threads:[~2009-11-27 15:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-27  9:29 [PATCH, testsuite]: Fix fallout from vperm tests Uros Bizjak
2009-11-27 15:46 ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2009-11-27  0:48 Uros Bizjak
2009-11-27  0:51 ` Richard Henderson
2009-11-27  1:03   ` H.J. Lu
2009-11-27  1:08     ` Richard Henderson
2009-11-27  1:10       ` H.J. Lu

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).