diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-09 04:25:16 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-09 04:25:16 +0000 |
commit | 7f10ce853cc23d553ec4cbbb5c85c60c24fca5eb (patch) | |
tree | 9c41d4715db8183fa4cc21bb3b2577b70c3e259f /gcc/optabs.c | |
parent | b717879b20e0d5ea2cbf8da1808b8865fd6b06c9 (diff) | |
download | gcc-7f10ce853cc23d553ec4cbbb5c85c60c24fca5eb.tar.gz |
* optabs.c (expand_unop): Widen clz properly when clz is done
via libcall.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62595 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 6fcdb1d9611..226b199daa0 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -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) |