You must mask every bit to check where the interrupt came from. The exception handling procedure is shown here:
You can see the manual for your equipment that says where the interrupt came from, and there are often error codes that you can load into the register and compare with the EPIE register to find out if the exception was a trap or an interrupt, do not forget to reset the EPIE (register error state) before returning from the error and turning on the interrupt bits in the processor control register so that the hardware can create interrupts.
This is the scheme I used when coding the exception handler for Nios II, the procedure should be similar for MIPS32.
Assembly language MIPS , MIPS: interrupts and exceptions p. 22
source share