public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...
@ 2016-11-01  9:05 Uros Bizjak
  2016-11-01 16:05 ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2016-11-01  9:05 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

... simplify some conditions and add i?86-*-* target where missing.

2016-11-01  Uros Bizjak  <ubizjak@gmail.com>

    * lib/target-supports.exp: Normalize order of i?86 and x86_64 targets.
    Whitespace fixes.
    (check_effective_target_vect_cmdline_needed): Check
    is-effective-target ia32 for x86 targets.
    (check_effective_target_vect_simd_clones): Simplify condition.
    (check_effective_target_vect_double): Ditto.
    (check_effective_target_vect_aligned_arrays): Check
    is-effective-target ia32 for x86 targets.  Simplify condition.
    (check_effective_target_vect_multiple_sizes): Simplify condition.
    (check_effective_target_sqrt_insn): Add i?86-*-* target.
    (check_effective_target_sync_int_128): Simplify condition.
    (check_effective_target_sync_int_128_runtime): Ditto.
    (check_effective_target_sync_long_long_runtime): Ditto.
    (check_effective_target_divmod): Add i?86-*-* target.

Tested on x86_64-linux-gnu {,-m32} and commited to mainline SVN.

Uros.

[-- Attachment #2: t.diff.txt --]
[-- Type: text/plain, Size: 13170 bytes --]

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 241701)
+++ lib/target-supports.exp	(working copy)
@@ -533,7 +533,7 @@
     }
 
     if { $test_what == "-fauto-profile" } {
-	if { ! ([istarget x86_64-*-linux*] || [istarget i?86-*-linux*]) } {
+	if { !([istarget i?86-*-linux*] || [istarget x86_64-*-linux*]) } {
             verbose "autofdo only supported on linux"
             return 0
         }
@@ -1521,7 +1521,7 @@
 proc check_sse_os_support_available { } {
     return [check_cached_effective_target sse_os_support_available {
 	# If this is not the right target then we can skip the test.
-	if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	    expr 0
 	} elseif { [istarget i?86-*-solaris2*] } {
 	    # The Solaris 2 kernel doesn't save and restore SSE registers
@@ -1545,7 +1545,7 @@
 proc check_avx_os_support_available { } {
     return [check_cached_effective_target avx_os_support_available {
 	# If this is not the right target then we can skip the test.
-	if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	    expr 0
 	} else {
 	    # Check that OS has AVX and SSE saving enabled.
@@ -1568,7 +1568,7 @@
 proc check_sse_hw_available { } {
     return [check_cached_effective_target sse_hw_available {
 	# If this is not the right target then we can skip the test.
-	if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	    expr 0
 	} else {
 	    check_runtime_nocache sse_hw_available {
@@ -1668,7 +1668,7 @@
 proc check_sse2_hw_available { } {
     return [check_cached_effective_target sse2_hw_available {
 	# If this is not the right target then we can skip the test.
-	if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	    expr 0
 	} else {
 	    check_runtime_nocache sse2_hw_available {
@@ -1691,7 +1691,7 @@
 proc check_sse4_hw_available { } {
     return [check_cached_effective_target sse4_hw_available {
 	# If this is not the right target then we can skip the test.
-	if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	    expr 0
 	} else {
 	    check_runtime_nocache sse4_hw_available {
@@ -1714,7 +1714,7 @@
 proc check_avx_hw_available { } {
     return [check_cached_effective_target avx_hw_available {
 	# If this is not the right target then we can skip the test.
-	if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	    expr 0
 	} else {
 	    check_runtime_nocache avx_hw_available {
@@ -2619,8 +2619,7 @@
 	return [check_ppc_float128_sw_available]
     }
     if { [istarget ia64-*-*]
-	 || [istarget i?86-*-*]
-	 || [istarget x86_64-*-*] } {
+	 || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
 	return 1
     }
     return 0
@@ -2776,9 +2775,8 @@
 	set et_vect_cmdline_needed_saved 1
 	if { [istarget alpha*-*-*]
 	     || [istarget ia64-*-*]
-	     || (([istarget x86_64-*-*] || [istarget i?86-*-*])
-		 && ([check_effective_target_x32]
-		     || [check_effective_target_lp64]))
+	     || (([istarget i?86-*-*] || [istarget x86_64-*-*])
+		 && ![is-effective-target ia32])
 	     || ([istarget powerpc*-*-*]
 		 && ([check_effective_target_powerpc_spe]
 		     || [check_effective_target_powerpc_altivec]))
@@ -2966,16 +2964,15 @@
 	verbose "check_effective_target_vect_simd_clones: using cached result" 2
     } else {
 	set et_vect_simd_clones_saved($et_index) 0
-	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-	    # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx, avx2
-	    # and avx512f clone.  Only the right clone for the specified arch
-	    # will be chosen, but still we need to at least be able to assemble
-	    # avx512f.
-	    if { [check_effective_target_avx512f] } {
+	# On i?86/x86_64 #pragma omp declare simd builds a sse2, avx,
+	# avx2 and avx512f clone.  Only the right clone for the
+	# specified arch will be chosen, but still we need to at least
+	# be able to assemble avx512f.
+	if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	      && [check_effective_target_avx512f]) } {
 		set et_vect_simd_clones_saved($et_index) 1
 	    }
 	}
-    }
 
     verbose "check_effective_target_vect_simd_clones:\
 	     returning $et_vect_simd_clones_saved($et_index)" 2
@@ -4926,18 +4923,14 @@
 	verbose "check_effective_target_vect_double: using cached result" 2
     } else {
 	set et_vect_double_saved($et_index) 0
-	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
-	     || [istarget aarch64*-*-*] } {
-	   if { [check_no_compiler_messages vect_double assembly {
+	if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	      && [check_no_compiler_messages vect_double assembly {
 		 #ifdef __tune_atom__
 		 # error No double vectorizer support.
 		 #endif
-		}] } {
-		set et_vect_double_saved($et_index) 1
-	    } else {
-		set et_vect_double_saved($et_index) 0
-	    }
-	} elseif { [istarget spu-*-*]
+	      }])
+	     || [istarget aarch64*-*-*]
+	     || [istarget spu-*-*]
 		   || ([istarget powerpc*-*-*] && [check_vsx_hw_available])
 		   || ([istarget mips*-*-*]
 		       && [et-is-effective-target mips_msa]) } {
@@ -5520,7 +5513,7 @@
         verbose "check_effective_target_vect_usad_char: using cached result" 2
     } else {
 	set et_vect_usad_char_saved($et_index) 0
-        if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
+        if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
 	    set et_vect_usad_char_saved($et_index) 1
         }
     }
@@ -5665,16 +5658,13 @@
 
 proc check_effective_target_vect_aligned_arrays { } {
     set et_vect_aligned_arrays 0
-    if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
-	if { ([is-effective-target lp64]
-	      && ( ![check_avx_available]
-		 || [check_prefer_avx128])) } {
+    if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	  && !([is-effective-target ia32]
+	       || ([check_avx_available] && ![check_prefer_avx128])))
+	 || [istarget spu-*-*] } {
 	     set et_vect_aligned_arrays 1
 	}
-    }
-    if [istarget spu-*-*] {
-	set et_vect_aligned_arrays 1
-    }
+
     verbose "check_effective_target_vect_aligned_arrays:\
 	     returning $et_vect_aligned_arrays" 2
     return $et_vect_aligned_arrays
@@ -6034,15 +6024,12 @@
     global et_index
 
     set et_vect_multiple_sizes_saved($et_index) 0
-    if { ([istarget aarch64*-*-*]
-	  || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } {
+    if { [istarget aarch64*-*-*]
+	 || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])
+	 || (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	     && ([check_avx_available] && ![check_prefer_avx128])) } {
        set et_vect_multiple_sizes_saved($et_index) 1
     }
-    if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
-      if { ([check_avx_available] && ![check_prefer_avx128]) } {
-	set et_vect_multiple_sizes_saved($et_index) 1
-      }
-    }
 
     verbose "check_effective_target_vect_multiple_sizes:\
 	     returning $et_vect_multiple_sizes_saved($et_index)" 2
@@ -6104,7 +6091,7 @@
 	verbose "check_effective_target_hw_sqrt: using cached result" 2
     } else {
 	set et_sqrt_insn_saved 0
-	if { [istarget x86_64-*-*]
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [istarget aarch64*-*-*]
 	     || ([istarget arm*-*-*] && [check_effective_target_arm_vfp_ok]) } {
@@ -6142,8 +6129,8 @@
 
 proc check_effective_target_vect_call_lrint { } {
     set et_vect_call_lrint 0
-    if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
-	 && [check_effective_target_ilp32] } {
+    if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	  && [check_effective_target_ilp32]) } {
 	set et_vect_call_lrint 1
     }
 
@@ -6417,11 +6404,10 @@
 # Return 1 if the target supports atomic operations on "int_128" values.
 
 proc check_effective_target_sync_int_128 { } {
-    if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
-	 && ![is-effective-target ia32] } {
+    if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	  && ![is-effective-target ia32])
+	 || [istarget spu-*-*] } {
 	return 1
-    } elseif { [istarget spu-*-*] } {
-	return 1
     } else {
 	return 0
     }
@@ -6431,9 +6417,9 @@
 # and can execute them.
 
 proc check_effective_target_sync_int_128_runtime { } {
-    if { ([istarget x86_64-*-*] || [istarget i?86-*-*])
-	 && ![is-effective-target ia32] } {
-	return [check_cached_effective_target sync_int_128_available {
+    if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	  && ![is-effective-target ia32]
+	  && [check_cached_effective_target sync_int_128_available {
 	    check_runtime_nocache sync_int_128_available {
 		#include "cpuid.h"
 		int main ()
@@ -6444,8 +6430,8 @@
 		  return 1;
 		}
 	    } ""
-	}]
-    } elseif { [istarget spu-*-*] } {
+	  }])
+	 || [istarget spu-*-*] } {
 	return 1
     } else {
 	return 0
@@ -6458,7 +6444,7 @@
 # Note: 32bit s390 targets require -mzarch in dg-options.
 
 proc check_effective_target_sync_long_long { } {
-    if { [istarget x86_64-*-*] || [istarget i?86-*-*])
+    if { [istarget i?86-*-*] || [istarget x86_64-*-*])
 	 || [istarget aarch64*-*-*]
 	 || [istarget arm*-*-*]
 	 || [istarget alpha*-*-*]
@@ -6477,8 +6463,8 @@
 # Note: 32bit x86 targets require -march=pentium in dg-options.
 
 proc check_effective_target_sync_long_long_runtime { } {
-    if { [istarget x86_64-*-*] || [istarget i?86-*-*] } {
-	return [check_cached_effective_target sync_long_long_available {
+    if { (([istarget x86_64-*-*] || [istarget i?86-*-*])
+	  && [check_cached_effective_target sync_long_long_available {
 	    check_runtime_nocache sync_long_long_available {
 		#include "cpuid.h"
 		int main ()
@@ -6489,11 +6475,10 @@
 		  return 1;
 		}
 	    } ""
-	}]
-    } elseif { [istarget aarch64*-*-*] } {
-	return 1
-    } elseif { [istarget arm*-*-linux-*] } {
-	return [check_runtime sync_longlong_runtime {
+	  }])
+	 || [istarget aarch64*-*-*]
+	 || ([istarget arm*-*-linux-*]
+	     && [check_runtime sync_longlong_runtime {
 	    #include <stdlib.h>
 	    int main ()
 	    {
@@ -6502,22 +6487,20 @@
 	      if (sizeof (long long) != 8)
 		exit (1);
 
-	      /* Just check for native; checking for kernel fallback is tricky.  */
-	      asm volatile ("ldrexd r0,r1, [%0]" : : "r" (&l1) : "r0", "r1");
-
+		     /* Just check for native;
+			checking for kernel fallback is tricky.  */
+		     asm volatile ("ldrexd r0,r1, [%0]"
+				   : : "r" (&l1) : "r0", "r1");
 	      exit (0);
 	    }
-	} "" ]
-    } elseif { [istarget alpha*-*-*] } {
-	return 1
-    } elseif { ([istarget sparc*-*-*]
+	     } "" ])
+	 || [istarget alpha*-*-*]
+	 || ([istarget sparc*-*-*]
 		 && [check_effective_target_lp64]
-		 && [check_effective_target_ultrasparc_hw]) } {
+	     && [check_effective_target_ultrasparc_hw])
+	 || [istarget spu-*-*]
+	 || ([istarget powerpc*-*-*] && [check_effective_target_lp64]) } {
 	return 1
-    } elseif { [istarget spu-*-*] } {
-	return 1
-    } elseif { [istarget powerpc*-*-*] && [check_effective_target_lp64] } {
-	return 1
     } else {
 	return 0
     }
@@ -6538,20 +6521,17 @@
 	     || [istarget m68k-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [istarget rs6000-*-*]
-	     || [istarget s390*-*-*] } {
-	    set et_bswap_saved 1
-	} else {
-	    if { [istarget arm*-*-*]
+	     || [istarget s390*-*-*]
+	     || ([istarget arm*-*-*]
 		 && [check_no_compiler_messages_nocache arm_v6_or_later object {
 		     #if __ARM_ARCH < 6
 		     #error not armv6 or later
 		     #endif
 		     int i;
-		 } ""] } {
+		 } ""]) } {
 		set et_bswap_saved 1
 	    }
 	}
-    }
 
     verbose "check_effective_target_bswap: returning $et_bswap_saved" 2
     return $et_bswap_saved
@@ -7228,7 +7208,7 @@
 # Return 1 if avx instructions can be compiled.
 
 proc check_effective_target_avx { } {
-    if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+    if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	return 0
     }
     return [check_no_compiler_messages avx object {
@@ -7894,7 +7874,7 @@
     global tool
     global GCC_UNDER_TEST
 
-    if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+    if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	return 0
     }
 
@@ -7946,7 +7926,7 @@
     global tool
     global GCC_UNDER_TEST
 
-    if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+    if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	return 0
     }
 
@@ -7997,7 +7977,7 @@
     global tool
     global GCC_UNDER_TEST
 
-    if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+    if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
 	return 0
     }
 
@@ -8110,7 +8090,7 @@
     #TODO: Add checks for all targets that have either hardware divmod insn
     # or define libfunc for divmod.
     if { [istarget arm*-*-*]
-	 || [istarget x86_64-*-*] } {
+	 || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
 	return 1
     }
     return 0

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

* Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...
  2016-11-01  9:05 [PATCH, testsuite]: Cleanup lib/target-supports.exp, Uros Bizjak
@ 2016-11-01 16:05 ` Jakub Jelinek
  2016-11-01 18:11   ` Uros Bizjak
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2016-11-01 16:05 UTC (permalink / raw)
  To: Uros Bizjak, Prathamesh Kulkarni; +Cc: gcc-patches

On Tue, Nov 01, 2016 at 10:05:22AM +0100, Uros Bizjak wrote:
> ... simplify some conditions and add i?86-*-* target where missing.
> 
> 2016-11-01  Uros Bizjak  <ubizjak@gmail.com>
> 
>     * lib/target-supports.exp: Normalize order of i?86 and x86_64 targets.
>     Whitespace fixes.
...
>     (check_effective_target_divmod): Add i?86-*-* target.

This part likely broke
+FAIL: gcc.dg/divmod-1.c scan-tree-dump-times widening_mul "DIVMOD" 7
+FAIL: gcc.dg/divmod-2.c scan-tree-dump-times widening_mul "DIVMOD" 7
+FAIL: gcc.dg/divmod-3.c scan-tree-dump-times widening_mul "DIVMOD" 7
+FAIL: gcc.dg/divmod-4.c scan-tree-dump-times widening_mul "DIVMOD" 7
+FAIL: gcc.dg/divmod-6.c scan-tree-dump-times widening_mul "DIVMOD" 7
on i686-linux (i.e. 32-bit).

Dunno what exactly the tests are meant to test, most likely they just
need extra guards or something.  Can be reproduced even on x86_64-linux
with
make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} dg.exp=divmod*'

> @@ -8110,7 +8090,7 @@
>      #TODO: Add checks for all targets that have either hardware divmod insn
>      # or define libfunc for divmod.
>      if { [istarget arm*-*-*]
> -	 || [istarget x86_64-*-*] } {
> +	 || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
>  	return 1
>      }
>      return 0


	Jakub

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

* Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...
  2016-11-01 16:05 ` Jakub Jelinek
@ 2016-11-01 18:11   ` Uros Bizjak
  2016-11-02  7:09     ` Prathamesh Kulkarni
  0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2016-11-01 18:11 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Prathamesh Kulkarni, gcc-patches

On Tue, Nov 1, 2016 at 5:05 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Nov 01, 2016 at 10:05:22AM +0100, Uros Bizjak wrote:
>> ... simplify some conditions and add i?86-*-* target where missing.
>>
>> 2016-11-01  Uros Bizjak  <ubizjak@gmail.com>
>>
>>     * lib/target-supports.exp: Normalize order of i?86 and x86_64 targets.
>>     Whitespace fixes.
> ...
>>     (check_effective_target_divmod): Add i?86-*-* target.
>
> This part likely broke
> +FAIL: gcc.dg/divmod-1.c scan-tree-dump-times widening_mul "DIVMOD" 7
> +FAIL: gcc.dg/divmod-2.c scan-tree-dump-times widening_mul "DIVMOD" 7
> +FAIL: gcc.dg/divmod-3.c scan-tree-dump-times widening_mul "DIVMOD" 7
> +FAIL: gcc.dg/divmod-4.c scan-tree-dump-times widening_mul "DIVMOD" 7
> +FAIL: gcc.dg/divmod-6.c scan-tree-dump-times widening_mul "DIVMOD" 7
> on i686-linux (i.e. 32-bit).

No, this is expected (these tests already fail with x86_64 -m32
multilib). These will be fixed by [1].

[1] https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02483.html

Uros.

> Dunno what exactly the tests are meant to test, most likely they just
> need extra guards or something.  Can be reproduced even on x86_64-linux
> with
> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} dg.exp=divmod*'
>
>> @@ -8110,7 +8090,7 @@
>>      #TODO: Add checks for all targets that have either hardware divmod insn
>>      # or define libfunc for divmod.
>>      if { [istarget arm*-*-*]
>> -      || [istarget x86_64-*-*] } {
>> +      || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
>>       return 1
>>      }
>>      return 0
>
>
>         Jakub

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

* Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...
  2016-11-01 18:11   ` Uros Bizjak
@ 2016-11-02  7:09     ` Prathamesh Kulkarni
  2016-11-02  8:20       ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Prathamesh Kulkarni @ 2016-11-02  7:09 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Jakub Jelinek, gcc-patches

On 1 November 2016 at 23:41, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Nov 1, 2016 at 5:05 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Tue, Nov 01, 2016 at 10:05:22AM +0100, Uros Bizjak wrote:
>>> ... simplify some conditions and add i?86-*-* target where missing.
>>>
>>> 2016-11-01  Uros Bizjak  <ubizjak@gmail.com>
>>>
>>>     * lib/target-supports.exp: Normalize order of i?86 and x86_64 targets.
>>>     Whitespace fixes.
>> ...
>>>     (check_effective_target_divmod): Add i?86-*-* target.
>>
>> This part likely broke
>> +FAIL: gcc.dg/divmod-1.c scan-tree-dump-times widening_mul "DIVMOD" 7
>> +FAIL: gcc.dg/divmod-2.c scan-tree-dump-times widening_mul "DIVMOD" 7
>> +FAIL: gcc.dg/divmod-3.c scan-tree-dump-times widening_mul "DIVMOD" 7
>> +FAIL: gcc.dg/divmod-4.c scan-tree-dump-times widening_mul "DIVMOD" 7
>> +FAIL: gcc.dg/divmod-6.c scan-tree-dump-times widening_mul "DIVMOD" 7
>> on i686-linux (i.e. 32-bit).
>
> No, this is expected (these tests already fail with x86_64 -m32
> multilib). These will be fixed by [1].
Oops, sorry for the breakage.
The tests are meant to check if the divmod transform triggered, which
is done by scanning
DIVMOD in the widening_mul dump.

Apparently I only checked for the triplet "x86_64-*-*" in
check_effective_target_divmod()
and it returned 1, which probably caused the divmod DImode tests to
fail with -m32.

In general, could I check in check_effective_target_*(), what options
are passed ?
So in case of -m32, I wanted to return 0 instead of 1 to make the
tests on 32-bit
UNSUPPORTED.

Thanks for fixing the test-cases!

Thanks,
Prathamesh
>
> [1] https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02483.html
>
> Uros.
>
>> Dunno what exactly the tests are meant to test, most likely they just
>> need extra guards or something.  Can be reproduced even on x86_64-linux
>> with
>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} dg.exp=divmod*'
>>
>>> @@ -8110,7 +8090,7 @@
>>>      #TODO: Add checks for all targets that have either hardware divmod insn
>>>      # or define libfunc for divmod.
>>>      if { [istarget arm*-*-*]
>>> -      || [istarget x86_64-*-*] } {
>>> +      || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
>>>       return 1
>>>      }
>>>      return 0
>>
>>
>>         Jakub

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

* Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...
  2016-11-02  7:09     ` Prathamesh Kulkarni
@ 2016-11-02  8:20       ` Jakub Jelinek
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2016-11-02  8:20 UTC (permalink / raw)
  To: Prathamesh Kulkarni; +Cc: Uros Bizjak, gcc-patches

On Wed, Nov 02, 2016 at 12:39:08PM +0530, Prathamesh Kulkarni wrote:
> On 1 November 2016 at 23:41, Uros Bizjak <ubizjak@gmail.com> wrote:
> > On Tue, Nov 1, 2016 at 5:05 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> >> On Tue, Nov 01, 2016 at 10:05:22AM +0100, Uros Bizjak wrote:
> >>> ... simplify some conditions and add i?86-*-* target where missing.
> >>>
> >>> 2016-11-01  Uros Bizjak  <ubizjak@gmail.com>
> >>>
> >>>     * lib/target-supports.exp: Normalize order of i?86 and x86_64 targets.
> >>>     Whitespace fixes.
> >> ...
> >>>     (check_effective_target_divmod): Add i?86-*-* target.
> >>
> >> This part likely broke
> >> +FAIL: gcc.dg/divmod-1.c scan-tree-dump-times widening_mul "DIVMOD" 7
> >> +FAIL: gcc.dg/divmod-2.c scan-tree-dump-times widening_mul "DIVMOD" 7
> >> +FAIL: gcc.dg/divmod-3.c scan-tree-dump-times widening_mul "DIVMOD" 7
> >> +FAIL: gcc.dg/divmod-4.c scan-tree-dump-times widening_mul "DIVMOD" 7
> >> +FAIL: gcc.dg/divmod-6.c scan-tree-dump-times widening_mul "DIVMOD" 7
> >> on i686-linux (i.e. 32-bit).
> >
> > No, this is expected (these tests already fail with x86_64 -m32
> > multilib). These will be fixed by [1].
> Oops, sorry for the breakage.
> The tests are meant to check if the divmod transform triggered, which
> is done by scanning
> DIVMOD in the widening_mul dump.
> 
> Apparently I only checked for the triplet "x86_64-*-*" in
> check_effective_target_divmod()
> and it returned 1, which probably caused the divmod DImode tests to
> fail with -m32.
> 
> In general, could I check in check_effective_target_*(), what options
> are passed ?

On some targets, yes.  E.g. on i?86-*-*/x86_64-*-*, one can additionally
test lp64 or ia32 or negation thereof - there are -m32, -mx32 and -m64
modes, -m64 satisfies lp64, -m32 ia32.

Though the predicate seems to be misnamed and not properly documented
if it is about properties of DImode divmod rather than other modes
(SImode, HImode, QImode, TImode, ...).

	Jakub

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

end of thread, other threads:[~2016-11-02  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01  9:05 [PATCH, testsuite]: Cleanup lib/target-supports.exp, Uros Bizjak
2016-11-01 16:05 ` Jakub Jelinek
2016-11-01 18:11   ` Uros Bizjak
2016-11-02  7:09     ` Prathamesh Kulkarni
2016-11-02  8:20       ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).