Re: Wrong x86 assembler in the kernel

Ilya Zakharevich <[email protected]> Sat, 21 Sep 2024 07:01:33 -0700
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
On Fri, Sep 20, 2024 at 09:40:51AM +0200, Bill Allombert wrote:
> On Thu, Sep 19, 2024 at 04:41:41PM -0700, Ilya Zakharevich wrote:
> > It seems that even ChatGPT produces better code than one in PARI :―(
> > 
> > According to
> >    https://www.felixcloutier.com/x86/bsr#flags-affected
> 
> This page does not mention the carry nor the CF flag.

And?

> > the code for bfffo() needs a trailing
> >   : "cc"
> 
> Do you have a test case ?

How can I?  AFAIK, nobody has a crystal ball to predict how to trigger
a particular optimization…

AFAIU, if a flag is changed, the optimizer must know this (so the
instruction is not permuted to be placed between a test and a jump)…

Hope this helps,
Ilya