"Segher Boessenkool" wrote:
> On Wed, Dec 05, 2018 at 02:19:14AM +0100, Stefan Kanthak wrote:
>> "Paul Koning" wrote:
>>
>> > Yes, that's a rather nasty cut & paste error I made.
>>
>> I suspected that.
>> Replacing
>> !(den & (1L<<31))
>> with
>> (signed short) den >= 0
>> avoids this
> On Dec 5, 2018, at 11:23 AM, Segher Boessenkool
> wrote:
>
> On Wed, Dec 05, 2018 at 02:19:14AM +0100, Stefan Kanthak wrote:
>> "Paul Koning" wrote:
>>
>>> Yes, that's a rather nasty cut & paste error I made.
>>
>> I suspected that.
>> Replacing
>>!(den & (1L<<31))
>> with
>>(sig
On Wed, Dec 05, 2018 at 02:19:14AM +0100, Stefan Kanthak wrote:
> "Paul Koning" wrote:
>
> > Yes, that's a rather nasty cut & paste error I made.
>
> I suspected that.
> Replacing
> !(den & (1L<<31))
> with
> (signed short) den >= 0
> avoids this type of error: there's no need for a cons
> On Dec 4, 2018, at 8:19 PM, Stefan Kanthak wrote:
>
> "Paul Koning" wrote:
>
>> Yes, that's a rather nasty cut & paste error I made.
>
> I suspected that.
> Replacing
>!(den & (1L<<31))
> with
>(signed short) den >= 0
> avoids this type of error: there's no need for a constant her
"Paul Koning" wrote:
> Yes, that's a rather nasty cut & paste error I made.
I suspected that.
Replacing
!(den & (1L<<31))
with
(signed short) den >= 0
avoids this type of error: there's no need for a constant here!
JFTR: of course the 1L should be just a 1, without suffix.
> But if the
Yes, that's a rather nasty cut & paste error I made.
But if the 31 is changed to a 15, is the code correct? I would think so. For
optimization I'd think that an assembly language version would make more sense,
and a few targets do that.
paul
> On Dec 4, 2018, at 5:51 PM, Stefan Kant
Hi @ll,
libgcc's divmodhi4() function has an obvious bug; additionally
it shows rather poor inperformant code: two of the three conditions
tested in the first loop should clearly moved outside the loop!
divmodsi4() shows this inperformant code too!
regards
Stefan Kanthak
--- divmodhi4.c ---
un