mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Fix rdar://8456364 - llvm-mc rejects '%CS'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0c289c140e
commit
33d60d5e56
@ -10,20 +10,21 @@
|
||||
#include "llvm/Target/TargetAsmParser.h"
|
||||
#include "X86.h"
|
||||
#include "X86Subtarget.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/Target/TargetAsmParser.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCInst.h"
|
||||
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
||||
#include "llvm/MC/MCParser/MCAsmParser.h"
|
||||
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Support/SourceMgr.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/Target/TargetAsmParser.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
@ -373,14 +374,18 @@ bool X86ATTAsmParser::ParseRegister(unsigned &RegNo,
|
||||
// validation later, so maybe there is no need for this here.
|
||||
RegNo = MatchRegisterName(Tok.getString());
|
||||
|
||||
// If the match failed, try the register name as lowercase.
|
||||
if (RegNo == 0)
|
||||
RegNo = MatchRegisterName(LowercaseString(Tok.getString()));
|
||||
|
||||
// FIXME: This should be done using Requires<In32BitMode> and
|
||||
// Requires<In64BitMode> so "eiz" usage in 64-bit instructions
|
||||
// can be also checked.
|
||||
if (RegNo == X86::RIZ && !Is64Bit)
|
||||
return Error(Tok.getLoc(), "riz register in 64-bit mode only");
|
||||
|
||||
// Parse %st(1) and "%st" as "%st(0)"
|
||||
if (RegNo == 0 && Tok.getString() == "st") {
|
||||
// Parse "%st" as "%st(0)" and "%st(1)", which is multiple tokens.
|
||||
if (RegNo == 0 && (Tok.getString() == "st" || Tok.getString() == "ST")) {
|
||||
RegNo = X86::ST0;
|
||||
EndLoc = Tok.getLoc();
|
||||
Parser.Lex(); // Eat 'st'
|
||||
|
@ -316,3 +316,6 @@ enter $0x7ace,$0x7f
|
||||
// CHECK: encoding: [0xd9,0x18]
|
||||
fstp (%eax)
|
||||
|
||||
// rdar://8456364
|
||||
// CHECK: movw %cs, %ax
|
||||
mov %CS, %ax
|
||||
|
Loading…
x
Reference in New Issue
Block a user