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
22 * @brief Lower Double word operations, ie 64bit -> 32bit, 32bit -> 16bit etc.
24 * @author Michael Beck
27 #ifndef FIRM_LOWER_LOWER_DW_H
28 #define FIRM_LOWER_LOWER_DW_H
30 #include "firm_types.h"
33 * A callback type for creating an intrinsic entity for a given opcode.
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
41 typedef ir_entity *(create_intrinsic_fkt)(ir_type *method, const ir_op *op,
42 const ir_mode *imode, const ir_mode *omode,
46 * The lowering parameter description.
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 */
56 /** callback that creates the intrinsic entity */
57 create_intrinsic_fkt *create_intrinsic;
58 void *ctx; /**< context parameter for the creator function */
62 * Lower all double word operations.
64 void lower_dw_ops(const lwrdw_param_t *param);
67 * Default implementation. Context is unused.
69 ir_entity *def_create_intrinsic_fkt(ir_type *method, const ir_op *op,
70 const ir_mode *imode, const ir_mode *omode,
73 #endif /* FIRM_LOWER_LOWER_DW_H */