diff options
| author | Stefan Maksimovic <stefan.maksimovic@mips.com> | 2018-10-12 08:18:38 +0000 |
|---|---|---|
| committer | Stefan Maksimovic <stefan.maksimovic@mips.com> | 2018-10-12 08:18:38 +0000 |
| commit | 285c0f4fdc14a266f0765816c42c2c8a57601cbb (patch) | |
| tree | e1def88c732ab499cf30c1c76cc116d81d0397d7 /llvm/test/CodeGen/Mips/cconv | |
| parent | eddf6b5df563a6d10ba88272faaeae90c37dcc00 (diff) | |
| download | bcm5719-llvm-285c0f4fdc14a266f0765816c42c2c8a57601cbb.tar.gz bcm5719-llvm-285c0f4fdc14a266f0765816c42c2c8a57601cbb.zip | |
[mips] Mark fmaxl as a long double emulation routine
Failure was discovered upon running
projects/compiler-rt/test/builtins/Unit/divtc3_test.c
in a stage2 compiler build.
When compiling projects/compiler-rt/lib/builtins/divtc3.c,
a call to fmaxl within the divtc3 implementation had its
return values read from registers $2 and $3 instead of $f0 and $f2.
Include fmaxl in the list of long double emulation routines
to have its return value correctly interpreted as f128.
Almost exact issue here: https://reviews.llvm.org/D17760
Differential Revision: https://reviews.llvm.org/D52649
llvm-svn: 344326
Diffstat (limited to 'llvm/test/CodeGen/Mips/cconv')
| -rw-r--r-- | llvm/test/CodeGen/Mips/cconv/fmaxl_call.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/cconv/fmaxl_call.ll b/llvm/test/CodeGen/Mips/cconv/fmaxl_call.ll new file mode 100644 index 00000000000..0e3078edae4 --- /dev/null +++ b/llvm/test/CodeGen/Mips/cconv/fmaxl_call.ll @@ -0,0 +1,25 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=mips64el-unknown-linux-gnu -mcpu=mips64 < %s | FileCheck %s + +define fp128 @call_fmaxl(fp128 %a, fp128 %b) { +; CHECK-LABEL: call_fmaxl: +; CHECK: # %bb.0: +; CHECK-NEXT: daddiu $sp, $sp, -16 +; CHECK-NEXT: .cfi_def_cfa_offset 16 +; CHECK-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill +; CHECK-NEXT: .cfi_offset 31, -8 +; CHECK-NEXT: jal fmaxl +; CHECK-NEXT: nop +; CHECK-NEXT: mov.d $f12, $f0 +; CHECK-NEXT: jal f +; CHECK-NEXT: mov.d $f13, $f2 +; CHECK-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload +; CHECK-NEXT: jr $ra +; CHECK-NEXT: daddiu $sp, $sp, 16 + %1 = call fp128 @llvm.maxnum.f128(fp128 %a, fp128 %b) + %2 = call fp128 @f(fp128 %1) + ret fp128 %2 +} + +declare fp128 @llvm.maxnum.f128(fp128, fp128) +declare fp128 @f(fp128) |

