aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-26 11:20:48 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-26 11:20:48 +0000
commit5943d4e3eea9ad5ef55618c075262337463aafa9 (patch)
tree733ca4020baa5b3489963004dbd61a89f8e2f15a /lib
parentb5c8cf3ccd7a3cf27044a0f1c160bb4133b42eea (diff)
downloadexternal_llvm-5943d4e3eea9ad5ef55618c075262337463aafa9.zip
external_llvm-5943d4e3eea9ad5ef55618c075262337463aafa9.tar.gz
external_llvm-5943d4e3eea9ad5ef55618c075262337463aafa9.tar.bz2
Merging r195684:
------------------------------------------------------------------------ r195684 | rafael | 2013-11-25 12:50:03 -0800 (Mon, 25 Nov 2013) | 3 lines Do the string comparison in the constructor instead of once per nop. Thanks to Roman Divacky for the suggestion. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
index 1c6f071..f8e359b 100644
--- a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
@@ -68,9 +68,16 @@ public:
class X86AsmBackend : public MCAsmBackend {
StringRef CPU;
+ bool HasNopl;
public:
X86AsmBackend(const Target &T, StringRef _CPU)
- : MCAsmBackend(), CPU(_CPU) {}
+ : MCAsmBackend(), CPU(_CPU) {
+ HasNopl = CPU != "generic" && CPU != "i386" && CPU != "i486" &&
+ CPU != "i586" && CPU != "pentium" && CPU != "pentium-mmx" &&
+ CPU != "i686" && CPU != "k6" && CPU != "k6-2" && CPU != "k6-3" &&
+ CPU != "geode" && CPU != "winchip-c6" && CPU != "winchip2" &&
+ CPU != "c3" && CPU != "c3-2";
+ }
unsigned getNumFixupKinds() const {
return X86::NumTargetFixupKinds;
@@ -310,11 +317,7 @@ bool X86AsmBackend::writeNopData(uint64_t Count, MCObjectWriter *OW) const {
// This CPU doesnt support long nops. If needed add more.
// FIXME: Can we get this from the subtarget somehow?
// FIXME: We could generated something better than plain 0x90.
- if (CPU == "generic" || CPU == "i386" || CPU == "i486" || CPU == "i586" ||
- CPU == "pentium" || CPU == "pentium-mmx" || CPU == "i686" ||
- CPU == "k6" || CPU == "k6-2" || CPU == "k6-3" || CPU == "geode" ||
- CPU == "winchip-c6" || CPU == "winchip2" || CPU == "c3" ||
- CPU == "c3-2") {
+ if (!HasNopl) {
for (uint64_t i = 0; i < Count; ++i)
OW->Write8(0x90);
return true;