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