Fix PR82847

Message ID alpine.LSU.2.20.1803271345210.18265@zhemvz.fhfr.qr
State New
Headers show
Series
  • Fix PR82847
Related show

Commit Message

Richard Biener March 27, 2018, 11:46 a.m.
The following attempts to fix PR82847 by introducing a check whether
ssse3 is available and enable vect_perm_short if so.  Somewhat of
a kludge but I can't think of anything better right now.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2018-03-27  Richard Biener  <rguenther@suse.de>

	PR testsuite/82847
	* lib/target-supports.exp (check_ssse3_available): New function.
	(check_effective_target_vect_perm_short): Enable for x86 if
	check_ssse3_available.

Patch

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 258871)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -5828,6 +5828,8 @@  proc check_effective_target_vect_perm_sh
 		 && ![check_effective_target_vect_variable_length])
 	     || [istarget powerpc*-*-*]
 	     || [istarget spu-*-*]
+	     || (([istarget i?86-*-*] || [istarget x86_64-*-*]
+	         && [check_ssse3_available]))
 	     || ([istarget mips*-*-*]
 		  && [et-is-effective-target mips_msa])
 	     || ([istarget s390*-*-*]
@@ -8012,6 +8014,19 @@  proc check_avx_available { } {
     #error unsupported
     #endif
   } ""] } {
+    return 1;
+  }
+  return 0;
+}
+
+# Return true if we are compiling for SSSE3 target.
+
+proc check_ssse3_available { } {
+  if { [check_no_compiler_messages sse3a_available assembly {
+    #ifndef __SSSE3__
+    #error unsupported
+    #endif
+  } ""] } {
     return 1;
   }
   return 0;