This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Require OSXSAVE for AVX run-time tests


On Mon, 2010-07-19 at 09:12 -0700, H.J. Lu wrote:
> On Mon, Jul 19, 2010 at 9:05 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> > On Mon, 2010-07-19 at 07:43 -0700, H.J. Lu wrote:
> >
> >> OSXSAVE is needed for AVX run-time support. This patch adds the OSXSAVE
> >> check for AVX run-time tests.  OK to install?
> >
> > No, please introduce check_avx_hw_available and
> > check_avx_os_support_available, similar to very recent commit that
> > "fixed" SSE2 testcases on older solaris OSes.
> >
> 
> It is easy to check AVX and OSXSAVE bits at run-time. It isn't easy
> to implement check_avx_XXXX properly for simulator.

Let me explain the idea a bit:

By introducing check_avx_hw_available, you are caching the result of
cpuid call, so for N testcases that require AVX HW support, you call
cpuid only once instead of N-times.

Conceptually, OSXSAVE is set by OS, so we can say that checking this bit
should be done in check_avx_os_support_available (again, it is cached!).
However, CPU will just execute UD in place of AVX insn if OSXSAVE is not
set, so I guess that checking both bits in
check_effective_target_avx_runtime should also be OK.

Uros.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]