Remember I mentioned a while ago about using customasm to generate #riscv code? Well, I have put up a repository with most of rv32i and some of rv32m here: https://git.sr.ht/~aperezdc/customasm-riscv
It can only output flat binaries, and I have not yet checked that all possible inputs generate correct code, but it can already be used to assemble simple code.