libFirm
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
irarch.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1995-2008 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
26
#ifndef FIRM_IR_IRARCH_H
27
#define FIRM_IR_IRARCH_H
28
29
#include "
firm_types.h
"
30
#include "
begin.h
"
31
35
typedef
enum
instr {
36
LEA
,
37
SHIFT
,
38
SUB
,
39
ADD
,
40
ZERO
,
41
MUL
,
42
ROOT
43
}
insn_kind
;
44
54
typedef
int (*
evaluate_costs_func
)(
insn_kind
kind,
const
ir_mode
*mode,
ir_tarval
*tv);
55
60
typedef
struct
ir_settings_arch_dep_t
{
61
/* Mul optimization */
62
unsigned
also_use_subs
: 1;
63
unsigned
maximum_shifts
;
64
unsigned
highest_shift_amount
;
67
evaluate_costs_func
evaluate
;
69
/* Div/Mod optimization */
70
unsigned
allow_mulhs
: 1;
71
unsigned
allow_mulhu
: 1;
72
unsigned
max_bits_for_mulh
;
74
}
ir_settings_arch_dep_t
;
75
80
typedef
const
ir_settings_arch_dep_t
*(*arch_dep_params_factory_t)(void);
81
85
typedef
enum
{
86
arch_dep_none = 0,
87
arch_dep_mul_to_shift
= 1,
88
arch_dep_div_by_const
= 2,
89
arch_dep_mod_by_const
= 4
90
}
arch_dep_opts_t
;
91
ENUM_BITSET
(
arch_dep_opts_t
)
92
93
97
FIRM_API
void
arch_dep_set_opts
(
arch_dep_opts_t
opts);
98
106
FIRM_API
ir_node
*
arch_dep_replace_mul_with_shifts
(
ir_node
*irn);
107
123
FIRM_API
ir_node
*
arch_dep_replace_div_by_const
(
ir_node
*irn);
124
140
FIRM_API
ir_node
*
arch_dep_replace_mod_by_const
(
ir_node
*irn);
141
142
#include "end.h"
143
144
#endif
libfirm
irarch.h
Generated on Sat Nov 24 2012 19:13:48 for libFirm by
1.8.1.2