Index: builtins.c
===================================================================
--- builtins.c (Revision 124147)
+++ builtins.c (Arbeitskopie)
@@ -230,6 +230,11 @@
int (*)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t));
static tree do_mpfr_sincos (tree, tree, tree);
+/* This array records the insn_code of insns to imlement the signbit
+ function. */
+enum insn_code signbit_optab[NUM_MACHINE_MODES];
+
+
/* Return true if NODE should be considered for inline expansion regardless
of the optimization level. This means whenever a function is invoked with
its "internal" name, which normally contains the prefix "__builtin". */
@@ -5553,12 +5558,15 @@
return tramp;
}
-/* Expand a call to the built-in signbit, signbitf, signbitl, signbitd32,
- signbitd64, or signbitd128 function.
- Return NULL_RTX if a normal call should be emitted rather than expanding
- the function in-line. EXP is the expression that is a call to the builtin
- function; if convenient, the result should be placed in TARGET. */
-
+/* Expand the call EXP to the built-in signbit, signbitf or signbitl
+ function. The function first checks whether the back end provides
+ an insn to implement signbit for the respective mode. If not, it
+ checks whether the floating point format of the value is such that
+ the sign bit can be extracted. If that is not the case, the
+ function returns NULL_RTX to indicate that a normal call should be
+ emitted rather than expanding the function in-line. EXP is the
+ expression that is a call to the builtin function; if convenient,
+ the result should be placed in TARGET. */
static rtx
expand_builtin_signbit (tree exp, rtx target)
{
@@ -5567,6 +5575,7 @@
HOST_WIDE_INT hi, lo;
tree arg;
int word, bitpos;
+ enum insn_code signbit_insn_code;
rtx temp;
if (!validate_arglist (exp, REAL_TYPE, VOID_TYPE))
@@ -5577,6 +5586,19 @@
rmode = TYPE_MODE (TREE_TYPE (exp));
fmt = REAL_MODE_FORMAT (fmode);
+ /* Expand the argument yielding a RTX expression. */
+ temp = expand_normal (arg);