aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-09-21 01:37:52 +0000
committerReed Kotler <rkotler@mips.com>2013-09-21 01:37:52 +0000
commited7fd711a1917a31714d3f9a41210916be450079 (patch)
treee114dbee6b6ce33665902d032bd1553ab1722c85
parenta9baf1ecfd343e2d8d8fa277c8b093a1869726bb (diff)
downloadexternal_llvm-ed7fd711a1917a31714d3f9a41210916be450079.zip
external_llvm-ed7fd711a1917a31714d3f9a41210916be450079.tar.gz
external_llvm-ed7fd711a1917a31714d3f9a41210916be450079.tar.bz2
Set .reorder for the stub so that gas takes care of delay slot processing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191125 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/Mips/Mips16HardFloat.cpp4
-rw-r--r--test/CodeGen/Mips/fptr2.ll20
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/Target/Mips/Mips16HardFloat.cpp b/lib/Target/Mips/Mips16HardFloat.cpp
index a73d162..14a9424 100644
--- a/lib/Target/Mips/Mips16HardFloat.cpp
+++ b/lib/Target/Mips/Mips16HardFloat.cpp
@@ -441,8 +441,10 @@ static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
IAH.Out(".reloc 0,R_MIPS_NONE," + Name);
IAH.Out("la $$25," + LocalName);
}
- else
+ else {
+ IAH.Out(".set reorder");
IAH.Out("la $$25, " + Name);
+ }
swapFPIntParams(PV, M, IAH, LE, false);
IAH.Out("jr $$25");
IAH.Out(LocalName + " = " + Name);
diff --git a/test/CodeGen/Mips/fptr2.ll b/test/CodeGen/Mips/fptr2.ll
new file mode 100644
index 0000000..77028db
--- /dev/null
+++ b/test/CodeGen/Mips/fptr2.ll
@@ -0,0 +1,20 @@
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static < %s | FileCheck %s -check-prefix=static16
+
+; Function Attrs: nounwind
+define double @my_mul(double %a, double %b) #0 {
+entry:
+ %a.addr = alloca double, align 8
+ %b.addr = alloca double, align 8
+ store double %a, double* %a.addr, align 8
+ store double %b, double* %b.addr, align 8
+ %0 = load double* %a.addr, align 8
+ %1 = load double* %b.addr, align 8
+ %mul = fmul double %0, %1
+ ret double %mul
+}
+
+; static16: .ent __fn_stub_my_mul
+; static16: .set reorder
+; static16-NEXT: #NO_APP
+; static16: .end __fn_stub_my_mul
+attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }