summary refs log tree commit diff
path: root/amd64/targ.c
blob: e58ba2f65d1e50b1ea3ac84d3d22265e7103a8c9 (plain) (blame)
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
#include "all.h"

Amd64Op amd64_op[NOp] = {
#define O(op, t, x) [O##op] =
#define X(nm, zf, lf) { nm, zf, lf, },
	#include "../ops.h"
};

static int
amd64_memargs(int op)
{
	return amd64_op[op].nmem;
}

#define AMD64_COMMON \
	.gpr0 = RAX, \
	.ngpr = NGPR, \
	.fpr0 = XMM0, \
	.nfpr = NFPR, \
	.rglob = BIT(RBP) | BIT(RSP), \
	.nrglob = 2, \
	.rsave = amd64_sysv_rsave, \
	.nrsave = {NGPS, NFPS}, \
	.retregs = amd64_sysv_retregs, \
	.argregs = amd64_sysv_argregs, \
	.memargs = amd64_memargs, \
	.abi = amd64_sysv_abi, \
	.isel = amd64_isel, \

Target T_amd64_sysv = {
	.name = "amd64_sysv",
	.emitfn = amd64_sysv_emitfn,
	.emitfin = elf_emitfin,
	.asloc = ".L",
	AMD64_COMMON
};

Target T_amd64_apple = {
	.name = "amd64_apple",
	.emitfn = amd64_apple_emitfn,
	.emitfin = macho_emitfin,
	.asloc = "L",
	.assym = "_",
	AMD64_COMMON
};