Re: [eigen] cpuid on MSVC |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] cpuid on MSVC
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Thu, 24 Jun 2010 10:26:06 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.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=zsbcFCcLuLmYDYUj35vnwLILuAmEA0flMz/QE4VX7MQ=; b=Hd9PANDch28PBZd8HKxcz5gUkyfBNYXy0WLiEGFJ+mzzb5nbfytmpb0kU7Qhf9w2pd 99Cva6kqhzmvEhMPfGkzz7AxqwWv8d0Qjf34VokRLJdauPA/TJz/aMWb5JofGNT+sShY P8CNabOrGxEbWV/CrjUb5b2Q1ysZ/t6SFbax8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vXjznvLn84uFgy4kwpN/QxSIvGXRbvjP3T3oz5wQW1brfDsREU3Ay0Niiz99Nf6c7U tKiCXQcaWsLvFgXhXieCz35INOpVDSEafQUC/IiRFKKFp03Intd0krwJRhRjpIDD4CiS Tm5qmd6y5l1hxD2TucbtFr3hzp1vVmogedWlc=
Thanks for the hint, it is already integrated.
On Thu, Jun 24, 2010 at 10:24 AM, Basil Fierz <basil.fierz@xxxxxxxxxxx> wrote:
> There are two version of the __cpuid intrinsic (at least on 2008 and 2010).
> There is a __cpuidex which explicitly takes the ecx register as a parameter.
>
> http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
>
> I hope that's what you where looking for.
>
> Regards,
> Basil
>
> -----Original Message-----
> From: Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] On Behalf Of Gael Guennebaud
> Sent: Donnerstag, 24. Juni 2010 09:41
> To: eigen
> Subject: [eigen] cpuid on MSVC
>
> Hi msvc developers,
>
> as some of you probably known, we are now using the cpuid instruction
> to retrieve CPU cache sizes. To do so I need to provide to cpuid two
> information: the function code in the eax register and the cache id in
> ecx. However, the msvc __cpuid intrinsics seems to be too limited
> since it only allows to set the function code. So I'd some help from
> msvc gurus to write inline assembly code doing that. For the record
> here is the GCC version:
>
> define EIGEN_CPUID(abcd,func,id) \
> __asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]),
> "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id) );
>
> The assembly is one instruction only: cpuid, thes next four items
> after the ":" are the outputs where "a" means eax register, "b" ==
> ebx, etc. and the last two item are the inputs which are put into the
> eax and ecx registers respectively.
>
> The code is in eigen/Eigen/src/Core/util/Memory.h line 598.
>
> thanks a lot :)
>
> gael
>
>
>
>
>
>