mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
[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. llvm-svn: 336217
This commit is contained in:
parent
29611158cd
commit
3f59f2298f
@ -1099,7 +1099,7 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo,
|
||||
// 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))
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user