public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* libgccjit: Clarifying the permitted type conversions
@ 2020-07-09 14:15 Alex Coplan
  2020-07-21  8:27 ` Alex Coplan
  2020-07-22  8:45 ` [PATCH] libgccjit: Improve doc and comments regarding type casts (Was: Clarifying the permitted type conversions) Andrea Corallo
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Coplan @ 2020-07-09 14:15 UTC (permalink / raw)
  To: jit; +Cc: David Malcolm, nd

Hello,

I have some questions about the type conversions allowed by the
libgccjit interface.

Firstly, I believe it is the case that the intent is that all implicit
conversions are forbidden. Is this correct?

Secondly, I wanted to clarify the situation with respect to explicit
casts; that is, those conversions allowed by gcc_jit_context_new_cast().
The docs [0] say:

Currently only a limited set of conversions are possible:
 - int <-> float
 - int <-> bool
 - P* <-> Q*, for pointer types P and Q

However, empirically (at least on aarch64), libgccjit appears to allow
me to compile casts between any pair of types in the following set
without any complaint:

{
  SIGNED_CHAR,
  UNSIGNED_CHAR,
  SHORT,
  UNSIGNED_SHORT,
  INT,
  UNSIGNED_INT,
  LONG,
  UNSIGNED_LONG,
  LONG_LONG,
  UNSIGNED_LONG_LONG
}

Is this intended behaviour? If so, does the documentation need to be
updated here? If not, perhaps there are some checks missing in the
libgccjit interface?

Many thanks,
Alex

[0] : https://gcc.gnu.org/onlinedocs/jit/topics/expressions.html

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

end of thread, other threads:[~2020-09-09  7:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 14:15 libgccjit: Clarifying the permitted type conversions Alex Coplan
2020-07-21  8:27 ` Alex Coplan
2020-07-22  8:45 ` [PATCH] libgccjit: Improve doc and comments regarding type casts (Was: Clarifying the permitted type conversions) Andrea Corallo
2020-08-06  7:40   ` [PATCH] libgccjit: Improve doc and comments regarding type casts Andrea Corallo
2020-09-09  7:56     ` Andrea Corallo

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