1 ! Copyright (C) 2008, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel compiler.cfg.stacks compiler.cfg.hats
4 compiler.cfg.instructions compiler.cfg.utilities ;
5 IN: compiler.cfg.intrinsics.float
7 : emit-float-op ( insn -- )
8 [ 2inputs ] dip call ds-push ; inline
10 : emit-float-ordered-comparison ( cc -- )
11 [ 2inputs ] dip ^^compare-float-ordered ds-push ; inline
13 : emit-float-unordered-comparison ( cc -- )
14 [ 2inputs ] dip ^^compare-float-unordered ds-push ; inline
16 : emit-float>fixnum ( -- )
17 ds-pop ^^float>integer ^^tag-fixnum ds-push ;
19 : emit-fixnum>float ( -- )
20 ds-pop ^^untag-fixnum ^^integer>float ds-push ;
23 ds-pop ^^sqrt ds-push ;
25 : emit-unary-float-function ( func -- )
26 [ ds-pop ] dip ^^unary-float-function ds-push ;
28 : emit-binary-float-function ( func -- )
29 [ 2inputs ] dip ^^binary-float-function ds-push ;