Ilya Zakharevich on Sat, 21 Sep 2024 16:01:38 +0200


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

Re: Wrong x86 assembler in the kernel


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