Skip to content

Commit

Permalink
qfloat16: Check in the tables to Git
Browse files Browse the repository at this point in the history
It's a 38k source file, which makes it MUCH smaller than other generated
files like qlocale_data_p.h (982k) and qunicodetables.cpp (718k). The
constants are platform-independent, since they are defined by IEEE 754,
so they will never change.

The generator tool is moved to util/ and removed from the build. That's
one fewer bootstrapped tool to have to worry about.

The output file is committed as .cpp so it won't get installed.

Fixes: QTBUG-76165
Change-Id: I2b1955a995ad40f3b89afffd15a3ded58dc3e35f
Reviewed-by: Allan Sandfeld Jensen <[email protected]>
  • Loading branch information
thiagomacieira committed Jun 3, 2019
1 parent 26e5aa4 commit 5e40d3d
Show file tree
Hide file tree
Showing 8 changed files with 3,276 additions and 29 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ qt*-config.pri
/src/angle/src/QtANGLE/libANGLE/
/src/angle/src/libGLESv2/libANGLE/

/src/corelib/global/qfloat16tables.cpp

/examples/*/*/*
!/examples/*/*/*[.]*
!/examples/*/*/README
Expand Down
15 changes: 4 additions & 11 deletions src/corelib/global/global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ SOURCES += \
global/qrandom.cpp \
global/qhooks.cpp

# To get listed in IDEs
false: SOURCES += \
global/qfloat16tables.cpp

# Only add global/qfloat16_f16c.c if qfloat16.cpp can't #include it.
# Any compiler: if it is already generating F16C code, let qfloat16.cpp do it
# Clang: ICE if not generating F16C code, so use qfloat16_f16c.c
Expand Down Expand Up @@ -124,14 +128,3 @@ gcc:ltcg {
} else {
SOURCES += $$VERSIONTAGGING_SOURCES
}

QMAKE_QFLOAT16_TABLES_GENERATE = global/qfloat16.h

qtPrepareTool(QMAKE_QFLOAT16_TABLES, qfloat16-tables)

qfloat16_tables.commands = $$QMAKE_QFLOAT16_TABLES > ${QMAKE_FILE_OUT}
qfloat16_tables.output = global/qfloat16tables.cpp
qfloat16_tables.depends = $$QMAKE_QFLOAT16_TABLES_EXE
qfloat16_tables.input = QMAKE_QFLOAT16_TABLES_GENERATE
qfloat16_tables.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += qfloat16_tables
1 change: 1 addition & 0 deletions src/corelib/global/qfloat16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype l

QT_END_NAMESPACE

#include "qfloat16tables.cpp"
#ifdef QFLOAT16_INCLUDE_FAST
# include "qfloat16_f16c.c"
#endif
Loading

0 comments on commit 5e40d3d

Please sign in to comment.