llvm.org GIT mirror llvm / d654cf3
Approved by Chris $ svn merge -c 113894 https://llvm.org/svn/llvm-project/llvm/trunk --- Merging r113894 into '.': U test/MC/AsmParser/X86/x86_instructions.s U lib/Target/X86/AsmParser/X86AsmParser.cpp Log: add a terrible hack to allow out with dx is parens, a gas bug. This fixes PR8114 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_28@113896 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 10 years ago
2 changed file(s) with 23 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
814814 Operands.erase(Operands.begin() + 1);
815815 }
816816
817 // FIXME: Hack to handle "out[bwl]? %al, (%dx)" -> "outb %al, %dx".
818 if ((Name == "outb" || Name == "outw" || Name == "outl" || Name == "out") &&
819 Operands.size() == 3) {
820 X86Operand &Op = *(X86Operand*)Operands.back();
821 if (Op.isMem() && Op.Mem.SegReg == 0 &&
822 isa(Op.Mem.Disp) &&
823 cast(Op.Mem.Disp)->getValue() == 0 &&
824 Op.Mem.BaseReg == MatchRegisterName("dx") && Op.Mem.IndexReg == 0) {
825 SMLoc Loc = Op.getEndLoc();
826 Operands.back() = X86Operand::CreateReg(Op.Mem.BaseReg, Loc, Loc);
827 delete &Op;
828 }
829 }
830
817831 // FIXME: Hack to handle "f{mul*,add*,sub*,div*} $op, st(0)" the same as
818832 // "f{mul*,add*,sub*,div*} $op"
819833 if ((Name.startswith("fmul") || Name.startswith("fadd") ||
163163
164164 // CHECK: imull %ecx, %eax
165165 imull %ecx, %eax
166
167 // PR8114
168 // CHECK: outb %al, %dx
169 // CHECK: outw %ax, %dx
170 // CHECK: outl %eax, %dx
171
172 out %al, (%dx)
173 out %ax, (%dx)
174 outl %eax, (%dx)