+ nreg_v0->prio = REG_IS_LOADED;
+ nreg_v0->emulated_register = reg;
+
+ } else if (nreg == nreg_v0) {
+ /* The target register 'reg' is mapped to JIT_V0 */
+
+ if (!nreg->zero_extended)
+ jit_extr_ui(JIT_V0, JIT_V0);
+
+ } else {
+ /* The target register 'reg' is mapped elsewhere. In that case,
+ * move the register's value to JIT_V0 and re-map it in the
+ * register cache. We can then safely discard the original
+ * mapped register (even if it was dirty). */
+
+ jit_reg = lightrec_reg_to_lightning(cache, nreg);
+ if (nreg->zero_extended)
+ jit_movr(JIT_V0, jit_reg);
+ else
+ jit_extr_ui(JIT_V0, jit_reg);
+
+ *nreg_v0 = *nreg;
+ lightrec_discard_nreg(nreg);
+ }
+
+ if (lightrec_store_next_pc()) {
+ jit_stxi_i(offsetof(struct lightrec_state, next_pc),
+ LIGHTREC_REG_STATE, JIT_V0);
+ } else {
+ lightrec_clean_reg(cache, _jit, JIT_V0);
+
+ nreg_v0->zero_extended = true;
+ nreg_v0->locked = true;
+ }