Generating instructions for miscellaneous primitives