2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
23 * @author Michael Beck
24 * @brief Lower Double word operations, ie Mode L -> I
29 #ifndef _FIRM_LOWER_DW_H
30 #define _FIRM_LOWER_DW_H
32 #include "firm_types.h"
35 * A callback type for creating an intrinsic entity for a given opcode.
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
43 typedef ir_entity *(create_intrinsic_fkt)(ir_type *method, const ir_op *op,
44 const ir_mode *imode, const ir_mode *omode,
48 * The lowering parameter description.
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 */
58 /** callback that creates the intrinsic entity */
59 create_intrinsic_fkt *create_intrinsic;
60 void *ctx; /**< context parameter for the creator function */
64 * Lower all double word operations.
66 void lower_dw_ops(const lwrdw_param_t *param);
69 * Default implementation. Context is unused.
71 ir_entity *def_create_intrinsic_fkt(ir_type *method, const ir_op *op,
72 const ir_mode *imode, const ir_mode *omode,
75 #endif /* _FIRM_LOWER_DW_H */