GCC does not generate ADCX or ADOX for _addcarryx_u64

Uros Bizjak ubizjak@gmail.com
Mon Aug 21 13:31:00 GMT 2017


On Mon, Aug 21, 2017 at 1:48 PM, Xi Ruoyao <ryxi@stu.xidian.edu.cn> wrote:
> On 2017-08-21 19:41 +0800, Xi Ruoyao wrote:
>> On 2017-08-21 07:31 -0400, Jeffrey Walton wrote:
>> > On Mon, Aug 21, 2017 at 7:20 AM, Marc Glisse <marc.glisse@inria.fr> wrote:
>> > > On Mon, 21 Aug 2017, Jeffrey Walton wrote:
>> > >
>> > > > I'm trying to use _addcarryx_u64. GCC 7.1 is still generating ADD and
>> > > > ADC instead of ADCX or ADOX:
>> > >
>> > > Does that compute wrong values? Make the program slower?
>> >
>> > It looks like the values are computed correctly.
>> >
>> > I don't know the affect on performance. The only benchmarks I have are
>> > for add/adc. I can't get the adcx/adox generated to benchmark them.
>> >
>> > Compared to Intel ICC code generation, Intel's code is about 20% to 30% smaller.
>>
>> GCC once used ADCX but got silly results.  So Uros disabled it.
>
> CC Uroš for his (or her) opinion.

The compiler is not able to distingusih between OF and CF chains,
since both are represented as a different mode of a single flags
register. This is the limitation of the compiler.

Uros.



More information about the Gcc-help mailing list