Re: [eigen] Building eigen in non x86/amd64/ppc archs |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Building eigen in non x86/amd64/ppc archs
- From: Jose Luis Blanco <joseluisblancoc@xxxxxxxxx>
- Date: Mon, 27 Dec 2010 22:08:08 +0100
- 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; bh=ld9izpdRdox+h1RKzm58WEr5/zK6+WwpU5SjH1hk6bM=; b=oJo7A+dBfu8MekpBkMGHbSzQS7GEvWHKmVwrgki2aeEYBW/2qjMbJ04Fc8t3WI1x49 M1BHyWh3dh8ky80LgQdUe02Hrp5JxPGR1HD6A0pQ2qaREJJWywoEdm2ZdYheit7sLi9L 6kHg54L+gFt+DTy9dfju39Ds3f4CP8KpdW7KA=
- 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; b=Hp2LazKOlJtBV610LSOugpUyG5TtQsK5bxuIgHF7YZCTdVADMAsapkCI1OPaGlimE1 YvDSyTYQChD6QrJH3u/YEhPIDDCMswzCz9/bklDKqhjhgJBvGKb0tmr8aTtHtqz6AXq7 vXd6rexmiTrzZO/BfW2qVstSydVsLy5ufzxNY=
Hi Thomas,
Yes, a list of positive checks is clearly a better solution.
But, wouldn't amd64 be also included (it seems __i386__ is not defined
in amd64 archs)?? [1]
Just like your code, but changing the first line:
#if defined(__GNUC__) && ( defined(__i386__) || defined(__amd64__) )
# if defined(__PIC__)
# define EIGEN_CPUID(abcd,func,id) \
__asm__ __volatile__ ("xchgl %%ebx, %%esi;cpuid; xchgl %%ebx,%%esi":
"=a" (abcd[0]), "=S" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a"
(func), "c" (id));
# else
# 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) );
# endif
#elif defined(_MSC_VER)
# if (_MSC_VER > 1500) /* newer than MSVC++ 9.0 */ || (_MSC_VER ==
1500 && _MSC_FULL_VER >= 150030729) /* MSVC++ 9.0 with SP1*/
# define EIGEN_CPUID(abcd,func,id) __cpuidex((int*)abcd,func,id)
# endif
#endif
In any case, I'll try to build a small test under MIPS with this
latest patch and I'll confirm if it works there.
JL
[1] http://predef.sourceforge.net/prearch.html