Open kiranchandramohan opened 2 years ago
Don't forget kinds 3 and 10 for real and complex, too.
@klausler What is real kind 3 BTW?
It's bfloat16 -- the upper 16 bits of a 32-bit IEEE-754 value, as opposed to kind 2, which is 16-bit IEEE.
The size specific integer output calls that Peter introduced are now called -
bool IONAME(OutputInteger8)(Cookie, std::int8_t);
bool IONAME(OutputInteger16)(Cookie, std::int16_t);
bool IONAME(OutputInteger32)(Cookie, std::int32_t);
bool IONAME(OutputInteger64)(Cookie, std::int64_t);
bool IONAME(OutputInteger128)(Cookie, common::int128_t);
For the first-cut implementation of printing various data types, we relied on upcasting or truncating various non-standard data types. At the moment we have the following (based on my understanding of
getOutputFunc
inflang/lib/Lower/IO.cpp
)The truncation caused by (1) will lead to incorrect behaviour due to truncation. The upcasting caused by (2) and (3) is probably OK but there are better ways to print these in the flang I/O runtime API. @klausler points out that convenient APIs for these types are not available since these types are not universally supported in C++. @klausler and @schweitzpgi suggest implementing the output functions for these types using the descriptor-based APIs.
Relevant snippet of
getOutputFunc
given below.