This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[JAVA] Generate fconst_2 bytecode
- From: Andrew Haley <aph at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, <java-patches at gcc dot gnu dot org>
- Date: Thu, 18 Sep 2003 11:20:53 +0100
- Subject: [JAVA] Generate fconst_2 bytecode
- References: <Pine.LNX.4.44.0309172034160.18892-100000@www.eyesopen.com>
Roger Sayle writes:
>
> Whilst investigating optimal JVM bytecode sequences for min and max ...
The optimum sequence is dup2 ; if_icmplt ; swap ; drop
But I think you're barking up the wrong tree by trying to optimize
bytecode generation for min and max. We just need to do something
that is straightforward and obviously correct.
Modern JVMs optimize code in the same way that ahead of time compilers
do, by doing semantic analysis and trying to generate optimal
instruction sequqnces. Trying to generate better bytecode won't make
much difference to them.
Andrew.