amd64_new_nodes.h 2.92 KB
Newer Older
1
2
/*
 * This file is part of libFirm.
3
 * Copyright (C) 2012 University of Karlsruhe.
4
5
6
7
8
9
 */

/**
 * @file
 * @brief   Function prototypes for the assembler ir node constructors.
 */
10
11
#ifndef FIRM_BE_AMD64_AMD64_NEW_NODES_H
#define FIRM_BE_AMD64_AMD64_NEW_NODES_H
12

13
#include <stdint.h>
Matthias Braun's avatar
Matthias Braun committed
14
15

#include "irnode_t.h"
16
#include "amd64_nodes_attr.h"
Matthias Braun's avatar
Matthias Braun committed
17
#include "gen_amd64_new_nodes.h"
18

Matthias Braun's avatar
Matthias Braun committed
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
static inline amd64_attr_t *get_amd64_attr(ir_node *node)
{
	assert(is_amd64_irn(node));
	return (amd64_attr_t*)get_irn_generic_attr(node);
}

static inline const amd64_attr_t *get_amd64_attr_const(const ir_node *node)
{
	assert(is_amd64_irn(node));
	return (const amd64_attr_t*)get_irn_generic_attr_const(node);
}

static inline amd64_addr_attr_t *get_amd64_addr_attr(ir_node *node)
{
	return (amd64_addr_attr_t*)get_irn_generic_attr(node);
}

static inline const amd64_addr_attr_t *get_amd64_addr_attr_const(
		const ir_node *node)
{
	return (const amd64_addr_attr_t*)get_irn_generic_attr_const(node);
}

static inline const amd64_unop_attr_t *get_amd64_unop_attr_const(
		const ir_node *node)
{
	return (const amd64_unop_attr_t*)get_irn_generic_attr_const(node);
}

static inline amd64_binop_addr_attr_t *get_amd64_binop_addr_attr(ir_node *node)
{
	return (amd64_binop_addr_attr_t*)get_irn_generic_attr(node);
}

static inline const amd64_binop_addr_attr_t *get_amd64_binop_addr_attr_const(
		const ir_node *node)
{
	return (const amd64_binop_addr_attr_t*)get_irn_generic_attr_const(node);
}

static inline const amd64_shift_attr_t *get_amd64_shift_attr_const(
		const ir_node *node)
{
	return (const amd64_shift_attr_t*)get_irn_generic_attr_const(node);
}

static inline amd64_shift_attr_t *get_amd64_shift_attr(ir_node *node)
{
	return (amd64_shift_attr_t*)get_irn_generic_attr(node);
}

static inline const amd64_switch_jmp_attr_t *get_amd64_switch_jmp_attr_const(
		const ir_node *node)
{
	return (const amd64_switch_jmp_attr_t*)get_irn_generic_attr_const(node);
}

static inline amd64_switch_jmp_attr_t *get_amd64_switch_jmp_attr(ir_node *node)
{
	return (amd64_switch_jmp_attr_t*)get_irn_generic_attr(node);
}

static inline const amd64_cc_attr_t *get_amd64_cc_attr_const(
	const ir_node *node)
{
	return (const amd64_cc_attr_t*)get_irn_generic_attr_const(node);
}

static inline amd64_cc_attr_t *get_amd64_cc_attr(ir_node *node)
{
	return (amd64_cc_attr_t*)get_irn_generic_attr(node);
}
91

Matthias Braun's avatar
Matthias Braun committed
92
93
94
95
96
static inline const amd64_movimm_attr_t *get_amd64_movimm_attr_const(
		const ir_node *node)
{
	return (const amd64_movimm_attr_t*)get_irn_generic_attr_const(node);
}
97

Matthias Braun's avatar
Matthias Braun committed
98
99
100
101
static inline amd64_movimm_attr_t *get_amd64_movimm_attr(ir_node *node)
{
	return (amd64_movimm_attr_t*)get_irn_generic_attr(node);
}
102

Matthias Braun's avatar
Matthias Braun committed
103
104
105
106
107
108
static inline bool amd64_has_addr_attr(const ir_node *node)
{
	const amd64_attr_t *attr = get_amd64_attr_const(node);
	return attr->op_mode == AMD64_OP_ADDR || attr->op_mode == AMD64_OP_ADDR_REG
	    || attr->op_mode == AMD64_OP_ADDR_IMM;
}
109

110
111
112
113
/* Include the generated headers */
#include "gen_amd64_new_nodes.h"

#endif