Ab initio study of MgSiO3 and CaSiO3 perovskites at lower-mantle pressures