Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...

2016-11-02 Thread Jakub Jelinek
On Wed, Nov 02, 2016 at 12:39:08PM +0530, Prathamesh Kulkarni wrote:
> On 1 November 2016 at 23:41, Uros Bizjak  wrote:
> > On Tue, Nov 1, 2016 at 5:05 PM, Jakub Jelinek  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  
> >>>
> >>> * 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


Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...

2016-11-02 Thread Prathamesh Kulkarni
On 1 November 2016 at 23:41, Uros Bizjak  wrote:
> On Tue, Nov 1, 2016 at 5:05 PM, Jakub Jelinek  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  
>>>
>>> * 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


Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...

2016-11-01 Thread Uros Bizjak
On Tue, Nov 1, 2016 at 5:05 PM, Jakub Jelinek  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  
>>
>> * 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


Re: [PATCH, testsuite]: Cleanup lib/target-supports.exp, ...

2016-11-01 Thread Jakub Jelinek
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  
> 
> * 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


[PATCH, testsuite]: Cleanup lib/target-supports.exp, ...

2016-11-01 Thread Uros Bizjak
... simplify some conditions and add i?86-*-* target where missing.

2016-11-01  Uros Bizjak  

* 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.
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