aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/builtins.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2006-02-08 18:06:11 +0000
committerTom Tromey <tromey@gcc.gnu.org>2006-02-08 18:06:11 +0000
commit855dd2bcff9e32e053bf66e336405ded26e9c927 (patch)
tree9a1df881ae846a312ad5ddcb0929d04574b40956 /gcc/java/builtins.c
parent59c02d8a613e46512e852d54ab2ff9209f47acc7 (diff)
downloadgcc-855dd2bcff9e32e053bf66e336405ded26e9c927.zip
gcc-855dd2bcff9e32e053bf66e336405ded26e9c927.tar.gz
gcc-855dd2bcff9e32e053bf66e336405ded26e9c927.tar.bz2
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
Diffstat (limited to 'gcc/java/builtins.c')
-rw-r--r--gcc/java/builtins.c12
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