Given that vgf2p8affineqb performs an XOR permutation of the input, and that XORs are associated, XORing two values that where transformed in the same manner can be reassociated to happen before. Their immediates also need to be XORed together as well:
gfniXor_src:
gf2p8affineqb xmm0, xmm2, 1
gf2p8affineqb xmm1, xmm2, 3
pxor xmm0, xmm1
ret
gfniXor_tgt:
pxor xmm0, xmm1
gf2p8affineqb xmm0, xmm2, 2
ret
https://godbolt.org/z/16or45959
Most nodes that lower to vgf2p8affineqb already perform this fold so this mostly applies to intrinsics.
Given that
vgf2p8affineqbperforms an XOR permutation of the input, and that XORs are associated, XORing two values that where transformed in the same manner can be reassociated to happen before. Their immediates also need to be XORed together as well:https://godbolt.org/z/16or45959
Most nodes that lower to
vgf2p8affineqbalready perform this fold so this mostly applies to intrinsics.