2 * Copyright (C) 1995-2011 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 mode_b operations to something the backend can handle
23 * @author Matthias Braun, Christoph Mallon
25 * Most machines can't really manipulate mode_b values (which are usually
26 * modeled as cpu flags). So you often have to convert them into machine words
27 * with the values 0/1 and operate on them instead.
29 * After this pass the following holds:
30 * - The only inputs with mode_b are for the Cond node and the Sel input of
32 * - The only nodes producing mode_b are: Proj(Cmp)
34 #ifndef FIRM_LOWER_MODE_B_H
35 #define FIRM_LOWER_MODE_B_H
37 #include "firm_types.h"
40 * Lowers mode_b operations to integer arithmetic. After the lowering the only
41 * operations with mode_b are the Projs of Cmps; the only nodes with mode_b
42 * inputs are Cond and Psi nodes.
44 * Example: Psi(a < 0, 1, 0) => a >> 31
46 * @param irg the firm graph to lower
47 * @param lowered_mode mode that is used to transport 0/1 values
49 void ir_lower_mode_b(ir_graph *irg, ir_mode *lowered_mode);