diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-06 18:52:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-06 18:52:40 +0000 |
commit | ec66010e800c687f9940ef21845014d3bd61067e (patch) | |
tree | 9733142a4ce19c79209b617d76da2f4f7f696e68 | |
parent | 6881e175c3a3d4ccb48d95e3ce4befaf6c0a0b01 (diff) | |
download | bcm5719-llvm-ec66010e800c687f9940ef21845014d3bd61067e.tar.gz bcm5719-llvm-ec66010e800c687f9940ef21845014d3bd61067e.zip |
move in/out aliases to the .td files.
llvm-svn: 118348
-rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.td | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index eaff6a4d6bd..69e6b5a78cf 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -797,22 +797,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, Operands.push_back(X86Operand::CreateReg(Reg, Loc, Loc)); } - // FIXME: Hack to handle recognize "out[bwl] <op>". Canonicalize it to - // "outb %al, <op>". - if ((Name == "outb" || Name == "outw" || Name == "outl") && - Operands.size() == 2) { - unsigned Reg; - if (Name[3] == 'b') - Reg = MatchRegisterName("al"); - else if (Name[3] == 'w') - Reg = MatchRegisterName("ax"); - else - Reg = MatchRegisterName("eax"); - SMLoc Loc = Operands.back()->getEndLoc(); - Operands.push_back(X86Operand::CreateReg(Reg, Loc, Loc)); - std::swap(Operands[1], Operands[2]); - } - // FIXME: Hack to handle "out[bwl]? %al, (%dx)" -> "outb %al, %dx". if ((Name == "outb" || Name == "outw" || Name == "outl" || Name == "out") && Operands.size() == 3) { diff --git a/llvm/lib/Target/X86/X86InstrInfo.td b/llvm/lib/Target/X86/X86InstrInfo.td index 88079615cb5..58573786cf8 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.td +++ b/llvm/lib/Target/X86/X86InstrInfo.td @@ -1388,6 +1388,14 @@ def : InstAlias<"imull $imm, $r", (IMUL32rri8 GR32:$r, GR32:$r, i32i8imm:$imm)>; def : InstAlias<"imulq $imm, $r",(IMUL64rri32 GR64:$r, GR64:$r,i64i32imm:$imm)>; def : InstAlias<"imulq $imm, $r", (IMUL64rri8 GR64:$r, GR64:$r, i64i8imm:$imm)>; +// inb %dx -> inb %al, %dx +def : InstAlias<"inb %dx", (IN8rr)>; +def : InstAlias<"inw %dx", (IN16rr)>; +def : InstAlias<"inl %dx", (IN32rr)>; +def : InstAlias<"inb $port", (IN8ri i8imm:$port)>; +def : InstAlias<"inw $port", (IN16rir i8imm:$port)>; +def : InstAlias<"inl $port", (IN32ri i8imm:$port)>; + // jmp and call aliases for lcall and ljmp. jmp $42,$5 -> ljmp def : InstAlias<"call $seg, $off", (FARCALL32i i32imm:$off, i16imm:$seg)>; @@ -1423,6 +1431,14 @@ def : InstAlias<"movzx $src, $dst", (MOVZX64rr8_Q GR64:$dst, GR8:$src)>; def : InstAlias<"movzx $src, $dst", (MOVZX64rr16_Q GR64:$dst, GR16:$src)>; // Note: No GR32->GR64 movzx form. +// outb %dx -> outb %al, %dx +def : InstAlias<"outb %dx", (OUT8rr)>; +def : InstAlias<"outw %dx", (OUT16rr)>; +def : InstAlias<"outl %dx", (OUT32rr)>; +def : InstAlias<"outb $port", (OUT8ir i8imm:$port)>; +def : InstAlias<"outw $port", (OUT16ir i8imm:$port)>; +def : InstAlias<"outl $port", (OUT32ir i8imm:$port)>; + // 'sldt <mem>' can be encoded with either sldtw or sldtq with the same // effect (both store to a 16-bit mem). Force to sldtw to avoid ambiguity // errors, since its encoding is the most compact. |