forked from OSchip/llvm-project
[mips] Set microMIPS ASE flag
This patch fixes an issue where microMIPS ASE flag is not set when a function has micromips attribute or when .set micromips directive is used. Differential Revision: https://reviews.llvm.org/D40316 llvm-svn: 318948
This commit is contained in:
parent
dd2f1c993e
commit
590f0793e8
|
@ -2273,8 +2273,10 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
|
||||||
|
|
||||||
// We know we emitted an instruction on the MER_NotAMacro or MER_Success path.
|
// We know we emitted an instruction on the MER_NotAMacro or MER_Success path.
|
||||||
// If we're in microMIPS mode then we must also set EF_MIPS_MICROMIPS.
|
// If we're in microMIPS mode then we must also set EF_MIPS_MICROMIPS.
|
||||||
if (inMicroMipsMode())
|
if (inMicroMipsMode()) {
|
||||||
TOut.setUsesMicroMips();
|
TOut.setUsesMicroMips();
|
||||||
|
TOut.updateABIInfo(*this);
|
||||||
|
}
|
||||||
|
|
||||||
// If this instruction has a delay slot and .set reorder is active,
|
// If this instruction has a delay slot and .set reorder is active,
|
||||||
// emit a NOP after it.
|
// emit a NOP after it.
|
||||||
|
|
|
@ -361,6 +361,7 @@ void MipsAsmPrinter::EmitFunctionEntryLabel() {
|
||||||
if (Subtarget->inMicroMipsMode()) {
|
if (Subtarget->inMicroMipsMode()) {
|
||||||
TS.emitDirectiveSetMicroMips();
|
TS.emitDirectiveSetMicroMips();
|
||||||
TS.setUsesMicroMips();
|
TS.setUsesMicroMips();
|
||||||
|
TS.updateABIInfo(*Subtarget);
|
||||||
} else
|
} else
|
||||||
TS.emitDirectiveSetNoMicroMips();
|
TS.emitDirectiveSetNoMicroMips();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
; RUN: llc -mtriple=mips-unknown-linux -filetype=obj %s -o - | \
|
||||||
|
; RUN: llvm-readobj -mips-abi-flags | \
|
||||||
|
; RUN: FileCheck --check-prefix=ASE-MICROMIPS %s
|
||||||
|
|
||||||
|
define void @_Z3foov() #0 {
|
||||||
|
entry:
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
attributes #0 = { "micromips" }
|
||||||
|
|
||||||
|
; ASE-MICROMIPS: microMIPS (0x800)
|
|
@ -0,0 +1,10 @@
|
||||||
|
# RUN: llvm-mc -triple=mips-unknown-linux -filetype=obj %s -o - | \
|
||||||
|
# RUN: llvm-readobj -mips-abi-flags | \
|
||||||
|
# RUN: FileCheck --check-prefix=ASE-MICROMIPS %s
|
||||||
|
|
||||||
|
.set micromips
|
||||||
|
.ent _Z3foov
|
||||||
|
_Z3foov:
|
||||||
|
addiu $sp, $sp, -8
|
||||||
|
|
||||||
|
# ASE-MICROMIPS: microMIPS (0x800)
|
Loading…
Reference in New Issue