[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

missing gcc_jit_context_new_rvalue_from_long_long etc....?



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