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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux