[X86] Limit NOPs to 7 bytes when 'slm' is spelled 'silvermont'.
authorCraig Topper <craig.topper@intel.com>
Mon, 13 Nov 2017 08:17:30 +0000 (08:17 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 13 Nov 2017 08:17:30 +0000 (08:17 +0000)
We support 2 spelling for silvermont and we should accept both here.

llvm-svn: 318023

llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
llvm/test/MC/X86/x86_long_nop.s

index a5cecf0..580570c 100644 (file)
@@ -76,7 +76,7 @@ class X86AsmBackend : public MCAsmBackend {
 public:
   X86AsmBackend(const Target &T, StringRef CPU)
       : MCAsmBackend(), CPU(CPU),
-        MaxNopLength((CPU == "slm") ? 7 : 15) {
+        MaxNopLength((CPU == "slm" || CPU == "silvermont") ? 7 : 15) {
     HasNopl = CPU != "generic" && CPU != "i386" && CPU != "i486" &&
               CPU != "i586" && CPU != "pentium" && CPU != "pentium-mmx" &&
               CPU != "i686" && CPU != "k6" && CPU != "k6-2" && CPU != "k6-3" &&
index 0657ece..fa8525b 100644 (file)
@@ -3,6 +3,7 @@
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=x86_64-apple-darwin10.0 %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-apple-darwin8 %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu -mcpu=slm %s | llvm-objdump -d -no-show-raw-insn - | FileCheck --check-prefix=LNOP7 %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu -mcpu=silvermont %s | llvm-objdump -d -no-show-raw-insn - | FileCheck --check-prefix=LNOP7 %s
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu -mcpu=lakemont %s | llvm-objdump -d -no-show-raw-insn - | FileCheck --check-prefix=NOP1 %s
 
 # Ensure alignment directives also emit sequences of 15-byte NOPs on processors