]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86 - add speculation_barrier pattern
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Aug 2018 08:16:38 +0000 (08:16 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Aug 2018 08:16:38 +0000 (08:16 +0000)
commit5812770a029b1a49b72cabf08b2f202d2d00dc69
treef062402e6442ac356e0f274656bcad1c4f5e332e
parentd6470854446446a4e8b3b958a00e5013ed86ae7f
x86 - add speculation_barrier pattern

This patch adds a speculation barrier for x86, based on my
understanding of the required mitigation for that CPU, which is to use
an lfence instruction.

This patch needs some review by an x86 expert and if adjustments are
needed, I'd appreciate it if they could be picked up by the port
maintainer.  This is supposed to serve as an example of how to deploy
the new __builtin_speculation_safe_value() intrinsic on this
architecture.

* config/i386/i386.md (unspecv): Add UNSPECV_SPECULATION_BARRIER.
(speculation_barrier): New insn.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263196 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/i386/i386.md