Need to choose the size of vector factor for mask based on the entries vector factors, not mask size, to generate correct code. Fixes #117170
Some of the tests from the X86 directory can be generalized to improve coverage for other architectures