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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-07-02
         Depends on|                            |115756
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> For the original testcase, the imul vs shift can be reduced down to just:
> ```
> unsigned long func(unsigned long x)
> {
>   return x * 240;
> }
> 
> ```
> 
> GCC produces:
> ```
>         movq    %rdi, %rax
>         salq    $4, %rax
>         subq    %rdi, %rax
>         salq    $4, %rax
> ```
> vs:
> ```
>         imulq   $240, %rdi, %rax
> ```
> 
> -mtune=skylake  produces the imul.

I split out the tuning issue for imul to PR 115756 .


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115756
[Bug 115756] default tuning for x86_64 produces shifts for `*240`

Reply via email to