diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-12-04 23:00:33 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-12-04 23:00:33 +0000 |
commit | 5000ce8a632c701aba09ddfa6d4bc33ae1b6f5a5 (patch) | |
tree | ae02f06e6e57385712e8cd41ded1a8af676109a6 /llvm/lib/Target/X86/X86Subtarget.h | |
parent | 3e9e7d28225fd7d262c660cf19429930d3bc2991 (diff) | |
download | bcm5719-llvm-5000ce8a632c701aba09ddfa6d4bc33ae1b6f5a5.tar.gz bcm5719-llvm-5000ce8a632c701aba09ddfa6d4bc33ae1b6f5a5.zip |
X86: Don't emit SAHF/LAHF for 64-bit targets unless explicitly supported
These instructions are not supported by all CPUs in 64-bit mode. Emitting them
causes Chromium to crash on start-up for users with such chips.
(GCC puts these instructions behind -msahf on 64-bit for the same reason.)
This patch adds FeatureLAHFSAHF, enables it by default for 32-bit targets
and modern CPUs, and changes X86InstrInfo::copyPhysReg back to the lowering
from before r244503 when the instructions are not available.
Differential Revision: http://reviews.llvm.org/D15240
llvm-svn: 254793
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.h')
-rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h index 353b4f7f5eb..83bc640976a 100644 --- a/llvm/lib/Target/X86/X86Subtarget.h +++ b/llvm/lib/Target/X86/X86Subtarget.h @@ -152,6 +152,9 @@ protected: /// Processor has RDSEED instructions. bool HasRDSEED; + /// Processor has LAHF/SAHF instructions. + bool HasLAHFSAHF; + /// True if BT (bit test) of memory instructions are slow. bool IsBTMemSlow; @@ -374,6 +377,7 @@ public: bool hasSHA() const { return HasSHA; } bool hasPRFCHW() const { return HasPRFCHW; } bool hasRDSEED() const { return HasRDSEED; } + bool hasLAHFSAHF() const { return HasLAHFSAHF; } bool isBTMemSlow() const { return IsBTMemSlow; } bool isSHLDSlow() const { return IsSHLDSlow; } bool isUnalignedMem16Slow() const { return IsUAMem16Slow; } |