https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120361
Bug ID: 120361 Summary: Why does prefetch_write() not generate a PREFETCHW instruction? Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: LYN_2019 at outlook dot com Target Milestone: --- https://godbolt.org/z/a8h8EoE7n x86_64-linug-gnu-gcc(trunk) ```cpp void prefetch_read(void const* i) { __builtin_prefetch(i, static_cast<int>(false), 1); } void prefetch_write(void const* i) { __builtin_prefetch(i, static_cast<int>(true), 1); } ``` ```asm prefetch_read(void const*): prefetcht2 [rdi] ret prefetch_write(void const*): prefetcht2 [rdi] ret ``` Why does prefetch_write() not generate a PREFETCHW instruction? https://www.felixcloutier.com/x86/prefetchw https://www.felixcloutier.com/x86/prefetchh