From 461a4ddd0a67ffda7bd89e7179bf85dea5880682 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 20 Oct 2008 05:56:39 -0500 Subject: [PATCH] Add SSE2 detection routine --- vm/cpu-x86.32.S | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vm/cpu-x86.32.S b/vm/cpu-x86.32.S index b1a3561974..1613579244 100644 --- a/vm/cpu-x86.32.S +++ b/vm/cpu-x86.32.S @@ -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"