qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] tcg/i386: Add vector operations patch does not compile on M


From: Programmingkid
Subject: [Qemu-devel] tcg/i386: Add vector operations patch does not compile on Mac OS 10.6
Date: Wed, 28 Feb 2018 13:16:31 -0500

https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04321.html

This patch causes problems with Mac OS 10.6. It stops compilation. This is the 
error I see when I try to compile the code:

tcg/i386/tcg-target.inc.c:3495:no such instruction: `xgetbv`

This is the code that causes the problem:

asm ("xgetbv" : "=a" (xcrl), "=d" (xcrh) : "c" (0));

This issue is documented here: https://bugs.launchpad.net/qemu/+bug/1751494

It looks like GNU's as command does not output Mac OS X's Mach-O object file 
format so updating this command is not going to work. I think one way to fix 
this issue is to add a test to the configure command that sees if a simple 
xgetbv test program can compile on the current system. If it can then use the 
xgetbv instruction. If it can't then use a generic function or what you feel is 
best.

I think the test program would look like this:

int main(int argc, char *argv[])
{
    asm volatile("xgetbv");
}

This may not be a valid use of the instruction but it is enough to tell us if 
this instruction can be used. On Mac OS 10.12 the program does compile. On Mac 
OS 10.6 the program failed to compile because the instruction is not recognized.

What do you think is the solution to this problem?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]