Viscous flow serves as a significant heating mechanism during the formation of hot spots, but the shear viscosity which determines this response is poorly characterized for most high explosives. Recently, a model was proposed for the shear viscosity of liquid HMX (1,3,5,7- tetranitro-1,3,5,7-tetrazocane) that was fit to pressures reaching 5 GPa, but this work uncovered uncertainties in the viscosity at 0 GPa and remains untested at higher pressures. We use molecular dynamics (MD) simulations and the Green-Kubo formalism to predict the temperature and pressure-dependent shear viscosity of HMX over the pressure interval 0 GPa <= P <= 40 GPa. Reassessment of the viscosity at 0 GPa rules out several potential explanations for discrepancies between earlier reports; we tentatively attribute these differences to details of MD trajectory integration and analysis protocols. The shear viscosity of HMX exhibits an Arrhenius temperature dependence at each pressure considered, with exponential prefactor and activation energy terms that are also strong functions of pressure. An analytic form for the viscosity is developed based on an extension of the well-known Andrade equation that simultaneously captures the temperature and pressure dependencies in the MD data up to 40 GPa. Comparison against a recently developed model for the viscosity of liquid RDX (1,3,5-trinitro-1,3,5-triazinane) shows that both materials exhibit similar functional dependencies with the viscosity of HMX being higher by roughly an order of magnitude at a given temperature-pressure state.