public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
@ 2010-07-23 13:43 Uros Bizjak
  2010-07-23 13:52 ` H.J. Lu
  0 siblings, 1 reply; 11+ messages in thread
From: Uros Bizjak @ 2010-07-23 13:43 UTC (permalink / raw)
  To: gcc-patches

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

Hello!

Also adds check_isa calls to vperm-*.c tests.

2010-06-23  Uros Bizjak  <ubizjak@gmail.com>

	* gcc.target/i386/*.c: Do not require sse{,2,3,4} effective target
	for compile-time only tests.
	* gcc.target/i386/pr39315-2.c: Remove redundant sse2 effective
	target check.
	* gcc.target/i386/pr39315-4.c: Ditto.
	* gcc.target/i386/vperm-v4si-1.c: Remove sse_runtime effective
	target check.  Include sse-os-support.h.
	(main): Call check_isa and sse_os_support.
	* gcc.target/i386/vperm-v4sf-1.c: Ditto.
	* gcc.target/i386/vperm-v4si-2.c (main): Call check_isa.
	* gcc.target/i386/vperm-v4sf-2.c: Ditto.
	* gcc.target/i386/vperm-v2di.c: Remove sse2_runtime effective
	target check.  Include sse-os-support.h.
	(main): Call check_isa and sse_os_support.
	* gcc.target/i386/vperm-v2df.c: Ditto.

Attached patch was tested with i386.exp on x86_64-pc-linux-gnu
{,-m32}. Patch was committed to mainline SVN.

Uros.

[-- Attachment #2: p.diff.txt.gz --]
[-- Type: application/x-gzip, Size: 4728 bytes --]

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 13:43 [PATCH, i386]: Remove sse{,2} effective target check from compile-time tests Uros Bizjak
@ 2010-07-23 13:52 ` H.J. Lu
  2010-07-23 14:43   ` Uros Bizjak
  0 siblings, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2010-07-23 13:52 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 6:43 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> Also adds check_isa calls to vperm-*.c tests.
>
> 2010-06-23  Uros Bizjak  <ubizjak@gmail.com>
>
>        * gcc.target/i386/*.c: Do not require sse{,2,3,4} effective target
>        for compile-time only tests.
>        * gcc.target/i386/pr39315-2.c: Remove redundant sse2 effective
>        target check.
>        * gcc.target/i386/pr39315-4.c: Ditto.
>        * gcc.target/i386/vperm-v4si-1.c: Remove sse_runtime effective
>        target check.  Include sse-os-support.h.
>        (main): Call check_isa and sse_os_support.
>        * gcc.target/i386/vperm-v4sf-1.c: Ditto.
>        * gcc.target/i386/vperm-v4si-2.c (main): Call check_isa.
>        * gcc.target/i386/vperm-v4sf-2.c: Ditto.
>        * gcc.target/i386/vperm-v2di.c: Remove sse2_runtime effective
>        target check.  Include sse-os-support.h.
>        (main): Call check_isa and sse_os_support.
>        * gcc.target/i386/vperm-v2df.c: Ditto.
>
> Attached patch was tested with i386.exp on x86_64-pc-linux-gnu
> {,-m32}. Patch was committed to mainline SVN.
>

I am not against this patch. I just think the xxx-runtime addition was
a bad idea. Most, if not all, SSE/AVX tests, which require
effective SSE/AVX targets, are run-time tests. There may be a few
of them are assemble/link tests. We should have added a different
effective proc just for them. The change would have been very small.
I guess it was too late to redo it now.


-- 
H.J.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 13:52 ` H.J. Lu
@ 2010-07-23 14:43   ` Uros Bizjak
  2010-07-23 15:15     ` H.J. Lu
  0 siblings, 1 reply; 11+ messages in thread
From: Uros Bizjak @ 2010-07-23 14:43 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 3:51 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

> I am not against this patch. I just think the xxx-runtime addition was
> a bad idea. Most, if not all, SSE/AVX tests, which require
> effective SSE/AVX targets, are run-time tests. There may be a few
> of them are assemble/link tests. We should have added a different
> effective proc just for them. The change would have been very small.
> I guess it was too late to redo it now.

There are two approaches, as far as x86 tests are concerned. One
approach was invented for gcc.target/i386 tests and the other for all
other test directories.

a) gcc.target/i386:

