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: [RFC] MIPS, use trap instead of break to detect divide by zero


David Daney <ddaney@avtrex.com> writes:

> 3.4.x and 3.5 (and earlier versions as well) use a combination of a
> branch and the break instruction to detect divide by zero.
>
> MIPS2 and above processors seem to all have a trap instruction that can
> do the same job in one instruction.  Using a trap instead of branch and
> break can save at least one instruction per divide.
>
> The attached patch is against 3.4.1.  3.5 would require a slightly
> different version, but the idea is the same.

I think this is a fine idea, but please submit a patch versus 3.5;
this sort of improvement is unlikely to be accepted for the 3.4 series.

zw


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