LibreOffice Module bridges (master) 1
gcc3_linux_x86-64/abi.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22// This is an implementation of the x86-64 ABI as described in 'System V
23// Application Binary Interface, AMD64 Architecture Processor Supplement'
24// (http://www.x86-64.org/documentation/abi-0.95.pdf)
25
26#include <typelib/typedescription.hxx>
27
28namespace x86_64
29{
30
31/* 6 general purpose registers are used for parameter passing */
32const sal_uInt32 MAX_GPR_REGS = 6;
33
34/* 8 SSE registers are used for parameter passing */
35const sal_uInt32 MAX_SSE_REGS = 8;
36
37/* Count number of required registers.
38
39 Examine the argument and return set number of register required in each
40 class.
41
42 Return false iff parameter should be passed in memory.
43*/
44bool examine_argument( typelib_TypeDescriptionReference *pTypeRef, int &nUsedGPR, int &nUsedSSE ) noexcept;
45
52bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) noexcept;
53
54enum class ReturnKind {
55 Memory,
57 RegistersFpInt,
58 RegistersIntFp
59};
60
61ReturnKind getReturnKind(typelib_TypeDescriptionReference * type) noexcept;
62
63void fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64* pGPR, const double* pSSE, void *pStruct ) noexcept;
64
65} // namespace x86_64
66
67/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool examine_argument(typelib_TypeDescriptionReference *pTypeRef, int &nUsedGPR, int &nUsedSSE) noexcept
bool return_in_hidden_param(typelib_TypeDescriptionReference *pTypeRef) noexcept
Does function that returns this type use a hidden parameter, or registers?
void fill_struct(typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64 *pGPR, const double *pSSE, void *pStruct) noexcept
const sal_uInt32 MAX_SSE_REGS
ReturnKind getReturnKind(typelib_TypeDescriptionReference *type) noexcept
const sal_uInt32 MAX_GPR_REGS