Commit f3624b4c authored by dbarbera's avatar dbarbera
Browse files

Added built-in fix generation

parent 654992b4
......@@ -566,7 +566,8 @@ def generate_abs(params):
def generate_fix(params):
''' Generate the code for the built-in fix operation'''
raise NotImplementedError
expr_val = expression(params[0])
return g.builder.fptosi(expr_val, g.i32)
def generate_float(params):
......
......@@ -164,7 +164,11 @@ COMMENT '1.0';
CALL writeln(float(1))
/* CIF COMMENT (54, 1707), (70, 35) */
COMMENT '1.0';
/* CIF NEXTSTATE (-85, 1757), (100, 50) */
/* CIF PROCEDURECALL (-102, 1757), (135, 35) */
CALL writeln(fix(1.0))
/* CIF COMMENT (52, 1757), (70, 35) */
COMMENT '1';
/* CIF NEXTSTATE (-85, 1807), (100, 50) */
NEXTSTATE Wait;
ENDSTATE;
ENDPROCESS basic;
\ No newline at end of file
......@@ -34,3 +34,4 @@ TRUE
1.00000000000000E+00
1.00000000000000E+00
1.00000000000000E+00
1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment