Commit graph

6 commits

Author SHA1 Message Date
Boyan Karatotev
34d7f196b4 perf(libc): use builtin implementations where possible
When conditions are right, eg a small memcpy of a known size and
alignment, the compiler may know of a sequence that is optimal for the
given constraints and inline it. If the compiler doesn't find one, it
will emit a call to the generic function (in the libc) which will
implement this in the most generic and unconstrained manner. That
generic function is rarely the most optimal when constraints are known.

So give the compiler a chance to do this. Replace calls to libc
functions that have builtins to the builtin and keep the generic
implementation if it decides to emit a call anyway.

And example of this in action is usage of FEAT_MOPS. When the compiler
is aware of the feature (-march=armv8.8-a) then it will emit the 3 MOPS
instructions instead of calls to our memcpy() and memset()
implementations.

Change-Id: I9860cfada1d941b613ebd4da068e9992c387952e
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-04-04 09:27:33 +01:00
Govindraj Raja
4c700c1563 chore: update to use Arm word across TF-A
Align entire TF-A to use Arm in copyright header.

Change-Id: Ief9992169efdab61d0da6bd8c5180de7a4bc2244
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-08 15:12:30 +01:00
Antonio Nino Diaz
2c5aca6eaa libc: Cleanup FreeBSD files
Remove code specific to FreeBSD so that they can be used in this
repository.

Change-Id: I5c11eb5b3c05a7fb91aed08371a1f7a0e6122a94
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-22 10:26:05 +01:00
Antonio Nino Diaz
c6fdaa7363 libc: Import files from FreeBSD
From commit aafd1cf4235d78ce85b76d7da63e9589039344b3:

- sys/sys/endian.h
- sys/arm/include/endian.h
- sys/arm64/include/endian.h
- sys/sys/errno.h
- lib/libc/strchr.c
- lib/libc/strcmp.c
- lib/libc/strncmp.c
- lib/libc/strnlen.c

strcasecmp() hasn't been imported.

Change-Id: I8a0787aec9ba8960a008fb5c66f7a73c84919b93
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-22 10:26:05 +01:00
Antonio Nino Diaz
091f39675a libc: Remove non-Arm files
Remove all files that don't have only Arm copyright. This is the first
step to cleanup the C library in this repository. They will be re-added
in the following patches.

Change-Id: I72c40a1620d1df3228fc397ec695d569a20245fd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-22 10:26:04 +01:00
Roberto Vargas
61f72a3425 Create a library file for libc
TF Makefile was linking all the objects files generated for the
c library instead of creating a static library that could be
used in the linking stage.

Change-Id: I721daea097e9b13cbb42c9f8eaa2af8fea0799cf
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-08-03 11:31:33 +01:00
Renamed from lib/stdlib/strchr.c (Browse further)