Commit c117dddc by Kazu Hirata Committed by Kazu Hirata

optabs.c (expand_unop): Widen clz properly when clz is done via libcall.

	* optabs.c (expand_unop): Widen clz properly when clz is done
	via libcall.

From-SVN: r62595
parent 5053bdf8
2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
* optabs.c (expand_unop): Widen clz properly when clz is done
via libcall.
2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/clzsi2.c: Replace "GNU CC" with "GCC".
* config/h8300/crti.asm: Likewise.
* config/h8300/crtn.asm: Likewise.
......
......@@ -2722,6 +2722,14 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
unsignedp);
/* If we are generating clz using wider mode, adjust the
result. */
if (unoptab == clz_optab && temp != 0)
temp = expand_binop (wider_mode, sub_optab, temp,
GEN_INT (GET_MODE_BITSIZE (wider_mode)
- GET_MODE_BITSIZE (mode)),
target, true, OPTAB_DIRECT);
if (temp)
{
if (class != MODE_INT)
......
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