This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] MIPS, use trap instead of break to detect divide by zero
- From: Zack Weinberg <zack at codesourcery dot com>
- To: David Daney <ddaney at avtrex dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 30 Jun 2004 23:54:11 -0700
- Subject: Re: [RFC] MIPS, use trap instead of break to detect divide by zero
- References: <40E3AE83.4040805@avtrex.com>
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