[PATCH] D40316: [mips] Set microMIPS ASE flag

Aleksandar Beserminji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 24 06:01:10 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL318948: [mips] Set microMIPS ASE flag (authored by abeserminji).

Changed prior to commit:
  https://reviews.llvm.org/D40316?vs=123903&id=124187#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40316

Files:
  llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
  llvm/trunk/test/CodeGen/Mips/micromips-ase-function-attribute.ll
  llvm/trunk/test/MC/Mips/micromips-ase-directive.s


Index: llvm/trunk/test/CodeGen/Mips/micromips-ase-function-attribute.ll
===================================================================
--- llvm/trunk/test/CodeGen/Mips/micromips-ase-function-attribute.ll
+++ llvm/trunk/test/CodeGen/Mips/micromips-ase-function-attribute.ll
@@ -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)
Index: llvm/trunk/test/MC/Mips/micromips-ase-directive.s
===================================================================
--- llvm/trunk/test/MC/Mips/micromips-ase-directive.s
+++ llvm/trunk/test/MC/Mips/micromips-ase-directive.s
@@ -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)
Index: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -361,6 +361,7 @@
   if (Subtarget->inMicroMipsMode()) {
     TS.emitDirectiveSetMicroMips();
     TS.setUsesMicroMips();
+    TS.updateABIInfo(*Subtarget);
   } else
     TS.emitDirectiveSetNoMicroMips();
 
Index: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -2273,8 +2273,10 @@
 
   // 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 (inMicroMipsMode())
+  if (inMicroMipsMode()) {
     TOut.setUsesMicroMips();
+    TOut.updateABIInfo(*this);
+  }
 
   // If this instruction has a delay slot and .set reorder is active,
   // emit a NOP after it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40316.124187.patch
Type: text/x-patch
Size: 2179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171124/94d8dde6/attachment.bin>


More information about the llvm-commits mailing list