[fpc-devel] Currency update

Sven Harazim sven at syconic.org
Wed Oct 7 07:41:33 CEST 2026


Hi Gareth,

tw41865c comes from my reproducers for #41865, so here are some
measurements that may help.

On x86_64-linux (cross compiler from current main 7a7ff6e731, run under
qemu-x86_64) the storage is not the issue: Currency is 8 bytes and holds the
scaled Int64 - Currency(10) is raw 100000, as on AArch64. What fails is the
compilation:

  tw41865c.pp(12,10) Error: Operator is not overloaded: "Currency" div "Currency"

There Currency is a floating type (s64currency, computed on the x87), and
div/mod are not defined for floating types. Would guarding the test with
{$ifdef FPC_CURRENCY_IS_INT64} match what you intend, or should div/mod work
there too?

On aarch64-win64, !1560 already makes tw41865c pass, and !1576 fixes your
tw41865g/h at -O4:
https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/1560
https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/1576
Could you check whether they overlap with your changes?

Sven



More information about the fpc-devel mailing list