This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[JAVA] Generate fconst_2 bytecode


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]