Use implementation of kmacro-to-register from upstream