- To: gcc-help@xxxxxxxxxxx
- Subject: Question about compare rtl
- From: Aurelien Buhrig <aurelien.buhrig.gcc@xxxxxxxxx>
- Date: Wed, 20 Jun 2012 19:36:33 +0200
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1
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
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]