We demonstrate through kinetic Monte Carlo simulations that different nanoscale compositional patterns can be formed in the film deposition of phase-separated alloys. When the diffusion is confined on the surface, cylinders (nanowires) perpendicular to the growth plane are observed in both symmetric and asymmetric phase-separated alloys. In the presence of both surface and subsurface diffusion, the compositional modulations along the growth direction (natural superlattices) may be formed in asymmetric alloys. Such nanoscale patterning is attributed to the competition of phase separation and surface segregation as well as to the geometrical confinement of the diffusion in the film growth.