void emit_branch_with_gp(Merced_Code_Emitter& emitter,
                         void **proc_ptr)
{
    void *new_gp = proc_ptr[1];
    void *vm_gp = get_vm_gp_value();

    // Set the gp according to the IPF software conventions. 
    if (new_gp != vm_gp)
    {
        emit_mov_imm_compactor(emitter, GP_REG, (uint64)new_gp);
    }

    uint64 branch_target = (uint64)(*proc_ptr);

    emit_mov_imm_compactor(emitter, SCRATCH_GENERAL_REG, branch_target, 0);
    emitter.ipf_mtbr(SCRATCH_BRANCH_REG, SCRATCH_GENERAL_REG);
    emitter.ipf_bri(br_cond, br_few, br_sptk, br_none, SCRATCH_BRANCH_REG);

    // someone else will restore the gp, according to the software conventions
} //emit_branch_with_gp