patch: cleanup gcc.dg/vect/ (take 2)

Dorit Naishlos DORIT@il.ibm.com
Sun Nov 7 17:33:00 GMT 2004





> We want the DejaGnu stuff in the test headers to be clear, and we want
> it to be easy to update the tests to be used for a new target.

Just a thought -
might make sense to also automate the dg-final stuff, together with the
dg-do. My concern is that when the targets and compilation flags are no
longer explicitly listed in the testcase header, it may become less obvious
to know if and which targets should xfail on:
/* { dg-final { scan-tree-dump-times "vectorized X loops" Y "vect" } } */)

For example, tests with unaligned accesses will only get vectorized on
targets that supply implementation of the alignment handling mechanisms
(i.e, define the vec_realign_load pattern (like alpha, altivec), or define
the target hook targetm.vectorize.misaligned_mem_ok (like mmx)):

- vect-[27,29,72,77].c are int testcases that don't get vectorized on
targets that do not model alignment handling mechanisms (i386 with -msse2)

- vect-[44,48,50,52,54,56,58,60,80].c are fp testcases that don't get
vectorized on targets that do not model alignment handling mechanisms (i386
with -msse2, mips)

I think we currently have only two additional classes of targets xfailing
on dg-final:

- vect-[17,18,19,20].c don't get vectorized on targets that don't have (or
don't model) vector bitwise operations.

- vect-13.c doesn't get vectorized on targets that don't have (or don't
model) a vector max operation.


dorit



                                                                                                                                 
                      Janis Johnson                                                                                              
                      <janis187@us.ibm.c        To:       gcc-patches@gcc.gnu.org                                                
                      om>                       cc:       aldyh@redhat.com                                                       
                      Sent by:                  Subject:  patch: cleanup gcc.dg/vect/ (take 2)                                   
                      gcc-patches-owner@                                                                                         
                      gcc.gnu.org                                                                                                
                                                                                                                                 
                                                                                                                                 
                      20/10/2004 19:40                                                                                           
                                                                                                                                 




This patch extends Aldy's cleanup of the gcc.dg/vect tests and includes
his changes.  It handles the dg-do action and the target list in a way
that I haven't seen before; maybe it's way cool, but maybe there are
good reasons no one uses this kind of construct.

We want to get the most out of these tests; that means generating code
and looking at the dump files whenever the compiler supports generating
vector instructions, but only executing the test if we've got vector
hardware.  We want to change "dg-do run" to "dg-do compile" if we don't
have hardware support.  This change handles that by using a proc in
vect.exp (local to these tests) to return either "run" or "compile"
depending on whether we've got hardware support.

We want the DejaGnu stuff in the test headers to be clear, and we want
it to be easy to update the tests to be used for a new target.
Currently the majority of the tests (55 out of 91) specify that they
are to be used for "powerpc*-*-* i?86-*-* x86_64-*-*", 31 specify those
targets plus mipsisa64*-*-*, and the rest are for subsets of those.
The patch adds another local proc that returns a target list represented
by an identifier.  The only identifier defined now is "int-fp", meaning
all targets that support both integer and float vectors, but it's easy
to add more when they are needed.  Aldy added an "exit" to vect.exp for
targets that never run these tests.

I've tested this patch by doing simple builds, C only, and running the
gcc.dg/vect tests on the following platforms before and after the patch:
  powerpc64-unknown-linux-gnu, -m32 and -m64, system with VMX
  powerpc64-unknown-linux-gnu, -m32 and -m64, system w/out vector hw
  i686-pc-linux-gnu
  mipsisa64-elf

OK for mainline?








More information about the Gcc-patches mailing list