added option to change ret type in cpu_ins()