-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
armv8-r/libc: optimize libc string apis with asm
Optimize libc string apis(memcpy/memset/memmove/memchr/strcmp/strlen) with arm32 assembly instruction including vfp and neon. Add arch releated elf parsing Signed-off-by: Jinliang Li <[email protected]>
- Loading branch information
1 parent
f5136b2
commit f3213ef
Showing
14 changed files
with
2,601 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# ############################################################################## | ||
# libs/libc/machine/arm/armv8-r/CMakeLists.txt | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements. See the NOTICE file distributed with this work for | ||
# additional information regarding copyright ownership. The ASF licenses this | ||
# file to you under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
# ############################################################################## | ||
|
||
if(CONFIG_ARCH_TOOLCHAIN_GNU) | ||
set(ARCH_TOOLCHAIN_DIR gnu) | ||
endif() | ||
|
||
if(CONFIG_ARMV8R_MEMCHR) | ||
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memchr.S) | ||
endif() | ||
|
||
if(CONFIG_ARMV8R_MEMCPY) | ||
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memcpy.S) | ||
endif() | ||
|
||
if(CONFIG_ARMV8R_MEMMOVE) | ||
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memmove.S) | ||
endif() | ||
|
||
if(CONFIG_ARMV8R_MEMSET) | ||
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_memset.S) | ||
endif() | ||
|
||
if(CONFIG_ARMV8R_STRCMP) | ||
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strcmp.S) | ||
endif() | ||
|
||
if(CONFIG_ARMV8R_STRLEN) | ||
list(APPEND SRCS ${ARCH_TOOLCHAIN_DIR}/arch_strlen.S) | ||
endif() | ||
|
||
if(CONFIG_LIBC_ARCH_ELF) | ||
list(APPEND SRCS arch_elf.c) | ||
endif() | ||
|
||
target_sources(c PRIVATE ${SRCS}) |
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,63 @@ | ||
# | ||
# For a description of the syntax of this configuration file, | ||
# see the file kconfig-language.txt in the NuttX tools repository. | ||
# | ||
|
||
config ARMV8R_STRING_FUNCTION | ||
bool "Enable optimized ARMV8R specific string function" | ||
default n | ||
depends on ARCH_TOOLCHAIN_GNU | ||
select ARMV8R_MEMCHR | ||
select ARMV8R_MEMCPY | ||
select ARMV8R_MEMMOVE | ||
select ARMV8R_MEMSET | ||
select ARMV8R_STRCMP | ||
select ARMV8R_STRLEN | ||
|
||
config ARMV8R_MEMCHR | ||
bool "Enable optimized memchr() for ARMv8-R" | ||
default n | ||
select LIBC_ARCH_MEMCHR | ||
depends on ARCH_TOOLCHAIN_GNU | ||
---help--- | ||
Enable optimized ARMv8-R specific memchr() library function | ||
|
||
config ARMV8R_MEMCPY | ||
bool "Enable optimized memcpy() for ARMv8-R" | ||
select LIBC_ARCH_MEMCPY | ||
depends on ARCH_TOOLCHAIN_GNU | ||
---help--- | ||
Enable optimized ARMv8-R specific memcpy() library function | ||
|
||
config ARMV8R_MEMMOVE | ||
bool "Enable optimized memmove() for ARMv8-R" | ||
default n | ||
select LIBC_ARCH_MEMMOVE | ||
depends on ARCH_TOOLCHAIN_GNU | ||
---help--- | ||
Enable optimized ARMv8-R specific memmove() library function | ||
|
||
config ARMV8R_MEMSET | ||
bool "Enable optimized memset() for ARMv8-R" | ||
default n | ||
select LIBC_ARCH_MEMSET | ||
depends on ARCH_TOOLCHAIN_GNU | ||
depends on ARM_NEON | ||
---help--- | ||
Enable optimized ARMv8-R specific memset() library function | ||
|
||
config ARMV8R_STRCMP | ||
bool "Enable optimized strcmp() for ARMv8-R" | ||
default n | ||
select LIBC_ARCH_STRCMP | ||
depends on ARCH_TOOLCHAIN_GNU | ||
---help--- | ||
Enable optimized ARMv8-R specific strcmp() library function | ||
|
||
config ARMV8R_STRLEN | ||
bool "Enable optimized strlen() for ARMv8-R" | ||
default n | ||
select LIBC_ARCH_STRLEN | ||
depends on ARCH_TOOLCHAIN_GNU | ||
---help--- | ||
Enable optimized ARMv8-R specific strlen() library function |
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,57 @@ | ||
############################################################################ | ||
# libs/libc/machine/arm/armv8-r/Make.defs | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. The | ||
# ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
############################################################################ | ||
|
||
ifeq ($(CONFIG_ARMV8R_MEMCHR),y) | ||
ASRCS += arch_memchr.S | ||
endif | ||
|
||
ifeq ($(CONFIG_ARMV8R_MEMCPY),y) | ||
ASRCS += arch_memcpy.S | ||
endif | ||
|
||
ifeq ($(CONFIG_ARMV8R_MEMMOVE),y) | ||
ASRCS += arch_memmove.S | ||
endif | ||
|
||
ifeq ($(CONFIG_ARMV8R_MEMSET),y) | ||
ASRCS += arch_memset.S | ||
endif | ||
|
||
ifeq ($(CONFIG_ARMV8R_STRCMP),y) | ||
ASRCS += arch_strcmp.S | ||
endif | ||
|
||
ifeq ($(CONFIG_ARMV8R_STRLEN),y) | ||
ASRCS += arch_strlen.S | ||
endif | ||
|
||
ifeq ($(CONFIG_LIBC_ARCH_ELF),y) | ||
CSRCS += arch_elf.c | ||
endif | ||
|
||
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y) | ||
DEPPATH += --dep-path machine/arm/armv8-r/gnu | ||
VPATH += :machine/arm/armv8-r/gnu | ||
endif | ||
|
||
DEPPATH += --dep-path machine/arm/armv8-r | ||
VPATH += :machine/arm/armv8-r |
Oops, something went wrong.