Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I am trying to get the string functions work on aarch64. While memset and bzero work as is, memcpy does not because of the x86 specific arrangement we have currently. The x86 specific pieces are actually in dead code. So I went ahead and removed them in this patch. If required in future, we should add it back in a fashion which does not break the build for non-x86 architectures.
Also, I do not remember everything we discussed in the past. So, feel free to tell me I am doing rubbish.
memset and bzero are generic and can be used as-is for all architectures.
They may need to be tweaked for individual architecture later on but the current code is good enough.
memcpyis a different story. The C++ implementation is quite tied to x86 so I would rather duplicate the code.
Keep the one we have with the reference to AVX and repmovsb for x86 (libc/src/string/x86/memcpy.cpp)
Duplicate it without AVX / Repmovsb for a generic implementation (libc/src/string/memcpy.cpp)
It also sets an example for anyone wanting to provide an architecture specific implementation.
Thx for the -O2 flag!