[llvm-commits] [llvm] r165878 - in /llvm/trunk: lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp test/MC/X86/x86_nop.s

Benjamin Kramer benny.kra at googlemail.com
Sat Oct 13 10:28:35 PDT 2012


Author: d0k
Date: Sat Oct 13 12:28:35 2012
New Revision: 165878

URL: http://llvm.org/viewvc/llvm-project?rev=165878&view=rev
Log:
X86: Disable long nops for all cpus prior to pentiumpro/i686.

Modified:
    llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
    llvm/trunk/test/MC/X86/x86_nop.s

Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp?rev=165878&r1=165877&r2=165878&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Sat Oct 13 12:28:35 2012
@@ -307,7 +307,9 @@
   };
 
   // This CPU doesnt support long nops. If needed add more.
-  if (CPU == "geode") {
+  // FIXME: Can we get this from the subtarget somehow?
+  if (CPU == "generic" || CPU == "i386" || CPU == "i486" || CPU == "i586" ||
+      CPU == "pentium" || CPU == "pentium-mmx" || CPU == "geode") {
     for (uint64_t i = 0; i < Count; ++i)
       OW->Write8(0x90);
     return true;

Modified: llvm/trunk/test/MC/X86/x86_nop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86_nop.s?rev=165878&r1=165877&r2=165878&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86_nop.s (original)
+++ llvm/trunk/test/MC/X86/x86_nop.s Sat Oct 13 12:28:35 2012
@@ -1,5 +1,11 @@
-# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=geode %s -o %t
-# RUN: llvm-objdump -disassemble %t | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=generic %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=i386 %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=i486 %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=i586 %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=pentium %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=pentium-mmx %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=geode %s | llvm-objdump -d - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -mcpu=i686 %s | llvm-objdump -d - | not FileCheck %s
 
 # CHECK-NOT: nopw
 inc %eax





More information about the llvm-commits mailing list