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
This commit is contained in:
Kazu Hirata 2003-02-09 04:25:16 +00:00 committed by Kazu Hirata
parent 5053bdf834
commit c117dddced
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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".

View File

@ -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)