This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: testsuite run-time test for sse2 support
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 13 Mar 2008 09:39:52 -0500
- Subject: Re: testsuite run-time test for sse2 support
- References: <5787cf470803130032u323a4a06ka403f5d6b18eb78@mail.gmail.com> <47D92D98.8090605@oarcorp.com> <5787cf470803130725v157e2ad6p6e1bc8052a699804@mail.gmail.com>
Uros Bizjak wrote:
On Thu, Mar 13, 2008 at 2:35 PM, Joel Sherrill
<joel.sherrill@oarcorp.com> wrote:
I hacked on that test program to get the attached
program. I ran it multiple times on qemu.
ext=0x0 sig=0x756e6547
0x781abfd YES on SSE2
I am now printing the return value from __get_cpuid_max()
ext=0x0 sig=0x756e6547 returned=0x2
0x781abfd YES on SSE2
Isn't the "sig" supposed to be >= 0x80000000?
I ran the same program natively and got this:
ext=0x0 sig=0x756e6547
0xbfebfbff YES on SSE2
I wonder if qemu is just reporting things wrong. :(
I searched the qemu manual and googled some but
didn't see anything that jumped out.
Does this look like qemu reporting a bogus cpuid or
gcc not parsing it correctly?
This all depends on the return value of __get_cpuid_max(). It returns
max value of base cpuid level (5 in my case), and shoould return 0 if
cpuid is not supported. This follows the procedure outlined in
http://download.intel.com/design/processor/applnots/24161832.pdf,
section 2: "Detecting the CPUID Instruction".
I added a print before the return on !__get_cpuid and it is returning
non-zero.
It is true, that this is not the most maintained code on the planet,
so some bitrot is possible. The return value of __get_cpuid_max() on
your target will tell...
The call to __get_cpuid is checking against level 1 and this is a level 2.
--joel
Thanks,
Uros.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985