Add safe version of ldm and stm (ldms and stms)