cmd/compile: move the modularMultiplicativeInverse helper from ssa to generic