mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
CryptoPkg/IntrinsicLib: Corrects __ashrdi3 and adds __lshrdi3
The ashrdi3 function should do arithmetic shift instead of logic using sar instruction. Also adds __lshrdi3 implementation to correct build using LLVM Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
This commit is contained in:
parent
850cf3b628
commit
bf04e15d55
@ -23,6 +23,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
global ASM_PFX(__ashrdi3)
|
||||
ASM_PFX(__ashrdi3):
|
||||
cmp cl,0x40
|
||||
jnc ReturnZero
|
||||
cmp cl,0x20
|
||||
jnc CounterMore32
|
||||
shrd eax,edx,cl
|
||||
sar edx,cl
|
||||
ret
|
||||
CounterMore32:
|
||||
mov eax,edx
|
||||
xor edx,edx
|
||||
and cl,0x1f
|
||||
sar eax,cl
|
||||
ret
|
||||
ReturnZero:
|
||||
xor eax,eax
|
||||
xor edx,edx
|
||||
ret
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; void __cdecl __lshrdi3 (void)
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
global ASM_PFX(__lshrdi3)
|
||||
ASM_PFX(__lshrdi3):
|
||||
cmp cl,0x40
|
||||
jnc _Exit
|
||||
cmp cl,0x20
|
||||
@ -40,4 +65,3 @@ _Exit:
|
||||
xor eax,eax
|
||||
xor edx,edx
|
||||
ret
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user