1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/CodeGen/X86/win64-long-double.ll
Martin Storsjo db412bb236 [X86] Properly implement the calling convention for f80 for mingw/x86_64
In these cases, both parameters and return values are passed
as a pointer to a stack allocation.

MSVC doesn't use the f80 data type at all, while it is used
for long doubles on mingw.

Normally, this part of the calling convention is handled
within clang, but for intrinsics that are lowered to libcalls,
it may need to be handled within llvm as well.

Differential Revision: https://reviews.llvm.org/D44592

llvm-svn: 327957
2018-03-20 06:19:38 +00:00

23 lines
633 B
LLVM

; RUN: llc -mtriple x86_64-w64-mingw32 %s -o - | FileCheck %s
@glob = common dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
define dso_local void @call() {
entry:
%0 = load x86_fp80, x86_fp80* @glob, align 16
%1 = tail call x86_fp80 @floorl(x86_fp80 %0)
store x86_fp80 %1, x86_fp80* @glob, align 16
ret void
}
declare x86_fp80 @floorl(x86_fp80)
; CHECK-LABEL: call
; CHECK: fldt glob(%rip)
; CHECK: fstpt [[ARGOFF:[0-9]+]](%rsp)
; CHECK: leaq [[RETOFF:[0-9]+]](%rsp), %rcx
; CHECK: leaq [[ARGOFF]](%rsp), %rdx
; CHECK: callq floorl
; CHECK: fldt [[RETOFF]](%rsp)
; CHECK: fstpt glob(%rip)