aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/benchmarks/Makefile
diff options
context:
space:
mode:
authorCyril Bur <cyrilbur@gmail.com>2016-03-04 10:06:40 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-05 23:49:50 +1000
commitf2418ae8a81760b4dec8d5e3e7f1faf45c422e9d (patch)
tree721787068ed0ac900bb739fdd4fbe1f4372f6a4f /tools/testing/selftests/powerpc/benchmarks/Makefile
parentselftests/powerpc: Fix usage message in context_switch (diff)
downloadlinux-dev-f2418ae8a81760b4dec8d5e3e7f1faf45c422e9d.tar.xz
linux-dev-f2418ae8a81760b4dec8d5e3e7f1faf45c422e9d.zip
selftests/powerpc: Fix generation of vector instructions/types in context_switch
Currently it doesn't appear the resulting binary actually uses any Altivec or VSX instructions the solution is to explicitly tell GCC to use vector instructions and use vector types in the code. Part of this this issue can be GCC version specific: GCC 4.9.x is happy to use Altivec and VSX instructions if altivec.h is includedi (and possibly if vector types are used), this also means that 4.9.x will use VSX instructions even if only -maltivec is passed. It is also possible that Altivec instructions will be used even without -maltivec or -mabi=altivec. GCC 5.2.x complains about the lack of -maltivec parameter if altivec.h is included and will not use VSX unless -mvsx is present on commandline. GCC 5.3.0 has a regression that means __attribute__((__target__("no-vsx")) fails to build. A fix is targeted for 5.4. Furthermore LTO (Link Time Optimisation) doesn't play well with __attribute__((__target__("no-vsx")), LTO can cause GCC to forget about the attribute and compile with VSX instructions regardless. Be wary when enabling -flfo for this test. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/benchmarks/Makefile')
-rw-r--r--tools/testing/selftests/powerpc/benchmarks/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile b/tools/testing/selftests/powerpc/benchmarks/Makefile
index 912445ff7ce7..6816fc2140cb 100644
--- a/tools/testing/selftests/powerpc/benchmarks/Makefile
+++ b/tools/testing/selftests/powerpc/benchmarks/Makefile
@@ -7,6 +7,7 @@ all: $(TEST_PROGS)
$(TEST_PROGS): ../harness.c
context_switch: ../utils.c
+context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec
context_switch: LDLIBS += -lpthread
include ../../lib.mk