Skip to content

[aarch64] Add configure flag to control the use of optimized memset/memcpy#12

Merged
Ana Pazos (apazos) merged 3 commits into
qualcomm:mainfrom
pzhengqc:mem2
Jan 21, 2026
Merged

[aarch64] Add configure flag to control the use of optimized memset/memcpy#12
Ana Pazos (apazos) merged 3 commits into
qualcomm:mainfrom
pzhengqc:mem2

Conversation

@pzhengqc

Copy link
Copy Markdown

No description provided.

Zhaoshi Zheng and others added 3 commits January 20, 2026 17:22
Signed-off-by: Zhaoshi Zheng <zhaoshiz@qti.qualcomm.com>
This patch adds bti landing pad for aarch64's assembly implementation of
memset/memcpy when --quic-aarch64-mark-bti is passed during configure.

Signed-off-by: Pengxuan Zheng <pzheng@qti.qualcomm.com>
…emcpy

This patch adds a configure flag "--quic-aarch64-optmem" to optionally
enable aarch64's assembly implementation of memset/memcpy. With this
patch, the generic implementation is used by default and the optimized
implementation is only used if the flag "--quic-aarch64-optmem" is
passed explicitly when configuring.

More specifically, with this patch, all aarch64 baremetal variants will
use the generic version of memset/memcpy instead of the optimzed one. We
only enable the optimized memset/memcpy for the aarch64 linux variant
for now.

Signed-off-by: Pengxuan Zheng <pzheng@qti.qualcomm.com>
@pzhengqc pzhengqc changed the title Add flag -mmark-bti-property for memcpy.S and memset.S [aarch64] Add configure flag to control the use of optimized memset/memcpy Jan 21, 2026
@apazos

Copy link
Copy Markdown
Contributor

Thanks Pengxuan, LGTM

@apazos Ana Pazos (apazos) merged commit 59dcb29 into qualcomm:main Jan 21, 2026
6 checks passed
BUILTIN=clang_rt.builtins-pacret-bti-aarch64-nofp

./configure --disable-wrapper --quic-arm-baremetal --quic-aarch64-nofp --disable-visibility CROSS_COMPILE="llvm-" CC="clang --target=aarch64-none-elf -fuse-ld=eld" CFLAGS="-mabi=aapcs-soft -march=armv8.5-a -mbranch-protection=pac-ret+leaf+b-key+bti -Os -mstrict-align -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden -DVISIBILITY_HIDDEN -mgeneral-regs-only -mllvm -aarch64-enable-simd-scalar=false -fno-rounding-math" LDFLAGS="-Wl,-L${PATH_TO_BUILTIN}" LIBCC="-l${BUILTIN}" "$@"
./configure --disable-wrapper --quic-arm-baremetal --quic-aarch64-nofp --quic-aarch64-mark-bti --disable-visibility CROSS_COMPILE="llvm-" CC="clang --target=aarch64-none-elf -fuse-ld=eld" CFLAGS="-mabi=aapcs-soft -march=armv8.5-a -mbranch-protection=pac-ret+leaf+b-key+bti -Os -mstrict-align -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden -DVISIBILITY_HIDDEN -mgeneral-regs-only -mllvm -aarch64-enable-simd-scalar=false -fno-rounding-math" LDFLAGS="-Wl,-L${PATH_TO_BUILTIN}" LIBCC="-l${BUILTIN}" "$@"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed with pzhengqc that if quic_aarch64_optmem is not specified, quic-aarch64-mark-bti is not needed. So we should clean this up. We can also enable the quic_aarch64_optmem for all linux configs.

@pzhengqc pzhengqc deleted the mem2 branch January 22, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants