[fpc-devel] Currency update

J. Gareth "Kit" Moreton gareth at moreton-family.com
Wed Oct 7 21:52:19 CEST 2026


Ah yes, that makes sense.  My fix-in-progress for div and mod is very 
similar to 1560 but I use a distinct method to create the Currency 
scalar that handles the flags etc (although it's otherwise the same).  I 
like the look of your i and j tests though.

For 1576 I want to avoid using a recursive node search if possible 
because the "nf_is_currency" flag should be propagated.

Gareth aka. Kit

On 07/10/2026 06:41, Sven Harazim via fpc-devel wrote:
> 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
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com


More information about the fpc-devel mailing list