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]

Re: portable signed right shift


<<But I was wondering if there were any C89 implementations
which didn't always use the machine division instruction;
e.g. perhaps there might be some optimization advantage
to rounding differently in certain cases?.
>>

That's a good point, for example, it IS valid to replace a division in C
(C89) by an arithmetic right shift, even though that gives the "wrong"
result for negative values, and indeed this replacement is a nice
optimization.


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