diff options
author | John Arbuckle | 2018-06-04 23:51:02 +0200 |
---|---|---|
committer | Richard Henderson | 2018-06-15 19:42:55 +0200 |
commit | 1019242af11400252f6735ca71a35f81ac23a66d (patch) | |
tree | 1b8f8b62eae98317fe96c7e1ccf867490c0f4436 /tcg/i386 | |
parent | Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2018-06-15... (diff) | |
download | qemu-1019242af11400252f6735ca71a35f81ac23a66d.tar.gz qemu-1019242af11400252f6735ca71a35f81ac23a66d.tar.xz qemu-1019242af11400252f6735ca71a35f81ac23a66d.zip |
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.
Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
Message-Id: <20180604215102.11002-1-programmingkidx@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/i386')
-rw-r--r-- | tcg/i386/tcg-target.inc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 5357909fff..0d0ff524b7 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -3501,7 +3501,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; |