Re: [PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-18 Thread Jonathan Looney via cfe-commits
On Fri, Feb 16, 2018 at 6:21 PM, Dimitry Andric wrote: > On 17 Feb 2018, at 00:12, Craig Topper via Phabricator < > revi...@reviews.llvm.org> wrote: > > > > craig.topper added inline comments. > > > > > > > > Comment at: lib/Basic/Targets/X86.cpp:1049 > > > > + if (HasLAHFSAHF)

[PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-16 Thread Dimitry Andric via Phabricator via cfe-commits
dim updated this revision to Diff 134746. dim added a comment. Added the `sahf` feature for knm, knl and amdfam10 too. Repository: rC Clang https://reviews.llvm.org/D43394 Files: include/clang/Driver/Options.td lib/Basic/Targets/X86.cpp lib/Basic/Targets/X86.h test/CodeGen/attr-targe

Re: [PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-16 Thread Dimitry Andric via cfe-commits
On 17 Feb 2018, at 00:12, Craig Topper via Phabricator wrote: > > craig.topper added inline comments. > > > > Comment at: lib/Basic/Targets/X86.cpp:1049 > > + if (HasLAHFSAHF) > +Builder.defineMacro("__LAHFSAHF__"); > > dim wrote: >> craig.topper wrote:

[PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-16 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: lib/Basic/Targets/X86.cpp:1049 + if (HasLAHFSAHF) +Builder.defineMacro("__LAHFSAHF__"); dim wrote: > craig.topper wrote: > > Does gcc define this? It's such a low level instruction I have a hard time > > bel

[PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-16 Thread Dimitry Andric via Phabricator via cfe-commits
dim added inline comments. Comment at: lib/Basic/Targets/X86.cpp:1049 + if (HasLAHFSAHF) +Builder.defineMacro("__LAHFSAHF__"); craig.topper wrote: > Does gcc define this? It's such a low level instruction I have a hard time > believing this define would b

[PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-16 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: lib/Basic/Targets/X86.cpp:295 setFeatureEnabledImpl(Features, "xsave", true); setFeatureEnabledImpl(Features, "movbe", true); break; KNM and KNL should both have sahf Comment at: li

[PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

2018-02-16 Thread Dimitry Andric via Phabricator via cfe-commits
dim created this revision. dim added reviewers: craig.topper, coby, efriedma, rsmith. Make clang accept `-msahf` (and `-mno-sahf`) flags to activate the `+sahf` feature for the backend, for bug 36028 (Incorrect use of pushf/popf enables/disables interrupts on amd64 kernels). This was originally s