sparc_nodes_attr.h 2.96 KB
Newer Older
Hannes Rapp's avatar
Hannes Rapp committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
 *
 * This file is part of libFirm.
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * Licensees holding valid libFirm Professional Edition licenses may use
 * this file in accordance with the libFirm Commercial License.
 * Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
 */

/**
 * @file
 * @brief   attributes attached to all sparc nodes
Michael Beck's avatar
Michael Beck committed
23
 * @version $Id$
Hannes Rapp's avatar
Hannes Rapp committed
24
25
26
27
28
 */
#ifndef FIRM_BE_SPARC_SPARC_NODES_ATTR_H
#define FIRM_BE_SPARC_SPARC_NODES_ATTR_H

#include "../bearch.h"
29
#include <stdint.h>
Hannes Rapp's avatar
Hannes Rapp committed
30
31
32
33
34
35
36
37

typedef struct sparc_attr_t  sparc_attr_t;

/**
 * base SPARC attribute
 */
struct sparc_attr_t
{
38
39
	except_attr                 exc;                /**< the exception attribute. MUST be the first one. */
	const arch_register_req_t **in_req;             /**< register requirements for arguments */
40
	int32_t                     immediate_value;    /* immediate values */
41
	ir_entity                  *immediate_value_entity;
Hannes Rapp's avatar
Hannes Rapp committed
42
43
};

44
enum sparc_arch_irn_flags_t {
45
46
47
	sparc_arch_irn_flag_modifies_flags        = arch_irn_flags_backend << 0,
	sparc_arch_irn_flag_modifies_fp_flags     = arch_irn_flags_backend << 1,
	sparc_arch_irn_flag_needs_64bit_spillslot = arch_irn_flags_backend << 2,
48
49
};

Hannes Rapp's avatar
Hannes Rapp committed
50
51
52
53
54
/**
 * attribute for FP immediate instruction
 */
typedef struct sparc_fp_attr_t sparc_fp_attr_t;
struct sparc_fp_attr_t {
55
56
57
58
59
60
61
62
63
	sparc_attr_t  base;         /**< generic attribute */
	ir_mode      *fp_mode;
};

typedef struct sparc_fp_conv_attr_t sparc_fp_conv_attr_t;
struct sparc_fp_conv_attr_t {
	sparc_attr_t  base;
	ir_mode      *src_mode;
	ir_mode      *dest_mode;
Hannes Rapp's avatar
Hannes Rapp committed
64
};
Hannes Rapp's avatar
Hannes Rapp committed
65

66
67
68
69
70
/**
 * attribute for save instruction
 */
typedef struct sparc_save_attr_t sparc_save_attr_t;
struct sparc_save_attr_t {
71
72
	sparc_attr_t  base;              /**< generic attribute */
	int           initial_stacksize; /* the min. stack size required by the sparc ABI */
73
74
};

Hannes Rapp's avatar
Hannes Rapp committed
75
76
77
78
79
/**
 * attributes for load/store adressing modes
 */
typedef struct sparc_load_store_attr_t sparc_load_store_attr_t;
struct sparc_load_store_attr_t {
80
81
	sparc_attr_t  base;    /**< generic attribute */
	ir_mode      *load_store_mode;
82
83
	bool          is_frame_entity : 1;
	bool          is_reg_reg      : 1;
Hannes Rapp's avatar
Hannes Rapp committed
84
85
86
87
88
89
90
};

/**
 * attributes for conditional jumps
 */
typedef struct sparc_jmp_cond_attr_t sparc_jmp_cond_attr_t;
struct sparc_jmp_cond_attr_t {
91
	sparc_attr_t base;    /**< generic attribute */
92
	pn_Cmp       pnc;
93
	bool         is_unsigned : 1;
Hannes Rapp's avatar
Hannes Rapp committed
94
95
96
97
98
99
100
};

/**
 * attributes for switch jumps
 */
typedef struct sparc_jmp_switch_attr_t sparc_jmp_switch_attr_t;
struct sparc_jmp_switch_attr_t {
101
102
103
	sparc_attr_t  base;    /**< generic attribute */
	int           n_projs;
	long          default_proj_num;
Hannes Rapp's avatar
Hannes Rapp committed
104
105
106
};

#endif