Commit 0f2f71b5 by Roger Sayle

simplify-rtx.c (simplify_unary_operation): When simplifying (neg (lt X 0)) into…

simplify-rtx.c (simplify_unary_operation): When simplifying (neg (lt X 0)) into (ashiftrt X C) or (lshiftrt X C)...


	* simplify-rtx.c (simplify_unary_operation): When simplifying
	(neg (lt X 0)) into (ashiftrt X C) or (lshiftrt X C), make sure
	that we perform the right shift in the appropriate mode, and
	then extend or truncate the result to requested mode.

From-SVN: r111671
parent e20f9511
2006-03-02 Roger Sayle <roger@eyesopen.com>
* simplify-rtx.c (simplify_unary_operation): When simplifying
(neg (lt X 0)) into (ashiftrt X C) or (lshiftrt X C), make sure
that we perform the right shift in the appropriate mode, and
then extend or truncate the result to requested mode.
2006-03-03 Zdenek Dvorak <dvorakz@suse.cz> 2006-03-03 Zdenek Dvorak <dvorakz@suse.cz>
* gengtype.c (main): Handle double_int type. * gengtype.c (main): Handle double_int type.
...@@ -16,7 +23,8 @@ ...@@ -16,7 +23,8 @@
2006-03-02 Zdenek Dvorak <dvorakz@suse.cz> 2006-03-02 Zdenek Dvorak <dvorakz@suse.cz>
* tree-vrp.c (remove_range_assertions): Do not update statements unnecessarily. * tree-vrp.c (remove_range_assertions): Do not update statements
unnecessarily.
2006-03-02 Zdenek Dvorak <dvorakz@suse.cz> 2006-03-02 Zdenek Dvorak <dvorakz@suse.cz>
......
...@@ -590,12 +590,28 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) ...@@ -590,12 +590,28 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
if (GET_CODE (op) == LT if (GET_CODE (op) == LT
&& XEXP (op, 1) == const0_rtx) && XEXP (op, 1) == const0_rtx)
{ {
enum machine_mode inner = GET_MODE (XEXP (op, 0));
int isize = GET_MODE_BITSIZE (inner);
if (STORE_FLAG_VALUE == 1) if (STORE_FLAG_VALUE == 1)
return simplify_gen_binary (ASHIFTRT, mode, XEXP (op, 0), {
GEN_INT (GET_MODE_BITSIZE (mode) - 1)); temp = simplify_gen_binary (ASHIFTRT, inner, XEXP (op, 0),
GEN_INT (isize - 1));
if (mode == inner)
return temp;
if (GET_MODE_BITSIZE (mode) > isize)
return simplify_gen_unary (SIGN_EXTEND, mode, temp, inner);
return simplify_gen_unary (TRUNCATE, mode, temp, inner);
}
else if (STORE_FLAG_VALUE == -1) else if (STORE_FLAG_VALUE == -1)
return simplify_gen_binary (LSHIFTRT, mode, XEXP (op, 0), {
GEN_INT (GET_MODE_BITSIZE (mode) - 1)); temp = simplify_gen_binary (LSHIFTRT, inner, XEXP (op, 0),
GEN_INT (isize - 1));
if (mode == inner)
return temp;
if (GET_MODE_BITSIZE (mode) > isize)
return simplify_gen_unary (ZERO_EXTEND, mode, temp, inner);
return simplify_gen_unary (TRUNCATE, mode, temp, inner);
}
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment