-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEST COMMIT: Update OcCompilerIntrinsicsLib so that it can build the …
…network stack
- Loading branch information
1 parent
5c94885
commit 2253496
Showing
9 changed files
with
177 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** @file | ||
64-bit Math Worker Function. | ||
The 32-bit versions of C compiler generate calls to library routines | ||
to handle 64-bit math. These functions use non-standard calling conventions. | ||
Copyright (c) 2023, Intel Corporation. All rights reserved.<BR> | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Library/BaseLib.h> | ||
|
||
/* https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html */ | ||
__attribute__ ((__used__)) | ||
long long | ||
__divdi3 ( | ||
long long A, | ||
long long B | ||
) | ||
{ | ||
return DivS64x64Remainder ((INT64)A, (INT64)B, NULL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
;------------------------------------------------------------------------------ | ||
; | ||
; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> | ||
; SPDX-License-Identifier: BSD-2-Clause-Patent | ||
; | ||
; Module Name: | ||
; | ||
; MathLShiftS64.nasm | ||
; | ||
; Abstract: | ||
; | ||
; 64-bit Math Worker Function. | ||
; Shifts a 64-bit signed value left by a certain number of bits. | ||
; | ||
;------------------------------------------------------------------------------ | ||
|
||
SECTION .text | ||
|
||
global ASM_PFX(__ashldi3) | ||
;------------------------------------------------------------------------------ | ||
; | ||
; void __cdecl __ashldi3 (void) | ||
; | ||
;------------------------------------------------------------------------------ | ||
ASM_PFX(__ashldi3): | ||
cmp cl,0x40 | ||
jnc ReturnZero | ||
cmp cl,0x20 | ||
jnc More32 | ||
shld edx,eax,cl | ||
shl eax,cl | ||
ret | ||
More32: | ||
mov edx,eax | ||
xor eax,eax | ||
and cl,0x1f | ||
shl edx,cl | ||
ret | ||
ReturnZero: | ||
xor eax,eax | ||
xor edx,edx | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** @file | ||
64-bit Math Worker Function. | ||
The 32-bit versions of C compiler generate calls to library routines | ||
to handle 64-bit math. These functions use non-standard calling conventions. | ||
Copyright (c) 2023, Intel Corporation. All rights reserved.<BR> | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Library/BaseLib.h> | ||
|
||
/* https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html */ | ||
__attribute__ ((__used__)) | ||
unsigned long long | ||
__umoddi3 ( | ||
unsigned long long A, | ||
unsigned long long B | ||
) | ||
{ | ||
unsigned long long Reminder; | ||
|
||
DivU64x64Remainder ((UINT64)A, (UINT64)B, (UINT64 *)&Reminder); | ||
|
||
return Reminder; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
;------------------------------------------------------------------------------ | ||
; | ||
; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> | ||
; SPDX-License-Identifier: BSD-2-Clause-Patent | ||
; | ||
; Module Name: | ||
; | ||
; MathRShiftU64.nasm | ||
; | ||
; Abstract: | ||
; | ||
; 64-bit Math Worker Function. | ||
; Shifts a 64-bit unsigned value right by a certain number of bits. | ||
; | ||
;------------------------------------------------------------------------------ | ||
|
||
SECTION .text | ||
|
||
;------------------------------------------------------------------------------ | ||
; | ||
; void __cdecl __ashrdi3 (void) | ||
; | ||
;------------------------------------------------------------------------------ | ||
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 | ||
jnc More32 | ||
shrd eax,edx,cl | ||
shr edx,cl | ||
ret | ||
More32: | ||
mov eax,edx | ||
xor edx,edx | ||
and cl,0x1f | ||
shr eax,cl | ||
ret | ||
_Exit: | ||
xor eax,eax | ||
xor edx,edx | ||
ret |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters