Automatic Microarchitecture-Aware Custom Instruction Design for RISC-V Processors (Full Report)