Question about compare rtl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a question about combining compare with arithmetic operations.
The doc says about (compare:m x y):

"Represents the result of subtracting y from x for purposes of
comparison. The result is computed without overflow, as if with infinite
precision.
Of course, machines can’t really subtract with infinite precision.
However, they can pretend to do so when only the sign of the result will
be used, which is the case when the result is stored in the condition
code. And that is the only way this kind of expression may validly be
used: as a value to be stored in the condition codes, either (cc0) or a
register."

So is it valid to combine a subm pattern (which sets the flags as a
compare does) and a cbranchm with a signed comparison operator?

If it is, what is the expected behavior when an overflow occurs?
Should we branch if (compare x y) is true, or if (compare result 0) is true?

Thank you in advance!
Aurélien


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux