Bug 1105729: Pre VS2010 SP1 define our own verion of _xgetbv. r=tabraldes

This commit is contained in:
Bob Owen 2014-11-28 18:58:33 +00:00
parent a1ac996177
commit 1c6c8cb0ce
2 changed files with 13 additions and 2 deletions

View File

@ -51,6 +51,16 @@ CPU::CPU()
namespace {
#if defined(ARCH_CPU_X86_FAMILY)
#if defined(_MSC_VER) && (_MSC_FULL_VER < 160040219)
// Prior to VS2010 SP1, _xgetbv is not defined in immintrin.h, so we need to
// define our own version using the assembly operation.
// By using __fastcall we ensure that xcr is already in register ecx for xgetbv
// and xgetbv populates the correct registers (eax edx) for our return value.
uint64_t __fastcall _xgetbv(uint32_t xcr) {
__asm xgetbv;
}
#endif
#ifndef _MSC_VER
#if defined(__pic__) && defined(__i386__)

View File

@ -1,5 +1,6 @@
Please add a link to the bugzilla bug and patch name that should be re-applied.
Also, please update any existing links to their actual mozilla-central changeset.
https://bugzilla.mozilla.org/show_bug.cgi?id=1041775 bug1041775part3.patch
https://bugzilla.mozilla.org/show_bug.cgi?id=928044 bug928044part3.patch
https://hg.mozilla.org/mozilla-central/rev/365d1073111a
https://hg.mozilla.org/mozilla-central/rev/0f763c186855
https://bugzilla.mozilla.org/show_bug.cgi?id=1105729 bug1105729.patch