mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/Model/ABI.h"
|
|
#include "revng/Model/Register.h"
|
|
|
|
namespace abi {
|
|
|
|
template<model::ABI::Values ABI>
|
|
struct Trait;
|
|
|
|
template<>
|
|
struct Trait<model::ABI::Pascal_x86> {
|
|
static constexpr auto ABI = model::ABI::Pascal_x86;
|
|
|
|
static constexpr bool ArgumentsArePositionBased = false;
|
|
static constexpr bool OnlyStartDoubleArgumentsFromAnEvenRegister = false;
|
|
static constexpr bool ArgumentsCanBeSplitBetweenRegistersAndStack = false;
|
|
static constexpr bool UsePointerToCopyForStackArguments = false;
|
|
|
|
static constexpr size_t MaximumGPRsPerAggregateArgument = 0;
|
|
static constexpr size_t MaximumGPRsPerAggregateReturnValue = 0;
|
|
static constexpr size_t MaximumGPRsPerScalarArgument = 0;
|
|
static constexpr size_t MaximumGPRsPerScalarReturnValue = 2;
|
|
|
|
static constexpr std::array<model::Register::Values, 0>
|
|
GeneralPurposeArgumentRegisters = {};
|
|
static constexpr std::array GeneralPurposeReturnValueRegisters = {
|
|
model::Register::eax_x86,
|
|
model::Register::edx_x86
|
|
};
|
|
|
|
static constexpr std::array<model::Register::Values, 0>
|
|
VectorArgumentRegisters = {};
|
|
static constexpr std::array<model::Register::Values, 0>
|
|
VectorReturnValueRegisters = {};
|
|
|
|
static constexpr std::array CalleeSavedRegisters = {
|
|
model::Register::ebx_x86,
|
|
model::Register::ebp_x86,
|
|
model::Register::esp_x86,
|
|
model::Register::edi_x86,
|
|
model::Register::esi_x86
|
|
};
|
|
|
|
static constexpr auto ReturnValueLocationRegister = model::Register::eax_x86;
|
|
};
|
|
|
|
} // namespace abi
|