From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx (limited to 'bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx') diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx new file mode 100644 index 000000000..2c7332a16 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include "call.hxx" + +void privateSnippetExecutor() +{ + asm volatile + ( + " subq $160, %rsp\n" + + " movq %r10, -152(%rbp) # Save (nVtableOffset << 32) + nFunctionIndex\n" + + " movq %rdi, -112(%rbp) # Save GP registers\n" + " movq %rsi, -104(%rbp)\n" + " movq %rdx, -96(%rbp)\n" + " movq %rcx, -88(%rbp)\n" + " movq %r8 , -80(%rbp)\n" + " movq %r9 , -72(%rbp)\n" + + " movsd %xmm0, -64(%rbp) # Save FP registers\n" + " movsd %xmm1, -56(%rbp)\n" + " movsd %xmm2, -48(%rbp)\n" + " movsd %xmm3, -40(%rbp)\n" + " movsd %xmm4, -32(%rbp)\n" + " movsd %xmm5, -24(%rbp)\n" + " movsd %xmm6, -16(%rbp)\n" + " movsd %xmm7, -8(%rbp)\n" + + " leaq -144(%rbp), %r9 # 6th param: sal_uInt64 * pRegisterReturn\n" + " leaq 16(%rbp), %r8 # 5rd param: void ** ovrflw\n" + " leaq -64(%rbp), %rcx # 4th param: void ** fpreg\n" + " leaq -112(%rbp), %rdx # 3rd param: void ** gpreg\n" + " movl -148(%rbp), %esi # 2nd param: sal_int32 nVtableOffset\n" + " movl -152(%rbp), %edi # 1st param: sal_int32 nFunctionIndex\n" + + " call _cpp_vtable_call\n" + + " testl %eax, %eax\n" + " je .Lfpint\n" + " jg .Lintfp\n" + + " movq -144(%rbp), %rax # Potential return value (general case)\n" + " movq -136(%rbp), %rdx # Potential return value (general case)\n" + " movq -144(%rbp), %xmm0 # Potential return value (general case)\n" + " movq -136(%rbp), %xmm1 # Potential return value (general case)\n" + " jmp .Lfinish\n" + + ".Lfpint:\n" + " movq -144(%rbp), %xmm0 # Return value (special fp and integer case)\n" + " movq -136(%rbp), %rax # Return value (special fp and integer case)\n" + " jmp .Lfinish\n" + + ".Lintfp:\n" + " movq -144(%rbp), %rax # Return value (special integer and fp case)\n" + " movq -136(%rbp), %xmm0 # Return value (special integer and fp case)\n" + + ".Lfinish:\n" + " addq $160, %rsp\n" + ); +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3