This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, middle-end]: Generate +QNaN using real_nan() in reg-stack.c
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Uros Bizjak" <ubizjak at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 6 Nov 2008 11:03:54 +0100
- Subject: Re: [PATCH, middle-end]: Generate +QNaN using real_nan() in reg-stack.c
- References: <5787cf470811060040p6b8ca61cw987bc78838d8e15d@mail.gmail.com>
On Thu, Nov 6, 2008 at 9:40 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> 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?
Ok.
Thanks,
Richard.
> 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);
> }
>