简体   繁体   中英

__fp16 type undefined in GNU ARM C++

I'm trying to use type __fp16 (half precision float) in program compiled with GNU ARM C++ Compiler however whenever I try to declare variable of this type I get an error message __fp16 is not declared . I assume that it's caused by the fact that I lack some header file, but I was unable to find any data on which header it might be. Does anybody know where it's defined / what shall I include?

Yes the target supports half precision operations; it doesn't support doubles.

I got a reply from the GNU team. The solution is to add the compiler command -mfp16-format=ieee . That defines __fp16 to ieee standard (see https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM