This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: How can I get VRP information for an RTX?


Andrew Haley wrote:
Andrew Pinski writes:
 > It seems wrong that the java front-end thinks we don't have to use
 > the divide subroutine for MIPS.  Really I think it is wrong that
 > the mips back-end thinks it should enable by default trap on divide
 > by zero.

I'm not sure about that: the MIPS conditional trap instruction is
quite efficient.  Before making any change we should do some
benchmarking.


There are two issues:


1) Should the compiler generate a trap on division by zero?

As far as I can tell, most mips compilers can be configured to generate a trap on division by zero. We should not remove this capability, just make it as efficient as possible.

2) Should the mips[el]-linux port of libgcj use trapping division?

The JLS requires that an exception be thrown on division by zero. For the mips a division + conditional trap = 2 instructions and no branching. Calling the special libgcj divide function executes at least 4 times as many instructions and involves at least two jumps (call and return). I am not going to benchmark it. If you think there is a better way, you can benchmark it and report your findings.

David Daney


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