mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
[x86] Fix printing of register operands with q modifier.
Emit 32-bit register names instead of 64-bit register names if the target does not have 64-bit general purpose registers. <rdar://problem/14653996> llvm-svn: 205067
This commit is contained in:
parent
400f67a1c7
commit
cca54c2eea
@ -363,9 +363,11 @@ static bool printAsmMRegister(X86AsmPrinter &P, const MachineOperand &MO,
|
|||||||
case 'k': // Print SImode register
|
case 'k': // Print SImode register
|
||||||
Reg = getX86SubSuperRegister(Reg, MVT::i32);
|
Reg = getX86SubSuperRegister(Reg, MVT::i32);
|
||||||
break;
|
break;
|
||||||
case 'q': // Print DImode register
|
case 'q':
|
||||||
// FIXME: gcc will actually print e instead of r for 32-bit.
|
// Print 64-bit register names if 64-bit integer registers are available.
|
||||||
Reg = getX86SubSuperRegister(Reg, MVT::i64);
|
// Otherwise, print 32-bit register names.
|
||||||
|
MVT::SimpleValueType Ty = P.getSubtarget().is64Bit() ? MVT::i64 : MVT::i32;
|
||||||
|
Reg = getX86SubSuperRegister(Reg, Ty);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
test/CodeGen/X86/inline-asm-modifier-q.ll
Normal file
12
test/CodeGen/X86/inline-asm-modifier-q.ll
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
; RUN: llc < %s -march=x86 -no-integrated-as | FileCheck %s
|
||||||
|
|
||||||
|
; If the target does not have 64-bit integer registers, emit 32-bit register
|
||||||
|
; names.
|
||||||
|
|
||||||
|
; CHECK: movq (%e{{[abcd]}}x, %ebx, 4)
|
||||||
|
|
||||||
|
define void @q_modifier(i32* %p) {
|
||||||
|
entry:
|
||||||
|
tail call void asm sideeffect "movq (${0:q}, %ebx, 4), %mm0", "r,~{dirflag},~{fpsr},~{flags}"(i32* %p)
|
||||||
|
ret void
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user