« first day (1671 days earlier)      last day (165 days later) » 

19:51
In the strcmp code, you claim that having to copies of the code ("normal" and "swapped") performs better than a branchless implementation. How did you measure that? Did you use a microbenchmark or did you evalutate whole-application performance? The reason I ask is because duplicating the code increases cache pressure (and memory pressure, although that effect is likely negligible), which is not an issue in microbenchmarks but may be visible in application-level benchmarks.
Linux switched from compiling the kernel with -O2 to -Os (optimize for size) for exactly that reason.
fuz
fuz
I wrote both and compared them in a microbenchmark. The branchless variant is significantly slower, by like 10%. This is because swapping the various registers using conditional move instructions turns out to be a lot slower than one would naively believe.
I spent a lot of time trying to work out a solution without swapping and no duplicate code, but didn't manage to come up with anything.
20:13
Speaking about cache/memory pressure: It might make sense to put all the SSE2 string operations in a different code subsection, to avoid having a lot of dead instruction bytes in case the computer is not SSE2 capable. The SSE2 code is just never paged in on that kind of machine.
fuz
fuz
I agree and I had considered this; it would be trivial to implement.
However, we decided not to do so to avoid extra complexity.
I expect one could hide the complexity in the ARCHENTRY / ARCHEND macros, and have it apply to all architecture distinctions, like having ".text", ".text_scalar" and ".text_baseline". Yet, it still would increase complexity, and maybe the disctinction is not just scalar/baseline at all occurences, but also higher profile SSE/AVX, so text_baseline could again be subject to fragmented use.
fuz
fuz
People do weird things with libc
e.g. they write their own linker scripts to pull it in
Not sure if there could be any impact from adding new sections like that

« first day (1671 days earlier)      last day (165 days later) »