mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 09:35:40 +00:00
tcg/i386: Use byte form of xgetbv instruction
The assembler in most versions of Mac OS X is pretty old and does not support the xgetbv instruction. To go around this problem, the raw encoding of the instruction is used instead. Backports commit 1019242af11400252f6735ca71a35f81ac23a66d from qemu
This commit is contained in:
parent
f447a6f668
commit
22c3206738
|
@ -3606,7 +3606,10 @@ static void tcg_target_init(TCGContext *s)
|
|||
sure of not hitting invalid opcode. */
|
||||
if (c & bit_OSXSAVE) {
|
||||
unsigned xcrl, xcrh;
|
||||
asm ("xgetbv" : "=a" (xcrl), "=d" (xcrh) : "c" (0));
|
||||
/* The xgetbv instruction is not available to older versions of
|
||||
* the assembler, so we encode the instruction manually.
|
||||
*/
|
||||
asm(".byte 0x0f, 0x01, 0xd0" : "=a" (xcrl), "=d" (xcrh) : "c" (0));
|
||||
if ((xcrl & 6) == 6) {
|
||||
have_avx1 = (c & bit_AVX) != 0;
|
||||
have_avx2 = (b7 & bit_AVX2) != 0;
|
||||
|
|
Loading…
Reference in a new issue