mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 15:49:26 +02:00
* fix #40421: implement assembly variants of the SwapEndian functions for Aarch64
This commit is contained in:
parent
98fc58b229
commit
30a1cde7a5
@ -480,3 +480,46 @@ asm
|
||||
end;
|
||||
|
||||
{$endif}
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
Math Routines
|
||||
****************************************************************************}
|
||||
|
||||
{$define FPC_SYSTEM_HAS_SWAPENDIAN}
|
||||
|
||||
function SwapEndian(const AValue: SmallInt): SmallInt; assembler; nostackframe;
|
||||
asm
|
||||
rev16 w0, w0
|
||||
end;
|
||||
|
||||
|
||||
function SwapEndian(const AValue: Word): Word; assembler; nostackframe;
|
||||
asm
|
||||
rev16 w0, w0
|
||||
end;
|
||||
|
||||
|
||||
function SwapEndian(const AValue: LongInt): LongInt; assembler; nostackframe;
|
||||
asm
|
||||
rev32 x0, x0
|
||||
end;
|
||||
|
||||
|
||||
function SwapEndian(const AValue: DWord): DWord; assembler; nostackframe;
|
||||
asm
|
||||
rev32 x0, x0
|
||||
end;
|
||||
|
||||
|
||||
function SwapEndian(const AValue: Int64): Int64; assembler; nostackframe;
|
||||
asm
|
||||
rev x0, x0
|
||||
end;
|
||||
|
||||
|
||||
function SwapEndian(const AValue: QWord): QWord; assembler; nostackframe;
|
||||
asm
|
||||
rev x0, x0
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user