- add an extra filed for the bit offset\n- renamed access functions\n- renamed entity...
[libfirm] / ir / lower / lower_dw.h
1 /**
2  * @file irlwrdw.h
3  * @date 8.10.2004
4  * @author Michael Beck
5  * @brief Lower Double word operations, ie Mode L -> I
6  *
7  * $Id$
8  */
9
10 #ifndef _FIRM_LOWER_DW_H
11 #define _FIRM_LOWER_DW_H
12
13 #include "firm_types.h"
14
15 /**
16  * A callback type for creating an intrinsic entity for a given opcode.
17  *
18  * @param method   the method type of the emulation function entity
19  * @param op       the emulated ir_op
20  * @param imode    the input mode of the emulated opcode
21  * @param omode    the output mode of the emulated opcode
22  * @param context  the context parameter
23  */
24 typedef entity *(create_intrinsic_fkt)(ir_type *method, const ir_op *op,
25                                        const ir_mode *imode, const ir_mode *omode,
26                                        void *context);
27
28 /**
29  * The lowering parameter description.
30  */
31 typedef struct _lwrdw_param_t {
32         int enable;                   /**< if true lowering is enabled */
33         int little_endian;            /**< if true should be lowered for little endian, else big endian */
34         ir_mode *high_signed;         /**< the double word signed mode to be lowered, typically Ls */
35         ir_mode *high_unsigned;       /**< the double word unsigned mode to be lowered, typically Lu */
36         ir_mode *low_signed;          /**< the word signed mode to be used, typically Is */
37         ir_mode *low_unsigned;        /**< the word unsigned mode to be used, typically Iu */
38
39         /** callback that creates the intrinsic entity */
40         create_intrinsic_fkt *create_intrinsic;
41         void *ctx;                    /**< context parameter for the creator function */
42 } lwrdw_param_t;
43
44 /**
45  * Lower all double word operations.
46  */
47 void lower_dw_ops(const lwrdw_param_t *param);
48
49 /**
50  * Default implementation. Context is unused.
51  */
52 entity *def_create_intrinsic_fkt(ir_type *method, const ir_op *op,
53                                  const ir_mode *imode, const ir_mode *omode,
54                                  void *context);
55
56 #endif /* _FIRM_LOWER_DW_H */