Revision b551ec04
b/target-sparc/translate.c | ||
---|---|---|
1663 | 1663 |
#ifdef TARGET_SPARC64 |
1664 | 1664 |
static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env) |
1665 | 1665 |
{ |
1666 |
TCGv r_tl = tcg_temp_new();
|
|
1666 |
TCGv_i32 r_tl = tcg_temp_new_i32();
|
|
1667 | 1667 |
|
1668 | 1668 |
/* load env->tl into r_tl */ |
1669 |
{ |
|
1670 |
TCGv_i32 r_tl_tmp = tcg_temp_new_i32(); |
|
1671 |
tcg_gen_ld_i32(r_tl_tmp, cpu_env, offsetof(CPUSPARCState, tl)); |
|
1672 |
tcg_gen_ext_i32_tl(r_tl, r_tl_tmp); |
|
1673 |
tcg_temp_free_i32(r_tl_tmp); |
|
1674 |
} |
|
1669 |
tcg_gen_ld_i32(r_tl, cpu_env, offsetof(CPUSPARCState, tl)); |
|
1675 | 1670 |
|
1676 | 1671 |
/* tl = [0 ... MAXTL_MASK] where MAXTL_MASK must be power of 2 */ |
1677 |
tcg_gen_andi_tl(r_tl, r_tl, MAXTL_MASK);
|
|
1672 |
tcg_gen_andi_i32(r_tl, r_tl, MAXTL_MASK);
|
|
1678 | 1673 |
|
1679 | 1674 |
/* calculate offset to current trap state from env->ts, reuse r_tl */ |
1680 |
tcg_gen_muli_tl(r_tl, r_tl, sizeof (trap_state));
|
|
1675 |
tcg_gen_muli_i32(r_tl, r_tl, sizeof (trap_state));
|
|
1681 | 1676 |
tcg_gen_addi_ptr(r_tsptr, cpu_env, offsetof(CPUState, ts)); |
1682 | 1677 |
|
1683 | 1678 |
/* tsptr = env->ts[env->tl & MAXTL_MASK] */ |
1684 |
tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl); |
|
1679 |
{ |
|
1680 |
TCGv_ptr r_tl_tmp = tcg_temp_new_ptr(); |
|
1681 |
tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl); |
|
1682 |
tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp); |
|
1683 |
tcg_temp_free_i32(r_tl_tmp); |
|
1684 |
} |
|
1685 | 1685 |
|
1686 |
tcg_temp_free(r_tl); |
|
1686 |
tcg_temp_free_i32(r_tl);
|
|
1687 | 1687 |
} |
1688 | 1688 |
#endif |
1689 | 1689 |
|
Also available in: Unified diff