mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Build: Turn off floating-point contraction for C++
Clang and GCC fuse a * b + c into one rounding on CPUs that have fused multiply-add, which on ARM64 made the interpreter's dot products, vavg, vdet and vqmul round differently from x86-64. Fused operations now only happen where the code asks for them. MSVC doesn't contract by default. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
b9144d4fca
commit
1206528e45
3 files changed
+6
-2
No files matched your search
@@ -496,6 +496,9 @@ if(NOT MSVC)
|
||||
|
||||
add_compile_options(-fno-math-errno)
|
||||
|
||||
# No fused multiply-adds unless written explicitly, so float results are the same on every CPU.
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-ffp-contract=off>")
|
||||
|
||||
if(X86)
|
||||
# enable sse2 code generation (enabled by default on X86_64)
|
||||
if(NOT MACOSX)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
LOCAL_CFLAGS := -DUSE_FFMPEG -DWITH_UPNP -DUSING_GLES2 -DZ7_CRC_NUM_TABLES=1 -DMOBILE_DEVICE -O3 -fsigned-char -Wall -Wno-multichar -Wno-unused-variable -fno-strict-aliasing -D__STDC_CONSTANT_MACROS -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
|
||||
# yes, it's really CPPFLAGS for C++
|
||||
# deprecated-register is generated by Android default code and causes noise.
|
||||
LOCAL_CPPFLAGS := -fexceptions -std=c++17 -frtti -Wno-reorder -Wno-deprecated-register -Wno-nullability-completeness
|
||||
LOCAL_CPPFLAGS := -fexceptions -std=c++17 -ffp-contract=off -frtti -Wno-reorder -Wno-deprecated-register -Wno-nullability-completeness
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/../../Common \
|
||||
$(LOCAL_PATH)/../.. \
|
||||
|
||||
+2
-1
@@ -448,7 +448,8 @@ else
|
||||
endif
|
||||
|
||||
ifeq (,$(findstring msvc,$(platform)))
|
||||
CXXFLAGS += -std=c++17
|
||||
# No fused multiply-adds unless written explicitly, so float results are the same on every CPU.
|
||||
CXXFLAGS += -std=c++17 -ffp-contract=off
|
||||
else
|
||||
CXXFLAGS += -std:c++17
|
||||
endif
|
||||
|
||||
Reference in new issue
Block a user