added new licence header
[libfirm] / ir / lower / lower_dw.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 irlwrdw.h
22  * @date 8.10.2004
23  * @author Michael Beck
24  * @brief Lower Double word operations, ie Mode L -> I
25  *
26  * $Id$
27  */
28
29 #ifndef _FIRM_LOWER_DW_H
30 #define _FIRM_LOWER_DW_H
31
32 #include "firm_types.h"
33
34 /**
35  * A callback type for creating an intrinsic entity for a given opcode.
36  *
37  * @param method   the method type of the emulation function entity
38  * @param op       the emulated ir_op
39  * @param imode    the input mode of the emulated opcode
40  * @param omode    the output mode of the emulated opcode
41  * @param context  the context parameter
42  */
43 typedef ir_entity *(create_intrinsic_fkt)(ir_type *method, const ir_op *op,
44                                           const ir_mode *imode, const ir_mode *omode,
45                                           void *context);
46
47 /**
48  * The lowering parameter description.
49  */
50 typedef struct _lwrdw_param_t {
51         int enable;                   /**< if true lowering is enabled */
52         int little_endian;            /**< if true should be lowered for little endian, else big endian */
53         ir_mode *high_signed;         /**< the double word signed mode to be lowered, typically Ls */
54         ir_mode *high_unsigned;       /**< the double word unsigned mode to be lowered, typically Lu */
55         ir_mode *low_signed;          /**< the word signed mode to be used, typically Is */
56         ir_mode *low_unsigned;        /**< the word unsigned mode to be used, typically Iu */
57
58         /** callback that creates the intrinsic entity */
59         create_intrinsic_fkt *create_intrinsic;
60         void *ctx;                    /**< context parameter for the creator function */
61 } lwrdw_param_t;
62
63 /**
64  * Lower all double word operations.
65  */
66 void lower_dw_ops(const lwrdw_param_t *param);
67
68 /**
69  * Default implementation. Context is unused.
70  */
71 ir_entity *def_create_intrinsic_fkt(ir_type *method, const ir_op *op,
72                                     const ir_mode *imode, const ir_mode *omode,
73                                     void *context);
74
75 #endif /* _FIRM_LOWER_DW_H */