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