public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [GSoC-19] Implementing narrowing functions like fadd
@ 2019-07-03 12:53 Tejas Joshi
  2019-07-06 12:53 ` Tejas Joshi
  0 siblings, 1 reply; 11+ messages in thread
From: Tejas Joshi @ 2019-07-03 12:53 UTC (permalink / raw)
  To: gcc; +Cc: Martin Jambor, hubicka, joseph

Hello.
Functions like fadd, faddl take two arguments, do the addition and
return the answer in narrower precision than the argument type. The
thing that might be helpful is using the do_add function directly, if
appropriate?
The thing to consider about narrowed down return type is how it can be
achieved. The functions that operate on real numbers like real_round
and so on, do not consider the return type and do calculations on the
entire real number representation. So just defining these functions
and their return type in builtins.def and other appropriate places
would do the trick?
like:
BT_FN_FLOAT_DOUBLE_DOUBLE as return and argument type for FADD

Or it has to be narrowed down by zeroing down the trailing
out-of-precision bits?
Also, if the addition or any one of the argument exceeds the return
size, the integer part of the addition would not fit in the narrowed
type. Like, 2^32 would easily fit in double but will lose its least
significant bit in float and become 2^31. How these types are supposed
to be handled?

Thanks,
-Tejas

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

end of thread, other threads:[~2019-08-06 15:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03 12:53 [GSoC-19] Implementing narrowing functions like fadd Tejas Joshi
2019-07-06 12:53 ` Tejas Joshi
2019-07-10 11:28   ` Tejas Joshi
2019-07-10 12:33     ` Richard Sandiford
2019-07-23 17:05       ` Tejas Joshi
2019-07-24 16:23         ` Joseph Myers
     [not found]         ` <ri68ssk1znm.fsf@suse.cz>
2019-07-27  6:16           ` Tejas Joshi
2019-07-29 17:17             ` Martin Jambor
2019-07-31  6:30               ` Tejas Joshi
2019-08-02 10:34                 ` Tejas Joshi
2019-08-06 15:40                   ` Tejas Joshi

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