moved get_*_dbg_info() and set_*_dbg_info() to logical places
[libfirm] / include / libfirm / archop.h
1 /*
2  * Copyright (C) 1995-2007 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    Architecture depended IR operations
23  * @version  $Id$
24  */
25 #ifndef FIRM_ARCH_ARCHOP_H
26 #define FIRM_ARCH_ARCHOP_H
27
28 #include "firm_types.h"
29
30 /**
31  * Mask defining which architecture depend
32  * operations are supported.
33  */
34 typedef enum _arch_ops_mask {
35         ARCH_OPS_NONE   = 0,              /**< no additional Operations */
36         ARCH_OPS_MINMAX = 1               /**< use the Min/Max Operation */
37 } arch_ops_mask;
38
39 typedef struct _arch_ops_info {
40         arch_ops_mask  enabled_ops;         /**< a mask of enabled IR-opcodes */
41         unsigned       minmax_handle_NaN:1; /**< if set, Min(a,a) == a, else unknown */
42 } arch_ops_info;
43
44 extern ir_op *op_Min, *op_Max;
45
46 ir_op *get_op_Min(void);
47 ir_op *get_op_Max(void);
48
49 /** construct a Min: Min(a,b) = a < b ? a : b */
50 ir_node *
51 new_rd_Min(dbg_info *db, ir_graph *irg, ir_node *block,
52        ir_node *op1, ir_node *op2, ir_mode *mode);
53
54 /** construct a Max: Max(a,b) = a > b ? a : b */
55 ir_node *
56 new_rd_Max(dbg_info *db, ir_graph *irg, ir_node *block,
57        ir_node *op1, ir_node *op2, ir_mode *mode);
58
59 ir_node *
60 new_r_Min(ir_graph *irg, ir_node *block,
61        ir_node *op1, ir_node *op2, ir_mode *mode);
62
63 ir_node *
64 new_r_Max(ir_graph *irg, ir_node *block,
65        ir_node *op1, ir_node *op2, ir_mode *mode);
66
67 ir_node *
68 new_Min(ir_node *op1, ir_node *op2, ir_mode *mode);
69
70 ir_node *
71 new_Max(ir_node *op1, ir_node *op2, ir_mode *mode);
72
73 /**
74  * Create Min and Mux from Mux nodes
75  */
76 ir_node *arch_transform_node_Mux(ir_node *mux);
77
78 /**
79  * initialize the ops.
80  */
81 void firm_archops_init(const arch_ops_info *info);
82
83 #endif