public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* missing gcc_jit_context_new_rvalue_from_long_long etc....?
@ 2015-01-01  0:00 Basile Starynkevitch
  2015-01-01  0:00 ` David Malcolm
  0 siblings, 1 reply; 7+ messages in thread
From: Basile Starynkevitch @ 2015-01-01  0:00 UTC (permalink / raw)
  To: jit

Hello all,

It looks like we are missing functions to create various rvalues from
various numerical types, e.g.

   gcc_jit_rvalue * 
   gcc_jit_context_new_rvalue_from_long_long(gcc_jit_context *ctxt, 
                                             gcc_jit_type *numeric_type, 
                                             
   gcc_jit_rvalue *
   gcc_jit_context_new_rvalue_from_int64(gcc_jit_context *ctxt,
                                             gcc_jit_type *numeric_type,
                                             int64_t value);

   gcc_jit_rvalue *
   gcc_jit_context_new_rvalue_from_uint64(gcc_jit_context *ctxt,
                                             gcc_jit_type *numeric_type,
                                             uint64_t value);


   gcc_jit_rvalue *
   gcc_jit_context_new_rvalue_from_long_double(gcc_jit_context *ctxt,
                                             gcc_jit_type *numeric_type,
                                             long double value);

and many more (int128_t & intptr_t perhaps, and all the types defined
by the C99 standard in <stdint.h>?).

On x86-64/Linux this does not matters much, because `long` are 64 bits already.
On some 32 bits architecture (ia32 a.k.a. 32 bits x86, or ARM) it might matter more.

Perhaps we might want to parse some constants from a string, and have some

   gcc_jit_rvalue *
   gcc_jit_context_new_rvalue_from_parsed_string(gcc_jit_context *ctxt,
                                             gcc_jit_type *numeric_type,
                                             const char*string);

where string could be something like "0x123456789abcdef0" or "007"
(i.e. C-like lexical conventions)

Regards.

-- 
Basile Starynkevitch        http://starynkevitch.net/Basile/
France
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-16 15:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01  0:00 missing gcc_jit_context_new_rvalue_from_long_long etc....? Basile Starynkevitch
2015-01-01  0:00 ` David Malcolm
2015-01-01  0:00   ` Basile Starynkevitch
2015-01-01  0:00   ` cross-compilation & libgccjit Basile Starynkevitch
2015-01-01  0:00     ` David Malcolm
2015-01-01  0:00       ` Basile Starynkevitch
2015-01-01  0:00   ` missing gcc_jit_context_new_rvalue_from_long_long etc....? Basile Starynkevitch

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).