Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP

Ricardo Neri <[email protected]>
Newsgroups gmane.linux.msdos.general,gmane.comp.emulators.wine.devel,gmane.linux.kernel
Message-ID <1487963247.115017.10.camel@ranerica-desktop>
On Fri, 2017-02-24 at 09:47 -0500, Nathan Howard wrote:
>         Also, this code would read better with the inner test
>         reversed or done first
>         
>                         if (indx_offset < 0) {
>                                 if (indx_offset != -EDOM)
>                                         goto out_err;
>                                 indx = 0;
>                         } else {
>                                 indx = regs_get_register(etc...)
>                         }
>         
>         or
>                         if (indx_offset == -EDOM)
>                                 indx = 0;
>                         else if (indx_offset < 0)
>                                 goto err;
> 
> 
> Or goto out_err;
> 
> 
>                         else
>                                 indx = regs_get_register(etc...)
>         
>         The compiler should generate the same code in any
>         case, but either could improve reader understanding.
> 
> 
> Also, it may be a tweak more efficient to handle the most likely
> runtime case in the conditional stack first (whichever that may be).

The most likely case will be a positive value but I need to check for
negatives first :( I could wrap the first conditional in an "unlikely".

Thanks and BR,
Ricardo


--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.