mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 17:59:25 +02:00
+ Assembler implementation of SarInt64 for i386.
git-svn-id: trunk@25037 -
This commit is contained in:
parent
7c110e9b42
commit
30a6432a17
@ -1590,3 +1590,25 @@ asm
|
||||
.L2:
|
||||
end;
|
||||
{$endif FPC_SYSTEM_HAS_BSR_QWORD}
|
||||
|
||||
{$ifndef FPC_SYSTEM_HAS_SAR_QWORD}
|
||||
{$define FPC_SYSTEM_HAS_SAR_QWORD}
|
||||
function fpc_SarInt64(Const AValue : Int64;const Shift : Byte): Int64; [Public,Alias:'FPC_SARINT64']; compilerproc; assembler; nostackframe;
|
||||
asm
|
||||
movb %al,%cl
|
||||
movl 8(%esp),%edx
|
||||
movl 4(%esp),%eax
|
||||
andb $63,%cl
|
||||
cmpb $32,%cl
|
||||
jnb .L1
|
||||
shrdl %cl,%edx,%eax
|
||||
sarl %cl,%edx
|
||||
jmp .Lexit
|
||||
.L1:
|
||||
movl %edx,%eax
|
||||
sarl $31,%edx
|
||||
andb $31,%cl
|
||||
sarl %cl,%eax
|
||||
.Lexit:
|
||||
end;
|
||||
{$endif FPC_SYSTEM_HAS_SAR_QWORD}
|
Loading…
Reference in New Issue
Block a user