-
Notifications
You must be signed in to change notification settings - Fork 0
/
aarch64.h
60 lines (44 loc) · 1.11 KB
/
aarch64.h
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
50
51
52
53
54
55
56
57
58
59
60
#ifndef AARCH64_H
#define AARCH64_H
#include "aarch64/emit.h"
#include "aarch64/lower.h"
#include "disasm.h"
#include "target.h"
// FIXME: this unnecessarily ties arm64 to mach-o
#define AARCH64_FUNCTION_ALIGNMENT (16)
#define AARCH64_STACK_ALIGNMENT (16)
#define MAX_IMM_SIZE (4095)
extern const struct target AARCH64_MACOS_TARGET;
extern const struct target AARCH64_LINUX_TARGET;
struct aarch64_op_page {
struct ir_op *glb_ref;
};
struct aarch64_op_page_off {
struct ir_op *glb_ref;
};
struct aarch64_store_variadic {
struct ir_op *value;
size_t idx;
};
enum aarch64_op_ty {
// Saving LR has two steps - one instr per op so we have two ops for it
AARCH64_OP_TY_SAVE_LR,
AARCH64_OP_TY_SAVE_FP,
AARCH64_OP_TY_RSTR_LR,
AARCH64_OP_TY_SUB_STACK,
AARCH64_OP_TY_ADD_STACK,
AARCH64_OP_TY_SAVE_REG,
AARCH64_OP_TY_RSTR_REG,
AARCH64_OP_TY_PAGE,
AARCH64_OP_TY_PAGE_OFF,
AARCH64_OP_TY_STORE_VARIADIC,
};
struct aarch64_op {
enum aarch64_op_ty ty;
union {
struct aarch64_op_page page;
struct aarch64_op_page_off page_off;
struct aarch64_store_variadic store_variadic;
};
};
#endif