These tests are protected by sse{,2,...,n} and avx effective targets.
These effective targets tests check if the whole toolchain is able to
compile the test, but the real hardware/OS support will be checked by
the executable itself and will terminate early on targets that can't
execute all instructions. The benefit for this approach can be seen
for i.e. AVX tests. Using recent enough binutils, even if the hardware
can not support the execution, the test _can_ be compiled all the way
to the executable, so toolchain can be tested as far as possible.

b) other parts

There is no need to separate the toolchain test from the run-time
target support test in other testsuite parts. So, the toolchain test
will go hand-in-hand with target support check test. Consequently, if
neither toolchain nor target support requirements are met to run the
test, there is no point to compile particular torture runtime test 10
times with various optimization flags. Various levels of SSE certainly
won't change during the whole testsuite run, so it is enough to check
them once at the beginning of the testsuite run. This is exactly what
sseN_runtime checks are for.

Uros.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 14:43   ` Uros Bizjak
@ 2010-07-23 15:15     ` H.J. Lu
  2010-07-23 15:19       ` Uros Bizjak
  0 siblings, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2010-07-23 15:15 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 7:43 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Jul 23, 2010 at 3:51 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>> I am not against this patch. I just think the xxx-runtime addition was
>> a bad idea. Most, if not all, SSE/AVX tests, which require
>> effective SSE/AVX targets, are run-time tests. There may be a few
>> of them are assemble/link tests. We should have added a different
>> effective proc just for them. The change would have been very small.
>> I guess it was too late to redo it now.
>
> There are two approaches, as far as x86 tests are concerned. One
> approach was invented for gcc.target/i386 tests and the other for all
> other test directories.
>
> a) gcc.target/i386:
>
> These tests are protected by sse{,2,...,n} and avx effective targets.
> These effective targets tests check if the whole toolchain is able to
> compile the test, but the real hardware/OS support will be checked by
> the executable itself and will terminate early on targets that can't
> execute all instructions. The benefit for this approach can be seen
> for i.e. AVX tests. Using recent enough binutils, even if the hardware
> can not support the execution, the test _can_ be compiled all the way
> to the executable, so toolchain can be tested as far as possible.
>

If there is no hardware/OS support, do we still run those run-time tests
or just skip them?

-- 
H.J.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:15     ` H.J. Lu
@ 2010-07-23 15:19       ` Uros Bizjak
  2010-07-23 15:25         ` H.J. Lu
  0 siblings, 1 reply; 11+ messages in thread
From: Uros Bizjak @ 2010-07-23 15:19 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 5:15 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jul 23, 2010 at 7:43 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Fri, Jul 23, 2010 at 3:51 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>>> I am not against this patch. I just think the xxx-runtime addition was
>>> a bad idea. Most, if not all, SSE/AVX tests, which require
>>> effective SSE/AVX targets, are run-time tests. There may be a few
>>> of them are assemble/link tests. We should have added a different
>>> effective proc just for them. The change would have been very small.
>>> I guess it was too late to redo it now.
>>
>> There are two approaches, as far as x86 tests are concerned. One
>> approach was invented for gcc.target/i386 tests and the other for all
>> other test directories.
>>
>> a) gcc.target/i386:
>>
>> These tests are protected by sse{,2,...,n} and avx effective targets.
>> These effective targets tests check if the whole toolchain is able to
>> compile the test, but the real hardware/OS support will be checked by
>> the executable itself and will terminate early on targets that can't
>> execute all instructions. The benefit for this approach can be seen
>> for i.e. AVX tests. Using recent enough binutils, even if the hardware
>> can not support the execution, the test _can_ be compiled all the way
>> to the executable, so toolchain can be tested as far as possible.
>>
>
> If there is no hardware/OS support, do we still run those run-time tests
> or just skip them?

We run them.

