blob: bc03fe86ca888c03a5914650a35e43d1ff06e6d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef RCC_LIB_TARGET_RISCV_GISEL_RISCVCALLLOWERING_H
#define RCC_LIB_TARGET_RISCV_GISEL_RISCVCALLLOWERING_H
#include "../RISCVCallingConv.h"
#include "rcc/CodeGen/TargetCallLowering.h"
#include "rcc/Target/RISCV/RISCVInstructions.h"
#include <cstdint>
namespace rcc::riscv {
enum class CallTargetFlag : std::uint32_t {
DirectCall = 1U << 0U,
};
enum class CallStackObjectFlag : std::uint64_t {
IncomingArgument = 1ULL << 0U,
OutgoingArgument = 1ULL << 1U,
ByValCopy = 1ULL << 2U,
VarArgSaveArea = 1ULL << 3U,
VarArgAlignmentPadding = 1ULL << 4U,
};
enum class CallValueTransform : std::uint8_t {
Full,
AnyExtend,
SignExtend,
ZeroExtend,
Truncate,
Bitcast,
};
class RISCVCallLowering final : public TargetCallLowering {
public:
[[nodiscard]] Expected<CallLoweringPlan>
planFormalArguments(const FormalArgumentRequest &Request) const override;
[[nodiscard]] Expected<CallLoweringPlan>
planCall(const CallLoweringRequest &Request) const override;
[[nodiscard]] Expected<CallLoweringPlan>
planReturn(const ReturnLoweringRequest &Request) const override;
[[nodiscard]] Expected<void> emitPlan(MachineIRBuilder &Builder,
const CallLoweringPlan &Plan) const override;
};
} // namespace rcc::riscv
#endif // RCC_LIB_TARGET_RISCV_GISEL_RISCVCALLLOWERING_H
|