From: Alexandre Oliva (oliva@dcc.unicamp.br)
Date: Wed Feb 10 1999 - 08:12:31 EST
On Feb 8, 1999, Godmar Back <gback@cs.utah.edu> wrote:
>>
>> 0x8...0 % 0xf...f generates an arithmetic exception on mips. The
>> following programs demonstrates this.
>>
>> Should we test for this failure at configure time and generate extra
>> code to expand `a%b' to `(b==-1)?0:(a%b)' ? :-(
> The FAQ already mentions that it's broken on netbsd and other platforms.
> I would like a configure test.
> However, note that on broken FreeBSDs and on the netbsd/arm, what we
> want to return is simply -(a%b) if sgn(a%b) != sgn(a), I think.
Another configure test. Ok, the result of integer remainder in C is
undefined for negative values, so we should already expect to have to
take care of these anyway. It's easy to do in the interpreter case,
and in the case of soft_call, but I doubt we can do it if HAVE_int_rem
or HAVE_long_rem. Should we revert to the softcalls in this case, or
can anyone think of some magic to handle it inline?
> Maybe these patches can be unified?
Will give it a try some day :-)
-- Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org} oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org} Universidade Estadual de Campinas, SP, Brasil
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:58:04 EDT