public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Converting float -> double, double -> float
@ 2024-04-30 17:44 Lukasz Stafiniak
  0 siblings, 0 replies; only message in thread
From: Lukasz Stafiniak @ 2024-04-30 17:44 UTC (permalink / raw)
  To: jit

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

Hi!

I know these conversions are prohibited, because I get errors like:

  libgccjit.so: error: gcc_jit_context_new_binary_op: mismatching types for
binary op: a: (float)(float *)0x55f43a23ac00[...] (type: float) b:
(float)n4[...] + (float)((float *)&n28)[...] (type: double)

The error does not trigger at the gcc_jit_context_new_cast conversion point
(n4 is double), the result of the conversion behaves as if it's still
double.
Auto-generated indices omitted.
I read through the discussions throughout the mailing list's history:
"Clarifying the permitted type conversions"
"Improve doc and comments regarding type casts"
"Handle truncation and extension for casts"
But I didn't find hints of a solution.
How can I make the conversions? Are there builtin functions to invoke?
I use libgccjit via bindings to OCaml.
The bindings haven't been updated in a long time, but I maintain them
and will be happy to update if there's anything missing.

Regards,
Lukasz

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-30 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30 17:44 Converting float -> double, double -> float Lukasz Stafiniak

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