X86: Disable long nops for all cpus prior to pentiumpro/i686.
llvm-svn: 165878
This commit is contained in:
		
							parent
							
								
									ea82bd7f0d
								
							
						
					
					
						commit
						35480284e7
					
				| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue