]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/intrinsics/float/float.factor
Merge branch 'master' of git://factorcode.org/git/factor into constraints
[factor.git] / basis / compiler / cfg / intrinsics / float / float.factor
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
6
7 : emit-float-op ( insn -- )
8     [ 2inputs ] dip call ds-push ; inline
9
10 : emit-float-ordered-comparison ( cc -- )
11     [ 2inputs ] dip ^^compare-float-ordered ds-push ; inline
12
13 : emit-float-unordered-comparison ( cc -- )
14     [ 2inputs ] dip ^^compare-float-unordered ds-push ; inline
15
16 : emit-float>fixnum ( -- )
17     ds-pop ^^float>integer ^^tag-fixnum ds-push ;
18
19 : emit-fixnum>float ( -- )
20     ds-pop ^^untag-fixnum ^^integer>float ds-push ;
21
22 : emit-fsqrt ( -- )
23     ds-pop ^^sqrt ds-push ;
24
25 : emit-unary-float-function ( func -- )
26     [ ds-pop ] dip ^^unary-float-function ds-push ;
27
28 : emit-binary-float-function ( func -- )
29     [ 2inputs ] dip ^^binary-float-function ds-push ;