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: INT_MIN % -1


> From: Robert Dewar <dewar@gnat.com>
> 
> Paul Schlie wrote:
>> With reference to the below:
>> 
>> I would guess that rather than attempting to expose a check for a / or % by
>> -1 to the compiler, I would assume that it's best handled by the back end
>> during code generations, as the most efficient solution is target specific:
> 
> Indeed, but remember we would need to have both operations, one with the
> special handling and one without.

Understood, as ADA programs may bound the domain of it's variables
guaranteeing that the operation would be well behaved within the bounds of
it's operands; but wonder if saving a few cycles out of the likely several
required for a divide or modulo operation would likely be worth the added,
albeit minor, complexity?




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