Code generation for primitive operators