This patch fixes emitting of correct variant of DINS instruction. I'm referencing the gnu assembler for this solution.
Here is an example of a case where LLVM assembler emits DINS instruction instead of DINSM:
For instruction: dins $2, $1, 28, 6
Output without the patch: 7c220f07 dins v0,at,0x1c,0xffffffe6 -> 07 (opcode for dins)
Output with the patch: 7c220f05 dins v0,at,0x1c,0x6 -> 05 (opcode for dinsm)
Output with gnu assembler: 7c220f05 dins v0,at,0x1c,0x6 -> (05 opcode for dinsm)
The second condition is incorrect, it should be (pos + size) <= 64, according to the 5.04 BIS.