beifg: Factorise code to count interference components.
[libfirm] / ir / be / sparc / sparc_nodes_attr.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief   attributes attached to all sparc nodes
9  * @author  Hannes Rapp, Matthias Braun
10  */
11 #ifndef FIRM_BE_SPARC_SPARC_NODES_ATTR_H
12 #define FIRM_BE_SPARC_SPARC_NODES_ATTR_H
13
14 #include "bearch.h"
15 #include <stdint.h>
16
17 typedef struct sparc_attr_t  sparc_attr_t;
18
19 /**
20  * base SPARC attribute
21  */
22 struct sparc_attr_t
23 {
24         except_attr                 exc;                /**< the exception attribute. MUST be the first one. */
25         int32_t                     immediate_value;    /* immediate values */
26         ir_entity                  *immediate_value_entity;
27 };
28
29 enum sparc_arch_irn_flags_t {
30         sparc_arch_irn_flag_needs_64bit_spillslot = arch_irn_flags_backend << 0,
31         sparc_arch_irn_flag_immediate_form        = arch_irn_flags_backend << 1,
32         sparc_arch_irn_flag_aggregate_return      = arch_irn_flags_backend << 2,
33         sparc_arch_irn_flag_has_delay_slot        = arch_irn_flags_backend << 3,
34 };
35
36 /**
37  * attribute for FP immediate instruction
38  */
39 typedef struct sparc_fp_attr_t sparc_fp_attr_t;
40 struct sparc_fp_attr_t {
41         sparc_attr_t  base;         /**< generic attribute */
42         ir_mode      *fp_mode;
43 };
44
45 typedef struct sparc_fp_conv_attr_t sparc_fp_conv_attr_t;
46 struct sparc_fp_conv_attr_t {
47         sparc_attr_t  base;
48         ir_mode      *src_mode;
49         ir_mode      *dest_mode;
50 };
51
52 /**
53  * attributes for load/store addressing modes
54  */
55 typedef struct sparc_load_store_attr_t sparc_load_store_attr_t;
56 struct sparc_load_store_attr_t {
57         sparc_attr_t  base;    /**< generic attribute */
58         ir_mode      *load_store_mode;
59         bool          is_frame_entity : 1;
60         bool          is_reg_reg      : 1;
61 };
62
63 /**
64  * attributes for conditional jumps
65  */
66 typedef struct sparc_jmp_cond_attr_t sparc_jmp_cond_attr_t;
67 struct sparc_jmp_cond_attr_t {
68         sparc_attr_t base;    /**< generic attribute */
69         ir_relation  relation;
70         bool         is_unsigned      : 1;
71         bool         annul_delay_slot : 1;
72 };
73
74 /**
75  * attributes for switch jumps
76  */
77 typedef struct sparc_switch_jmp_attr_t sparc_switch_jmp_attr_t;
78 struct sparc_switch_jmp_attr_t {
79         sparc_attr_t           base;
80         const ir_switch_table *table;
81         ir_entity             *table_entity;
82 };
83
84 enum n_sparc_Return {
85         n_sparc_Return_mem = 0,
86         n_sparc_Return_sp  = 1,
87 };
88
89 #endif