[fpc-devel] I've asked this before, but perhaps I wasn't specific enough that time: what do I *personally*, specifically need to do to ensure that a native Windows 64-bit build winds up on the FPC website for the next release?
Ben Grasset
operator97 at gmail.com
Fri Jan 14 03:15:59 CET 2022
On Thu, Jan 13, 2022 at 9:48 AM Nikolay Nikolov via fpc-devel <
fpc-devel at lists.freepascal.org> wrote:
> What do other win64 compilers do? Do they generate x87 FPU code for 64-bit
> Windows?
>
Yes. Given the following:
#include <stdio.h>
long double do_three(long double x, long double y, long double z) {
return (((x * x) / y) + z);
}
int main () {
printf("%d\n", sizeof(long double));
printf("%.19Lf\n", do_three(9.4567575785454772685L,
2.1211991522332311497L, 16.1216453784376343456L));
}
GCC 11.2 produces this assembly with "gcc -O3 -march=native -S test.c" on
64-bit Windows 10:
do_three:
.seh_endprologue
fldt (%rdx)
fldt (%r8)
fldt (%r9)
fxch %st(2)
movq %rcx, %rax
fmul %st(0), %st
fdivp %st, %st(1)
faddp %st, %st(1)
fstpt (%rcx)
ret
.seh_endproc
and Clang 13.0 produces this with the same command line arguments passed:
do_three: # @do_three
# %bb.0:
movq %rcx, %rax
fldt (%rdx)
fldt (%r8)
fldt (%r9)
fxch %st(2)
fmul %st, %st(0)
fdivp %st, %st(1)
faddp %st, %st(1)
fstpt (%rcx)
retq
Running the program prints this with both compilers:
16
58.2818846964779790909
So the answer to Mattias's question about C compilers from before is "they
just directly support it on Windows".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220113/8e1c144f/attachment-0001.htm>
More information about the fpc-devel
mailing list