Pair int8 weight rows in accumulator updates
Since SFNNv18 every feature-transformer weight row (piece-square, threat and pawn-pair features) is stored as int8 and widened to int16 while it is added to or subtracted from the accumulator. On x86 the widening is done with one sign extension (vpmovsxbw) per vector register, and the accumulator update is bound by the shuffle port that executes it.
This patch widens two rows at once: the bytes of the two rows are interleaved with unpacklo/unpackhi_epi8 and each pair is summed by a maddubs against a vector of ones, which costs one shuffle per two rows instead of one per row. The weight rows are permuted at load time (FeatureTransformer::WideningPairOrder, inverted again by export_net) so that the accumulator layout stays unchanged. Rows of all feature sets with the same sign are collected (WeightRows) and processed together so that nearly every row has a partner; a leftover row is widened on its own with unpack + shift. Enabled for SSSE3 and better; other targets are unchanged.
Measured with an interleaved bench comparison (1 thread) on an Ice Lake server core:
x86-64-avx512icl +7.0% nps
x86-64-avx2 +5.2% nps
x86-64-sse41-popcnt +10.7% nps
Non-functional change: node counts are identical to master for the avx512icl, avx2, sse41-popcnt, sse2 and scalar builds, including debug and sanitized builds, and export_net reproduces the original net file.
passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 20768 W: 5480 L: 5211 D: 10077
Ptnml(0-2): 23, 2092, 5888, 2355, 26
https://tests.stockfishchess.org/tests/view/6ad04cd2733e627f7058c248
closes https://github.com/official-stockfish/Stockfish/pull/7225
No functional change
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>