Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArmPkg/CompilerIntrinsicsLib: provide __ashlti3 #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#------------------------------------------------------------------------------

#include <AsmMacroIoLib.h>

ASM_FUNC(__ashlti3)
# return if shift is 0
cbz x2, 1f

mov x3, #64
sub x3, x3, x2
cmp x3, #0
b.le 2f

# shift is <= 64 bits
lsr x3, x0, x3
lsl x1, x1, x2
orr x1, x1, x3
lsl x0, x0, x2
1:
ret

2:
# shift is > 64
neg w3, w3
lsl x1, x0, x3
mov x0, #0
ret
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

[Sources.AARCH64]
AArch64/Atomics.S | GCC
AArch64/ashlti3.S | GCC

[Packages]
MdePkg/MdePkg.dec
Expand Down
Loading