diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-04-25 19:24:18 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-04-25 19:24:18 +0000 |
commit | 39aa8a14702f49b1d129b181c411823cf82177f2 (patch) | |
tree | 1171835189fa2a5653bd2abcdeadb1b313327edc | |
parent | 659d1f1896ac8aced4977dcc51be38006a7e10d4 (diff) | |
download | fpc-39aa8a14702f49b1d129b181c411823cf82177f2.tar.gz |
* fix bootstrapping on aarch64-linux with 3.2.x
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49264 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | rtl/aarch64/math.inc | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/rtl/aarch64/math.inc b/rtl/aarch64/math.inc index a526128870..6bdaebbcff 100644 --- a/rtl/aarch64/math.inc +++ b/rtl/aarch64/math.inc @@ -51,47 +51,47 @@ {$endif FPC_SYSTEM_HAS_SQRT} - {$ifndef FPC_SYSTEM_HAS_INT} - {$define FPC_SYSTEM_HAS_INT} - function fpc_int_real(d : ValReal) : ValReal;compilerproc; +{$ifndef VER3_2} + {$ifndef FPC_SYSTEM_HAS_FRAC} + {$define FPC_SYSTEM_HAS_FRAC} + function fpc_frac_real(d : ValReal) : ValReal;compilerproc; begin { Function is handled internal in the compiler } runerror(207); result:=0; end; + {$endif FPC_SYSTEM_HAS_FRAC} +{$endif VER3_2} + + + {$ifndef FPC_SYSTEM_HAS_INT} + {$define FPC_SYSTEM_HAS_INT} + function fpc_int_real(d : ValReal) : ValReal;assembler;nostackframe;compilerproc; + asm + // { round as floating point towards zero } + frintz d0,d0 + end; {$endif FPC_SYSTEM_HAS_INT} {$ifndef FPC_SYSTEM_HAS_TRUNC} {$define FPC_SYSTEM_HAS_TRUNC} - function fpc_trunc_real(d : ValReal) : int64;compilerproc; - begin - { Function is handled internal in the compiler } - runerror(207); - result:=0; + function fpc_trunc_real(d : ValReal) : int64;assembler;nostackframe;compilerproc; + asm + // { round to signed integer towards zero } + fcvtzs x0,d0 end; {$endif FPC_SYSTEM_HAS_TRUNC} -{$ifndef VER3_2} - {$ifndef FPC_SYSTEM_HAS_FRAC} - {$define FPC_SYSTEM_HAS_FRAC} - function fpc_frac_real(d : ValReal) : ValReal;compilerproc; - begin - { Function is handled internal in the compiler } - runerror(207); - result:=0; - end; - {$endif FPC_SYSTEM_HAS_FRAC} -{$endif VER3_2} {$ifndef FPC_SYSTEM_HAS_ROUND} {$define FPC_SYSTEM_HAS_ROUND} - function fpc_round_real(d : ValReal) : int64;compilerproc; - begin - { Function is handled internal in the compiler } - runerror(207); - result:=0; + function fpc_round_real(d : ValReal) : int64;assembler;nostackframe;compilerproc; + asm + // { round as floating point using current rounding mode } + frintx d0,d0 + // { convert to signed integer rounding towards zero (there's no "round to + // integer using current rounding mode") } + fcvtzs x0,d0 end; {$endif FPC_SYSTEM_HAS_ROUND} - - |