public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1
       [not found] <bug-82259-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-02 23:55 ` pinskia at gcc dot gnu.org
  2021-08-02 23:56 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #2)
> A couple of *scc_bt patterns are missing. These are similar to already
> existing *jcc_bt patterns. Combine wants:
> 
> Failed to match this instruction:
> (set (reg:QI 97)
>     (eq:QI (zero_extract:SI (reg/v:SI 91 [ x ])
>             (const_int 1 [0x1])
>             (zero_extend:SI (subreg:QI (reg/v:SI 92 [ bit ]) 0)))
>         (const_int 0 [0])))

I have a patch which changes that as I was running into something similar a few
days ago.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1
       [not found] <bug-82259-4@http.gcc.gnu.org/bugzilla/>
  2021-08-02 23:55 ` [Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1 pinskia at gcc dot gnu.org
@ 2021-08-02 23:56 ` pinskia at gcc dot gnu.org
  2021-08-02 23:56 ` [Bug rtl-optimization/82259] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02 23:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 51248
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51248&action=edit
patch for the eq issue

This is the patch for the eq issue

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1
       [not found] <bug-82259-4@http.gcc.gnu.org/bugzilla/>
  2021-08-02 23:55 ` [Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1 pinskia at gcc dot gnu.org
  2021-08-02 23:56 ` pinskia at gcc dot gnu.org
@ 2021-08-02 23:56 ` pinskia at gcc dot gnu.org
  2021-08-03  0:01 ` pinskia at gcc dot gnu.org
  2023-06-23  3:47 ` [Bug middle-end/82259] " pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02 23:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |rtl-optimization
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-08-02
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1
       [not found] <bug-82259-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-08-02 23:56 ` [Bug rtl-optimization/82259] " pinskia at gcc dot gnu.org
@ 2021-08-03  0:01 ` pinskia at gcc dot gnu.org
  2023-06-23  3:47 ` [Bug middle-end/82259] " pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-03  0:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> Created attachment 51248 [details]
> patch for the eq issue
> 
> This is the patch for the eq issue

Of course after that we get:
(set (reg:QI 92)
    (xor:QI (subreg:QI (zero_extract:SI (reg:SI 93)
                (const_int 1 [0x1])
                (and:SI (reg:SI 94)
                    (const_int 255 [0xff]))) 0)
        (const_int 1 [0x1])))

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1
       [not found] <bug-82259-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-08-03  0:01 ` pinskia at gcc dot gnu.org
@ 2023-06-23  3:47 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-23  3:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-08-02 00:00:00         |2023-6-22
          Component|rtl-optimization            |middle-end

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is an expansion issue not taking into cost of expanding using shifts
rather than test/set.

I am still working in this area and might improve this for GCC 14 but still
deciding on how to get some good infrastructure for the cost modeling ...

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-23  3:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-82259-4@http.gcc.gnu.org/bugzilla/>
2021-08-02 23:55 ` [Bug target/82259] missed optimization: use LEA to add 1 to flip the low bit when copying before AND with 1 pinskia at gcc dot gnu.org
2021-08-02 23:56 ` pinskia at gcc dot gnu.org
2021-08-02 23:56 ` [Bug rtl-optimization/82259] " pinskia at gcc dot gnu.org
2021-08-03  0:01 ` pinskia at gcc dot gnu.org
2023-06-23  3:47 ` [Bug middle-end/82259] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).