This is the mail archive of the gcc-patches@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: [Patch-86512]: Subnormal float support in armv7(with -msoft-float) for intrinsics


On Fri, 27 Jul 2018, Wilco Dijkstra wrote:

> Nicolas Pitre wrote:
> 
> >> However if r4 is non-zero, the carry will be set, and the tsths will be executed. This
> >> clears the carry and sets the Z flag based on bit 20.
> >
> > No, not at all. The carry is not affected. And that's the point of the 
> > tst instruction here rather than a cmp: it sets the N and Z flags but 
> > leaves C alone as there is no shifter involved.
> 
> No, the carry is always set by logical operations with a shifted immediate. It is only
> unchanged if the immediate uses a zero rotate. So any shifted immediate > 255
> will set the carry.

Holy cow !!!

Who knows all the bugs I must have created in the past 25 years having 
missed this particular subtlety.

Here's the updated patch with your suggestion.

Attachment: fix.patch
Description: Text document


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