[llvm] r336217 - [X86][AsmParser] Don't consider %eip as a valid register outside of 32-bit mode.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 3 10:40:52 PDT 2018
Author: ctopper
Date: Tue Jul 3 10:40:51 2018
New Revision: 336217
URL: http://llvm.org/viewvc/llvm-project?rev=336217&view=rev
Log:
[X86][AsmParser] Don't consider %eip as a valid register outside of 32-bit mode.
This might make the error message added in r335668 unneeded, but I'm not sure yet.
The check for RIP is technically unnecessary since RIP is in GR64, but that fact is kind of surprising so be explicit.
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/test/CodeGen/X86/eip-addressing-i386.ll
llvm/trunk/test/MC/X86/x86_errors.s
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=336217&r1=336216&r2=336217&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Jul 3 10:40:51 2018
@@ -1099,7 +1099,7 @@ bool X86AsmParser::ParseRegister(unsigne
// checked.
// FIXME: Check AH, CH, DH, BH cannot be used in an instruction requiring a
// REX prefix.
- if (RegNo == X86::RIZ ||
+ if (RegNo == X86::RIZ || RegNo == X86::RIP || RegNo == X86::EIP ||
X86MCRegisterClasses[X86::GR64RegClassID].contains(RegNo) ||
X86II::isX86_64NonExtLowByteReg(RegNo) ||
X86II::isX86_64ExtendedReg(RegNo))
Modified: llvm/trunk/test/CodeGen/X86/eip-addressing-i386.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/eip-addressing-i386.ll?rev=336217&r1=336216&r2=336217&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/eip-addressing-i386.ll (original)
+++ llvm/trunk/test/CodeGen/X86/eip-addressing-i386.ll Tue Jul 3 10:40:51 2018
@@ -1,5 +1,5 @@
; RUN: not llc -mtriple i386-apple-- -o /dev/null < %s 2>&1| FileCheck %s
-; CHECK: <inline asm>:1:13: error: RIP-relative addressing requires 64-bit mode
+; CHECK: <inline asm>:1:13: error: register %eip is only available in 64-bit mode
; CHECK-NEXT: jmpl *_foo(%eip)
; Make sure that we emit an error if we encounter RIP-relative instructions in
Modified: llvm/trunk/test/MC/X86/x86_errors.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86_errors.s?rev=336217&r1=336216&r2=336217&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86_errors.s (original)
+++ llvm/trunk/test/MC/X86/x86_errors.s Tue Jul 3 10:40:51 2018
@@ -103,11 +103,11 @@ lea (%si,%bx), %ax
// 64: error: invalid 16-bit base register
lea (%di,%bx), %ax
-// 32: error: invalid base+index expression
+// 32: error: register %eip is only available in 64-bit mode
// 64: error: invalid base+index expression
mov (,%eip), %rbx
-// 32: error: invalid base+index expression
+// 32: error: register %eip is only available in 64-bit mode
// 64: error: invalid base+index expression
mov (%eip,%eax), %rbx
More information about the llvm-commits
mailing list