A compression ignition engine (60) has a control system (66) for processing data, one or more combustion chambers (62), and fuel injectors (64) for injecting fuel into the chambers. The control system controls fueling using a result of the processing of certain data, such as engine speed and engine load, to select one of three fueling modes (HCCI+RVT, HCCI+VVT, CD+RVT) for operating the engine. When the result of the processing selects the HCCI+RVT mode, intake valves operate with regular valve timing (RVT), and the engine is fueled to cause homogeneous-charge compression-ignition (HCCI) combustion. When the result of the processing selects the HCCI+VVT mode, intake valve timing is changed relative to RVT, and the engine is fueled to cause HCCI combustion. When the result of the processing selects the CD+RVT mode, the intake valves operate with RVT, and the engine is fueled to cause CD combustion.