This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add SSE4.1 testcases


On 5/22/07, H. J. Lu <hjl@lucon.org> wrote:

> /* { dg-do run { target i?86-*-* x86_64-*-* } } */
> /* { dg-require-effective-target sse41 } */
>
> Also, please do not add new headers:
>
> +#include "sse4_1-check.h"
>
> but use i386-cpuid.h directly with a runtime feature test in main,
> like it is used in ssse3-* and sse4a-* tests.

That will duplicate lots of codes. What is the advantage for this
approach?

The runtime check can be seen immediatelly at the top of testcase. And all existing test implements runtime check this way. Like from ssse3 tests:

--cut here--
...
#include "../../gcc.dg/i386-cpuid.h"
#include "ssse3-vals.h"

static void ssse3_test (void);

int
main ()
{
 unsigned long cpu_facilities;

cpu_facilities = i386_cpuid_ecx ();

 /* Run SSSE3 test only if host has SSSE3 support.  */
 if ((cpu_facilities & bit_SSSE3))
   ssse3_test ();

 exit (0);
}
...
--cut here--

This is all code that needs to be duplicated...


-/* Define to 1 to enable decimal float extension to C. */ +/* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ #ifndef USED_FOR_TARGET -#undef ENABLE_DECIMAL_FLOAT +#undef ENABLE_DECIMAL_BID_FORMAT #endif


-/* Define to 1 to say we are using the BID decimal format */ +/* Define to 1 to enable decimal float extension to C. */ #ifndef USED_FOR_TARGET -#undef ENABLE_DECIMAL_BID_FORMAT +#undef ENABLE_DECIMAL_FLOAT #endif

The above is not intended to be in this patch?

It is generated by autoheader in autoconf 2.59.


Hm, this should be resolved elsewhere.

> BTW: I'll implement asm checks for target-support.exp. Stay tuned ;)
>

I will wait for your patch.

It is allready commited [1][2]. Please put in a compile-time check for sse4 target support (preferrably in pure C; just copy some representative intrinsic function from support header).

[1] http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01430.html
[2] http://gcc.gnu.org/ml/gcc-cvs/2007-05/msg00638.html

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]