This is the mail archive of the 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: testsuite run-time test for sse2 support


> The attached patch adds a run-time check for
> SSE2 support.  I think I picked an instruction
> that only shows up at >= SSE2.  At this point,
> I didn't see any need to test for each level
> individually.

> +# Return 1 if the target supports executing MMX instructions, 0
> +# otherwise.  Cache the result.

This comment is wrong, the procedure checks if target supports
executing SSE2 instructions, and the result is not cached. This
procedure is however called only once, at the beginning of vectorizer
testsuite, so it doesn't need to be cached.

+proc check_sse2_hw_available { } {
+    return [check_runtime x86_sse2_hw_available {
+	int
+	main (void)
+	{
+	  asm volatile ("paddq  %xmm0,%xmm0");
+	  return 0;
+	}
+    } "-msse2"]

The code that checks for SSE2 feature should use CPUID instruction
through __get_cpuid() call from cpuid.h instead of trapping on unknown
insn, something similar to what is implemented in

However, since all runtime tests in directory are
protected by the check using CPUID, it looks that these checks are not
effective on your target for some reason. Since your target doesn't
support CPUID, this should be detected by __get_cpuid_max() from
cpuid.h that follows Intel recommended procedure. Can you check if
__get_cpuid_max () from gcc/config/i386/cpuid.h returns 0 for your
target? And if not, why not ;)

BTW: Looking at the rtems testresults, I belive that *-*-rtems* should
be added to check_profiling_available dg procedure in
testsuite/lib/target-support.exp. This will remove _lots_ of failures
from your testresults.


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