use sub_immediate in case of add a,0x1000
[libfirm] / ir / be / amd64 / amd64_nodes_attr.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   attributes attached to all amd64 nodes
23  * @version $Id: amd64_nodes_attr.h 26317 2009-08-05 10:53:46Z matze $
24  */
25 #ifndef FIRM_BE_amd64_amd64_NODES_ATTR_H
26 #define FIRM_BE_amd64_amd64_NODES_ATTR_H
27
28 #include "../bearch.h"
29
30 typedef struct amd64_attr_t            amd64_attr_t;
31 typedef struct amd64_SymConst_attr_t   amd64_SymConst_attr_t;
32
33 struct amd64_attr_t
34 {
35         except_attr                 exc;     /**< the exception attribute. MUST be the first one. */
36         const arch_register_req_t **in_req;  /**< register requirements for arguments */
37         const arch_register_req_t **out_req; /**< register requirements for results */
38         ir_mode                    *ls_mode; /**< Stores the "input" mode */
39         struct amd64_attr_data_bitfield {
40                 unsigned ins_permuted : 1;      /**< inputs of node have been permuted
41                                                      (for commutative nodes) */
42                 unsigned cmp_unsigned : 1;      /**< compare should be unsigned */
43         } data;
44         struct amd64_attr_extended {
45                 pn_Cmp   pnc;                   /**< type of compare operation >*/
46                 unsigned imm_value;             /**< immediate value to use >*/
47         } ext;
48 };
49
50 struct amd64_SymConst_attr_t
51 {
52         amd64_attr_t  base;
53         ir_entity    *entity;
54         unsigned      fp_offset;
55 };
56
57 #define CAST_AMD64_ATTR(type,ptr)        ((type *)(ptr))
58 #define CONST_CAST_AMD64_ATTR(type,ptr)  ((const type *)(ptr))
59
60 #endif