moving teststate_check_regs written by klehman into openpower-isa