Uros.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:19       ` Uros Bizjak
@ 2010-07-23 15:25         ` H.J. Lu
  2010-07-23 15:34           ` Uros Bizjak
  0 siblings, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2010-07-23 15:25 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 8:18 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Jul 23, 2010 at 5:15 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Jul 23, 2010 at 7:43 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>> On Fri, Jul 23, 2010 at 3:51 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>
>>>> I am not against this patch. I just think the xxx-runtime addition was
>>>> a bad idea. Most, if not all, SSE/AVX tests, which require
>>>> effective SSE/AVX targets, are run-time tests. There may be a few
>>>> of them are assemble/link tests. We should have added a different
>>>> effective proc just for them. The change would have been very small.
>>>> I guess it was too late to redo it now.
>>>
>>> There are two approaches, as far as x86 tests are concerned. One
>>> approach was invented for gcc.target/i386 tests and the other for all
>>> other test directories.
>>>
>>> a) gcc.target/i386:
>>>
>>> These tests are protected by sse{,2,...,n} and avx effective targets.
>>> These effective targets tests check if the whole toolchain is able to
>>> compile the test, but the real hardware/OS support will be checked by
>>> the executable itself and will terminate early on targets that can't
>>> execute all instructions. The benefit for this approach can be seen
>>> for i.e. AVX tests. Using recent enough binutils, even if the hardware
>>> can not support the execution, the test _can_ be compiled all the way
>>> to the executable, so toolchain can be tested as far as possible.
>>>
>>
>> If there is no hardware/OS support, do we still run those run-time tests
>> or just skip them?
>
> We run them.
>

2 issues if we still run those tests when there is no hardware/OS support:

1. Each test needs t do a run-time check. I don't see why we
need the new proc to check hardware/OS support.
2. Passing those tests doesn't mean implementation is correct,
encoding could be wrong or wrong instructions could be
generated.

-- 
H.J.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:25         ` H.J. Lu
@ 2010-07-23 15:34           ` Uros Bizjak
  2010-07-23 15:39             ` H.J. Lu
  0 siblings, 1 reply; 11+ messages in thread
From: Uros Bizjak @ 2010-07-23 15:34 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 5:25 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>>>> a) gcc.target/i386:
>>>>
>>>> These tests are protected by sse{,2,...,n} and avx effective targets.
>>>> These effective targets tests check if the whole toolchain is able to
>>>> compile the test, but the real hardware/OS support will be checked by
>>>> the executable itself and will terminate early on targets that can't
>>>> execute all instructions. The benefit for this approach can be seen
>>>> for i.e. AVX tests. Using recent enough binutils, even if the hardware
>>>> can not support the execution, the test _can_ be compiled all the way
>>>> to the executable, so toolchain can be tested as far as possible.
>>>>
>>>
>>> If there is no hardware/OS support, do we still run those run-time tests
>>> or just skip them?
>>
>> We run them.
>>
>
> 2 issues if we still run those tests when there is no hardware/OS support:
>
> 1. Each test needs t do a run-time check. I don't see why we
> need the new proc to check hardware/OS support.
> 2. Passing those tests doesn't mean implementation is correct,
> encoding could be wrong or wrong instructions could be
> generated.

These are IMO acceptable compromises with the rationale I outlined in
my previous post. If you have better implementation, please provide
patches, so we can discuss concrete benefits and drawbacks of your
approach.

Thanks,
Uros.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:34           ` Uros Bizjak
@ 2010-07-23 15:39             ` H.J. Lu
  2010-07-23 15:57               ` Uros Bizjak
  0 siblings, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2010-07-23 15:39 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 8:33 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Jul 23, 2010 at 5:25 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>>>> a) gcc.target/i386:
>>>>>
>>>>> These tests are protected by sse{,2,...,n} and avx effective targets.
>>>>> These effective targets tests check if the whole toolchain is able to
>>>>> compile the test, but the real hardware/OS support will be checked by
>>>>> the executable itself and will terminate early on targets that can't
>>>>> execute all instructions. The benefit for this approach can be seen
>>>>> for i.e. AVX tests. Using recent enough binutils, even if the hardware
>>>>> can not support the execution, the test _can_ be compiled all the way
>>>>> to the executable, so toolchain can be tested as far as possible.
>>>>>
>>>>
>>>> If there is no hardware/OS support, do we still run those run-time tests
>>>> or just skip them?
>>>
>>> We run them.
>>>
>>
>> 2 issues if we still run those tests when there is no hardware/OS support:
>>
>> 1. Each test needs t do a run-time check. I don't see why we
>> need the new proc to check hardware/OS support.
>> 2. Passing those tests doesn't mean implementation is correct,
>> encoding could be wrong or wrong instructions could be
>> generated.
>
> These are IMO acceptable compromises with the rationale I outlined in
> my previous post. If you have better implementation, please provide
> patches, so we can discuss concrete benefits and drawbacks of your
> approach.
>

First we have to decide when there is no hardware/OS support,
do we want to run the run-time tests. If the answer is yes,
we can use my first AVX run-time check patch is at

http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01791.html

and add more run-time check if needed.

If we don't want to run the run-time tests when there is
no hardware/OS support, then we should start with:

http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01792.html


-- 
H.J.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:39             ` H.J. Lu
@ 2010-07-23 15:57               ` Uros Bizjak
  2010-07-23 15:59                 ` H.J. Lu
  0 siblings, 1 reply; 11+ messages in thread
