Skip to content

Commit 59fb337

Browse files
committed
Use -ffast-math for calculation of dot product
This reduces the code size for intsimdmatrixavx2 from 2700 to 2668 and slightly improves the performance for fast models with AVX2. Signed-off-by: Stefan Weil <[email protected]>
1 parent fda3ba9 commit 59fb337

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/arch/Makefile.am

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ noinst_LTLIBRARIES = libtesseract_avx.la libtesseract_avx2.la libtesseract_sse.l
1818
noinst_LTLIBRARIES += libtesseract_arch.la
1919

2020
if AVX_OPT
21-
libtesseract_avx_la_CXXFLAGS = -mavx
21+
libtesseract_avx_la_CXXFLAGS = -ffast-math -mavx
2222
endif
2323
if AVX2_OPT
24-
libtesseract_avx2_la_CXXFLAGS = -mavx2
24+
libtesseract_avx2_la_CXXFLAGS = -ffast-math -mavx2
2525
endif
2626
if SSE41_OPT
27-
libtesseract_sse_la_CXXFLAGS = -msse4.1
27+
libtesseract_sse_la_CXXFLAGS = -ffast-math -msse4.1
2828
endif
2929

3030
libtesseract_arch_la_SOURCES = intsimdmatrix.cpp simddetect.cpp

0 commit comments

Comments
 (0)