public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104688] New: gcc and libatomic can use SSE for 128-bit atomic loads on Intel CPUs with AVX
@ 2022-02-25 14:22 xry111 at mengyan1223 dot wang
  2022-02-25 14:30 ` [Bug target/104688] " jakub at gcc dot gnu.org
                   ` (33 more replies)
  0 siblings, 34 replies; 35+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2022-02-25 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104688
           Summary: gcc and libatomic can use SSE for 128-bit atomic loads
                    on Intel CPUs with AVX
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xry111 at mengyan1223 dot wang
  Target Milestone: ---

In Dec 2021, Intel updated the SDM and added the following content:

> Processors that enumerate support for Intel® AVX (by setting the feature flag CPUID.01H:ECX.AVX[bit 28]) guarantee that the 16-byte memory operations performed by the following instructions will always be carried out atomically:
> - MOVAPD, MOVAPS, and MOVDQA.
> - VMOVAPD, VMOVAPS, and VMOVDQA when encoded with VEX.128.
> - VMOVAPD, VMOVAPS, VMOVDQA32, and VMOVDQA64 when encoded with EVEX.128 and k0 (masking disabled).
> 
> (Note that these instructions require the linear addresses of their memory operands to be 16-byte aligned.)

(see Change 13, https://cdrdv2.intel.com/v1/dl/getContent/671294)

So we can use SSE for Intel CPUs with AVX, instead of a loop with LOCK
CMPXCHG16B.

AMD has no such guarantee (at least for now), so we still need LOCK CMPXCHG16B
on old Intel CPUs and (old or new) AMD CPUs.

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

end of thread, other threads:[~2023-02-15 16:09 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 14:22 [Bug target/104688] New: gcc and libatomic can use SSE for 128-bit atomic loads on Intel CPUs with AVX xry111 at mengyan1223 dot wang
2022-02-25 14:30 ` [Bug target/104688] " jakub at gcc dot gnu.org
2022-02-25 14:33 ` xry111 at mengyan1223 dot wang
2022-02-25 14:34 ` fw at gcc dot gnu.org
2022-02-25 16:36 ` jakub at gcc dot gnu.org
2022-02-25 16:37 ` jakub at gcc dot gnu.org
2022-03-17 17:50 ` cvs-commit at gcc dot gnu.org
2022-03-29  5:54 ` cvs-commit at gcc dot gnu.org
2022-04-05 12:30 ` xry111 at mengyan1223 dot wang
2022-04-05 12:35 ` jakub at gcc dot gnu.org
2022-11-14  3:31 ` Ganesh.Gopalasubramanian at amd dot com
2022-11-14  4:58 ` sam at gentoo dot org
2022-11-14  5:10 ` [Bug target/104688] gcc and libatomic can use SSE for 128-bit atomic loads on Intel and AMD " xry111 at gcc dot gnu.org
2022-11-14  7:54 ` jakub at gcc dot gnu.org
2022-11-14  9:24 ` amonakov at gcc dot gnu.org
2022-11-14  9:29 ` jakub at gcc dot gnu.org
2022-11-14  9:52 ` amonakov at gcc dot gnu.org
2022-11-15  7:18 ` cvs-commit at gcc dot gnu.org
2022-11-15  7:20 ` jakub at gcc dot gnu.org
2022-11-20 23:11 ` cvs-commit at gcc dot gnu.org
2022-11-21  9:23 ` cvs-commit at gcc dot gnu.org
2022-11-23  9:18 ` xry111 at gcc dot gnu.org
2022-11-23  9:51 ` jakub at gcc dot gnu.org
2022-11-23 10:23 ` xry111 at gcc dot gnu.org
2022-11-28 18:35 ` peter at cordes dot ca
2022-11-28 18:46 ` amonakov at gcc dot gnu.org
2022-11-28 19:03 ` peter at cordes dot ca
2022-11-28 20:11 ` amonakov at gcc dot gnu.org
2022-11-28 20:47 ` peter at cordes dot ca
2022-11-29  8:11 ` fw at gcc dot gnu.org
2023-02-15 12:27 ` segher at gcc dot gnu.org
2023-02-15 12:46 ` fw at gcc dot gnu.org
2023-02-15 16:03 ` segher at gcc dot gnu.org
2023-02-15 16:07 ` pinskia at gcc dot gnu.org
2023-02-15 16:09 ` segher 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).