Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added software implementations of bitwise instructions
This helps significantly with supporting different compilers. Intrinsics for different compilers can be added as they are found. Note that for ARMCC, __builtin_ctz is not used. This was the result of a strange issue where ARMCC only emits __builtin_ctz when passed the --gnu flag, but __builtin_clz and __builtin_popcount are always emitted. This isn't a big problem since the ARM instruction set doesn't have a ctz instruction, and the npw2 based implementation is one of the most efficient. Also note that for littefs's purposes, we consider ctz(0) to be undefined. This lets us save a branch in the software lfs_ctz implementation.
- Loading branch information