Ab initio simulation of hydrogen bonding in ices under ultra-high pressure