Introduce the core/platform/host header seam under include/gk/ (portable value
types in core/, Kinect/PE mirror layouts in platform/, the camera-elevation
service interface in host/); the existing include/gk/structs/* paths become
compatibility forwards so no definition is duplicated. Add include/gk/fp.h with
gk::fp::round32 (binary32 rounding barrier) and gk::fp::ExtendedAcc (long double
faithful / double portable), and a GK_FIDELITY=faithful|portable CMake knob
paired with -mfpmath; faithful stays the drop-in differential target. i386-gate
GK_CDECL/STDCALL/THISCALL so non-i386 GNU builds get empty macros (native
-Werror). Migrate the three proven slice functions onto the seam without
behaviour change: box_distance expresses FP through gk/fp.h while keeping the
volatile spill the differential pins; the bodies stay in src/game/*.cpp where
prove_t11.py compiles and greps them. Add tools/seam_symbol_check.py (G5) and
re/game/seam_symbols.json asserting each flagged seam RVA ships as a
non-inlined, addressable symbol.
Verified: prove_t11.py exit 0 / ALL DIFFERENTIALS PASS (faithful, exact-FP from
df1620e); native GK_FIDELITY=portable validity compile under -Werror; macro
cross-check; G5 tool reports all three seam symbols addressable.
20 lines
480 B
C++
20 lines
480 B
C++
#pragma once
|
|
|
|
namespace gk::fp {
|
|
|
|
// Direct compiler invocations retain faithful behavior unless opted out.
|
|
#if defined(GK_FIDELITY_PORTABLE) && GK_FIDELITY_PORTABLE
|
|
using ExtendedAcc = double;
|
|
#else
|
|
using ExtendedAcc = long double;
|
|
#endif
|
|
|
|
// Match an original DWORD spill, even when x87 retains wider intermediates.
|
|
template <typename T>
|
|
inline float round32(T expression) {
|
|
volatile float rounded = static_cast<float>(expression);
|
|
return rounded;
|
|
}
|
|
|
|
} // namespace gk::fp
|