public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Basile Starynkevitch <basile@starynkevitch.net>
Cc: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org
Subject: Re: PATCH (v2) trunk GCCJIT: adding gcc_jit_context_new_rvalue_from_long_long, etc...
Date: Thu, 01 Jan 2015 00:00:00 -0000	[thread overview]
Message-ID: <1437141581.15571.60.camel@surprise> (raw)
In-Reply-To: <1437140458.15571.58.camel@surprise>

On Fri, 2015-07-17 at 09:40 -0400, David Malcolm wrote:
> On Thu, 2015-07-16 at 11:00 +0200, Basile Starynkevitch wrote:

(snip)

> > + 
> > +/* Specialization of making an rvalue from a const, for host <long
> > long>.  */
> > +
> > +template <>
> > +rvalue *
> > +context::
> > +new_rvalue_from_const <long long> (type *type,
> > +                                  long long value)
> > +{
> > +  // FIXME: type-checking, or coercion?
> > +  tree inner_type = type->as_tree ();
> > +  if (INTEGRAL_TYPE_P (inner_type))
> > +    {
> > +      tree inner = build_int_cst (inner_type, value);
> > +      return new rvalue (this, inner);
> > +    }
> > +  else
> > +    {
> > +      REAL_VALUE_TYPE real_value;
> > +      real_from_integer (&real_value, VOIDmode, value, SIGNED);
> > +      tree inner = build_real (inner_type, real_value);
> > +      return new rvalue (this, inner);
> > +    }
> > +}
> 
> This is probably out-of-scope for this patch, but seeing this made me
> wonder if we ought to add a validation to the various
> "new_rvalue_from_TYPE" APIs to ensure that the host value will fit in
> the target type, and emit an error on the context if the given host
> value won't fit.

Filed as PR jit/66913 for now.  The validation would happen in
libgccjit.c.

(snip)


  reply	other threads:[~2015-07-17 14:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55A6A421.8060707@starynkevitch.net>
2015-01-01  0:00 ` PATCH " David Malcolm
2015-01-01  0:00   ` Basile Starynkevitch
2015-01-01  0:00     ` David Malcolm
2015-01-01  0:00       ` PATCH (v2) " Basile Starynkevitch
2015-01-01  0:00         ` David Malcolm
2015-01-01  0:00           ` David Malcolm [this message]
2015-01-01  0:00           ` Basile Starynkevitch
2015-01-01  0:00   ` PATCH " Basile Starynkevitch
2015-01-01  0:00   ` Basile Starynkevitch
2015-01-01  0:00     ` David Malcolm
2015-01-01  0:00   ` [PATCH, committed] jit: Add guide for submitting patches to jit docs David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437141581.15571.60.camel@surprise \
    --to=dmalcolm@redhat.com \
    --cc=basile@starynkevitch.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).