2 * Copyright (C) 1995-2008 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 ia32 architecture variants
23 * @author Michael Beck, Matthias Braun
24 * @version $Id: bearch_ia32_t.h 16363 2007-10-25 23:27:07Z beck $
26 #ifndef FIRM_BE_IA32_ARCHITECTURE_H
27 #define FIRM_BE_IA32_ARCHITECTURE_H
30 /** use leave in function epilogue */
32 /** use inc, dec instead of add ,1 and add, -1 */
33 unsigned use_incdec:1;
34 /** use sse2 instructions (instead of x87) */
36 /** use ffreep instead of fpop */
37 unsigned use_ffreep:1;
38 /** use ftst where possible */
40 /** use femms to pop all float registers */
42 /** use emms to pop all float registers */
44 /** use the fucomi instruction */
45 unsigned use_fucomi:1;
46 /** use cmovXX instructions */
48 /** use add esp, 4 instead of pop */
49 unsigned use_add_esp_4:1;
50 /** use add esp, 8 instead of 2 pop's */
51 unsigned use_add_esp_8:1;
52 /** use sub esp, 4 instead of push */
53 unsigned use_sub_esp_4:1;
54 /** use sub esp, 8 instead of 2 push's */
55 unsigned use_sub_esp_8:1;
56 /** use imul mem, imm32 instruction (slow on some cpu's */
57 unsigned use_imul_mem_imm32:1;
58 /** use mov reg, 0 instruction */
60 /** pad Ret that are destination of conditional jump or directly preceded
61 by other jump instruction. */
62 unsigned use_pad_return;
63 /** optimize calling convention where possible */
64 unsigned optimize_cc:1;
66 * disrespect current floating point rounding mode at entry and exit of
67 * functions (this is ok for programs that don't explicitly change the
70 unsigned use_unsafe_floatconv:1;
71 /** function alignment (a power of two in bytes) */
72 unsigned function_alignment;
73 /** alignment for labels (which are expected to be frequent jump targets) */
74 unsigned label_alignment;
75 /** if a blocks execfreq is factor higher than it's predecessor then align
76 * the blocks label (0 switches of label alignment) */
77 double label_alignment_factor;
78 } ia32_code_gen_config_t;
80 extern ia32_code_gen_config_t ia32_cg_config;
82 void ia32_init_architecture(void);
83 void ia32_setup_cg_config(void);
85 int ia32_evaluate_insn(insn_kind kind, tarval *tv);