diff --git a/lib/Target/X86/MachineCodeEmitter.cpp b/lib/Target/X86/MachineCodeEmitter.cpp index efef5a0f734..b5b1a0d754f 100644 --- a/lib/Target/X86/MachineCodeEmitter.cpp +++ b/lib/Target/X86/MachineCodeEmitter.cpp @@ -148,7 +148,7 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI, emitConstant(Disp.getImmedValue(), 1); } else { // Emit the most general non-SIB encoding: [REG+disp32] - MCE.emitByte(ModRMByte(1, RegOpcodeField, BaseRegNo)); + MCE.emitByte(ModRMByte(2, RegOpcodeField, BaseRegNo)); emitConstant(Disp.getImmedValue(), 4); } } diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index efef5a0f734..b5b1a0d754f 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -148,7 +148,7 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI, emitConstant(Disp.getImmedValue(), 1); } else { // Emit the most general non-SIB encoding: [REG+disp32] - MCE.emitByte(ModRMByte(1, RegOpcodeField, BaseRegNo)); + MCE.emitByte(ModRMByte(2, RegOpcodeField, BaseRegNo)); emitConstant(Disp.getImmedValue(), 4); } }