This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, middle-end]: Generate +QNaN using real_nan() in reg-stack.c
- From: "Uros Bizjak" <ubizjak at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 6 Nov 2008 09:40:03 +0100
- Subject: [PATCH, middle-end]: Generate +QNaN using real_nan() in reg-stack.c
Hello!
Instead of playing tricks with gen_lowpart, this patch generates +QNaN
using available infrastructure for manipulating real numbers.
2008-11-06 Uros Bizjak <ubizjak@gmail.com>
* reg-stack.c (reg_to_stack): Generate +QNaN using real_nan.
Patch was bootstrapped and regression tested on i686-pc-linux-gnu. OK
for mainline under obvious rule?
Thanks,
Uros.
Index: reg-stack.c
===================================================================
--- reg-stack.c (revision 141603)
+++ reg-stack.c (working copy)
@@ -3180,14 +3180,17 @@ reg_to_stack (void)
??? We can't load from constant memory in PIC mode, because
we're inserting these instructions before the prologue and
the PIC register hasn't been set up. In that case, fall back
- on zero, which we can get from `ldz'. */
+ on zero, which we can get from `fldz'. */
if ((flag_pic && !TARGET_64BIT)
|| ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC)
not_a_num = CONST0_RTX (SFmode);
else
{
- not_a_num = gen_lowpart (SFmode, GEN_INT (0x7fc00000));
+ REAL_VALUE_TYPE r;
+
+ real_nan (&r, "", 1, SFmode);
+ not_a_num = CONST_DOUBLE_FROM_REAL_VALUE (r, SFmode);
not_a_num = force_const_mem (SFmode, not_a_num);
}