From 855dd2bcff9e32e053bf66e336405ded26e9c927 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 8 Feb 2006 18:06:11 +0000 Subject: re PR java/22578 (should inline floatToIntBits et al) gcc/java PR java/22578: * check-init.c (check_init): Handle VIEW_CONVERT_EXPR. * builtins.c (convert_real): New function. (java_builtins): Handle Float.intBitsToFloat, Float.floatToRawIntBits, Double.longBitsToDouble, Double.doubleToRawLongBits. libjava PR java/22578: * gcj/javaprims.h: Updated. * sources.am, Makefile.in: Rebuilt. * java/lang/natDouble.cc (doubleToLongBits): Moved to VMDouble. (doubleToRawLongBits): Likewise. (longBitsToDouble): Likewise. (toString): Likewise. (parseDouble): Likewise. * java/lang/natFloat.cc (floatToIntBits): Moved to VMFloat. (floatToRawIntBits): Likewise. (intBitsToFloat): Likewise. * java/lang/VMDouble.java: New file. * java/lang/VMFloat.java: New file. * java/lang/Float.java, java/lang/Double.java: Removed. From-SVN: r110759 --- gcc/java/builtins.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/java/builtins.c') 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 -- cgit v1.1