Add SSE2 detection routine

db4
Slava Pestov 2008-10-20 05:56:39 -05:00
parent 508b1f52b8
commit 461a4ddd0a
1 changed files with 11 additions and 0 deletions

View File

@ -39,4 +39,15 @@ DEF(void,set_callstack,(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, voi
add $12,%esp /* pop args from the stack */
ret /* return _with new stack_ */
/* cpu.x86.32 calls this */
DEF(bool,check_sse2,())
push %ebx
mov 1,%eax
cpuid
shr $26,%edx
and $1,%edx
pop %ebx
mov %edx,%eax
ret
#include "cpu-x86.S"