Use getregtype() to restore register's mode.