1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: system kernel math alien.syntax ;
8 FUNCTION: bool check_sse2 ( ) ;
10 FUNCTION: longlong read_timestamp_counter ( ) ;
14 HOOK: sse2? cpu ( -- ? )
16 M: x86.32 sse2? check_sse2 ;
20 HOOK: instruction-count cpu ( -- n )
22 M: x86 instruction-count read_timestamp_counter ;
24 : count-instructions ( quot -- n )
25 instruction-count [ call ] dip instruction-count swap - ; inline