From: Uros Bizjak @ 2010-07-23 15:57 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 5:39 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>>> 2 issues if we still run those tests when there is no hardware/OS support:
>>>
>>> 1. Each test needs t do a run-time check. I don't see why we
>>> need the new proc to check hardware/OS support.
>>> 2. Passing those tests doesn't mean implementation is correct,
>>> encoding could be wrong or wrong instructions could be
>>> generated.
>>
>> These are IMO acceptable compromises with the rationale I outlined in
>> my previous post. If you have better implementation, please provide
>> patches, so we can discuss concrete benefits and drawbacks of your
>> approach.
>>
>
> First we have to decide when there is no hardware/OS support,
> do we want to run the run-time tests. If the answer is yes,
> we can use my first AVX run-time check patch is at
>
> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01791.html
>
> and add more run-time check if needed.
>
> If we don't want to run the run-time tests when there is
> no hardware/OS support, then we should start with:
>
> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01792.html

Hm, these two links point to the same implementation, the difference
is only -O2 vs. -O0. And you need to play various tricks with -O0 and
asm volatiles instead of checking assembler support and hw support
separately with different optimization flags.

Uros.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:57               ` Uros Bizjak
@ 2010-07-23 15:59                 ` H.J. Lu
  2010-07-23 16:16                   ` Uros Bizjak
  0 siblings, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2010-07-23 15:59 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 8:57 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Jul 23, 2010 at 5:39 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>>> 2 issues if we still run those tests when there is no hardware/OS support:
>>>>
>>>> 1. Each test needs t do a run-time check. I don't see why we
>>>> need the new proc to check hardware/OS support.
>>>> 2. Passing those tests doesn't mean implementation is correct,
>>>> encoding could be wrong or wrong instructions could be
>>>> generated.
>>>
>>> These are IMO acceptable compromises with the rationale I outlined in
>>> my previous post. If you have better implementation, please provide
>>> patches, so we can discuss concrete benefits and drawbacks of your
>>> approach.
>>>
>>
>> First we have to decide when there is no hardware/OS support,
>> do we want to run the run-time tests. If the answer is yes,
>> we can use my first AVX run-time check patch is at
>>
>> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01791.html

This should be:

http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01491.html

>>
>> and add more run-time check if needed.
>>
>> If we don't want to run the run-time tests when there is
>> no hardware/OS support, then we should start with:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01792.html
>
> Hm, these two links point to the same implementation, the difference
> is only -O2 vs. -O0. And you need to play various tricks with -O0 and
> asm volatiles instead of checking assembler support and hw support
> separately with different optimization flags.
>
> Uros.
>



-- 
H.J.

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

* Re: [PATCH, i386]: Remove sse{,2} effective target check from  compile-time tests
  2010-07-23 15:59                 ` H.J. Lu
@ 2010-07-23 16:16                   ` Uros Bizjak
  0 siblings, 0 replies; 11+ messages in thread
From: Uros Bizjak @ 2010-07-23 16:16 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Fri, Jul 23, 2010 at 5:59 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>>> First we have to decide when there is no hardware/OS support,
>>> do we want to run the run-time tests. If the answer is yes,
>>> we can use my first AVX run-time check patch is at
>>>
>>> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01791.html
>
> This should be:
>
> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01491.html

This is correct approach, since for AVX, OS and hw checks can be
blended together due to OSXSAVE. Can you please commit this patch
(modulo gcc.dg/compat/* and avx-check.h changes)?

	* gcc.target/i386/aes-avx-check.h (main): Likewise.
	* gcc.target/i386/avx-check.h (main): Likewise.
	* gcc.target/i386/pclmul-avx-check.h (main): Likewise.
	* gcc.target/x86_64/abi/avx/avx-check.h (main): Likewise.

Thanks,
Uros.

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

end of thread, other threads:[~2010-07-23 16:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23 13:43 [PATCH, i386]: Remove sse{,2} effective target check from compile-time tests Uros Bizjak
2010-07-23 13:52 ` H.J. Lu
2010-07-23 14:43   ` Uros Bizjak
2010-07-23 15:15     ` H.J. Lu
2010-07-23 15:19       ` Uros Bizjak
2010-07-23 15:25         ` H.J. Lu
2010-07-23 15:34           ` Uros Bizjak
2010-07-23 15:39             ` H.J. Lu
2010-07-23 15:57               ` Uros Bizjak
2010-07-23 15:59                 ` H.J. Lu
2010-07-23 16:16                   ` Uros Bizjak

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