public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98167] New: [x86] Failure to optimize operation on indentically shuffled operand into a shuffle of the result of the operation
@ 2020-12-07  2:09 gabravier at gmail dot com
  2020-12-07  2:12 ` [Bug target/98167] [x86] Failure to optimize operation on indentically shuffled operands " gabravier at gmail dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: gabravier at gmail dot com @ 2020-12-07  2:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98167
           Summary: [x86] Failure to optimize operation on indentically
                    shuffled operand into a shuffle of the result of the
                    operation
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

__m128 f(__m128 a, __m128 b) {
    return _mm_mul_ps(_mm_shuffle_ps(a, a, 0), _mm_shuffle_ps(b, b, 0));
}

This can be optimized to:

__m128 f(__m128 a, __m128 b) {
    __m128 tmp = _mm_mul_ss(a, b);
    return _mm_shuffle_ps(tmp, tmp, 0);
}

This transformation is done by LLVM, but not by GCC.

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

end of thread, other threads:[~2022-11-15  5:36 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07  2:09 [Bug target/98167] New: [x86] Failure to optimize operation on indentically shuffled operand into a shuffle of the result of the operation gabravier at gmail dot com
2020-12-07  2:12 ` [Bug target/98167] [x86] Failure to optimize operation on indentically shuffled operands " gabravier at gmail dot com
2020-12-07  8:04 ` rguenth at gcc dot gnu.org
2020-12-07 12:19 ` crazylht at gmail dot com
2020-12-07 12:26 ` rguenth at gcc dot gnu.org
2020-12-07 12:39 ` rguenth at gcc dot gnu.org
2020-12-07 12:40 ` rguenth at gcc dot gnu.org
2020-12-07 12:43 ` rguenth at gcc dot gnu.org
2020-12-08 23:05 ` glisse at gcc dot gnu.org
2020-12-10  5:49 ` crazylht at gmail dot com
2021-01-14 10:45 ` crazylht at gmail dot com
2021-01-14 10:59 ` jakub at gcc dot gnu.org
2021-08-27  0:51 ` cvs-commit at gcc dot gnu.org
2021-08-27  0:58 ` crazylht at gmail dot com
2021-08-27  1:13 ` pinskia at gcc dot gnu.org
2021-08-27  5:48 ` crazylht at gmail dot com
2021-08-27  6:31 ` crazylht at gmail dot com
2021-08-27  6:48 ` pinskia at gcc dot gnu.org
2021-08-27  7:02 ` crazylht at gmail dot com
2021-08-27  7:39 ` pinskia at gcc dot gnu.org
2022-01-11 11:27 ` rguenth at gcc dot gnu.org
2022-11-15  5:36 ` cvs-commit 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).