1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

X86: Disable long nops for all cpus prior to pentiumpro/i686.

llvm-svn: 165878
This commit is contained in:
Benjamin Kramer 2012-10-13 17:28:35 +00:00
parent 4aac24404c
commit 80915069f7
2 changed files with 11 additions and 3 deletions

View File

@ -307,7 +307,9 @@ bool X86AsmBackend::writeNopData(uint64_t Count, MCObjectWriter *OW) const {
};
// 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;

View File

@ -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