diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-09-18 14:55:43 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-09-18 14:55:43 +0000 |
commit | a490d1be3fa7903ddd0161c9c33bc0a4a9b8aaf5 (patch) | |
tree | c9a47357d7fdbb3f7af3ed6a39390f77f560406c /gcc/java | |
parent | b2bc33399bfe7f0abfc7b1d0a0ce8bf1a77b9d08 (diff) | |
download | gcc-a490d1be3fa7903ddd0161c9c33bc0a4a9b8aaf5.zip gcc-a490d1be3fa7903ddd0161c9c33bc0a4a9b8aaf5.tar.gz gcc-a490d1be3fa7903ddd0161c9c33bc0a4a9b8aaf5.tar.bz2 |
* jcf-write.c (generate_bytecode_insns): Add support for fconst_2.
From-SVN: r71524
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/java/jcf-write.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index a171aa1..5c9ca01 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2003-09-18 Roger Sayle <roger@eyesopen.com> + + * jcf-write.c (generate_bytecode_insns): Add support for fconst_2. + 2003-09-16 Andrew Haley <aph@redhat.com> * jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR. diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index febd04f..82c77b1 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -1462,8 +1462,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) OP1 (prec == 1 ? OPCODE_fconst_0 : OPCODE_dconst_0); else if (real_onep (exp)) OP1 (prec == 1 ? OPCODE_fconst_1 : OPCODE_dconst_1); - /* FIXME Should also use fconst_2 for 2.0f. - Also, should use iconst_2/ldc followed by i2f/i2d + else if (prec == 1 && real_twop (exp)) + OP1 (OPCODE_fconst_2); + /* ??? We could also use iconst_3/ldc followed by i2f/i2d for other float/double when the value is a small integer. */ else { |