add some asm notes, some more registers back to the clobber list, and memset the fxsave area in FPU::FPU()
git-svn-id: svn://localhost/ardour2/branches/3.0@6420 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
019100470a
commit
53b0b4d114
@ -1,4 +1,5 @@
|
||||
#define _XOPEN_SOURCE 600
|
||||
#include <cstring> // for memset
|
||||
#include <cstdlib>
|
||||
#include <stdint.h>
|
||||
|
||||
@ -20,6 +21,12 @@ FPU::FPU ()
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* asm notes: although we explicitly save&restore ebx/rbx (stack pointer), we must tell
|
||||
gcc that ebx,rbx is clobbered so that it doesn't try to use it as an intermediate
|
||||
register when storing edx/rdx. gcc 4.3 didn't make this "mistake", but gcc 4.4
|
||||
does, at least on x86_64.
|
||||
*/
|
||||
|
||||
#ifndef USE_X86_64_ASM
|
||||
asm volatile (
|
||||
"mov $1, %%eax\n"
|
||||
@ -29,7 +36,7 @@ FPU::FPU ()
|
||||
"popl %%ebx\n"
|
||||
: "=r" (cpuflags)
|
||||
:
|
||||
: "%eax", "%ebx", "%edx"
|
||||
: "%eax", "%ebx", "%ecx", "%edx"
|
||||
);
|
||||
|
||||
#else
|
||||
@ -42,7 +49,7 @@ FPU::FPU ()
|
||||
"popq %%rbx\n"
|
||||
: "=r" (cpuflags)
|
||||
:
|
||||
: "%rax", "%rbx", "%rdx"
|
||||
: "%rax", "%rbx", "%rcx", "%rdx"
|
||||
);
|
||||
|
||||
#endif /* USE_X86_64_ASM */
|
||||
@ -68,6 +75,8 @@ FPU::FPU ()
|
||||
error << _("cannot allocate 16 byte aligned buffer for h/w feature detection") << endmsg;
|
||||
} else {
|
||||
|
||||
memset (fxbuf, 0, 512);
|
||||
|
||||
asm volatile (
|
||||
"fxsave (%0)"
|
||||
:
|
||||
|
Loading…
Reference in New Issue
Block a user