You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A list of “out-of-band” uses for the GF2P8AFFINEQB instruction I haven’t seen documented elsewhere
Count Leading/Trailing Zero Bits (Byte-wise)
Counting the trailing zero bit count (TZCNT) can be done by isolating the lowest bit, then depositing this into the appropriate locations for the count. The leading zero bit count (LZCNT) can be done by reversing bits, then computing the TZCNT.
__m128i_mm_tzcnt_epi8(__m128ia) {
// isolate lowest bita=_mm_andnot_si128(_mm_add_epi8(a, _mm_set1_epi8(0xff)), a);
// convert lowest bit to index
A list of articles documenting uses of the GF2P8AFFINE instruction
Unexpected Uses for the Galois Field Affine Transformation Instruction
Intel added the Galois Field instruction set (GFNI) extensions to their Sunny Cove and Tremont cores. What’s particularly interesting is that GFNI is the only new SIMD extension that came with SSE and VEX/AVX encodings (in addition to EVEX/AVX512), to allow it to be supported on all future Intel cores, including those which don’t support AVX512 (such as the Atom line, as well as Celeron/Pentium branded “big” cores).
I suspect GFNI was aimed at accelerating SM4 encryption, however, one of the instructions can be used for many other purposes. The extension includes three instructions, but of particular interest here is the Affine Transformation (GF2P8AFFINEQB), aka bit-matrix multiply, instruction.
There have been various articles which discuss out-of-band
ffmpeg patch to fix up muxing HEVC streams with bad version, instead of erroring out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ /* The version field is is ignored by the decoder, so any value should be allowed. As this code relies on magic identifiers, we'll be a bit more strict and only accept '0' as a candidate to be fixed */
+ /* (these instances are outputs likely sourced from older/buggy tools) */
+ /* it might be ideal to do extra checks on the subsequent field (profile/tier) but I can't find open documentation on how they work */
Compute Affine table for GF(2^8) multiplication with 0x11d polynomial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quick'n'dirty patch to enable x86/ARM AES acceleration (plus Blake2s/RS16 x86 SIMD) in GCC/Clang for unrar 6.2.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters