Commit f2d236f4 authored by Michael Beck's avatar Michael Beck
Browse files

renamed node type Rot to Rotl to make clear that this is a LEFT rotation

[r20010]
parent 88e79a74
......@@ -72,7 +72,7 @@ enum firmstat_optimizations_t {
FS_OPT_EOR_TO_NOT_BOOL, /**< bool ^ 1 = !bool */
FS_OPT_EOR_TO_NOT, /**< x ^ 0b1..1 = ~x, (a ^ b) & b -> ~a & b */
FS_OPT_NOT_CMP, /**< !(a cmp b) = a !cmp b */
FS_OPT_OR_SHFT_TO_ROT, /**< (x << c) | (x >> (bits - c)) == Rot(x, c) */
FS_OPT_OR_SHFT_TO_ROTL, /**< (x << c) | (x >> (bits - c)) == Rotl(x, c) */
FS_OPT_REASSOC_SHIFT, /**< (x SHF c1) SHF c2 = x SHF (c1+c2) */
FS_OPT_SHIFT_AND, /**< (a SHF c) AND (b SHF c) = (a AND b) SHF c */
FS_OPT_SHIFT_OR, /**< (a SHF c) OR (b SHF c) = (a OR b) SHF c */
......
......@@ -289,7 +289,7 @@
* ir_node *new_Shl (ir_node *op, ir_node *k, ir_mode *mode);
* ir_node *new_Shr (ir_node *op, ir_node *k, ir_mode *mode);
* ir_node *new_Shrs (ir_node *op, ir_node *k, ir_mode *mode);
* ir_node *new_Rot (ir_node *op, ir_node *k, ir_mode *mode);
* ir_node *new_Rotl (ir_node *op, ir_node *k, ir_mode *mode);
* ir_node *new_Cmp (ir_node *op1, ir_node *op2);
* ir_node *new_Conv (ir_node *op, ir_mode *mode);
* ir_node *new_Cast (ir_node *op, ir_type *to_tp);
......@@ -759,10 +759,10 @@
*
* Arithmetic shift right, i.e., sign extended.
*
* ir_node *new_Rot (ir_node *op, ir_node *k, ir_mode *mode)
* ir_node *new_Rotl (ir_node *op, ir_node *k, ir_mode *mode)
* ---------------------------------------------------------
*
* Rotates the operand to the (right?) by k bits.
* Rotates the operand to the left by k bits.
*
* ir_node *new_Carry (ir_node *op1, ir_node *op2, ir_mode *mode)
* ------------------------------------------------------------
......@@ -1648,7 +1648,7 @@ ir_node *new_rd_Shr (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *new_rd_Shrs (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rot node.
/** Constructor for a Rotl node.
*
* @param *db A pointer for debug information.
* @param *irg The IR graph the node belongs to.
......@@ -1657,7 +1657,7 @@ ir_node *new_rd_Shrs (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
ir_node *new_rd_Rot (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *new_rd_Rotl (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode);
......@@ -2486,7 +2486,7 @@ ir_node *new_r_Shr (ir_graph *irg, ir_node *block,
ir_node *new_r_Shrs (ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rot node.
/** Constructor for a Rotl node.
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
......@@ -2494,7 +2494,7 @@ ir_node *new_r_Shrs (ir_graph *irg, ir_node *block,
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
ir_node *new_r_Rot (ir_graph *irg, ir_node *block,
ir_node *new_r_Rotl (ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Conv node.
......@@ -3306,7 +3306,7 @@ ir_node *new_d_Shr (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
*/
ir_node *new_d_Shrs (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rot node.
/** Constructor for a Rotl node.
*
* Adds the node to the block in current_ir_block.
*
......@@ -3315,7 +3315,7 @@ ir_node *new_d_Shrs (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
ir_node *new_d_Rot (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
ir_node *new_d_Rotl (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Cmp node.
*
......@@ -4128,7 +4128,7 @@ ir_node *new_Shr (ir_node *op, ir_node *k, ir_mode *mode);
*/
ir_node *new_Shrs (ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rot node.
/** Constructor for a Rotl node.
*
* Adds the node to the block in current_ir_block.
*
......@@ -4136,7 +4136,7 @@ ir_node *new_Shrs (ir_node *op, ir_node *k, ir_mode *mode);
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
ir_node *new_Rot (ir_node *op, ir_node *k, ir_mode *mode);
ir_node *new_Rotl (ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Cmp node.
*
......
......@@ -688,7 +688,7 @@ void set_CallBegin_call(ir_node *node, ir_node *call);
second arithmetic value as listed in tech report 1999-44.
unops are: Minus, Abs, Not, Conv, Cast
binops are: Add, Sub, Mul, Quot, DivMod, Div, Mod, And, Or, Eor, Shl,
Shr, Shrs, Rot, Cmp */
Shr, Shrs, Rotl, Cmp */
int is_unop(const ir_node *node);
ir_node *get_unop_op(const ir_node *node);
void set_unop_op(ir_node *node, ir_node *op);
......@@ -884,10 +884,10 @@ void set_Shrs_left(ir_node *node, ir_node *left);
ir_node *get_Shrs_right(const ir_node *node);
void set_Shrs_right(ir_node *node, ir_node *right);
ir_node *get_Rot_left(const ir_node *node);
void set_Rot_left(ir_node *node, ir_node *left);
ir_node *get_Rot_right(const ir_node *node);
void set_Rot_right(ir_node *node, ir_node *right);
ir_node *get_Rotl_left(const ir_node *node);
void set_Rotl_left(ir_node *node, ir_node *left);
ir_node *get_Rotl_right(const ir_node *node);
void set_Rotl_right(ir_node *node, ir_node *right);
ir_node *get_Conv_op(const ir_node *node);
void set_Conv_op(ir_node *node, ir_node *op);
......@@ -1274,8 +1274,8 @@ int is_Shl(const ir_node *node);
int is_Shr(const ir_node *node);
/** Returns true if node is a Shrs node. */
int is_Shrs(const ir_node *node);
/** Returns true if node is a Rot node. */
int is_Rot(const ir_node *node);
/** Returns true if node is a Rotl node. */
int is_Rotl(const ir_node *node);
/** Returns true if node is a Psi node. */
int is_Psi(const ir_node *node);
/** Returns true if node is an Id node. */
......
......@@ -84,7 +84,7 @@ typedef enum {
iro_Sel,
iro_Call, iro_Add, iro_Sub, iro_Minus, iro_Mul, iro_Mulh, iro_Quot, iro_DivMod,
iro_Div, iro_Mod, iro_Abs, iro_And, iro_Or, iro_Eor, iro_Not,
iro_Cmp, iro_Shl, iro_Shr, iro_Shrs, iro_Rot, iro_Conv, iro_Cast,
iro_Cmp, iro_Shl, iro_Shr, iro_Shrs, iro_Rotl, iro_Conv, iro_Cast,
iro_Carry, iro_Borrow,
iro_Phi,
iro_Load, iro_Store, iro_Alloc, iro_Free, iro_Sync,
......@@ -154,7 +154,7 @@ extern ir_op *op_Cmp; ir_op *get_op_Cmp (void);
extern ir_op *op_Shl; ir_op *get_op_Shl (void);
extern ir_op *op_Shr; ir_op *get_op_Shr (void);
extern ir_op *op_Shrs; ir_op *get_op_Shrs (void);
extern ir_op *op_Rot; ir_op *get_op_Rot (void);
extern ir_op *op_Rotl; ir_op *get_op_Rotl (void);
extern ir_op *op_Conv; ir_op *get_op_Conv (void);
extern ir_op *op_Cast; ir_op *get_op_Cast (void);
extern ir_op *op_Carry; ir_op *get_op_Carry (void);
......
......@@ -465,8 +465,8 @@ tarval *tarval_shr(tarval *a, tarval *b);
/** Signed (arithmetic) right shift. */
tarval *tarval_shrs(tarval *a, tarval *b);
/** Rotation. */
tarval *tarval_rot(tarval *a, tarval *b);
/** Rotation to left. */
tarval *tarval_rotl(tarval *a, tarval *b);
/**
* Returns the carry flag of the last operation.
......
......@@ -242,7 +242,7 @@ static ir_type *find_type_for_node(ir_node *n) {
case iro_Shl:
case iro_Shr:
case iro_Shrs:
case iro_Rot:
case iro_Rotl:
tp = tp1; break;
case iro_Cast:
tp = get_Cast_type(n); break;
......
......@@ -1549,7 +1549,7 @@ static void arm_register_transformers(void) {
GEN(Shl);
GEN(Shr);
GEN(Shrs);
BAD(Rot); /* unsupported yet */
BAD(Rotl); /* unsupported yet */
GEN(Quot);
......
......@@ -1665,20 +1665,20 @@ static ir_node *gen_Shrs(ir_node *node) {
/**
* Creates an ia32 RotL.
* Creates an ia32 Rol.
*
* @param op1 The first operator
* @param op2 The second operator
* @return The created ia32 RotL node
*/
static ir_node *gen_RotL(ir_node *node, ir_node *op1, ir_node *op2) {
static ir_node *gen_Rol(ir_node *node, ir_node *op1, ir_node *op2) {
return gen_shift_binop(node, op1, op2, new_rd_ia32_Rol, match_immediate);
}
/**
* Creates an ia32 RotR.
* Creates an ia32 Ror.
* NOTE: There is no RotR with immediate because this would always be a RotL
* "imm-mode_size_bits" which can be pre-calculated.
*
......@@ -1686,7 +1686,7 @@ static ir_node *gen_RotL(ir_node *node, ir_node *op1, ir_node *op2) {
* @param op2 The second operator
* @return The created ia32 RotR node
*/
static ir_node *gen_RotR(ir_node *node, ir_node *op1, ir_node *op2) {
static ir_node *gen_Ror(ir_node *node, ir_node *op1, ir_node *op2) {
return gen_shift_binop(node, op1, op2, new_rd_ia32_Ror, match_immediate);
}
......@@ -1697,16 +1697,16 @@ static ir_node *gen_RotR(ir_node *node, ir_node *op1, ir_node *op2) {
*
* @return The created ia32 RotL or RotR node
*/
static ir_node *gen_Rot(ir_node *node) {
static ir_node *gen_Rotl(ir_node *node) {
ir_node *rotate = NULL;
ir_node *op1 = get_Rot_left(node);
ir_node *op2 = get_Rot_right(node);
ir_node *op1 = get_Rotl_left(node);
ir_node *op2 = get_Rotl_right(node);
/* Firm has only Rot (which is a RotL), so we are looking for a right (op2)
/* Firm has only RotL, so we are looking for a right (op2)
operand "-e+mode_size_bits" (it's an already modified "mode_size_bits-e",
that means we can create a RotR instead of an Add and a RotL */
if (get_irn_op(op2) == op_Add) {
if (is_Add(op2)) {
ir_node *add = op2;
ir_node *left = get_Add_left(add);
ir_node *right = get_Add_right(add);
......@@ -1715,19 +1715,19 @@ static ir_node *gen_Rot(ir_node *node) {
ir_mode *mode = get_irn_mode(node);
long bits = get_mode_size_bits(mode);
if (get_irn_op(left) == op_Minus &&
tarval_is_long(tv) &&
get_tarval_long(tv) == bits &&
bits == 32)
if (is_Minus(left) &&
tarval_is_long(tv) &&
get_tarval_long(tv) == bits &&
bits == 32)
{
DB((dbg, LEVEL_1, "RotL into RotR ... "));
rotate = gen_RotR(node, op1, get_Minus_op(left));
rotate = gen_Ror(node, op1, get_Minus_op(left));
}
}
}
if (rotate == NULL) {
rotate = gen_RotL(node, op1, op2);
rotate = gen_Rol(node, op1, op2);
}
return rotate;
......@@ -2235,7 +2235,7 @@ static ir_node *try_create_dest_am(ir_node *node) {
if(get_nodes_block(node) != get_nodes_block(val))
return NULL;
switch(get_irn_opcode(val)) {
switch (get_irn_opcode(val)) {
case iro_Add:
op1 = get_Add_left(val);
op2 = get_Add_right(val);
......@@ -2310,9 +2310,9 @@ static ir_node *try_create_dest_am(ir_node *node) {
new_rd_ia32_SarMem, new_rd_ia32_SarMem,
match_dest_am | match_immediate);
break;
case iro_Rot:
op1 = get_Rot_left(val);
op2 = get_Rot_right(val);
case iro_Rotl:
op1 = get_Rotl_left(val);
op2 = get_Rotl_right(val);
new_node = dest_am_binop(val, op1, op2, mem, ptr, mode,
new_rd_ia32_RolMem, new_rd_ia32_RolMem,
match_dest_am | match_immediate);
......@@ -5239,7 +5239,7 @@ static void register_transformers(void)
GEN(Shl);
GEN(Shr);
GEN(Shrs);
GEN(Rot);
GEN(Rotl);
GEN(Quot);
......
......@@ -659,14 +659,14 @@ static ir_node *gen_Shrs(ppc32_transform_env_t *env) {
}
/**
* Creates an ppc RotL.
* Creates an ppc Rotl.
*
* @param env The transformation environment
* @return the created ppc RotL node
* @return the created ppc Rotl node
*/
static ir_node *gen_Rot(ppc32_transform_env_t *env) {
ir_node *op1 = get_Rot_left(env->irn);
ir_node *op2 = get_Rot_right(env->irn);
static ir_node *gen_Rotl(ppc32_transform_env_t *env) {
ir_node *op1 = get_Rotl_left(env->irn);
ir_node *op2 = get_Rotl_right(env->irn);
if(is_ppc32_Const(op2))
{
......@@ -1302,7 +1302,7 @@ void ppc32_register_transformers(void) {
FIRM_OP(Shl);
FIRM_OP(Shr);
FIRM_OP(Shrs);
FIRM_OP(Rot);
FIRM_OP(Rotl);
FIRM_OP(Quot);
FIRM_OP(Div);
FIRM_OP(DivMod);
......
......@@ -395,7 +395,7 @@ NEW_BD_UNOP(Not)
NEW_BD_BINOP(Shl)
NEW_BD_BINOP(Shr)
NEW_BD_BINOP(Shrs)
NEW_BD_BINOP(Rot)
NEW_BD_BINOP(Rotl)
NEW_BD_UNOP(Abs)
NEW_BD_BINOP(Carry)
NEW_BD_BINOP(Borrow)
......@@ -1050,7 +1050,7 @@ NEW_RD_UNOP(Not)
NEW_RD_BINOP(Shl)
NEW_RD_BINOP(Shr)
NEW_RD_BINOP(Shrs)
NEW_RD_BINOP(Rot)
NEW_RD_BINOP(Rotl)
NEW_RD_UNOP(Abs)
NEW_RD_BINOP(Carry)
NEW_RD_BINOP(Borrow)
......@@ -1607,9 +1607,9 @@ ir_node *new_r_Shrs(ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode) {
return new_rd_Shrs(NULL, irg, block, op, k, mode);
}
ir_node *new_r_Rot(ir_graph *irg, ir_node *block,
ir_node *new_r_Rotl(ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode) {
return new_rd_Rot(NULL, irg, block, op, k, mode);
return new_rd_Rotl(NULL, irg, block, op, k, mode);
}
ir_node *new_r_Carry(ir_graph *irg, ir_node *block,
ir_node *op, ir_node *k, ir_mode *mode) {
......@@ -2466,7 +2466,7 @@ NEW_D_UNOP(Not)
NEW_D_BINOP(Shl)
NEW_D_BINOP(Shr)
NEW_D_BINOP(Shrs)
NEW_D_BINOP(Rot)
NEW_D_BINOP(Rotl)
NEW_D_UNOP(Abs)
NEW_D_BINOP(Carry)
NEW_D_BINOP(Borrow)
......@@ -3016,8 +3016,8 @@ ir_node *new_Shr(ir_node *op, ir_node *k, ir_mode *mode) {
ir_node *new_Shrs(ir_node *op, ir_node *k, ir_mode *mode) {
return new_d_Shrs(NULL, op, k, mode);
}
ir_node *new_Rot(ir_node *op, ir_node *k, ir_mode *mode) {
return new_d_Rot(NULL, op, k, mode);
ir_node *new_Rotl(ir_node *op, ir_node *k, ir_mode *mode) {
return new_d_Rotl(NULL, op, k, mode);
}
ir_node *new_Carry(ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_Carry(NULL, op1, op2, mode);
......
......@@ -1502,7 +1502,7 @@ UNOP(Not)
BINOP(Shl)
BINOP(Shr)
BINOP(Shrs)
BINOP(Rot)
BINOP(Rotl)
BINOP(Cmp)
UNOP(Conv)
UNOP(Cast)
......@@ -2715,8 +2715,8 @@ int
}
int
(is_Rot)(const ir_node *node) {
return _is_Rot(node);
(is_Rotl)(const ir_node *node) {
return _is_Rotl(node);
}
int
......
......@@ -542,9 +542,9 @@ _is_Shrs(const ir_node *node) {
}
static INLINE int
_is_Rot(const ir_node *node) {
_is_Rotl(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Rot);
return (_get_irn_op(node) == op_Rotl);
}
static INLINE int
......@@ -1083,7 +1083,7 @@ _set_Block_mark(ir_node *block, unsigned mark) {
#define is_Shl(node) _is_Shl(node)
#define is_Shr(node) _is_Shr(node)
#define is_Shrs(node) _is_Shrs(node)
#define is_Rot(node) _is_Rot(node)
#define is_Rotl(node) _is_Rotl(node)
#define is_Psi(node) _is_Psi(node)
#define is_Id(node) _is_Id(node)
#define is_Tuple(node) _is_Tuple(node)
......
......@@ -79,7 +79,7 @@ ir_op *op_Cmp; ir_op *get_op_Cmp (void) { return op_Cmp; }
ir_op *op_Shl; ir_op *get_op_Shl (void) { return op_Shl; }
ir_op *op_Shr; ir_op *get_op_Shr (void) { return op_Shr; }
ir_op *op_Shrs; ir_op *get_op_Shrs (void) { return op_Shrs; }
ir_op *op_Rot; ir_op *get_op_Rot (void) { return op_Rot; }
ir_op *op_Rotl; ir_op *get_op_Rotl (void) { return op_Rotl; }
ir_op *op_Conv; ir_op *get_op_Conv (void) { return op_Conv; }
ir_op *op_Cast; ir_op *get_op_Cast (void) { return op_Cast; }
ir_op *op_Carry; ir_op *get_op_Carry (void) { return op_Carry; }
......@@ -321,7 +321,7 @@ init_op(void)
op_Shl = new_ir_op(iro_Shl, "Shl", op_pin_state_floats, N, oparity_binary, 0, 0, NULL);
op_Shr = new_ir_op(iro_Shr, "Shr", op_pin_state_floats, N, oparity_binary, 0, 0, NULL);
op_Shrs = new_ir_op(iro_Shrs, "Shrs", op_pin_state_floats, N, oparity_binary, 0, 0, NULL);
op_Rot = new_ir_op(iro_Rot, "Rot", op_pin_state_floats, N, oparity_binary, 0, 0, NULL);
op_Rotl = new_ir_op(iro_Rotl, "Rotl", op_pin_state_floats, N, oparity_binary, 0, 0, NULL);
op_Conv = new_ir_op(iro_Conv, "Conv", op_pin_state_floats, N, oparity_unary, 0, sizeof(conv_attr), NULL);
op_Cast = new_ir_op(iro_Cast, "Cast", op_pin_state_floats, H, oparity_unary, 0, sizeof(cast_attr), NULL);
op_Carry = new_ir_op(iro_Carry, "Carry", op_pin_state_floats, C, oparity_binary, 0, 0, NULL);
......@@ -409,7 +409,7 @@ void finish_op(void) {
free_ir_op (op_Shl ); op_Shl = NULL;
free_ir_op (op_Shr ); op_Shr = NULL;
free_ir_op (op_Shrs ); op_Shrs = NULL;
free_ir_op (op_Rot ); op_Rot = NULL;
free_ir_op (op_Rotl ); op_Rotl = NULL;
free_ir_op (op_Conv ); op_Conv = NULL;
free_ir_op (op_Cast ); op_Cast = NULL;
free_ir_op (op_Carry ); op_Carry = NULL;
......
......@@ -418,20 +418,20 @@ static tarval *computed_value_Shrs(ir_node *n) {
} /* computed_value_Shrs */
/**
* Return the value of a Rot.
* Return the value of a Rotl.
*/
static tarval *computed_value_Rot(ir_node *n) {
ir_node *a = get_Rot_left(n);
ir_node *b = get_Rot_right(n);
static tarval *computed_value_Rotl(ir_node *n) {
ir_node *a = get_Rotl_left(n);
ir_node *b = get_Rotl_right(n);
tarval *ta = value_of(a);
tarval *tb = value_of(b);
if ((ta != tarval_bad) && (tb != tarval_bad)) {
return tarval_rot (ta, tb);
return tarval_rotl(ta, tb);
}
return tarval_bad;
} /* computed_value_Rot */
} /* computed_value_Rotl */
/**
* Return the value of a Conv.
......@@ -695,7 +695,7 @@ static ir_op_ops *firm_set_default_computed_value(ir_opcode code, ir_op_ops *ops
CASE(Shl);
CASE(Shr);
CASE(Shrs);
CASE(Rot);
CASE(Rotl);
CASE(Carry);
CASE(Borrow);
CASE(Conv);
......@@ -995,7 +995,7 @@ static ir_node *equivalent_node_left_zero(ir_node *n) {
#define equivalent_node_Shl equivalent_node_left_zero
#define equivalent_node_Shr equivalent_node_left_zero
#define equivalent_node_Shrs equivalent_node_left_zero
#define equivalent_node_Rot equivalent_node_left_zero
#define equivalent_node_Rotl equivalent_node_left_zero
/**
* Optimize a - 0 and (a + x) - x (for modes with wrap-around).
......@@ -1736,7 +1736,7 @@ static ir_op_ops *firm_set_default_equivalent_node(ir_opcode code, ir_op_ops *op
CASE(Shl);
CASE(Shr);
CASE(Shrs);
CASE(Rot);
CASE(Rotl);
CASE(Not);
CASE(Minus);
CASE(Mul);
......@@ -3870,11 +3870,11 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_OP);
}
break;
case iro_Rot:
if (get_Rot_right(left) == get_Rot_right(right)) {
/* a ROT X CMP b ROT X ==> a CMP b */
left = get_Rot_left(left);
right = get_Rot_left(right);
case iro_Rotl:
if (get_Rotl_right(left) == get_Rotl_right(right)) {
/* a ROTL X CMP b ROTL X ==> a CMP b */
left = get_Rotl_left(left);
right = get_Rotl_left(right);
changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_OP);
}
......@@ -4522,9 +4522,9 @@ static ir_node *transform_node_Or_bf_store(ir_node *or) {
} /* transform_node_Or_bf_store */
/**
* Optimize an Or(shl(x, c), shr(x, bits - c)) into a Rot
* Optimize an Or(shl(x, c), shr(x, bits - c)) into a Rotl
*/
static ir_node *transform_node_Or_Rot(ir_node *or) {
static ir_node *transform_node_Or_Rotl(ir_node *or) {
ir_mode *mode = get_irn_mode(or);
ir_node *shl, *shr, *block;
ir_node *irn, *x, *c1, *c2, *v, *sub, *n;
......@@ -4570,9 +4570,9 @@ static ir_node *transform_node_Or_Rot(ir_node *or) {
/* yet, condition met */
block = get_irn_n(or, -1);
n = new_r_Rot(current_ir_graph, block, x, c1, mode);
n = new_r_Rotl(current_ir_graph, block, x, c1, mode);
DBG_OPT_ALGSIM1(or, shl, shr, n, FS_OPT_OR_SHFT_TO_ROT);
DBG_OPT_ALGSIM1(or, shl, shr, n, FS_OPT_OR_SHFT_TO_ROTL);
return n;
} else if (is_Sub(c1)) {
v = c2;
......@@ -4596,9 +4596,9 @@ static ir_node *transform_node_Or_Rot(ir_node *or) {
block = get_nodes_block(or);
/* a Rot right is not supported, so use a rot left */
n = new_r_Rot(current_ir_graph, block, x, sub, mode);
n = new_r_Rotl(current_ir_graph, block, x, sub, mode);
DBG_OPT_ALGSIM0(or, n, FS_OPT_OR_SHFT_TO_ROT);
DBG_OPT_ALGSIM0(or, n, FS_OPT_OR_SHFT_TO_ROTL);
return n;
} else if (is_Sub(c2)) {
v = c1;
......@@ -4619,14 +4619,14 @@ static ir_node *transform_node_Or_Rot(ir_node *or) {
block = get_irn_n(or, -1);
/* a Rot Left */
n = new_r_Rot(current_ir_graph, block, x, v, mode);
n = new_r_Rotl(current_ir_graph, block, x, v, mode);
DBG_OPT_ALGSIM0(or, n, FS_OPT_OR_SHFT_TO_ROT);
DBG_OPT_ALGSIM0(or, n, FS_OPT_OR_SHFT_TO_ROTL);
return n;
}
return or;
} /* transform_node_Or_Rot */
} /* transform_node_Or_Rotl */
/**
* Transform an Or.
......@@ -4671,7 +4671,7 @@ static ir_node *transform_node_Or(ir_node *n) {
HANDLE_BINOP_PHI(tarval_or, a, b, c, mode);
n = transform_node_Or_bf_store(n);
n = transform_node_Or_Rot(n);
n = transform_node_Or_Rotl(n);
if (n != oldn)
return n;
......@@ -4685,7 +4685,7 @@ static ir_node *transform_node_Or(ir_node *n) {
static ir_node *transform_node(ir_node *n);
/**
* Optimize (a >> c1) >> c2), works for Shr, Shrs, Shl, Rot.
* Optimize (a >> c1) >> c2), works for Shr, Shrs, Shl, Rotl.
*
* Should be moved to reassociation?
*/
......@@ -4782,17 +4782,17 @@ static ir_node *transform_node_Shl(ir_node *n) {
} /* transform_node_Shl */
/**
* Transform a Rot.
* Transform a Rotl.
*/
static ir_node *transform_node_Rot(ir_node *n) {
static ir_node *transform_node_Rotl(ir_node *n) {
ir_node *c, *oldn = n;
ir_node *a = get_Rot_left(n);
ir_node *b = get_Rot_right(n);
ir_node *a = get_Rotl_left(n);
ir_node *b = get_Rotl_right(n);
ir_mode *mode = get_irn_mode(n);
HANDLE_BINOP_PHI(tarval_rot, a, b, c, mode);
HANDLE_BINOP_PHI(tarval_rotl, a, b, c, mode);
return transform_node_shift(n);
} /* transform_node_Rot */
} /* transform_node_Rotl */
/**
* Transform a Conv.
......@@ -5183,7 +5183,7 @@ static ir_op_ops *firm_set_default_transform_node(ir_opcode code, ir_op_ops *ops
CASE(Shr);
CASE(Shrs);
CASE(Shl);
CASE(Rot);
CASE(Rotl);
CASE(Conv);
CASE(End);
CASE(Mux);
......
......@@ -1538,21 +1538,21 @@ static int verify_node_Shift(ir_node *n, ir_graph *irg) {
#define verify_node_Shrs verify_node_Shift