LibreOffice Module bridges (master) 1
gcc3_macosx_x86-64/call.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 * This file is part of the LibreOffice project.
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 *
10 * This file incorporates work covered by the following license notice:
11 *
12 * Licensed to the Apache Software Foundation (ASF) under one or more
13 * contributor license agreements. See the NOTICE file distributed
14 * with this work for additional information regarding copyright
15 * ownership. The ASF licenses this file to you under the Apache
16 * License, Version 2.0 (the "License"); you may not use this file
17 * except in compliance with the License. You may obtain a copy of
18 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 */
20
21#include <sal/config.h>
22
23#include "call.hxx"
24
26{
27 asm volatile
28 (
29 " subq $160, %rsp\n"
30
31 " movq %r10, -152(%rbp) # Save (nVtableOffset << 32) + nFunctionIndex\n"
32
33 " movq %rdi, -112(%rbp) # Save GP registers\n"
34 " movq %rsi, -104(%rbp)\n"
35 " movq %rdx, -96(%rbp)\n"
36 " movq %rcx, -88(%rbp)\n"
37 " movq %r8 , -80(%rbp)\n"
38 " movq %r9 , -72(%rbp)\n"
39
40 " movsd %xmm0, -64(%rbp) # Save FP registers\n"
41 " movsd %xmm1, -56(%rbp)\n"
42 " movsd %xmm2, -48(%rbp)\n"
43 " movsd %xmm3, -40(%rbp)\n"
44 " movsd %xmm4, -32(%rbp)\n"
45 " movsd %xmm5, -24(%rbp)\n"
46 " movsd %xmm6, -16(%rbp)\n"
47 " movsd %xmm7, -8(%rbp)\n"
48
49 " leaq -144(%rbp), %r9 # 6th param: sal_uInt64 * pRegisterReturn\n"
50 " leaq 16(%rbp), %r8 # 5rd param: void ** ovrflw\n"
51 " leaq -64(%rbp), %rcx # 4th param: void ** fpreg\n"
52 " leaq -112(%rbp), %rdx # 3rd param: void ** gpreg\n"
53 " movl -148(%rbp), %esi # 2nd param: sal_int32 nVtableOffset\n"
54 " movl -152(%rbp), %edi # 1st param: sal_int32 nFunctionIndex\n"
55
56 " call _cpp_vtable_call\n"
57
58 " testl %eax, %eax\n"
59 " je .Lfpint\n"
60 " jg .Lintfp\n"
61
62 " movq -144(%rbp), %rax # Potential return value (general case)\n"
63 " movq -136(%rbp), %rdx # Potential return value (general case)\n"
64 " movq -144(%rbp), %xmm0 # Potential return value (general case)\n"
65 " movq -136(%rbp), %xmm1 # Potential return value (general case)\n"
66 " jmp .Lfinish\n"
67
68 ".Lfpint:\n"
69 " movq -144(%rbp), %xmm0 # Return value (special fp and integer case)\n"
70 " movq -136(%rbp), %rax # Return value (special fp and integer case)\n"
71 " jmp .Lfinish\n"
72
73 ".Lintfp:\n"
74 " movq -144(%rbp), %rax # Return value (special integer and fp case)\n"
75 " movq -136(%rbp), %xmm0 # Return value (special integer and fp case)\n"
76
77 ".Lfinish:\n"
78 " addq $160, %rsp\n"
79 );
80}
81/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void privateSnippetExecutor()