Patchwork [testsuite] Clear hardware capabilities for gcc.target/x86_64/abi/avx on Solaris 10+/x86

login
register
mail settings
Submitter Rainer Orth
Date Aug. 26, 2010, 4:35 p.m.
Message ID <yddfwy172n8.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/62787/
State New
Headers show

Comments

Rainer Orth - Aug. 26, 2010, 4:35 p.m.
The latest patch 119961-07 for the Solaris 10/x86 assembler added AVX
support.  When I tried a bootstrap with it, I noticed that all
gcc.target/x86_64 AVX execution test were failing:

FAIL: gcc.target/x86_64/abi/avx/test_m256_returning.c execution,  -O1 

The reason is already well known: the executables are tagged to require
AVX hardware support, but the machine obviously doesn't have it:

ld.so.1: test_m256_returning.x0: fatal: hardware capability unsupported: 0x20000000  [ 0x20000000 ]

The solution is the same as in

	PATCH: Clear hardware capabilities from gcc.target/i386 executables with Sun ld
	http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00985.html

clear them via an apporpriate linker map if the linker used supports
that.  The following patch implements this and lets the failures go
away.  Ok for mainline?

Even with this patch, there are still a couple of failing AVX tests in
gcc.target/i386 which seem to be due to as not handling a couple of AVX
instructions.  I've filed a bug for that:

6979956	as doesn't understand some AVX instructions

	Rainer


2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.target/x86_64/abi/avx/abi-avx.exp: Link with
	gcc.target/i386/clearcap.map if supported.
Rainer Orth - Sept. 3, 2010, 3:10 p.m.
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> The latest patch 119961-07 for the Solaris 10/x86 assembler added AVX
> support.  When I tried a bootstrap with it, I noticed that all
> gcc.target/x86_64 AVX execution test were failing:
>
> FAIL: gcc.target/x86_64/abi/avx/test_m256_returning.c execution,  -O1 
>
> The reason is already well known: the executables are tagged to require
> AVX hardware support, but the machine obviously doesn't have it:
>
> ld.so.1: test_m256_returning.x0: fatal: hardware capability unsupported: 0x20000000  [ 0x20000000 ]
>
> The solution is the same as in
>
> 	PATCH: Clear hardware capabilities from gcc.target/i386 executables with Sun ld
> 	http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00985.html
>
> clear them via an apporpriate linker map if the linker used supports
> that.  The following patch implements this and lets the failures go
> away.  Ok for mainline?

Uros suggested in private mail that I could approve the patch myself as
purely Solaris-specific.  So I've installed it on mainline and the 4.4
and 4.5 branches, which are equally affected.  Tested on those was done
with the appropriate runtest invocations.

	Rainer

Patch

diff -r 0cf77b5772bf gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp	Mon Aug 23 13:25:29 2010 +0200
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp	Thu Aug 26 18:26:25 2010 +0200
@@ -28,9 +28,20 @@ 
 }
 
 
+# If the linker used understands -M <mapfile>, pass it to clear hardware
+# capabilities set by the Sun assembler.
+set flags ""
+set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
+
+if [check_no_compiler_messages mapfile executable {
+	int main (void) { return 0; }
+  } $clearcap_ldflags ] {
+  set flags $clearcap_ldflags
+}
+
 torture-init
 set-torture-options $C_TORTURE_OPTIONS
-set additional_flags "-W -Wall -mavx"
+set additional_flags "-W -Wall -mavx $flags"
 
 foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] {
     if {[runtest_file_p $runtests $src]} {