summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2019-03-13 20:22:52 -0700
committerThiago Macieira <thiago.macieira@intel.com>2019-03-14 14:59:28 +0000
commit9649c41ed950eaa7dd9d3cb6d37a05d3a9ed8a3e (patch)
tree0b22019419c9436241dd977519e7b5a67abcd17d /src/tools
parenteb25acc05b177c49eb81b190a476854fbf3c6fb1 (diff)
qfloat16: suppress the tables if FP16 is supported by the CPU
If QtCore is being compiled to a system with FP16 support, then all applications are too and, therefore, we don't need the tables. Saves 12k of read-only data. Change-Id: I46363e5b8944459e8c48fffd158bb53d906df297 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qfloat16-tables/gen_qfloat16_tables.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/qfloat16-tables/gen_qfloat16_tables.cpp b/src/tools/qfloat16-tables/gen_qfloat16_tables.cpp
index a9bf7e86e4..17fc978039 100644
--- a/src/tools/qfloat16-tables/gen_qfloat16_tables.cpp
+++ b/src/tools/qfloat16-tables/gen_qfloat16_tables.cpp
@@ -79,6 +79,7 @@ qint32 main(qint32 argc, char **argv)
fid.write("#include <QtCore/qfloat16.h>\n\n");
fid.write("QT_BEGIN_NAMESPACE\n\n");
+ fid.write("#if !defined(__F16C__) && !defined(__ARM_FP16_FORMAT_IEEE)\n\n");
fid.write("const quint32 qfloat16::mantissatable[2048] = {\n");
fid.write("0,\n");
@@ -155,6 +156,7 @@ qint32 main(qint32 argc, char **argv)
fid.write("};\n\n");
+ fid.write("#endif // !__F16C__ && !__ARM_FP16_FORMAT_IEEE\n\n");
fid.write("QT_END_NAMESPACE\n");
fid.close();
return 0;