Commit 254878ea by Roger Sayle Committed by Roger Sayle

builtins.c (expand_builtin_signbit): Use extract_bit_field instead of…

builtins.c (expand_builtin_signbit): Use extract_bit_field instead of gen_highpart or gen_lowpart when...


	* builtins.c (expand_builtin_signbit): Use extract_bit_field instead
	of gen_highpart or gen_lowpart when the floating point format is
	wider than the result mode.

Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>

From-SVN: r77439
parent b1053160
2004-02-06 Roger Sayle <roger@eyesopen.com>
Ulrich Weigand <uweigand@de.ibm.com>
* builtins.c (expand_builtin_signbit): Use extract_bit_field instead
of gen_highpart or gen_lowpart when the floating point format is
wider than the result mode.
2004-02-06 Andrew Pinski <pinskia@physics.uc.edu> 2004-02-06 Andrew Pinski <pinskia@physics.uc.edu>
* dwarf2out.c (loclabel_num): Move into #ifdef * dwarf2out.c (loclabel_num): Move into #ifdef
......
...@@ -4986,19 +4986,19 @@ expand_builtin_signbit (tree exp, rtx target) ...@@ -4986,19 +4986,19 @@ expand_builtin_signbit (tree exp, rtx target)
temp = expand_expr (arg, NULL_RTX, VOIDmode, 0); temp = expand_expr (arg, NULL_RTX, VOIDmode, 0);
temp = gen_lowpart (imode, temp); temp = gen_lowpart (imode, temp);
if (GET_MODE_BITSIZE (imode) < GET_MODE_BITSIZE (rmode)) if (GET_MODE_BITSIZE (imode) > GET_MODE_BITSIZE (rmode))
temp = gen_lowpart (rmode, temp);
else if (GET_MODE_BITSIZE (imode) > GET_MODE_BITSIZE (rmode))
{ {
if (bitpos > GET_MODE_BITSIZE (rmode)) if (BITS_BIG_ENDIAN)
{ bitpos = GET_MODE_BITSIZE (imode) - 1 - bitpos;
temp = gen_highpart (rmode, temp); temp = copy_to_mode_reg (imode, temp);
bitpos %= GET_MODE_BITSIZE (rmode); temp = extract_bit_field (temp, 1, bitpos, 1,
NULL_RTX, rmode, rmode,
GET_MODE_SIZE (imode));
} }
else else
{
if (GET_MODE_BITSIZE (imode) < GET_MODE_BITSIZE (rmode))
temp = gen_lowpart (rmode, temp); temp = gen_lowpart (rmode, temp);
}
if (bitpos < HOST_BITS_PER_WIDE_INT) if (bitpos < HOST_BITS_PER_WIDE_INT)
{ {
hi = 0; hi = 0;
...@@ -5014,6 +5014,7 @@ expand_builtin_signbit (tree exp, rtx target) ...@@ -5014,6 +5014,7 @@ expand_builtin_signbit (tree exp, rtx target)
temp = expand_binop (rmode, and_optab, temp, temp = expand_binop (rmode, and_optab, temp,
immed_double_const (lo, hi, rmode), immed_double_const (lo, hi, rmode),
target, 1, OPTAB_LIB_WIDEN); target, 1, OPTAB_LIB_WIDEN);
}
return temp; return temp;
} }
......
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