automatically generate instruction type check methods