Hello,
The answer to this is going to be different depending on whether you're asking about the API contract, or the actual behavior.
The API contract is that it's undefined behavior -- so we make no guarantees at all. At some point we might want to add assertions guarding against this, but at the moment there are no assertions (these would have significant overhead).
The actual behavior if LHS still contains zero values is as follows. If two LHS values on the same LHS row, exactly 8 columns apart, are both zero, and the corresponding RHS values that they are multiplied against in the GEMM (in the same RHS column, exactly 8 RHS rows apart) are also both zero, then an incorrect result is produced (because integer overflow occurs). (This is an incorrect result, not undefined behavior as in the C++ language semantics for signed integer overflow, because we use assembly, not C++, to perform this arithmetic). In every other case, the result is correct. In particular, RHS and LHS actually play symmetric roles, so for instance if RHS only contains nonzero values, then it does not actually matter if there are zero values in LHS. Also, if LHS contains only one value that is zero, then nothing bad can happen. But this is an implementation detail and we make no guarantees about this. The current API contract is intentionally much stricter than we need, so as to avoid entrenching implementation details in the API.
The idea of requiring specifically the LHS values to be nonzero is that we typically use gemmlowp in NN inference applications, where LHS is the weights and RHS is the activations. The weights matrix being a constant, is easy to control to avoid zero values there.
Let me know if a change to that would help.
Cheers,
Benoit