mirror of https://github.com/acidanthera/audk.git
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
e19d725d4c
commit
9252fc0e1a
|
@ -23,6 +23,31 @@
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
global ASM_PFX(__ashrdi3)
|
global ASM_PFX(__ashrdi3)
|
||||||
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
|
cmp cl,0x40
|
||||||
jnc _Exit
|
jnc _Exit
|
||||||
cmp cl,0x20
|
cmp cl,0x20
|
||||||
|
@ -40,4 +65,3 @@ _Exit:
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue