Compiler Proof · Win32 → Win64 Floating-Point ABI
Why {$EXTENDEDCOMPATIBILITY ON} on Win64 still computes with a 53-bit mantissa.
One of the costliest mistakes in Delphi Win64 upgrades happens when engineers — or AI coding agents — enable {$EXTENDEDCOMPATIBILITY ON} assuming it brings back 80-bit x87 precision on 64-bit Windows. It does not.
Storage width vs. significand precision (measured on Delphi 13 CE)
In Delphi source code, System.Extended looks identical on every platform, but hardware storage and arithmetic diverge sharply across targets:
- Intel Win32 (x86):
SizeOf(Extended) = 10bytes — hardware 80-bit x87 FPU format (1 sign bit + 15 exponent bits + 1 explicit integer bit + 63 fraction bits = 64-bit significand mantissa). - Intel Win64 (x64, default
{$EXTENDEDCOMPATIBILITY OFF}):SizeOf(Extended) = 8bytes — an alias of 64-bit IEEE 754binary64Double(53-bit significand mantissa: 52 explicit + 1 implicit bit, computed on SSE2XMMregisters). - Intel Win64 with
{$EXTENDEDCOMPATIBILITY ON}:SizeOf(Extended) = 10bytes so legacy binary files andpacked recordoffsets match Win32 — but every read, calculation, and assignment still passes through a 64-bitDouble(53-bit mantissa), silently zeroing the lower 11 mantissa bits.
Reproducible Delphi 13 compiler probe (P13_ExtCompat_Prec_On64.dpr)
This standalone probe ships directly in the free demo repository (Chapter 70 on GitHub) and can be compiled on Delphi 13 Win32 and Win64:
program P13_ExtCompat_Prec_On64;
{$APPTYPE CONSOLE}
{$EXTENDEDCOMPATIBILITY ON}
uses System.SysUtils;
var
E1, E2, E3: Extended;
begin
Writeln('SizeOf(Extended)=', SizeOf(Extended)); // Win64: 10
E1 := 1.0 + ParamCount * 0.0;
E2 := 1e-17 + ParamCount * 0.0;
E3 := E1 + E2;
Writeln('prec64=', E3 <> E1); // Win32: TRUE | Win64: FALSE!
end.Measured results (Delphi 13 CE 37.0.60542.8024):
- Win32 (
OFForON):SizeOf=10,TPacked=12 (offE=1, offB=11),prec64=TRUE, bytewiseExtended -> TExtended80Rec -> Extendedround-triprt_eq=TRUE. - Win64 (
{$EXTENDEDCOMPATIBILITY OFF}):SizeOf=8,TPacked=10 (offE=1, offB=9),prec64=FALSE. - Win64 (
{$EXTENDEDCOMPATIBILITY ON}):SizeOf=10,TPacked=12 (offE=1, offB=11),prec64=FALSE, and bytewise round-triprt_eq=FALSE(low 11 mantissa bits truncated!).
Safe engineering rule for Win64 upgrades & C# ports
If Win64 code merely needs to forward or store legacy 80-bit Win32 binary payloads without corrupting the low 11 mantissa bits, copy them as raw System.TExtended80Rec without casting through Extended. For financial totals, audit rounding drift explicitly against Currency or target-language decimal.
Related guides: System.Round & uses shadowing · Delphi 7 to Delphi 13 Win64 checklist.
Verify it yourself in Delphi 13 (Free < 1 MB Demo)
Every rule in these guides comes from 879 build observations and 650 executable runs on Delphi 13 Community Edition (Win32, Win64, and compile-only Android ARM). The free demo on GitHub includes the complete 74-chapter & 89-directive Table of Contents, 6 multi-difficulty excerpts, 4 complete directive cards, 8 compiler JSON receipts, 6 runnable .dpr probes, and working plugins, skills, and local offline MCP server.
Get Full Universal Suite · from $99Inspect Free Demo on GitHubAll Technical Guides
Honest scope boundaries: Strictly a Delphi / Object Pascal language, runtime-behavior, and compiler-directive reference — not a VCL, FMX, or FireDAC component API encyclopedia. Does not claim 100% coverage of the language or any ABI; open questions are listed explicitly by name. Independent product, not affiliated with Embarcadero Technologies, Inc.