bavison / arm-mem Goto Github PK
View Code? Open in Web Editor NEWARM-accelerated versions of selected functions from <string.h>
ARM-accelerated versions of selected functions from <string.h>
Benchmarked using CacheBench
from LLCbench.
cachebench
:cd </path/to/extracted/llcbench/directory>
make linux-lam
make cache-bench
./cachebench/cachebench -p
Hi,
After e6c03fd and adding this to /etc/ld.so.preload I get a segmentation fault at boot on Pi1 with Raspbian. Have not had this issue with earlier versions of your library. My init instantly segfaults, and as pid1 dies, kernel oops! Removing the preload line brought me back up.
Here is output of readelf -A on the shared object generated under Raspbian Jessie using GCC 4.9.1 as the compiler:
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv3
Tag_Advanced_SIMD_arch: NEONv1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_CPU_unaligned_access: v6
For now I am tempted to use your earlier build which had a separate lib for a7 as we package this library twice anyway (once for rbp1 and once for rbp2), but it's good to report this kind of thing.
gdb is not helpful, because I am not sure set env LD_PRELOAD was working properly
Hi
Did you consider submitting these improvements to the glibc developers to get it into the default build everywhere?
memset() does not honour the "converted to an unsigned char" required by 7.21.6.1 of ISO/IEC 9899:1999(E)
signed char smallint = -3;
signed char smallarray[10];
memset(smallarray, smallint, 10);
results in smallarray[0] ←→ -3
smallarray[1] ←→ -1
smallarray[2] ←→ -1
smallarray[3] ←→ -1
smallarray[4] ←→ -3
...
code widens the smallint of -3 to int with sign extension - correctly. memset() fails to AND this with 0xff before shifting and ORing.
Hi there,
I just tested to run my RPi (2 Model B) on Raspbian Buster. The current archive.raspberrypi.org
does not yet contain a Buster repo, just Stretch, however it works fine, besides the package for this git repo: raspi-copies-and-fills
. I needed to purge it, to allow Raspbian Buster upgrade.
The question is, if this is an issue from source, or if I could compile it also for Raspbian Buster. Maybe there is already a Buster ready compiled package available somewhere 😃?
Thanks for your nice work!
MichaIng
dec5ddf seems to be completely messed up.
gcc version 4.9.3 20150311 (prerelease) (crosstool-NG crosstool-ng-1.21.0-33-g334c22a) edit: linaro
glibc-2.21
binutils-2.25
make[1]: Entering directory '/home/asavah/piko7/src/arm-mem'
arm-rpi2-linux-gnueabihf-gcc -c -o architecture.o architecture.S
arm-rpi2-linux-gnueabihf-gcc -c -o memcmp.o memcmp.S
arm-rpi2-linux-gnueabihf-gcc -c -o memcpymove.o memcpymove.S
arm-rpi2-linux-gnueabihf-gcc -c -o memcpymove-a7.o memcpymove-a7.S
arm-rpi2-linux-gnueabihf-gcc -c -o memset.o memset.S
arm-rpi2-linux-gnueabihf-gcc -pipe --sysroot=/home/asavah/piko7/build/rpi2/rootfs -Wl,--sysroot=/home/asavah/piko7/build/rpi2/rootfs -std=gnu99 -O2 -c -o trampoline.o trampoline.c
In file included from /home/asavah/piko7/build/rpi2/rootfs/usr/include/string.h:634:0,
from trampoline.c:29:
trampoline.c:57:18: error: redefinition of ‘__builtin_mempcpy’
DISPATCH(void *, mempcpy, (void *__restrict __dest, __const void *__restrict __src, size_t __n), (__dest, __src, __n))
^
trampoline.c:57:1: note: in expansion of macro ‘DISPATCH’
DISPATCH(void *, mempcpy, (void *__restrict __dest, __const void *__restrict __src, size_t __n), (__dest, __src, __n))
^
trampoline.c:56:17: note: previous definition of ‘__builtin_mempcpy’ was here
DISPATCH(void *,__mempcpy, (void *__restrict __dest, __const void *__restrict __src, size_t __n), (__dest, __src, __n))
^
trampoline.c:56:1: note: in expansion of macro ‘DISPATCH’
DISPATCH(void *,__mempcpy, (void *__restrict __dest, __const void *__restrict __src, size_t __n), (__dest, __src, __n))
^
Makefile:7: recipe for target 'trampoline.o' failed
make[1]: *** [trampoline.o] Error 1
make[1]: Leaving directory '/home/asavah/piko7/src/arm-mem'
Makefile:55: recipe for target 'build' failed
make: *** [build] Error 2
As suggested in comments of ~/usr/include/string.h I tried defining __NO_STRING_INLINES in CFLAGS, it helped, somewhat:
make[1]: Entering directory '/home/asavah/piko7/src/arm-mem'
arm-rpi2-linux-gnueabihf-gcc -c -o architecture.o architecture.S
arm-rpi2-linux-gnueabihf-gcc -c -o memcmp.o memcmp.S
arm-rpi2-linux-gnueabihf-gcc -c -o memcpymove.o memcpymove.S
arm-rpi2-linux-gnueabihf-gcc -c -o memcpymove-a7.o memcpymove-a7.S
arm-rpi2-linux-gnueabihf-gcc -c -o memset.o memset.S
arm-rpi2-linux-gnueabihf-gcc -pipe --sysroot=/home/asavah/piko7/build/rpi2/rootfs -Wl,--sysroot=/home/asavah/piko7/build/rpi2/rootfs -D__NO_STRING_INLINES -std=gnu99 -O2 -c -o trampoline.o trampoline.c
arm-rpi2-linux-gnueabihf-gcc -shared -o libarmmem.so architecture.o memcmp.o memcpymove.o memcpymove-a7.o memset.o trampoline.o
/home/asavah/piko7/toolchain-rpi2/arm-rpi2-linux-gnueabihf/lib/gcc/arm-rpi2-linux-gnueabihf/4.9.3/../../../../arm-rpi2-linux-gnueabihf/bin/ld.bfd: trampoline.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
trampoline.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:13: recipe for target 'libarmmem.so' failed
make[1]: *** [libarmmem.so] Error 1
make[1]: Leaving directory '/home/asavah/piko7/src/arm-mem'
Makefile:55: recipe for target 'build' failed
make: *** [build] Error 2
So we are back to #3 with relocation issues.
Valgrind crashes during memcmp() due to the presence (really lack of implementation in Valgrind) of SETEND. ARM has deprecated these instructions, though they're still available in A32 and T32.
This pull request: #5 Removes the SETEND instructions and replaces them with REV instructions, which I expect to be a few cycles slower, but work with valgrind.
Back in January I opened an issue on Raspbian Launchpad. The only answer was to ask if the patch I provided was for Valgrind or libarmmem, which I would have thought obvious enough from the patch itself.
https://bugs.launchpad.net/raspbian/+bug/2051392
Could you take a look at the above bug report and patch please?
Let me know if you'd like me to open a pull request.
Do you have plan to add armmem for aarch64 platform?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.