diff options
Diffstat (limited to 'util/qfloat16-tables')
-rw-r--r-- | util/qfloat16-tables/gen_qfloat16_tables.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/util/qfloat16-tables/gen_qfloat16_tables.cpp b/util/qfloat16-tables/gen_qfloat16_tables.cpp index 5aca0235e3..faedb5073c 100644 --- a/util/qfloat16-tables/gen_qfloat16_tables.cpp +++ b/util/qfloat16-tables/gen_qfloat16_tables.cpp @@ -41,6 +41,18 @@ #include <stdint.h> #include <stdio.h> +/* + * This tool generates the tables used by qfloat16 to implement a + * software-emulated version of IEEE 754 binary16. qfloat16 automatically uses + * CPU instructions to convert to and from float (IEEE 754 binary32), but if + * the CPU is not guaranteed to have those instructions available at compile + * time, then qfloat16 needs the tables to perform the conversion with + * reasonable performance. + * + * Because Qt requires float to be IEEE 754 binary32, these tables are + * platform-independent and will never change. + */ + uint32_t convertmantissa(int32_t i) { uint32_t m = i << 13; // Zero pad mantissa bits @@ -64,7 +76,7 @@ int main() { uint32_t i; - printf("/* This file was generated by gen_qfloat16_tables.cpp */\n\n"); + printf("/* This file was generated by util/qfloat16-tables/gen_qfloat16_tables.cpp */\n\n"); printf("#include <QtCore/qfloat16.h>\n\n"); printf("QT_BEGIN_NAMESPACE\n\n"); |