1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_MACOSX_X86_64_ABI_HXX
21 #define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_MACOSX_X86_64_ABI_HXX
23 // This is an implementation of the x86-64 ABI as described in 'System V
24 // Application Binary Interface, AMD64 Architecture Processor Supplement'
25 // (http://www.x86-64.org/documentation/abi-0.95.pdf)
27 #include <typelib/typedescription.hxx>
32 /* 6 general purpose registers are used for parameter passing */
33 const sal_uInt32 MAX_GPR_REGS
= 6;
35 /* 8 SSE registers are used for parameter passing */
36 const sal_uInt32 MAX_SSE_REGS
= 8;
38 /* Count number of required registers.
40 Examine the argument and return set number of register required in each
43 Return false iff parameter should be passed in memory.
45 bool examine_argument( typelib_TypeDescriptionReference
*pTypeRef
, bool bInReturn
, int &nUsedGPR
, int &nUsedSSE
) throw ();
47 /** Does function that returns this type use a hidden parameter, or registers?
49 The value can be returned either in a hidden 1st parameter (which is a
50 pointer to a structure allocated by the caller), or in registers (rax, rdx
51 for the integers, xmm0, xmm1 for the floating point numbers).
53 bool return_in_hidden_param( typelib_TypeDescriptionReference
*pTypeRef
) throw ();
55 void fill_struct( typelib_TypeDescriptionReference
*pTypeRef
, const sal_uInt64
* pGPR
, const double* pSSE
, void *pStruct
) throw ();
59 #endif // INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_MACOSX_X86_64_ABI_HXX
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */