diff options
Diffstat (limited to 'gcc/java/builtins.c')
-rw-r--r-- | gcc/java/builtins.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 5082cd0..bd7e696 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -39,6 +39,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ static tree max_builtin (tree, tree); static tree min_builtin (tree, tree); static tree abs_builtin (tree, tree); +static tree convert_real (tree, tree); static tree java_build_function_call_expr (tree, tree); @@ -85,6 +86,10 @@ static GTY(()) struct builtin_record java_builtins[] = { { "java.lang.Math" }, { "sin" }, NULL, BUILT_IN_SIN }, { { "java.lang.Math" }, { "sqrt" }, NULL, BUILT_IN_SQRT }, { { "java.lang.Math" }, { "tan" }, NULL, BUILT_IN_TAN }, + { { "java.lang.Float" }, { "intBitsToFloat" }, convert_real, 0 }, + { { "java.lang.Double" }, { "longBitsToDouble" }, convert_real, 0 }, + { { "java.lang.Float" }, { "floatToRawIntBits" }, convert_real, 0 }, + { { "java.lang.Double" }, { "doubleToRawLongBits" }, convert_real, 0 }, { { NULL }, { NULL }, NULL, END_BUILTINS } }; @@ -131,6 +136,13 @@ java_build_function_call_expr (tree fn, tree arglist) call_expr, arglist, NULL_TREE); } +static tree +convert_real (tree method_return_type, tree method_arguments) +{ + return build1 (VIEW_CONVERT_EXPR, method_return_type, + TREE_VALUE (method_arguments)); +} + #define BUILTIN_NOTHROW 1 |