public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass/tests: toolchain.sh
@ 2014-02-02 23:43 Ryan Hill (dirtyepic)
  0 siblings, 0 replies; 3+ messages in thread
From: Ryan Hill (dirtyepic) @ 2014-02-02 23:43 UTC (permalink / raw
  To: gentoo-commits

dirtyepic    14/02/02 23:43:49

  Added:                toolchain.sh
  Log:
  Add downgrade_arch_flags() to automatically replace/strip unsupported -march
  and instruction set flags. Add testsuite.

Revision  Changes    Path
1.1                  eclass/tests/toolchain.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?rev=1.1&content-type=text/plain

Index: toolchain.sh
===================================================================
#!/bin/bash

source tests-common.sh

inherit toolchain

test_downgrade_arch_flags() {
	local exp msg ret=0 ver

	ver=${1}
	exp=${2}
	shift 2
	CFLAGS=${@}

	tbegin "${ver} ${CFLAGS} => ${exp}"

	downgrade_arch_flags ${ver}
	
	if [[ ${CFLAGS} != ${exp} ]]; then
		msg="Failure - Expected: \"${exp}\" Got: \"${CFLAGS}\""
		ret=1
	fi
	tend ${ret} ${msg}
}

#                         ver  expected            given
test_downgrade_arch_flags 4.9 "-march=haswell"    "-march=haswell"
test_downgrade_arch_flags 4.8 "-march=core-avx2"  "-march=haswell"
test_downgrade_arch_flags 4.7 "-march=core-avx2"  "-march=haswell"
test_downgrade_arch_flags 4.6 "-march=core-avx-i" "-march=haswell"
test_downgrade_arch_flags 4.5 "-march=core2"      "-march=haswell"
test_downgrade_arch_flags 4.4 "-march=core2"      "-march=haswell"
test_downgrade_arch_flags 4.3 "-march=core2"      "-march=haswell"
test_downgrade_arch_flags 4.2 "-march=nocona"     "-march=haswell"
test_downgrade_arch_flags 4.1 "-march=nocona"     "-march=haswell"
test_downgrade_arch_flags 4.0 "-march=nocona"     "-march=haswell"
test_downgrade_arch_flags 3.4 "-march=nocona"     "-march=haswell"
test_downgrade_arch_flags 3.3 "-march=nocona"     "-march=haswell"

test_downgrade_arch_flags 4.9 "-march=bdver4"     "-march=bdver4"
test_downgrade_arch_flags 4.8 "-march=bdver3"     "-march=bdver4"
test_downgrade_arch_flags 4.7 "-march=bdver2"     "-march=bdver4"
test_downgrade_arch_flags 4.6 "-march=bdver1"     "-march=bdver4"
test_downgrade_arch_flags 4.5 "-march=amdfam10"   "-march=bdver4"
test_downgrade_arch_flags 4.4 "-march=amdfam10"   "-march=bdver4"
test_downgrade_arch_flags 4.3 "-march=amdfam10"   "-march=bdver4"
test_downgrade_arch_flags 4.2 "-march=k8"         "-march=bdver4"
test_downgrade_arch_flags 4.1 "-march=k8"         "-march=bdver4"
test_downgrade_arch_flags 4.0 "-march=k8"         "-march=bdver4"
test_downgrade_arch_flags 3.4 "-march=k8"         "-march=bdver4"
test_downgrade_arch_flags 3.3 "-march=x86-64"     "-march=bdver4"

test_downgrade_arch_flags 3.4 "-march=c3-2"       "-march=c3-2"
test_downgrade_arch_flags 3.3 "-march=c3"         "-march=c3-2"

test_downgrade_arch_flags 4.5 "-march=garbage"    "-march=garbage"

test_downgrade_arch_flags 4.9 "-mtune=intel"      "-mtune=intel"
test_downgrade_arch_flags 4.8 "-mtune=generic"    "-mtune=intel"
test_downgrade_arch_flags 3.4 ""                  "-mtune=generic"
test_downgrade_arch_flags 3.4 ""                  "-mtune=x86-64"
test_downgrade_arch_flags 3.3 "-mtune=nocona"     "-mtune=haswell"

test_downgrade_arch_flags 4.5 "-march=amdfam10 -mtune=generic" "-march=btver2 -mtune=generic"
test_downgrade_arch_flags 3.3 "-march=k6-2"       "-march=geode -mtune=barcelona"
test_downgrade_arch_flags 3.4 "-march=k8"         "-march=btver2 -mtune=generic"

test_downgrade_arch_flags 4.2 "-march=native"     "-march=native"
test_downgrade_arch_flags 4.1 "-march=nocona"     "-march=native"

test_downgrade_arch_flags 4.9 "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.8 "-march=foo -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.7 "-march=foo -mavx2 -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.6 "-march=foo -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.5 "-march=foo -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.4 "-march=foo -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.3 "-march=foo -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
test_downgrade_arch_flags 4.2 "-march=foo" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"

test_downgrade_arch_flags 4.4 "-O2 -march=core2 -ffoo -fblah" "-O2 -march=atom -msha -ffoo -mrtm -mavx2 -fblah"
texit





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

* [gentoo-commits] gentoo-x86 commit in eclass/tests: toolchain.sh
@ 2014-02-05  6:18 Ryan Hill (dirtyepic)
  0 siblings, 0 replies; 3+ messages in thread
From: Ryan Hill (dirtyepic) @ 2014-02-05  6:18 UTC (permalink / raw
  To: gentoo-commits

dirtyepic    14/02/05 06:18:30

  Modified:             toolchain.sh
  Log:
  Limit downgrading flags to amd64 and x86. Strip -mtune for < 3.4. Only
  worry about -mno* flags, -m* are removed by strip-flags. Add -mno-movbe.

Revision  Changes    Path
1.2                  eclass/tests/toolchain.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?r1=1.1&r2=1.2

Index: toolchain.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/toolchain.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- toolchain.sh	2 Feb 2014 23:43:49 -0000	1.1
+++ toolchain.sh	5 Feb 2014 06:18:29 -0000	1.2
@@ -14,8 +14,9 @@
 
 	tbegin "${ver} ${CFLAGS} => ${exp}"
 
+	CHOST=x86_64 # needed for tc-arch
 	downgrade_arch_flags ${ver}
-	
+
 	if [[ ${CFLAGS} != ${exp} ]]; then
 		msg="Failure - Expected: \"${exp}\" Got: \"${CFLAGS}\""
 		ret=1
@@ -59,7 +60,7 @@
 test_downgrade_arch_flags 4.8 "-mtune=generic"    "-mtune=intel"
 test_downgrade_arch_flags 3.4 ""                  "-mtune=generic"
 test_downgrade_arch_flags 3.4 ""                  "-mtune=x86-64"
-test_downgrade_arch_flags 3.3 "-mtune=nocona"     "-mtune=haswell"
+test_downgrade_arch_flags 3.3 ""                  "-mtune=anything"
 
 test_downgrade_arch_flags 4.5 "-march=amdfam10 -mtune=generic" "-march=btver2 -mtune=generic"
 test_downgrade_arch_flags 3.3 "-march=k6-2"       "-march=geode -mtune=barcelona"
@@ -68,14 +69,12 @@
 test_downgrade_arch_flags 4.2 "-march=native"     "-march=native"
 test_downgrade_arch_flags 4.1 "-march=nocona"     "-march=native"
 
-test_downgrade_arch_flags 4.9 "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.8 "-march=foo -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.7 "-march=foo -mavx2 -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.6 "-march=foo -mbmi -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.5 "-march=foo -mno-xop -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.4 "-march=foo -maes -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.3 "-march=foo -mno-sse4" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
-test_downgrade_arch_flags 4.2 "-march=foo" "-march=foo -msha -mrtm -mavx2 -mbmi -mno-xop -maes -mno-sse4"
+test_downgrade_arch_flags 4.9 "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
+test_downgrade_arch_flags 4.8 "-march=foo -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
+test_downgrade_arch_flags 4.7 "-march=foo -mno-avx2 -mno-avx -mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
+test_downgrade_arch_flags 4.6 "-march=foo -mno-avx -mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
+test_downgrade_arch_flags 4.3 "-march=foo -mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
+test_downgrade_arch_flags 4.2 "-march=foo" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
 
-test_downgrade_arch_flags 4.4 "-O2 -march=core2 -ffoo -fblah" "-O2 -march=atom -msha -ffoo -mrtm -mavx2 -fblah"
+test_downgrade_arch_flags 4.4 "-O2 -march=core2 -ffoo -fblah" "-O2 -march=atom -mno-sha -ffoo -mno-rtm -fblah"
 texit





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

* [gentoo-commits] gentoo-x86 commit in eclass/tests: toolchain.sh
@ 2015-05-17 20:12 Ulrich Mueller (ulm)
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Mueller (ulm) @ 2015-05-17 20:12 UTC (permalink / raw
  To: gentoo-commits

ulm         15/05/17 20:12:56

  Modified:             toolchain.sh
  Log:
  Add standard header, acknowledged by rhill in bug 548984.

Revision  Changes    Path
1.3                  eclass/tests/toolchain.sh

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/toolchain.sh?r1=1.2&r2=1.3

Index: toolchain.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/toolchain.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- toolchain.sh	5 Feb 2014 06:18:29 -0000	1.2
+++ toolchain.sh	17 May 2015 20:12:56 -0000	1.3
@@ -1,4 +1,7 @@
 #!/bin/bash
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/tests/toolchain.sh,v 1.3 2015/05/17 20:12:56 ulm Exp $
 
 source tests-common.sh
 





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

end of thread, other threads:[~2015-05-17 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-02 23:43 [gentoo-commits] gentoo-x86 commit in eclass/tests: toolchain.sh Ryan Hill (dirtyepic)
  -- strict thread matches above, loose matches on Subject: below --
2014-02-05  6:18 Ryan Hill (dirtyepic)
2015-05-17 20:12 Ulrich Mueller (ulm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox