Coming from a world where no two compilers are alike, I have some
experience with such problems.

#ifndef HAVE__XGETBV  /* set by autoconf or in boinc_win.h */
static unsigned long long _xgetbv(unsigned int index){
      unsigned int A, D;

#ifdef __GNUC__
  #ifdef ASM_SUPPORTS_XGETBV  /* gcc version >= 4.4, but better tested by
autoconf */
      __asm__ __volatile__("xgetbv" : "=a"(A), "=d"(D) : "c"(index));
  #else
      __asm__ __volatile__(".byte 0x0f, 0x01, 0xd0": "=a"(A), "=d"(D) :
"c"(index));
  #endif
#elif defined(_MSC_VER)
  #ifdef _M_IX86
      __asm {
                       mov ecx,index
                       __emit 00fh
                       __emit 001h
                       __emit 0d0h
                       mov D,edx
                       mov A,eax
       }
  #elif defined(_M_AMD64)
      // damn Microsoft for not having inline assembler in 64-bit code
      // so this is in an NASM compiled library
      return asm_xgetbv(index);
  #endif
      return ((unsigned long long)D << 32) | A;
#else
      return 0;
#endif
}
#endif



On Thu, May 22, 2014 at 3:52 PM, Rom Walton <[email protected]> wrote:

> I meant to say not supported.
>
> ----- Rom
>
> -----Original Message-----
> From: boinc_dev [mailto:[email protected]] On Behalf Of
> Rom Walton
> Sent: Thursday, May 22, 2014 6:49 PM
> To: Raistmer the Sorcerer
> Cc: BOINC Dev Mailing List
> Subject: Re: [boinc_dev] WINBUILD: Minimum supported VS is now VS 2010
>
> It is my understanding that the '_xgetbv' intrinsic is supported in VS2008.
>
>
>
> ----- Rom
>
>
>
> From: Raistmer the Sorcerer [mailto:[email protected]]
> Sent: Thursday, May 22, 2014 6:46 PM
> To: Rom Walton
> Cc: BOINC Dev Mailing List; Jord van der Elst
> Subject: Re[2]: [boinc_dev] WINBUILD: Minimum supported VS is now VS 2010
>
>
>
> That is, this code will do wrong being compiled with VS2008?
>
>     int cpuInfo[4];
>
>     __cpuid(cpuInfo, 1);
>
>
>
>     bool osUsesXSAVE_XRSTORE = cpuInfo[2] & (1 << 27) || false;
>
>     bool cpuAVXSuport = cpuInfo[2] & (1 << 28) || false;
>
>
>
>     if (osUsesXSAVE_XRSTORE && cpuAVXSuport)
>
>     {
>
>         // Check if the OS will save the YMM registers
>
>         unsigned long long xcrFeatureMask =
> _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
>
>         avxSupported = (xcrFeatureMask & 0x6) || false;
>
>     }
>
> __cpuid() will not report correctly?
>
>
>
>
> Thu, 22 May 2014 17:47:28 -0400 от "Rom Walton" <[email protected]>:
>
> Demand for AVX detection and support:
>
>
> http://insufficientlycomplicated.wordpress.com/2011/11/07/detecting-intel-advanced-vector-extensions-avx-in-visual-studio/
>
>
>
> ----- Rom
>
>
>
> From: Raistmer the Sorcerer [mailto:[email protected]]
> Sent: Thursday, May 22, 2014 5:19 PM
> To: Jord van der Elst
> Cc: BOINC Dev Mailing List; Rom Walton
> Subject: Re: [boinc_dev] WINBUILD: Minimum supported VS is now VS 2010
>
>
>
> What reasons behind of this version shift?
> What unresolvable problems with VS2008 ?
>
>
>
> Thu, 22 May 2014 16:54:15 +0200 от Jord van der Elst <[email protected] <
> https://e.mail.ru/compose/?mailto=mailto%[email protected]> >:
>
> WINBUILD: Minimum supported VS is now VS 2010
>
> So then that means that someone has to retest and rewrite all and
> everything of http://boinc.berkeley.edu/trac/wiki/CompileClient#Windowsas the 
> compilers the page is written for are VS 2005 (Express) and 2008.
>
> And what VS, full VS or is Express also an option?
> Or is Express still not capable of compiling 64bit applications?
>
> Thanks,
>
> -- Jord van der Elst.
> _______________________________________________
> boinc_dev mailing list
> [email protected] <
> https://e.mail.ru/[email protected]>
> http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
> To unsubscribe, visit the above URL and
> (near bottom of page) enter your email address.
>
>
>
>
>
> _______________________________________________
> boinc_dev mailing list
> [email protected]
> http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
> To unsubscribe, visit the above URL and
> (near bottom of page) enter your email address.
> _______________________________________________
> boinc_dev mailing list
> [email protected]
> http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
> To unsubscribe, visit the above URL and
> (near bottom of page) enter your email address.
>
>
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to