Re: [eigen] Performance gap between gcc and msvc ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Performance gap between gcc and msvc ?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sun, 20 Jun 2010 10:34:18 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9eJps96UFFq/yCsnS2YpeCaBDsLLruUSSJFRRxQiO/I=; b=bolMicoCdCa2vf6EFLYY2uszE4HbFkUWfUQ+/WjBZzc+AxQ8mrXwcbXO4tsh+JKIOv eLdGdoARmbP6N4XW3Vi3WjPhWG+V4ubjNKX5UKIwq6G/KSB7paskrDJdmddFw3kvgImF qQlh9ZnMV723UCNlEHlio0/qSu1RI0C03kTDE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PzMUBDxgKoN4hCGM3kTBhPMrQWbtnsf8yPsnGCTAl2GZIJzkyxPR4lzg11xNi2LO1o kY/vqiki8Yr7/I743Tn+ZjyVpUTHkQgKlMSirg6kN9o1EFGUTi/YFMhFCyWcWloZrKMq VZtTagOXLyZKDN4ixmubUPHsV7O2tCM0O7o7w=
forgot to reply earlier, but thanks a lot for the code, that can come in handy!
2010/6/18 Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>:
>
> If that might help, I use the following code in one of my project to get a working 'cpuid' across compilers:
> (inside a proper #ifdef for x86/amd64, of course):
>
> #if defined(__GNUC__)
> # if defined(__PIC__) && defined(__i386__)
> # define cpuid(abcd,func) \
> __asm__ __volatile__ ("xchgl %%ebx, %%esi;cpuid; xchgl %%ebx,%%esi": "=a" (abcd[0]), "=S" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func));
> # else
> # define cpuid(abcd,func) \
> __asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func) );
> # endif
> #elif defined(_MSC_VER)
> # define cpuid(abcd,func) __cpuid((int*)abcd,func)
> #endif
>
> #ifndef cpuid
> #error "Failed to find a way to get cpuid() for this architecture."
> #endif
>
> (and wikipedia describes what you can get, very useful :-)
>
> Thomas
> --
> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
> http://www.freehackers.org/thomas
>
> In data venerdì 18 giugno 2010 23:42:50, Benoit Jacob ha scritto:
>> ok, looks what we need is just the CPUID instruction.
>>
>> http://en.wikipedia.org/wiki/CPUID#EAX.3D2:_Cache_and_TLB_Descriptor_information
>>
>> apparently this is what linux uses for /proc/cpuinfo.
>
>
>