linux-mips
[Top] [All Lists]

[RFC] MIPS division by zero and libgcj...

To: David Daney <ddaney@avtrex.com>, gcc@gcc.gnu.org, linux-mips@linux-mips.org, java@gcc.gnu.org
Subject: [RFC] MIPS division by zero and libgcj...
From: Andrew Haley <aph@redhat.com>
Date: Thu, 10 Jun 2004 20:39:25 +0100
In-reply-to: <16584.46883.332620.513805@cuddles.cambridge.redhat.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <40C8B29B.3090501@avtrex.com> <16584.46883.332620.513805@cuddles.cambridge.redhat.com>
Sender: linux-mips-bounce@linux-mips.org
Andrew Haley writes:
 > David Daney writes:
 >  > It appears that gcc configured for mipsel-linux will execute a "break 7" 
 >  > instruction on integer division by zero.
 > 
 > I thought that the MIPS never generated a hardware trap for division,
 > but instead there was an assembler macro that did the test for
 > overflow, and the "div" instruction actually generates this test
 > inline.  Maybe do a disassembly to check.

Here we are:

MIPS Dependent Features

--trap
--no-break

    automatically macro expands certain division and multiplication
    instructions to check for overflow and division by zero. This
    option causes to generate code to take a trap exception rather
    than a break exception when an error is detected. The trap
    instructions are only supported at Instruction Set Architecture
    level 2 and higher.

--break
--no-trap

    Generate code to take a break exception rather than a trap
    exception when an error is detected. This is the default.

Andrew.

<Prev in Thread] Current Thread [Next in Thread>