summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatheus Almeida <matheus.almeida@imgtec.com>2014-04-16 11:46:59 +0000
committerMatheus Almeida <matheus.almeida@imgtec.com>2014-04-16 11:46:59 +0000
commitdc7e48e084b7ba9f3423714d5d9fccaf1e644d03 (patch)
tree25975fa1d15e58eb5fe845ac7242fe33fab0c06f
parent58ce7f24cda77496ef31c150424bdf7a9e4c70d7 (diff)
downloadbcm5719-llvm-dc7e48e084b7ba9f3423714d5d9fccaf1e644d03.tar.gz
bcm5719-llvm-dc7e48e084b7ba9f3423714d5d9fccaf1e644d03.zip
[mips] Emit '.set nomicromips' before a function's entry label
if not in micromips mode. The test (elf_st_other.ll) was renamed as the name and description didn't make sense as the test wasn't checking any symbol table entry. Differential Revision: http://reviews.llvm.org/D3346 llvm-svn: 206377
-rw-r--r--llvm/lib/Target/Mips/MipsAsmPrinter.cpp5
-rw-r--r--llvm/test/CodeGen/Mips/elf_st_other.ll12
-rw-r--r--llvm/test/CodeGen/Mips/micromips-directives.ll16
3 files changed, 18 insertions, 15 deletions
diff --git a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
index d5df855a5ec..a3d34f64635 100644
--- a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -285,9 +285,8 @@ void MipsAsmPrinter::EmitFunctionEntryLabel() {
if (Subtarget->inMicroMipsMode())
TS.emitDirectiveSetMicroMips();
- // leave out until FSF available gas has micromips changes
- // else
- // TS.emitDirectiveSetNoMicroMips();
+ else
+ TS.emitDirectiveSetNoMicroMips();
if (Subtarget->inMips16Mode())
TS.emitDirectiveSetMips16();
diff --git a/llvm/test/CodeGen/Mips/elf_st_other.ll b/llvm/test/CodeGen/Mips/elf_st_other.ll
deleted file mode 100644
index 8a5f20df861..00000000000
--- a/llvm/test/CodeGen/Mips/elf_st_other.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; This tests value of ELF st_other field for function symbol table entries.
-; For microMIPS value should be equal to STO_MIPS_MICROMIPS.
-
-; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | FileCheck %s
-
-define i32 @main() nounwind {
-entry:
- ret i32 0
-}
-
-; CHECK: .set micromips
-; CHECK: main:
diff --git a/llvm/test/CodeGen/Mips/micromips-directives.ll b/llvm/test/CodeGen/Mips/micromips-directives.ll
new file mode 100644
index 00000000000..dd0bd5836d2
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/micromips-directives.ll
@@ -0,0 +1,16 @@
+; This test checks if the '.set [no]micromips' directives
+; are emitted before a function's entry label.
+
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | \
+; RUN: FileCheck %s -check-prefix=CHECK-MM
+; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=-micromips %s -o - | \
+; RUN: FileCheck %s -check-prefix=CHECK-NO-MM
+
+define i32 @main() nounwind {
+entry:
+ ret i32 0
+}
+
+; CHECK-MM: .set micromips
+; CHECK-NO-MM: .set nomicromips
+; CHECK: main:
OpenPOWER on IntegriCloud