https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98060

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
   Last reconfirmed|                            |2020-11-30
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
There are several other cases where sbb/adc can be used:

--cut here--
int r1 (unsigned v0, unsigned v1, int v2)
{
    return (v0 >= v1) + v2;
}

int r2 (unsigned v0, unsigned v1, int v2)
{
    return (v1 > v0) + v2;
}

int r3 (unsigned v0, unsigned v1, int v2)
{
    return (v0 <= v1) + v2;
}

int r4 (unsigned v0, unsigned v1, int v2)
{
    return (v1 < v0) + v2;
}
--cut here--

r1 and r3 can be implemented with sbb $-1, reg, r2 and r4 with adc $0, reg.

gcc currently converts only r4.

Reply via email to