mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
tcg: Rename cpu_env to tcg_env
Allow the name 'cpu_env' to be used for something else. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
a953b5fa15
commit
ad75a51e84
91 changed files with 3818 additions and 3819 deletions
|
@ -55,7 +55,7 @@ bool mve_skip_vmov(DisasContext *s, int vn, int index, int size);
|
|||
static inline TCGv_i32 load_cpu_offset(int offset)
|
||||
{
|
||||
TCGv_i32 tmp = tcg_temp_new_i32();
|
||||
tcg_gen_ld_i32(tmp, cpu_env, offset);
|
||||
tcg_gen_ld_i32(tmp, tcg_env, offset);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -115,7 +115,7 @@ static inline int vec_full_reg_offset(DisasContext *s, int regno)
|
|||
static inline TCGv_ptr vec_full_reg_ptr(DisasContext *s, int regno)
|
||||
{
|
||||
TCGv_ptr ret = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ret, cpu_env, vec_full_reg_offset(s, regno));
|
||||
tcg_gen_addi_ptr(ret, tcg_env, vec_full_reg_offset(s, regno));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ static inline int pred_gvec_reg_size(DisasContext *s)
|
|||
static inline TCGv_ptr pred_full_reg_ptr(DisasContext *s, int regno)
|
||||
{
|
||||
TCGv_ptr ret = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ret, cpu_env, pred_full_reg_offset(s, regno));
|
||||
tcg_gen_addi_ptr(ret, tcg_env, pred_full_reg_offset(s, regno));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,9 +85,9 @@ static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a)
|
|||
|
||||
fptr = load_reg(s, a->rn);
|
||||
if (a->l) {
|
||||
gen_helper_v7m_vlldm(cpu_env, fptr);
|
||||
gen_helper_v7m_vlldm(tcg_env, fptr);
|
||||
} else {
|
||||
gen_helper_v7m_vlstm(cpu_env, fptr);
|
||||
gen_helper_v7m_vlstm(tcg_env, fptr);
|
||||
}
|
||||
|
||||
clear_eci_state(s);
|
||||
|
@ -322,7 +322,7 @@ static bool gen_M_fp_sysreg_write(DisasContext *s, int regno,
|
|||
switch (regno) {
|
||||
case ARM_VFP_FPSCR:
|
||||
tmp = loadfn(s, opaque, true);
|
||||
gen_helper_vfp_set_fpscr(cpu_env, tmp);
|
||||
gen_helper_vfp_set_fpscr(tcg_env, tmp);
|
||||
gen_lookup_tb(s);
|
||||
break;
|
||||
case ARM_VFP_FPSCR_NZCVQC:
|
||||
|
@ -391,7 +391,7 @@ static bool gen_M_fp_sysreg_write(DisasContext *s, int regno,
|
|||
R_V7M_CONTROL_SFPA_SHIFT, 1);
|
||||
store_cpu_field(control, v7m.control[M_REG_S]);
|
||||
tcg_gen_andi_i32(tmp, tmp, ~FPCR_NZCV_MASK);
|
||||
gen_helper_vfp_set_fpscr(cpu_env, tmp);
|
||||
gen_helper_vfp_set_fpscr(tcg_env, tmp);
|
||||
s->base.is_jmp = DISAS_UPDATE_NOCHAIN;
|
||||
break;
|
||||
}
|
||||
|
@ -451,12 +451,12 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
|
|||
switch (regno) {
|
||||
case ARM_VFP_FPSCR:
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_vfp_get_fpscr(tmp, cpu_env);
|
||||
gen_helper_vfp_get_fpscr(tmp, tcg_env);
|
||||
storefn(s, opaque, tmp, true);
|
||||
break;
|
||||
case ARM_VFP_FPSCR_NZCVQC:
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_vfp_get_fpscr(tmp, cpu_env);
|
||||
gen_helper_vfp_get_fpscr(tmp, tcg_env);
|
||||
tcg_gen_andi_i32(tmp, tmp, FPCR_NZCVQC_MASK);
|
||||
storefn(s, opaque, tmp, true);
|
||||
break;
|
||||
|
@ -475,7 +475,7 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
|
|||
/* Bits [27:0] from FPSCR, bit [31] from CONTROL.SFPA */
|
||||
tmp = tcg_temp_new_i32();
|
||||
sfpa = tcg_temp_new_i32();
|
||||
gen_helper_vfp_get_fpscr(tmp, cpu_env);
|
||||
gen_helper_vfp_get_fpscr(tmp, tcg_env);
|
||||
tcg_gen_andi_i32(tmp, tmp, ~FPCR_NZCV_MASK);
|
||||
control = load_cpu_field(v7m.control[M_REG_S]);
|
||||
tcg_gen_andi_i32(sfpa, control, R_V7M_CONTROL_SFPA_MASK);
|
||||
|
@ -493,7 +493,7 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
|
|||
tcg_gen_andi_i32(control, control, ~R_V7M_CONTROL_SFPA_MASK);
|
||||
store_cpu_field(control, v7m.control[M_REG_S]);
|
||||
fpscr = load_cpu_field(v7m.fpdscr[M_REG_NS]);
|
||||
gen_helper_vfp_set_fpscr(cpu_env, fpscr);
|
||||
gen_helper_vfp_set_fpscr(tcg_env, fpscr);
|
||||
lookup_tb = true;
|
||||
break;
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
|
|||
tmp = tcg_temp_new_i32();
|
||||
sfpa = tcg_temp_new_i32();
|
||||
fpscr = tcg_temp_new_i32();
|
||||
gen_helper_vfp_get_fpscr(fpscr, cpu_env);
|
||||
gen_helper_vfp_get_fpscr(fpscr, tcg_env);
|
||||
tcg_gen_andi_i32(tmp, fpscr, ~FPCR_NZCV_MASK);
|
||||
control = load_cpu_field(v7m.control[M_REG_S]);
|
||||
tcg_gen_andi_i32(sfpa, control, R_V7M_CONTROL_SFPA_MASK);
|
||||
|
@ -540,7 +540,7 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
|
|||
fpdscr = load_cpu_field(v7m.fpdscr[M_REG_NS]);
|
||||
tcg_gen_movcond_i32(TCG_COND_EQ, fpscr, sfpa, tcg_constant_i32(0),
|
||||
fpdscr, fpscr);
|
||||
gen_helper_vfp_set_fpscr(cpu_env, fpscr);
|
||||
gen_helper_vfp_set_fpscr(tcg_env, fpscr);
|
||||
break;
|
||||
}
|
||||
case ARM_VFP_VPR:
|
||||
|
@ -643,7 +643,7 @@ static void fp_sysreg_to_memory(DisasContext *s, void *opaque, TCGv_i32 value,
|
|||
}
|
||||
|
||||
if (s->v8m_stackcheck && a->rn == 13 && a->w) {
|
||||
gen_helper_v8m_stackcheck(cpu_env, addr);
|
||||
gen_helper_v8m_stackcheck(tcg_env, addr);
|
||||
}
|
||||
|
||||
if (do_access) {
|
||||
|
@ -682,7 +682,7 @@ static TCGv_i32 memory_to_fp_sysreg(DisasContext *s, void *opaque,
|
|||
}
|
||||
|
||||
if (s->v8m_stackcheck && a->rn == 13 && a->w) {
|
||||
gen_helper_v8m_stackcheck(cpu_env, addr);
|
||||
gen_helper_v8m_stackcheck(tcg_env, addr);
|
||||
}
|
||||
|
||||
if (do_access) {
|
||||
|
|
|
@ -56,7 +56,7 @@ static inline long mve_qreg_offset(unsigned reg)
|
|||
static TCGv_ptr mve_qreg_ptr(unsigned reg)
|
||||
{
|
||||
TCGv_ptr ret = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ret, cpu_env, mve_qreg_offset(reg));
|
||||
tcg_gen_addi_ptr(ret, tcg_env, mve_qreg_offset(reg));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ static bool do_ldst(DisasContext *s, arg_VLDR_VSTR *a, MVEGenLdStFn *fn,
|
|||
}
|
||||
|
||||
qreg = mve_qreg_ptr(a->qd);
|
||||
fn(cpu_env, qreg, addr);
|
||||
fn(tcg_env, qreg, addr);
|
||||
|
||||
/*
|
||||
* Writeback always happens after the last beat of the insn,
|
||||
|
@ -234,7 +234,7 @@ static bool do_ldst_sg(DisasContext *s, arg_vldst_sg *a, MVEGenLdStSGFn fn)
|
|||
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qm, addr);
|
||||
fn(tcg_env, qd, qm, addr);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ static bool do_ldst_sg_imm(DisasContext *s, arg_vldst_sg_imm *a,
|
|||
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qm, tcg_constant_i32(offset));
|
||||
fn(tcg_env, qd, qm, tcg_constant_i32(offset));
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ static bool do_vldst_il(DisasContext *s, arg_vldst_il *a, MVEGenLdStIlFn *fn,
|
|||
* We pass the index of Qd, not a pointer, because the helper must
|
||||
* access multiple Q registers starting at Qd and working up.
|
||||
*/
|
||||
fn(cpu_env, tcg_constant_i32(a->qd), rn);
|
||||
fn(tcg_env, tcg_constant_i32(a->qd), rn);
|
||||
|
||||
if (a->w) {
|
||||
tcg_gen_addi_i32(rn, rn, addrinc);
|
||||
|
@ -491,7 +491,7 @@ static bool trans_VDUP(DisasContext *s, arg_VDUP *a)
|
|||
} else {
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
tcg_gen_dup_i32(a->size, rt, rt);
|
||||
gen_helper_mve_vdup(cpu_env, qd, rt);
|
||||
gen_helper_mve_vdup(tcg_env, qd, rt);
|
||||
}
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -517,7 +517,7 @@ static bool do_1op_vec(DisasContext *s, arg_1op *a, MVEGenOneOpFn fn,
|
|||
} else {
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qm);
|
||||
fn(tcg_env, qd, qm);
|
||||
}
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -612,7 +612,7 @@ static bool do_vcvt_rmode(DisasContext *s, arg_1op *a,
|
|||
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qm, tcg_constant_i32(arm_rmode_to_sf(rmode)));
|
||||
fn(tcg_env, qd, qm, tcg_constant_i32(arm_rmode_to_sf(rmode)));
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
}
|
||||
|
@ -800,7 +800,7 @@ static bool do_2op_vec(DisasContext *s, arg_2op *a, MVEGenTwoOpFn fn,
|
|||
qd = mve_qreg_ptr(a->qd);
|
||||
qn = mve_qreg_ptr(a->qn);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qn, qm);
|
||||
fn(tcg_env, qd, qn, qm);
|
||||
}
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -1052,7 +1052,7 @@ static bool do_2op_scalar(DisasContext *s, arg_2scalar *a,
|
|||
qd = mve_qreg_ptr(a->qd);
|
||||
qn = mve_qreg_ptr(a->qn);
|
||||
rm = load_reg(s, a->rm);
|
||||
fn(cpu_env, qd, qn, rm);
|
||||
fn(tcg_env, qd, qn, rm);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
}
|
||||
|
@ -1183,7 +1183,7 @@ static bool do_long_dual_acc(DisasContext *s, arg_vmlaldav *a,
|
|||
rda_i = tcg_constant_i64(0);
|
||||
}
|
||||
|
||||
fn(rda_o, cpu_env, qn, qm, rda_i);
|
||||
fn(rda_o, tcg_env, qn, qm, rda_i);
|
||||
|
||||
rdalo = tcg_temp_new_i32();
|
||||
rdahi = tcg_temp_new_i32();
|
||||
|
@ -1281,7 +1281,7 @@ static bool do_dual_acc(DisasContext *s, arg_vmladav *a, MVEGenDualAccOpFn *fn)
|
|||
rda_o = tcg_temp_new_i32();
|
||||
}
|
||||
|
||||
fn(rda_o, cpu_env, qn, qm, rda_i);
|
||||
fn(rda_o, tcg_env, qn, qm, rda_i);
|
||||
store_reg(s, a->rda, rda_o);
|
||||
|
||||
mve_update_eci(s);
|
||||
|
@ -1377,7 +1377,7 @@ static bool trans_VPNOT(DisasContext *s, arg_VPNOT *a)
|
|||
return true;
|
||||
}
|
||||
|
||||
gen_helper_mve_vpnot(cpu_env);
|
||||
gen_helper_mve_vpnot(tcg_env);
|
||||
/* This insn updates predication bits */
|
||||
s->base.is_jmp = DISAS_UPDATE_NOCHAIN;
|
||||
mve_update_eci(s);
|
||||
|
@ -1419,7 +1419,7 @@ static bool trans_VADDV(DisasContext *s, arg_VADDV *a)
|
|||
}
|
||||
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fns[a->size][a->u](rda_o, cpu_env, qm, rda_i);
|
||||
fns[a->size][a->u](rda_o, tcg_env, qm, rda_i);
|
||||
store_reg(s, a->rda, rda_o);
|
||||
|
||||
mve_update_eci(s);
|
||||
|
@ -1471,9 +1471,9 @@ static bool trans_VADDLV(DisasContext *s, arg_VADDLV *a)
|
|||
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
if (a->u) {
|
||||
gen_helper_mve_vaddlv_u(rda_o, cpu_env, qm, rda_i);
|
||||
gen_helper_mve_vaddlv_u(rda_o, tcg_env, qm, rda_i);
|
||||
} else {
|
||||
gen_helper_mve_vaddlv_s(rda_o, cpu_env, qm, rda_i);
|
||||
gen_helper_mve_vaddlv_s(rda_o, tcg_env, qm, rda_i);
|
||||
}
|
||||
|
||||
rdalo = tcg_temp_new_i32();
|
||||
|
@ -1508,7 +1508,7 @@ static bool do_1imm(DisasContext *s, arg_1imm *a, MVEGenOneOpImmFn *fn,
|
|||
imm, 16, 16);
|
||||
} else {
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
fn(cpu_env, qd, tcg_constant_i64(imm));
|
||||
fn(tcg_env, qd, tcg_constant_i64(imm));
|
||||
}
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -1580,7 +1580,7 @@ static bool do_2shift_vec(DisasContext *s, arg_2shift *a, MVEGenTwoOpShiftFn fn,
|
|||
} else {
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qm, tcg_constant_i32(shift));
|
||||
fn(tcg_env, qd, qm, tcg_constant_i32(shift));
|
||||
}
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -1685,7 +1685,7 @@ static bool do_2shift_scalar(DisasContext *s, arg_shl_scalar *a,
|
|||
|
||||
qda = mve_qreg_ptr(a->qda);
|
||||
rm = load_reg(s, a->rm);
|
||||
fn(cpu_env, qda, qda, rm);
|
||||
fn(tcg_env, qda, qda, rm);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
}
|
||||
|
@ -1827,7 +1827,7 @@ static bool trans_VSHLC(DisasContext *s, arg_VSHLC *a)
|
|||
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
rdm = load_reg(s, a->rdm);
|
||||
gen_helper_mve_vshlc(rdm, cpu_env, qd, rdm, tcg_constant_i32(a->imm));
|
||||
gen_helper_mve_vshlc(rdm, tcg_env, qd, rdm, tcg_constant_i32(a->imm));
|
||||
store_reg(s, a->rdm, rdm);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -1856,7 +1856,7 @@ static bool do_vidup(DisasContext *s, arg_vidup *a, MVEGenVIDUPFn *fn)
|
|||
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
rn = load_reg(s, a->rn);
|
||||
fn(rn, cpu_env, qd, rn, tcg_constant_i32(a->imm));
|
||||
fn(rn, tcg_env, qd, rn, tcg_constant_i32(a->imm));
|
||||
store_reg(s, a->rn, rn);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -1891,7 +1891,7 @@ static bool do_viwdup(DisasContext *s, arg_viwdup *a, MVEGenVIWDUPFn *fn)
|
|||
qd = mve_qreg_ptr(a->qd);
|
||||
rn = load_reg(s, a->rn);
|
||||
rm = load_reg(s, a->rm);
|
||||
fn(rn, cpu_env, qd, rn, rm, tcg_constant_i32(a->imm));
|
||||
fn(rn, tcg_env, qd, rn, rm, tcg_constant_i32(a->imm));
|
||||
store_reg(s, a->rn, rn);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -1957,7 +1957,7 @@ static bool do_vcmp(DisasContext *s, arg_vcmp *a, MVEGenCmpFn *fn)
|
|||
|
||||
qn = mve_qreg_ptr(a->qn);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qn, qm);
|
||||
fn(tcg_env, qn, qm);
|
||||
if (a->mask) {
|
||||
/* VPT */
|
||||
gen_vpst(s, a->mask);
|
||||
|
@ -1988,7 +1988,7 @@ static bool do_vcmp_scalar(DisasContext *s, arg_vcmp_scalar *a,
|
|||
} else {
|
||||
rm = load_reg(s, a->rm);
|
||||
}
|
||||
fn(cpu_env, qn, rm);
|
||||
fn(tcg_env, qn, rm);
|
||||
if (a->mask) {
|
||||
/* VPT */
|
||||
gen_vpst(s, a->mask);
|
||||
|
@ -2089,7 +2089,7 @@ static bool do_vmaxv(DisasContext *s, arg_vmaxv *a, MVEGenVADDVFn fn)
|
|||
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
rda = load_reg(s, a->rda);
|
||||
fn(rda, cpu_env, qm, rda);
|
||||
fn(rda, tcg_env, qm, rda);
|
||||
store_reg(s, a->rda, rda);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
@ -2153,7 +2153,7 @@ static bool do_vabav(DisasContext *s, arg_vabav *a, MVEGenVABAVFn *fn)
|
|||
qm = mve_qreg_ptr(a->qm);
|
||||
qn = mve_qreg_ptr(a->qn);
|
||||
rda = load_reg(s, a->rda);
|
||||
fn(rda, cpu_env, qn, qm, rda);
|
||||
fn(rda, tcg_env, qn, qm, rda);
|
||||
store_reg(s, a->rda, rda);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
static TCGv_ptr vfp_reg_ptr(bool dp, int reg)
|
||||
{
|
||||
TCGv_ptr ret = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ret, cpu_env, vfp_reg_offset(dp, reg));
|
||||
tcg_gen_addi_ptr(ret, tcg_env, vfp_reg_offset(dp, reg));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -42,13 +42,13 @@ static void neon_load_element(TCGv_i32 var, int reg, int ele, MemOp mop)
|
|||
|
||||
switch (mop) {
|
||||
case MO_UB:
|
||||
tcg_gen_ld8u_i32(var, cpu_env, offset);
|
||||
tcg_gen_ld8u_i32(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_UW:
|
||||
tcg_gen_ld16u_i32(var, cpu_env, offset);
|
||||
tcg_gen_ld16u_i32(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_UL:
|
||||
tcg_gen_ld_i32(var, cpu_env, offset);
|
||||
tcg_gen_ld_i32(var, tcg_env, offset);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -61,16 +61,16 @@ static void neon_load_element64(TCGv_i64 var, int reg, int ele, MemOp mop)
|
|||
|
||||
switch (mop) {
|
||||
case MO_UB:
|
||||
tcg_gen_ld8u_i64(var, cpu_env, offset);
|
||||
tcg_gen_ld8u_i64(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_UW:
|
||||
tcg_gen_ld16u_i64(var, cpu_env, offset);
|
||||
tcg_gen_ld16u_i64(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_UL:
|
||||
tcg_gen_ld32u_i64(var, cpu_env, offset);
|
||||
tcg_gen_ld32u_i64(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_UQ:
|
||||
tcg_gen_ld_i64(var, cpu_env, offset);
|
||||
tcg_gen_ld_i64(var, tcg_env, offset);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -83,13 +83,13 @@ static void neon_store_element(int reg, int ele, MemOp size, TCGv_i32 var)
|
|||
|
||||
switch (size) {
|
||||
case MO_8:
|
||||
tcg_gen_st8_i32(var, cpu_env, offset);
|
||||
tcg_gen_st8_i32(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_16:
|
||||
tcg_gen_st16_i32(var, cpu_env, offset);
|
||||
tcg_gen_st16_i32(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_32:
|
||||
tcg_gen_st_i32(var, cpu_env, offset);
|
||||
tcg_gen_st_i32(var, tcg_env, offset);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -102,16 +102,16 @@ static void neon_store_element64(int reg, int ele, MemOp size, TCGv_i64 var)
|
|||
|
||||
switch (size) {
|
||||
case MO_8:
|
||||
tcg_gen_st8_i64(var, cpu_env, offset);
|
||||
tcg_gen_st8_i64(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_16:
|
||||
tcg_gen_st16_i64(var, cpu_env, offset);
|
||||
tcg_gen_st16_i64(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_32:
|
||||
tcg_gen_st32_i64(var, cpu_env, offset);
|
||||
tcg_gen_st32_i64(var, tcg_env, offset);
|
||||
break;
|
||||
case MO_64:
|
||||
tcg_gen_st_i64(var, cpu_env, offset);
|
||||
tcg_gen_st_i64(var, tcg_env, offset);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -296,7 +296,7 @@ static bool trans_VFML(DisasContext *s, arg_VFML *a)
|
|||
tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd),
|
||||
vfp_reg_offset(a->q, a->vn),
|
||||
vfp_reg_offset(a->q, a->vm),
|
||||
cpu_env, opr_sz, opr_sz, a->s, /* is_2 == 0 */
|
||||
tcg_env, opr_sz, opr_sz, a->s, /* is_2 == 0 */
|
||||
gen_helper_gvec_fmlal_a32);
|
||||
return true;
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ static bool trans_VFML_scalar(DisasContext *s, arg_VFML_scalar *a)
|
|||
tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd),
|
||||
vfp_reg_offset(a->q, a->vn),
|
||||
vfp_reg_offset(a->q, a->rm),
|
||||
cpu_env, opr_sz, opr_sz,
|
||||
tcg_env, opr_sz, opr_sz,
|
||||
(a->index << 2) | a->s, /* is_2 == 0 */
|
||||
gen_helper_gvec_fmlal_idx_a32);
|
||||
return true;
|
||||
|
@ -920,7 +920,7 @@ DO_SHA2(SHA256SU1, gen_helper_crypto_sha256su1)
|
|||
#define DO_3SAME_64_ENV(INSN, FUNC) \
|
||||
static void gen_##INSN##_elt(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m) \
|
||||
{ \
|
||||
FUNC(d, cpu_env, n, m); \
|
||||
FUNC(d, tcg_env, n, m); \
|
||||
} \
|
||||
DO_3SAME_64(INSN, gen_##INSN##_elt)
|
||||
|
||||
|
@ -953,7 +953,7 @@ DO_3SAME_64_ENV(VQRSHL_U64, gen_helper_neon_qrshl_u64)
|
|||
}
|
||||
|
||||
/*
|
||||
* Some helper functions need to be passed the cpu_env. In order
|
||||
* Some helper functions need to be passed the tcg_env. In order
|
||||
* to use those with the gvec APIs like tcg_gen_gvec_3() we need
|
||||
* to create wrapper functions whose prototype is a NeonGenTwoOpFn()
|
||||
* and which call a NeonGenTwoOpEnvFn().
|
||||
|
@ -961,7 +961,7 @@ DO_3SAME_64_ENV(VQRSHL_U64, gen_helper_neon_qrshl_u64)
|
|||
#define WRAP_ENV_FN(WRAPNAME, FUNC) \
|
||||
static void WRAPNAME(TCGv_i32 d, TCGv_i32 n, TCGv_i32 m) \
|
||||
{ \
|
||||
FUNC(d, cpu_env, n, m); \
|
||||
FUNC(d, tcg_env, n, m); \
|
||||
}
|
||||
|
||||
#define DO_3SAME_32_ENV(INSN, FUNC) \
|
||||
|
@ -1305,7 +1305,7 @@ static bool do_2shift_env_64(DisasContext *s, arg_2reg_shift *a,
|
|||
{
|
||||
/*
|
||||
* 2-reg-and-shift operations, size == 3 case, where the
|
||||
* function needs to be passed cpu_env.
|
||||
* function needs to be passed tcg_env.
|
||||
*/
|
||||
TCGv_i64 constimm;
|
||||
int pass;
|
||||
|
@ -1338,7 +1338,7 @@ static bool do_2shift_env_64(DisasContext *s, arg_2reg_shift *a,
|
|||
TCGv_i64 tmp = tcg_temp_new_i64();
|
||||
|
||||
read_neon_element64(tmp, a->vm, pass, MO_64);
|
||||
fn(tmp, cpu_env, tmp, constimm);
|
||||
fn(tmp, tcg_env, tmp, constimm);
|
||||
write_neon_element64(tmp, a->vd, pass, MO_64);
|
||||
}
|
||||
return true;
|
||||
|
@ -1349,7 +1349,7 @@ static bool do_2shift_env_32(DisasContext *s, arg_2reg_shift *a,
|
|||
{
|
||||
/*
|
||||
* 2-reg-and-shift operations, size < 3 case, where the
|
||||
* helper needs to be passed cpu_env.
|
||||
* helper needs to be passed tcg_env.
|
||||
*/
|
||||
TCGv_i32 constimm, tmp;
|
||||
int pass;
|
||||
|
@ -1381,7 +1381,7 @@ static bool do_2shift_env_32(DisasContext *s, arg_2reg_shift *a,
|
|||
|
||||
for (pass = 0; pass < (a->q ? 4 : 2); pass++) {
|
||||
read_neon_element32(tmp, a->vm, pass, MO_32);
|
||||
fn(tmp, cpu_env, tmp, constimm);
|
||||
fn(tmp, tcg_env, tmp, constimm);
|
||||
write_neon_element32(tmp, a->vd, pass, MO_32);
|
||||
}
|
||||
return true;
|
||||
|
@ -1447,11 +1447,11 @@ static bool do_2shift_narrow_64(DisasContext *s, arg_2reg_shift *a,
|
|||
read_neon_element64(rm2, a->vm, 1, MO_64);
|
||||
|
||||
shiftfn(rm1, rm1, constimm);
|
||||
narrowfn(rd, cpu_env, rm1);
|
||||
narrowfn(rd, tcg_env, rm1);
|
||||
write_neon_element32(rd, a->vd, 0, MO_32);
|
||||
|
||||
shiftfn(rm2, rm2, constimm);
|
||||
narrowfn(rd, cpu_env, rm2);
|
||||
narrowfn(rd, tcg_env, rm2);
|
||||
write_neon_element32(rd, a->vd, 1, MO_32);
|
||||
|
||||
return true;
|
||||
|
@ -1514,7 +1514,7 @@ static bool do_2shift_narrow_32(DisasContext *s, arg_2reg_shift *a,
|
|||
|
||||
tcg_gen_concat_i32_i64(rtmp, rm1, rm2);
|
||||
|
||||
narrowfn(rm1, cpu_env, rtmp);
|
||||
narrowfn(rm1, tcg_env, rtmp);
|
||||
write_neon_element32(rm1, a->vd, 0, MO_32);
|
||||
|
||||
shiftfn(rm3, rm3, constimm);
|
||||
|
@ -1522,7 +1522,7 @@ static bool do_2shift_narrow_32(DisasContext *s, arg_2reg_shift *a,
|
|||
|
||||
tcg_gen_concat_i32_i64(rtmp, rm3, rm4);
|
||||
|
||||
narrowfn(rm3, cpu_env, rtmp);
|
||||
narrowfn(rm3, tcg_env, rtmp);
|
||||
write_neon_element32(rm3, a->vd, 1, MO_32);
|
||||
return true;
|
||||
}
|
||||
|
@ -2159,13 +2159,13 @@ DO_VMLAL(VMLSL_U,mull_u,sub)
|
|||
static void gen_VQDMULL_16(TCGv_i64 rd, TCGv_i32 rn, TCGv_i32 rm)
|
||||
{
|
||||
gen_helper_neon_mull_s16(rd, rn, rm);
|
||||
gen_helper_neon_addl_saturate_s32(rd, cpu_env, rd, rd);
|
||||
gen_helper_neon_addl_saturate_s32(rd, tcg_env, rd, rd);
|
||||
}
|
||||
|
||||
static void gen_VQDMULL_32(TCGv_i64 rd, TCGv_i32 rn, TCGv_i32 rm)
|
||||
{
|
||||
gen_mull_s32(rd, rn, rm);
|
||||
gen_helper_neon_addl_saturate_s64(rd, cpu_env, rd, rd);
|
||||
gen_helper_neon_addl_saturate_s64(rd, tcg_env, rd, rd);
|
||||
}
|
||||
|
||||
static bool trans_VQDMULL_3d(DisasContext *s, arg_3diff *a)
|
||||
|
@ -2182,12 +2182,12 @@ static bool trans_VQDMULL_3d(DisasContext *s, arg_3diff *a)
|
|||
|
||||
static void gen_VQDMLAL_acc_16(TCGv_i64 rd, TCGv_i64 rn, TCGv_i64 rm)
|
||||
{
|
||||
gen_helper_neon_addl_saturate_s32(rd, cpu_env, rn, rm);
|
||||
gen_helper_neon_addl_saturate_s32(rd, tcg_env, rn, rm);
|
||||
}
|
||||
|
||||
static void gen_VQDMLAL_acc_32(TCGv_i64 rd, TCGv_i64 rn, TCGv_i64 rm)
|
||||
{
|
||||
gen_helper_neon_addl_saturate_s64(rd, cpu_env, rn, rm);
|
||||
gen_helper_neon_addl_saturate_s64(rd, tcg_env, rn, rm);
|
||||
}
|
||||
|
||||
static bool trans_VQDMLAL_3d(DisasContext *s, arg_3diff *a)
|
||||
|
@ -2211,13 +2211,13 @@ static bool trans_VQDMLAL_3d(DisasContext *s, arg_3diff *a)
|
|||
static void gen_VQDMLSL_acc_16(TCGv_i64 rd, TCGv_i64 rn, TCGv_i64 rm)
|
||||
{
|
||||
gen_helper_neon_negl_u32(rm, rm);
|
||||
gen_helper_neon_addl_saturate_s32(rd, cpu_env, rn, rm);
|
||||
gen_helper_neon_addl_saturate_s32(rd, tcg_env, rn, rm);
|
||||
}
|
||||
|
||||
static void gen_VQDMLSL_acc_32(TCGv_i64 rd, TCGv_i64 rn, TCGv_i64 rm)
|
||||
{
|
||||
tcg_gen_neg_i64(rm, rm);
|
||||
gen_helper_neon_addl_saturate_s64(rd, cpu_env, rn, rm);
|
||||
gen_helper_neon_addl_saturate_s64(rd, tcg_env, rn, rm);
|
||||
}
|
||||
|
||||
static bool trans_VQDMLSL_3d(DisasContext *s, arg_3diff *a)
|
||||
|
@ -2550,7 +2550,7 @@ static bool do_vqrdmlah_2sc(DisasContext *s, arg_2scalar *a,
|
|||
for (pass = 0; pass < (a->q ? 4 : 2); pass++) {
|
||||
read_neon_element32(rn, a->vn, pass, MO_32);
|
||||
read_neon_element32(rd, a->vd, pass, MO_32);
|
||||
opfn(rd, cpu_env, rn, scalar, rd);
|
||||
opfn(rd, tcg_env, rn, scalar, rd);
|
||||
write_neon_element32(rd, a->vd, pass, MO_32);
|
||||
}
|
||||
return true;
|
||||
|
@ -2837,7 +2837,7 @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
|
|||
val = tcg_temp_new_i64();
|
||||
read_neon_element64(val, a->vm, 0, MO_64);
|
||||
|
||||
gen_helper_neon_tbl(val, cpu_env, desc, val, def);
|
||||
gen_helper_neon_tbl(val, tcg_env, desc, val, def);
|
||||
write_neon_element64(val, a->vd, 0, MO_64);
|
||||
return true;
|
||||
}
|
||||
|
@ -3171,9 +3171,9 @@ static bool do_vmovn(DisasContext *s, arg_2misc *a,
|
|||
rd1 = tcg_temp_new_i32();
|
||||
|
||||
read_neon_element64(rm, a->vm, 0, MO_64);
|
||||
narrowfn(rd0, cpu_env, rm);
|
||||
narrowfn(rd0, tcg_env, rm);
|
||||
read_neon_element64(rm, a->vm, 1, MO_64);
|
||||
narrowfn(rd1, cpu_env, rm);
|
||||
narrowfn(rd1, tcg_env, rm);
|
||||
write_neon_element32(rd0, a->vd, 0, MO_32);
|
||||
write_neon_element32(rd1, a->vd, 1, MO_32);
|
||||
return true;
|
||||
|
@ -3625,7 +3625,7 @@ static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a)
|
|||
#define WRAP_1OP_ENV_FN(WRAPNAME, FUNC) \
|
||||
static void WRAPNAME(TCGv_i32 d, TCGv_i32 m) \
|
||||
{ \
|
||||
FUNC(d, cpu_env, m); \
|
||||
FUNC(d, tcg_env, m); \
|
||||
}
|
||||
|
||||
WRAP_1OP_ENV_FN(gen_VQABS_s8, gen_helper_neon_qabs_s8)
|
||||
|
|
|
@ -90,7 +90,7 @@ static TCGv_ptr get_tile_rowcol(DisasContext *s, int esz, int rs,
|
|||
/* Add the byte offset to env to produce the final pointer. */
|
||||
addr = tcg_temp_new_ptr();
|
||||
tcg_gen_ext_i32_ptr(addr, tmp);
|
||||
tcg_gen_add_ptr(addr, addr, cpu_env);
|
||||
tcg_gen_add_ptr(addr, addr, tcg_env);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ static TCGv_ptr get_tile(DisasContext *s, int esz, int tile)
|
|||
|
||||
offset = tile * sizeof(ARMVectorReg) + offsetof(CPUARMState, zarray);
|
||||
|
||||
tcg_gen_addi_ptr(addr, cpu_env, offset);
|
||||
tcg_gen_addi_ptr(addr, tcg_env, offset);
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ static bool trans_ZERO(DisasContext *s, arg_ZERO *a)
|
|||
return false;
|
||||
}
|
||||
if (sme_za_enabled_check(s)) {
|
||||
gen_helper_sme_zero(cpu_env, tcg_constant_i32(a->imm),
|
||||
gen_helper_sme_zero(tcg_env, tcg_constant_i32(a->imm),
|
||||
tcg_constant_i32(streaming_vec_reg_size(s)));
|
||||
}
|
||||
return true;
|
||||
|
@ -237,7 +237,7 @@ static bool trans_LDST1(DisasContext *s, arg_LDST1 *a)
|
|||
svl = streaming_vec_reg_size(s);
|
||||
desc = simd_desc(svl, svl, desc);
|
||||
|
||||
fns[a->esz][be][a->v][mte][a->st](cpu_env, t_za, t_pg, addr,
|
||||
fns[a->esz][be][a->v][mte][a->st](tcg_env, t_za, t_pg, addr,
|
||||
tcg_constant_i32(desc));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -497,8 +497,8 @@ static void do_predtest(DisasContext *s, int dofs, int gofs, int words)
|
|||
TCGv_ptr gptr = tcg_temp_new_ptr();
|
||||
TCGv_i32 t = tcg_temp_new_i32();
|
||||
|
||||
tcg_gen_addi_ptr(dptr, cpu_env, dofs);
|
||||
tcg_gen_addi_ptr(gptr, cpu_env, gofs);
|
||||
tcg_gen_addi_ptr(dptr, tcg_env, dofs);
|
||||
tcg_gen_addi_ptr(gptr, tcg_env, gofs);
|
||||
|
||||
gen_helper_sve_predtest(t, dptr, gptr, tcg_constant_i32(words));
|
||||
|
||||
|
@ -956,8 +956,8 @@ static bool do_vpz_ool(DisasContext *s, arg_rpr_esz *a,
|
|||
t_zn = tcg_temp_new_ptr();
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(t_zn, tcg_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
fn(temp, t_zn, t_pg, desc);
|
||||
|
||||
write_fp_dreg(s, a->rd, temp);
|
||||
|
@ -1209,7 +1209,7 @@ static bool do_index(DisasContext *s, int esz, int rd,
|
|||
desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
|
||||
t_zd = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, rd));
|
||||
tcg_gen_addi_ptr(t_zd, tcg_env, vec_full_reg_offset(s, rd));
|
||||
if (esz == 3) {
|
||||
gen_helper_sve_index_d(t_zd, start, incr, desc);
|
||||
} else {
|
||||
|
@ -1379,12 +1379,12 @@ static bool do_pppp_flags(DisasContext *s, arg_rprr_s *a,
|
|||
TCGv_i64 pm = tcg_temp_new_i64();
|
||||
TCGv_i64 pg = tcg_temp_new_i64();
|
||||
|
||||
tcg_gen_ld_i64(pn, cpu_env, nofs);
|
||||
tcg_gen_ld_i64(pm, cpu_env, mofs);
|
||||
tcg_gen_ld_i64(pg, cpu_env, gofs);
|
||||
tcg_gen_ld_i64(pn, tcg_env, nofs);
|
||||
tcg_gen_ld_i64(pm, tcg_env, mofs);
|
||||
tcg_gen_ld_i64(pg, tcg_env, gofs);
|
||||
|
||||
gvec_op->fni8(pd, pn, pm, pg);
|
||||
tcg_gen_st_i64(pd, cpu_env, dofs);
|
||||
tcg_gen_st_i64(pd, tcg_env, dofs);
|
||||
|
||||
do_predtest1(pd, pg);
|
||||
} else {
|
||||
|
@ -1654,8 +1654,8 @@ static bool trans_PTEST(DisasContext *s, arg_PTEST *a)
|
|||
TCGv_i64 pn = tcg_temp_new_i64();
|
||||
TCGv_i64 pg = tcg_temp_new_i64();
|
||||
|
||||
tcg_gen_ld_i64(pn, cpu_env, nofs);
|
||||
tcg_gen_ld_i64(pg, cpu_env, gofs);
|
||||
tcg_gen_ld_i64(pn, tcg_env, nofs);
|
||||
tcg_gen_ld_i64(pg, tcg_env, gofs);
|
||||
do_predtest1(pn, pg);
|
||||
} else {
|
||||
do_predtest(s, nofs, gofs, words);
|
||||
|
@ -1736,7 +1736,7 @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag)
|
|||
t = tcg_temp_new_i64();
|
||||
if (fullsz <= 64) {
|
||||
tcg_gen_movi_i64(t, lastword);
|
||||
tcg_gen_st_i64(t, cpu_env, ofs);
|
||||
tcg_gen_st_i64(t, tcg_env, ofs);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -1755,17 +1755,17 @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag)
|
|||
|
||||
tcg_gen_movi_i64(t, word);
|
||||
for (i = 0; i < QEMU_ALIGN_DOWN(setsz, 8); i += 8) {
|
||||
tcg_gen_st_i64(t, cpu_env, ofs + i);
|
||||
tcg_gen_st_i64(t, tcg_env, ofs + i);
|
||||
}
|
||||
if (lastword != word) {
|
||||
tcg_gen_movi_i64(t, lastword);
|
||||
tcg_gen_st_i64(t, cpu_env, ofs + i);
|
||||
tcg_gen_st_i64(t, tcg_env, ofs + i);
|
||||
i += 8;
|
||||
}
|
||||
if (i < fullsz) {
|
||||
tcg_gen_movi_i64(t, 0);
|
||||
for (; i < fullsz; i += 8) {
|
||||
tcg_gen_st_i64(t, cpu_env, ofs + i);
|
||||
tcg_gen_st_i64(t, tcg_env, ofs + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1822,8 +1822,8 @@ static bool do_pfirst_pnext(DisasContext *s, arg_rr_esz *a,
|
|||
desc = FIELD_DP32(desc, PREDDESC, OPRSZ, pred_full_reg_size(s));
|
||||
desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
|
||||
|
||||
tcg_gen_addi_ptr(t_pd, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_pd, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, a->rn));
|
||||
t = tcg_temp_new_i32();
|
||||
|
||||
gen_fn(t, t_pd, t_pg, tcg_constant_i32(desc));
|
||||
|
@ -1919,8 +1919,8 @@ static void do_sat_addsub_vec(DisasContext *s, int esz, int rd, int rn,
|
|||
|
||||
dptr = tcg_temp_new_ptr();
|
||||
nptr = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(dptr, cpu_env, vec_full_reg_offset(s, rd));
|
||||
tcg_gen_addi_ptr(nptr, cpu_env, vec_full_reg_offset(s, rn));
|
||||
tcg_gen_addi_ptr(dptr, tcg_env, vec_full_reg_offset(s, rd));
|
||||
tcg_gen_addi_ptr(nptr, tcg_env, vec_full_reg_offset(s, rn));
|
||||
desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
|
||||
|
||||
switch (esz) {
|
||||
|
@ -2163,9 +2163,9 @@ static void do_cpy_m(DisasContext *s, int esz, int rd, int rn, int pg,
|
|||
TCGv_ptr t_zn = tcg_temp_new_ptr();
|
||||
TCGv_ptr t_pg = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, rd));
|
||||
tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, rn));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_addi_ptr(t_zd, tcg_env, vec_full_reg_offset(s, rd));
|
||||
tcg_gen_addi_ptr(t_zn, tcg_env, vec_full_reg_offset(s, rn));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg));
|
||||
|
||||
fns[esz](t_zd, t_zn, t_pg, val, desc);
|
||||
}
|
||||
|
@ -2310,8 +2310,8 @@ static void do_insr_i64(DisasContext *s, arg_rrr_esz *a, TCGv_i64 val)
|
|||
TCGv_ptr t_zd = tcg_temp_new_ptr();
|
||||
TCGv_ptr t_zn = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_zd, tcg_env, vec_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_zn, tcg_env, vec_full_reg_offset(s, a->rn));
|
||||
|
||||
fns[a->esz](t_zd, t_zn, val, desc);
|
||||
}
|
||||
|
@ -2323,7 +2323,7 @@ static bool trans_INSR_f(DisasContext *s, arg_rrr_esz *a)
|
|||
}
|
||||
if (sve_access_check(s)) {
|
||||
TCGv_i64 t = tcg_temp_new_i64();
|
||||
tcg_gen_ld_i64(t, cpu_env, vec_reg_offset(s, a->rm, 0, MO_64));
|
||||
tcg_gen_ld_i64(t, tcg_env, vec_reg_offset(s, a->rm, 0, MO_64));
|
||||
do_insr_i64(s, a, t);
|
||||
}
|
||||
return true;
|
||||
|
@ -2409,9 +2409,9 @@ static bool do_perm_pred3(DisasContext *s, arg_rrr_esz *a, bool high_odd,
|
|||
desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
|
||||
desc = FIELD_DP32(desc, PREDDESC, DATA, high_odd);
|
||||
|
||||
tcg_gen_addi_ptr(t_d, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_n, cpu_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_m, cpu_env, pred_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(t_d, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_n, tcg_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_m, tcg_env, pred_full_reg_offset(s, a->rm));
|
||||
|
||||
fn(t_d, t_n, t_m, tcg_constant_i32(desc));
|
||||
return true;
|
||||
|
@ -2429,8 +2429,8 @@ static bool do_perm_pred2(DisasContext *s, arg_rr_esz *a, bool high_odd,
|
|||
TCGv_ptr t_n = tcg_temp_new_ptr();
|
||||
uint32_t desc = 0;
|
||||
|
||||
tcg_gen_addi_ptr(t_d, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_n, cpu_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_d, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(t_n, tcg_env, pred_full_reg_offset(s, a->rn));
|
||||
|
||||
desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz);
|
||||
desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
|
||||
|
@ -2525,7 +2525,7 @@ static void find_last_active(DisasContext *s, TCGv_i32 ret, int esz, int pg)
|
|||
desc = FIELD_DP32(desc, PREDDESC, OPRSZ, pred_full_reg_size(s));
|
||||
desc = FIELD_DP32(desc, PREDDESC, ESZ, esz);
|
||||
|
||||
tcg_gen_addi_ptr(t_p, cpu_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_addi_ptr(t_p, tcg_env, pred_full_reg_offset(s, pg));
|
||||
|
||||
gen_helper_sve_last_active_element(ret, t_p, tcg_constant_i32(desc));
|
||||
}
|
||||
|
@ -2602,7 +2602,7 @@ static TCGv_i64 load_last_active(DisasContext *s, TCGv_i32 last,
|
|||
}
|
||||
#endif
|
||||
tcg_gen_ext_i32_ptr(p, last);
|
||||
tcg_gen_add_ptr(p, p, cpu_env);
|
||||
tcg_gen_add_ptr(p, p, tcg_env);
|
||||
|
||||
return load_esz(p, vec_full_reg_offset(s, rm), esz);
|
||||
}
|
||||
|
@ -2674,7 +2674,7 @@ static void do_clast_scalar(DisasContext *s, int esz, int pg, int rm,
|
|||
}
|
||||
|
||||
/* The conceit here is that while last < 0 indicates not found, after
|
||||
* adjusting for cpu_env->vfp.zregs[rm], it is still a valid address
|
||||
* adjusting for tcg_env->vfp.zregs[rm], it is still a valid address
|
||||
* from which we can load garbage. We then discard the garbage with
|
||||
* a conditional move.
|
||||
*/
|
||||
|
@ -2690,7 +2690,7 @@ static bool do_clast_fp(DisasContext *s, arg_rpr_esz *a, bool before)
|
|||
if (sve_access_check(s)) {
|
||||
int esz = a->esz;
|
||||
int ofs = vec_reg_offset(s, a->rd, 0, esz);
|
||||
TCGv_i64 reg = load_esz(cpu_env, ofs, esz);
|
||||
TCGv_i64 reg = load_esz(tcg_env, ofs, esz);
|
||||
|
||||
do_clast_scalar(s, esz, a->pg, a->rn, before, reg);
|
||||
write_fp_dreg(s, a->rd, reg);
|
||||
|
@ -2794,7 +2794,7 @@ static bool trans_CPY_m_v(DisasContext *s, arg_rpr_esz *a)
|
|||
}
|
||||
if (sve_access_check(s)) {
|
||||
int ofs = vec_reg_offset(s, a->rn, 0, a->esz);
|
||||
TCGv_i64 t = load_esz(cpu_env, ofs, a->esz);
|
||||
TCGv_i64 t = load_esz(tcg_env, ofs, a->esz);
|
||||
do_cpy_m(s, a->esz, a->rd, a->rd, a->pg, t);
|
||||
}
|
||||
return true;
|
||||
|
@ -2847,10 +2847,10 @@ static bool do_ppzz_flags(DisasContext *s, arg_rprr_esz *a,
|
|||
zm = tcg_temp_new_ptr();
|
||||
pg = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(pd, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(zn, cpu_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(zm, cpu_env, vec_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(pg, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(pd, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(zn, tcg_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(zm, tcg_env, vec_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(pg, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
|
||||
gen_fn(t, pd, zn, zm, pg, tcg_constant_i32(simd_desc(vsz, vsz, 0)));
|
||||
|
||||
|
@ -2920,9 +2920,9 @@ static bool do_ppzi_flags(DisasContext *s, arg_rpri_esz *a,
|
|||
zn = tcg_temp_new_ptr();
|
||||
pg = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(pd, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(zn, cpu_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(pg, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(pd, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(zn, tcg_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(pg, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
|
||||
gen_fn(t, pd, zn, pg, tcg_constant_i32(simd_desc(vsz, vsz, a->imm)));
|
||||
|
||||
|
@ -2971,10 +2971,10 @@ static bool do_brk3(DisasContext *s, arg_rprr_s *a,
|
|||
TCGv_ptr g = tcg_temp_new_ptr();
|
||||
TCGv_i32 desc = tcg_constant_i32(FIELD_DP32(0, PREDDESC, OPRSZ, vsz));
|
||||
|
||||
tcg_gen_addi_ptr(d, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(n, cpu_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(m, cpu_env, pred_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(g, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(d, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(n, tcg_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(m, tcg_env, pred_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(g, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
|
||||
if (a->s) {
|
||||
TCGv_i32 t = tcg_temp_new_i32();
|
||||
|
@ -3001,9 +3001,9 @@ static bool do_brk2(DisasContext *s, arg_rpr_s *a,
|
|||
TCGv_ptr g = tcg_temp_new_ptr();
|
||||
TCGv_i32 desc = tcg_constant_i32(FIELD_DP32(0, PREDDESC, OPRSZ, vsz));
|
||||
|
||||
tcg_gen_addi_ptr(d, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(n, cpu_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(g, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(d, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(n, tcg_env, pred_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(g, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
|
||||
if (a->s) {
|
||||
TCGv_i32 t = tcg_temp_new_i32();
|
||||
|
@ -3044,10 +3044,10 @@ static void do_cntp(DisasContext *s, TCGv_i64 val, int esz, int pn, int pg)
|
|||
if (psz <= 8) {
|
||||
uint64_t psz_mask;
|
||||
|
||||
tcg_gen_ld_i64(val, cpu_env, pred_full_reg_offset(s, pn));
|
||||
tcg_gen_ld_i64(val, tcg_env, pred_full_reg_offset(s, pn));
|
||||
if (pn != pg) {
|
||||
TCGv_i64 g = tcg_temp_new_i64();
|
||||
tcg_gen_ld_i64(g, cpu_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_ld_i64(g, tcg_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_and_i64(val, val, g);
|
||||
}
|
||||
|
||||
|
@ -3066,8 +3066,8 @@ static void do_cntp(DisasContext *s, TCGv_i64 val, int esz, int pn, int pg)
|
|||
desc = FIELD_DP32(desc, PREDDESC, OPRSZ, psz);
|
||||
desc = FIELD_DP32(desc, PREDDESC, ESZ, esz);
|
||||
|
||||
tcg_gen_addi_ptr(t_pn, cpu_env, pred_full_reg_offset(s, pn));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_addi_ptr(t_pn, tcg_env, pred_full_reg_offset(s, pn));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg));
|
||||
|
||||
gen_helper_sve_cntp(val, t_pn, t_pg, tcg_constant_i32(desc));
|
||||
}
|
||||
|
@ -3291,7 +3291,7 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a)
|
|||
desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
|
||||
|
||||
ptr = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ptr, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(ptr, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
|
||||
if (a->lt) {
|
||||
gen_helper_sve_whilel(t2, ptr, t2, tcg_constant_i32(desc));
|
||||
|
@ -3354,7 +3354,7 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a)
|
|||
desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
|
||||
|
||||
ptr = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ptr, cpu_env, pred_full_reg_offset(s, a->rd));
|
||||
tcg_gen_addi_ptr(ptr, tcg_env, pred_full_reg_offset(s, a->rd));
|
||||
|
||||
gen_helper_sve_whilel(t2, ptr, t2, tcg_constant_i32(desc));
|
||||
do_pred_flags(t2);
|
||||
|
@ -3684,8 +3684,8 @@ static bool do_reduce(DisasContext *s, arg_rpr_esz *a,
|
|||
t_zn = tcg_temp_new_ptr();
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(t_zn, tcg_env, vec_full_reg_offset(s, a->rn));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR);
|
||||
|
||||
fn(temp, t_zn, t_pg, status, t_desc);
|
||||
|
@ -3802,11 +3802,11 @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a)
|
|||
return true;
|
||||
}
|
||||
|
||||
t_val = load_esz(cpu_env, vec_reg_offset(s, a->rn, 0, a->esz), a->esz);
|
||||
t_val = load_esz(tcg_env, vec_reg_offset(s, a->rn, 0, a->esz), a->esz);
|
||||
t_rm = tcg_temp_new_ptr();
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(t_rm, cpu_env, vec_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_addi_ptr(t_rm, tcg_env, vec_full_reg_offset(s, a->rm));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
t_fpst = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR);
|
||||
t_desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
|
||||
|
||||
|
@ -3878,9 +3878,9 @@ static void do_fp_scalar(DisasContext *s, int zd, int zn, int pg, bool is_fp16,
|
|||
t_zd = tcg_temp_new_ptr();
|
||||
t_zn = tcg_temp_new_ptr();
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, zd));
|
||||
tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, zn));
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_addi_ptr(t_zd, tcg_env, vec_full_reg_offset(s, zd));
|
||||
tcg_gen_addi_ptr(t_zn, tcg_env, vec_full_reg_offset(s, zn));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg));
|
||||
|
||||
status = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR);
|
||||
desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
|
||||
|
@ -4228,7 +4228,7 @@ void gen_sve_ldr(DisasContext *s, TCGv_ptr base, int vofs,
|
|||
|
||||
/*
|
||||
* Predicate register loads can be any multiple of 2.
|
||||
* Note that we still store the entire 64-bit unit into cpu_env.
|
||||
* Note that we still store the entire 64-bit unit into tcg_env.
|
||||
*/
|
||||
if (len_remain >= 8) {
|
||||
t0 = tcg_temp_new_i64();
|
||||
|
@ -4370,7 +4370,7 @@ static bool trans_LDR_zri(DisasContext *s, arg_rri *a)
|
|||
if (sve_access_check(s)) {
|
||||
int size = vec_full_reg_size(s);
|
||||
int off = vec_full_reg_offset(s, a->rd);
|
||||
gen_sve_ldr(s, cpu_env, off, size, a->rn, a->imm * size);
|
||||
gen_sve_ldr(s, tcg_env, off, size, a->rn, a->imm * size);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -4383,7 +4383,7 @@ static bool trans_LDR_pri(DisasContext *s, arg_rri *a)
|
|||
if (sve_access_check(s)) {
|
||||
int size = pred_full_reg_size(s);
|
||||
int off = pred_full_reg_offset(s, a->rd);
|
||||
gen_sve_ldr(s, cpu_env, off, size, a->rn, a->imm * size);
|
||||
gen_sve_ldr(s, tcg_env, off, size, a->rn, a->imm * size);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -4396,7 +4396,7 @@ static bool trans_STR_zri(DisasContext *s, arg_rri *a)
|
|||
if (sve_access_check(s)) {
|
||||
int size = vec_full_reg_size(s);
|
||||
int off = vec_full_reg_offset(s, a->rd);
|
||||
gen_sve_str(s, cpu_env, off, size, a->rn, a->imm * size);
|
||||
gen_sve_str(s, tcg_env, off, size, a->rn, a->imm * size);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -4409,7 +4409,7 @@ static bool trans_STR_pri(DisasContext *s, arg_rri *a)
|
|||
if (sve_access_check(s)) {
|
||||
int size = pred_full_reg_size(s);
|
||||
int off = pred_full_reg_offset(s, a->rd);
|
||||
gen_sve_str(s, cpu_env, off, size, a->rn, a->imm * size);
|
||||
gen_sve_str(s, tcg_env, off, size, a->rn, a->imm * size);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -4465,8 +4465,8 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr,
|
|||
desc = simd_desc(vsz, vsz, zt | desc);
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
|
||||
fn(cpu_env, t_pg, addr, tcg_constant_i32(desc));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg));
|
||||
fn(tcg_env, t_pg, addr, tcg_constant_i32(desc));
|
||||
}
|
||||
|
||||
/* Indexed by [mte][be][dtype][nreg] */
|
||||
|
@ -4860,18 +4860,18 @@ static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)
|
|||
#if HOST_BIG_ENDIAN
|
||||
poff += 6;
|
||||
#endif
|
||||
tcg_gen_ld16u_i64(tmp, cpu_env, poff);
|
||||
tcg_gen_ld16u_i64(tmp, tcg_env, poff);
|
||||
|
||||
poff = offsetof(CPUARMState, vfp.preg_tmp);
|
||||
tcg_gen_st_i64(tmp, cpu_env, poff);
|
||||
tcg_gen_st_i64(tmp, tcg_env, poff);
|
||||
}
|
||||
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, poff);
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, poff);
|
||||
|
||||
gen_helper_gvec_mem *fn
|
||||
= ldr_fns[s->mte_active[0]][s->be_data == MO_BE][dtype][0];
|
||||
fn(cpu_env, t_pg, addr, tcg_constant_i32(simd_desc(16, 16, zt)));
|
||||
fn(tcg_env, t_pg, addr, tcg_constant_i32(simd_desc(16, 16, zt)));
|
||||
|
||||
/* Replicate that first quadword. */
|
||||
if (vsz > 16) {
|
||||
|
@ -4939,18 +4939,18 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype)
|
|||
#if HOST_BIG_ENDIAN
|
||||
poff += 4;
|
||||
#endif
|
||||
tcg_gen_ld32u_i64(tmp, cpu_env, poff);
|
||||
tcg_gen_ld32u_i64(tmp, tcg_env, poff);
|
||||
|
||||
poff = offsetof(CPUARMState, vfp.preg_tmp);
|
||||
tcg_gen_st_i64(tmp, cpu_env, poff);
|
||||
tcg_gen_st_i64(tmp, tcg_env, poff);
|
||||
}
|
||||
|
||||
t_pg = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, poff);
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, poff);
|
||||
|
||||
gen_helper_gvec_mem *fn
|
||||
= ldr_fns[s->mte_active[0]][s->be_data == MO_BE][dtype][0];
|
||||
fn(cpu_env, t_pg, addr, tcg_constant_i32(simd_desc(32, 32, zt)));
|
||||
fn(tcg_env, t_pg, addr, tcg_constant_i32(simd_desc(32, 32, zt)));
|
||||
|
||||
/*
|
||||
* Replicate that first octaword.
|
||||
|
@ -5027,7 +5027,7 @@ static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a)
|
|||
*/
|
||||
uint64_t psz_mask = MAKE_64BIT_MASK(0, psz * 8);
|
||||
temp = tcg_temp_new_i64();
|
||||
tcg_gen_ld_i64(temp, cpu_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_ld_i64(temp, tcg_env, pred_full_reg_offset(s, a->pg));
|
||||
tcg_gen_andi_i64(temp, temp, pred_esz_masks[esz] & psz_mask);
|
||||
tcg_gen_brcondi_i64(TCG_COND_EQ, temp, 0, over);
|
||||
} else {
|
||||
|
@ -5238,10 +5238,10 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
|
|||
}
|
||||
desc = simd_desc(vsz, vsz, desc | scale);
|
||||
|
||||
tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_addi_ptr(t_zm, cpu_env, vec_full_reg_offset(s, zm));
|
||||
tcg_gen_addi_ptr(t_zt, cpu_env, vec_full_reg_offset(s, zt));
|
||||
fn(cpu_env, t_zt, t_pg, t_zm, scalar, tcg_constant_i32(desc));
|
||||
tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg));
|
||||
tcg_gen_addi_ptr(t_zm, tcg_env, vec_full_reg_offset(s, zm));
|
||||
tcg_gen_addi_ptr(t_zt, tcg_env, vec_full_reg_offset(s, zt));
|
||||
fn(tcg_env, t_zt, t_pg, t_zm, scalar, tcg_constant_i32(desc));
|
||||
}
|
||||
|
||||
/* Indexed by [mte][be][ff][xs][u][msz]. */
|
||||
|
@ -7197,7 +7197,7 @@ static bool do_FMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sub, bool sel)
|
|||
{
|
||||
return gen_gvec_ptr_zzzz(s, gen_helper_sve2_fmlal_zzzw_s,
|
||||
a->rd, a->rn, a->rm, a->ra,
|
||||
(sel << 1) | sub, cpu_env);
|
||||
(sel << 1) | sub, tcg_env);
|
||||
}
|
||||
|
||||
TRANS_FEAT(FMLALB_zzzw, aa64_sve2, do_FMLAL_zzzw, a, false, false)
|
||||
|
@ -7209,7 +7209,7 @@ static bool do_FMLAL_zzxw(DisasContext *s, arg_rrxr_esz *a, bool sub, bool sel)
|
|||
{
|
||||
return gen_gvec_ptr_zzzz(s, gen_helper_sve2_fmlal_zzxw_s,
|
||||
a->rd, a->rn, a->rm, a->ra,
|
||||
(a->index << 2) | (sel << 1) | sub, cpu_env);
|
||||
(a->index << 2) | (sel << 1) | sub, tcg_env);
|
||||
}
|
||||
|
||||
TRANS_FEAT(FMLALB_zzxw, aa64_sve2, do_FMLAL_zzxw, a, false, false)
|
||||
|
@ -7289,7 +7289,7 @@ static bool trans_PSEL(DisasContext *s, arg_psel *a)
|
|||
|
||||
/* Load the predicate word. */
|
||||
tcg_gen_trunc_i64_ptr(ptr, didx);
|
||||
tcg_gen_add_ptr(ptr, ptr, cpu_env);
|
||||
tcg_gen_add_ptr(ptr, ptr, tcg_env);
|
||||
tcg_gen_ld8u_i64(tmp, ptr, pred_full_reg_offset(s, a->pm));
|
||||
|
||||
/* Extract the predicate bit and replicate to MO_64. */
|
||||
|
|
|
@ -30,22 +30,22 @@
|
|||
|
||||
static inline void vfp_load_reg64(TCGv_i64 var, int reg)
|
||||
{
|
||||
tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(true, reg));
|
||||
tcg_gen_ld_i64(var, tcg_env, vfp_reg_offset(true, reg));
|
||||
}
|
||||
|
||||
static inline void vfp_store_reg64(TCGv_i64 var, int reg)
|
||||
{
|
||||
tcg_gen_st_i64(var, cpu_env, vfp_reg_offset(true, reg));
|
||||
tcg_gen_st_i64(var, tcg_env, vfp_reg_offset(true, reg));
|
||||
}
|
||||
|
||||
static inline void vfp_load_reg32(TCGv_i32 var, int reg)
|
||||
{
|
||||
tcg_gen_ld_i32(var, cpu_env, vfp_reg_offset(false, reg));
|
||||
tcg_gen_ld_i32(var, tcg_env, vfp_reg_offset(false, reg));
|
||||
}
|
||||
|
||||
static inline void vfp_store_reg32(TCGv_i32 var, int reg)
|
||||
{
|
||||
tcg_gen_st_i32(var, cpu_env, vfp_reg_offset(false, reg));
|
||||
tcg_gen_st_i32(var, tcg_env, vfp_reg_offset(false, reg));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -116,7 +116,7 @@ static void gen_preserve_fp_state(DisasContext *s, bool skip_context_update)
|
|||
if (translator_io_start(&s->base)) {
|
||||
s->base.is_jmp = DISAS_UPDATE_EXIT;
|
||||
}
|
||||
gen_helper_v7m_preserve_fp_state(cpu_env);
|
||||
gen_helper_v7m_preserve_fp_state(tcg_env);
|
||||
/*
|
||||
* If the preserve_fp_state helper doesn't throw an exception
|
||||
* then it will clear LSPACT; we don't need to repeat this for
|
||||
|
@ -172,7 +172,7 @@ static void gen_update_fp_context(DisasContext *s)
|
|||
uint32_t bits = R_V7M_CONTROL_FPCA_MASK;
|
||||
|
||||
fpscr = load_cpu_field(v7m.fpdscr[s->v8m_secure]);
|
||||
gen_helper_vfp_set_fpscr(cpu_env, fpscr);
|
||||
gen_helper_vfp_set_fpscr(tcg_env, fpscr);
|
||||
if (dc_isar_feature(aa32_mve, s)) {
|
||||
store_cpu_field(tcg_constant_i32(0), v7m.vpr);
|
||||
}
|
||||
|
@ -815,7 +815,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a)
|
|||
if (s->current_el == 1) {
|
||||
gen_set_condexec(s);
|
||||
gen_update_pc(s, 0);
|
||||
gen_helper_check_hcr_el2_trap(cpu_env,
|
||||
gen_helper_check_hcr_el2_trap(tcg_env,
|
||||
tcg_constant_i32(a->rt),
|
||||
tcg_constant_i32(a->reg));
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a)
|
|||
tcg_gen_andi_i32(tmp, tmp, FPCR_NZCV_MASK);
|
||||
} else {
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_vfp_get_fpscr(tmp, cpu_env);
|
||||
gen_helper_vfp_get_fpscr(tmp, tcg_env);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -855,7 +855,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a)
|
|||
break;
|
||||
case ARM_VFP_FPSCR:
|
||||
tmp = load_reg(s, a->rt);
|
||||
gen_helper_vfp_set_fpscr(cpu_env, tmp);
|
||||
gen_helper_vfp_set_fpscr(tcg_env, tmp);
|
||||
gen_lookup_tb(s);
|
||||
break;
|
||||
case ARM_VFP_FPEXC:
|
||||
|
@ -1169,7 +1169,7 @@ static bool trans_VLDM_VSTM_sp(DisasContext *s, arg_VLDM_VSTM_sp *a)
|
|||
* value is above, it is UNKNOWN whether the limit check
|
||||
* triggers; we choose to trigger.
|
||||
*/
|
||||
gen_helper_v8m_stackcheck(cpu_env, addr);
|
||||
gen_helper_v8m_stackcheck(tcg_env, addr);
|
||||
}
|
||||
|
||||
offset = 4;
|
||||
|
@ -1252,7 +1252,7 @@ static bool trans_VLDM_VSTM_dp(DisasContext *s, arg_VLDM_VSTM_dp *a)
|
|||
* value is above, it is UNKNOWN whether the limit check
|
||||
* triggers; we choose to trigger.
|
||||
*/
|
||||
gen_helper_v8m_stackcheck(cpu_env, addr);
|
||||
gen_helper_v8m_stackcheck(tcg_env, addr);
|
||||
}
|
||||
|
||||
offset = 8;
|
||||
|
@ -2419,17 +2419,17 @@ DO_VFP_2OP(VNEG, dp, gen_helper_vfp_negd, aa32_fpdp_v2)
|
|||
|
||||
static void gen_VSQRT_hp(TCGv_i32 vd, TCGv_i32 vm)
|
||||
{
|
||||
gen_helper_vfp_sqrth(vd, vm, cpu_env);
|
||||
gen_helper_vfp_sqrth(vd, vm, tcg_env);
|
||||
}
|
||||
|
||||
static void gen_VSQRT_sp(TCGv_i32 vd, TCGv_i32 vm)
|
||||
{
|
||||
gen_helper_vfp_sqrts(vd, vm, cpu_env);
|
||||
gen_helper_vfp_sqrts(vd, vm, tcg_env);
|
||||
}
|
||||
|
||||
static void gen_VSQRT_dp(TCGv_i64 vd, TCGv_i64 vm)
|
||||
{
|
||||
gen_helper_vfp_sqrtd(vd, vm, cpu_env);
|
||||
gen_helper_vfp_sqrtd(vd, vm, tcg_env);
|
||||
}
|
||||
|
||||
DO_VFP_2OP(VSQRT, hp, gen_VSQRT_hp, aa32_fp16_arith)
|
||||
|
@ -2464,9 +2464,9 @@ static bool trans_VCMP_hp(DisasContext *s, arg_VCMP_sp *a)
|
|||
}
|
||||
|
||||
if (a->e) {
|
||||
gen_helper_vfp_cmpeh(vd, vm, cpu_env);
|
||||
gen_helper_vfp_cmpeh(vd, vm, tcg_env);
|
||||
} else {
|
||||
gen_helper_vfp_cmph(vd, vm, cpu_env);
|
||||
gen_helper_vfp_cmph(vd, vm, tcg_env);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2499,9 +2499,9 @@ static bool trans_VCMP_sp(DisasContext *s, arg_VCMP_sp *a)
|
|||
}
|
||||
|
||||
if (a->e) {
|
||||
gen_helper_vfp_cmpes(vd, vm, cpu_env);
|
||||
gen_helper_vfp_cmpes(vd, vm, tcg_env);
|
||||
} else {
|
||||
gen_helper_vfp_cmps(vd, vm, cpu_env);
|
||||
gen_helper_vfp_cmps(vd, vm, tcg_env);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2539,9 +2539,9 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a)
|
|||
}
|
||||
|
||||
if (a->e) {
|
||||
gen_helper_vfp_cmped(vd, vm, cpu_env);
|
||||
gen_helper_vfp_cmped(vd, vm, tcg_env);
|
||||
} else {
|
||||
gen_helper_vfp_cmpd(vd, vm, cpu_env);
|
||||
gen_helper_vfp_cmpd(vd, vm, tcg_env);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2564,7 +2564,7 @@ static bool trans_VCVT_f32_f16(DisasContext *s, arg_VCVT_f32_f16 *a)
|
|||
ahp_mode = get_ahp_flag();
|
||||
tmp = tcg_temp_new_i32();
|
||||
/* The T bit tells us if we want the low or high 16 bits of Vm */
|
||||
tcg_gen_ld16u_i32(tmp, cpu_env, vfp_f16_offset(a->vm, a->t));
|
||||
tcg_gen_ld16u_i32(tmp, tcg_env, vfp_f16_offset(a->vm, a->t));
|
||||
gen_helper_vfp_fcvt_f16_to_f32(tmp, tmp, fpst, ahp_mode);
|
||||
vfp_store_reg32(tmp, a->vd);
|
||||
return true;
|
||||
|
@ -2598,7 +2598,7 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a)
|
|||
ahp_mode = get_ahp_flag();
|
||||
tmp = tcg_temp_new_i32();
|
||||
/* The T bit tells us if we want the low or high 16 bits of Vm */
|
||||
tcg_gen_ld16u_i32(tmp, cpu_env, vfp_f16_offset(a->vm, a->t));
|
||||
tcg_gen_ld16u_i32(tmp, tcg_env, vfp_f16_offset(a->vm, a->t));
|
||||
vd = tcg_temp_new_i64();
|
||||
gen_helper_vfp_fcvt_f16_to_f64(vd, tmp, fpst, ahp_mode);
|
||||
vfp_store_reg64(vd, a->vd);
|
||||
|
@ -2623,7 +2623,7 @@ static bool trans_VCVT_b16_f32(DisasContext *s, arg_VCVT_b16_f32 *a)
|
|||
|
||||
vfp_load_reg32(tmp, a->vm);
|
||||
gen_helper_bfcvt(tmp, tmp, fpst);
|
||||
tcg_gen_st16_i32(tmp, cpu_env, vfp_f16_offset(a->vd, a->t));
|
||||
tcg_gen_st16_i32(tmp, tcg_env, vfp_f16_offset(a->vd, a->t));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2647,7 +2647,7 @@ static bool trans_VCVT_f16_f32(DisasContext *s, arg_VCVT_f16_f32 *a)
|
|||
|
||||
vfp_load_reg32(tmp, a->vm);
|
||||
gen_helper_vfp_fcvt_f32_to_f16(tmp, tmp, fpst, ahp_mode);
|
||||
tcg_gen_st16_i32(tmp, cpu_env, vfp_f16_offset(a->vd, a->t));
|
||||
tcg_gen_st16_i32(tmp, tcg_env, vfp_f16_offset(a->vd, a->t));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2682,7 +2682,7 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a)
|
|||
|
||||
vfp_load_reg64(vm, a->vm);
|
||||
gen_helper_vfp_fcvt_f64_to_f16(tmp, vm, fpst, ahp_mode);
|
||||
tcg_gen_st16_i32(tmp, cpu_env, vfp_f16_offset(a->vd, a->t));
|
||||
tcg_gen_st16_i32(tmp, tcg_env, vfp_f16_offset(a->vd, a->t));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2932,7 +2932,7 @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a)
|
|||
vm = tcg_temp_new_i32();
|
||||
vd = tcg_temp_new_i64();
|
||||
vfp_load_reg32(vm, a->vm);
|
||||
gen_helper_vfp_fcvtds(vd, vm, cpu_env);
|
||||
gen_helper_vfp_fcvtds(vd, vm, tcg_env);
|
||||
vfp_store_reg64(vd, a->vd);
|
||||
return true;
|
||||
}
|
||||
|
@ -2958,7 +2958,7 @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a)
|
|||
vd = tcg_temp_new_i32();
|
||||
vm = tcg_temp_new_i64();
|
||||
vfp_load_reg64(vm, a->vm);
|
||||
gen_helper_vfp_fcvtsd(vd, vm, cpu_env);
|
||||
gen_helper_vfp_fcvtsd(vd, vm, tcg_env);
|
||||
vfp_store_reg32(vd, a->vd);
|
||||
return true;
|
||||
}
|
||||
|
@ -3076,7 +3076,7 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a)
|
|||
vm = tcg_temp_new_i64();
|
||||
vd = tcg_temp_new_i32();
|
||||
vfp_load_reg64(vm, a->vm);
|
||||
gen_helper_vjcvt(vd, vm, cpu_env);
|
||||
gen_helper_vjcvt(vd, vm, tcg_env);
|
||||
vfp_store_reg32(vd, a->vd);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -63,18 +63,18 @@ void arm_translate_init(void)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
cpu_R[i] = tcg_global_mem_new_i32(cpu_env,
|
||||
cpu_R[i] = tcg_global_mem_new_i32(tcg_env,
|
||||
offsetof(CPUARMState, regs[i]),
|
||||
regnames[i]);
|
||||
}
|
||||
cpu_CF = tcg_global_mem_new_i32(cpu_env, offsetof(CPUARMState, CF), "CF");
|
||||
cpu_NF = tcg_global_mem_new_i32(cpu_env, offsetof(CPUARMState, NF), "NF");
|
||||
cpu_VF = tcg_global_mem_new_i32(cpu_env, offsetof(CPUARMState, VF), "VF");
|
||||
cpu_ZF = tcg_global_mem_new_i32(cpu_env, offsetof(CPUARMState, ZF), "ZF");
|
||||
cpu_CF = tcg_global_mem_new_i32(tcg_env, offsetof(CPUARMState, CF), "CF");
|
||||
cpu_NF = tcg_global_mem_new_i32(tcg_env, offsetof(CPUARMState, NF), "NF");
|
||||
cpu_VF = tcg_global_mem_new_i32(tcg_env, offsetof(CPUARMState, VF), "VF");
|
||||
cpu_ZF = tcg_global_mem_new_i32(tcg_env, offsetof(CPUARMState, ZF), "ZF");
|
||||
|
||||
cpu_exclusive_addr = tcg_global_mem_new_i64(cpu_env,
|
||||
cpu_exclusive_addr = tcg_global_mem_new_i64(tcg_env,
|
||||
offsetof(CPUARMState, exclusive_addr), "exclusive_addr");
|
||||
cpu_exclusive_val = tcg_global_mem_new_i64(cpu_env,
|
||||
cpu_exclusive_val = tcg_global_mem_new_i64(tcg_env,
|
||||
offsetof(CPUARMState, exclusive_val), "exclusive_val");
|
||||
|
||||
a64_translate_init();
|
||||
|
@ -179,10 +179,10 @@ void store_cpu_offset(TCGv_i32 var, int offset, int size)
|
|||
{
|
||||
switch (size) {
|
||||
case 1:
|
||||
tcg_gen_st8_i32(var, cpu_env, offset);
|
||||
tcg_gen_st8_i32(var, tcg_env, offset);
|
||||
break;
|
||||
case 4:
|
||||
tcg_gen_st_i32(var, cpu_env, offset);
|
||||
tcg_gen_st_i32(var, tcg_env, offset);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -329,7 +329,7 @@ static void store_sp_checked(DisasContext *s, TCGv_i32 var)
|
|||
{
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (s->v8m_stackcheck) {
|
||||
gen_helper_v8m_stackcheck(cpu_env, var);
|
||||
gen_helper_v8m_stackcheck(tcg_env, var);
|
||||
}
|
||||
#endif
|
||||
store_reg(s, 13, var);
|
||||
|
@ -346,7 +346,7 @@ static void store_sp_checked(DisasContext *s, TCGv_i32 var)
|
|||
|
||||
void gen_set_cpsr(TCGv_i32 var, uint32_t mask)
|
||||
{
|
||||
gen_helper_cpsr_write(cpu_env, var, tcg_constant_i32(mask));
|
||||
gen_helper_cpsr_write(tcg_env, var, tcg_constant_i32(mask));
|
||||
}
|
||||
|
||||
static void gen_rebuild_hflags(DisasContext *s, bool new_el)
|
||||
|
@ -355,16 +355,16 @@ static void gen_rebuild_hflags(DisasContext *s, bool new_el)
|
|||
|
||||
if (new_el) {
|
||||
if (m_profile) {
|
||||
gen_helper_rebuild_hflags_m32_newel(cpu_env);
|
||||
gen_helper_rebuild_hflags_m32_newel(tcg_env);
|
||||
} else {
|
||||
gen_helper_rebuild_hflags_a32_newel(cpu_env);
|
||||
gen_helper_rebuild_hflags_a32_newel(tcg_env);
|
||||
}
|
||||
} else {
|
||||
TCGv_i32 tcg_el = tcg_constant_i32(s->current_el);
|
||||
if (m_profile) {
|
||||
gen_helper_rebuild_hflags_m32(cpu_env, tcg_el);
|
||||
gen_helper_rebuild_hflags_m32(tcg_env, tcg_el);
|
||||
} else {
|
||||
gen_helper_rebuild_hflags_a32(cpu_env, tcg_el);
|
||||
gen_helper_rebuild_hflags_a32(tcg_env, tcg_el);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ static void gen_rebuild_hflags(DisasContext *s, bool new_el)
|
|||
static void gen_exception_internal(int excp)
|
||||
{
|
||||
assert(excp_is_internal(excp));
|
||||
gen_helper_exception_internal(cpu_env, tcg_constant_i32(excp));
|
||||
gen_helper_exception_internal(tcg_env, tcg_constant_i32(excp));
|
||||
}
|
||||
|
||||
static void gen_singlestep_exception(DisasContext *s)
|
||||
|
@ -617,10 +617,10 @@ static inline void gen_arm_shift_reg(TCGv_i32 var, int shiftop,
|
|||
{
|
||||
if (flags) {
|
||||
switch (shiftop) {
|
||||
case 0: gen_helper_shl_cc(var, cpu_env, var, shift); break;
|
||||
case 1: gen_helper_shr_cc(var, cpu_env, var, shift); break;
|
||||
case 2: gen_helper_sar_cc(var, cpu_env, var, shift); break;
|
||||
case 3: gen_helper_ror_cc(var, cpu_env, var, shift); break;
|
||||
case 0: gen_helper_shl_cc(var, tcg_env, var, shift); break;
|
||||
case 1: gen_helper_shr_cc(var, tcg_env, var, shift); break;
|
||||
case 2: gen_helper_sar_cc(var, tcg_env, var, shift); break;
|
||||
case 3: gen_helper_ror_cc(var, tcg_env, var, shift); break;
|
||||
}
|
||||
} else {
|
||||
switch (shiftop) {
|
||||
|
@ -849,7 +849,7 @@ static inline void gen_bxns(DisasContext *s, int rm)
|
|||
* is correct in the non-UNPREDICTABLE cases, and we can choose
|
||||
* "zeroes the IT bits" as our UNPREDICTABLE behaviour otherwise.
|
||||
*/
|
||||
gen_helper_v7m_bxns(cpu_env, var);
|
||||
gen_helper_v7m_bxns(tcg_env, var);
|
||||
s->base.is_jmp = DISAS_EXIT;
|
||||
}
|
||||
|
||||
|
@ -862,7 +862,7 @@ static inline void gen_blxns(DisasContext *s, int rm)
|
|||
* The blxns helper may throw an exception.
|
||||
*/
|
||||
gen_update_pc(s, curr_insn_len(s));
|
||||
gen_helper_v7m_blxns(cpu_env, var);
|
||||
gen_helper_v7m_blxns(tcg_env, var);
|
||||
s->base.is_jmp = DISAS_EXIT;
|
||||
}
|
||||
|
||||
|
@ -1024,7 +1024,7 @@ static inline void gen_hvc(DisasContext *s, int imm16)
|
|||
* the insn really executes).
|
||||
*/
|
||||
gen_update_pc(s, 0);
|
||||
gen_helper_pre_hvc(cpu_env);
|
||||
gen_helper_pre_hvc(tcg_env);
|
||||
/* Otherwise we will treat this as a real exception which
|
||||
* happens after execution of the insn. (The distinction matters
|
||||
* for the PC value reported to the exception handler and also
|
||||
|
@ -1041,7 +1041,7 @@ static inline void gen_smc(DisasContext *s)
|
|||
* the insn executes.
|
||||
*/
|
||||
gen_update_pc(s, 0);
|
||||
gen_helper_pre_smc(cpu_env, tcg_constant_i32(syn_aa32_smc()));
|
||||
gen_helper_pre_smc(tcg_env, tcg_constant_i32(syn_aa32_smc()));
|
||||
gen_update_pc(s, curr_insn_len(s));
|
||||
s->base.is_jmp = DISAS_SMC;
|
||||
}
|
||||
|
@ -1056,7 +1056,7 @@ static void gen_exception_internal_insn(DisasContext *s, int excp)
|
|||
|
||||
static void gen_exception_el_v(int excp, uint32_t syndrome, TCGv_i32 tcg_el)
|
||||
{
|
||||
gen_helper_exception_with_syndrome_el(cpu_env, tcg_constant_i32(excp),
|
||||
gen_helper_exception_with_syndrome_el(tcg_env, tcg_constant_i32(excp),
|
||||
tcg_constant_i32(syndrome), tcg_el);
|
||||
}
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ static void gen_exception_el(int excp, uint32_t syndrome, uint32_t target_el)
|
|||
|
||||
static void gen_exception(int excp, uint32_t syndrome)
|
||||
{
|
||||
gen_helper_exception_with_syndrome(cpu_env, tcg_constant_i32(excp),
|
||||
gen_helper_exception_with_syndrome(tcg_env, tcg_constant_i32(excp),
|
||||
tcg_constant_i32(syndrome));
|
||||
}
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn)
|
|||
{
|
||||
gen_set_condexec(s);
|
||||
gen_update_pc(s, 0);
|
||||
gen_helper_exception_bkpt_insn(cpu_env, tcg_constant_i32(syn));
|
||||
gen_helper_exception_bkpt_insn(tcg_env, tcg_constant_i32(syn));
|
||||
s->base.is_jmp = DISAS_NORETURN;
|
||||
}
|
||||
|
||||
|
@ -1192,20 +1192,20 @@ void read_neon_element32(TCGv_i32 dest, int reg, int ele, MemOp memop)
|
|||
|
||||
switch (memop) {
|
||||
case MO_SB:
|
||||
tcg_gen_ld8s_i32(dest, cpu_env, off);
|
||||
tcg_gen_ld8s_i32(dest, tcg_env, off);
|
||||
break;
|
||||
case MO_UB:
|
||||
tcg_gen_ld8u_i32(dest, cpu_env, off);
|
||||
tcg_gen_ld8u_i32(dest, tcg_env, off);
|
||||
break;
|
||||
case MO_SW:
|
||||
tcg_gen_ld16s_i32(dest, cpu_env, off);
|
||||
tcg_gen_ld16s_i32(dest, tcg_env, off);
|
||||
break;
|
||||
case MO_UW:
|
||||
tcg_gen_ld16u_i32(dest, cpu_env, off);
|
||||
tcg_gen_ld16u_i32(dest, tcg_env, off);
|
||||
break;
|
||||
case MO_UL:
|
||||
case MO_SL:
|
||||
tcg_gen_ld_i32(dest, cpu_env, off);
|
||||
tcg_gen_ld_i32(dest, tcg_env, off);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -1218,13 +1218,13 @@ void read_neon_element64(TCGv_i64 dest, int reg, int ele, MemOp memop)
|
|||
|
||||
switch (memop) {
|
||||
case MO_SL:
|
||||
tcg_gen_ld32s_i64(dest, cpu_env, off);
|
||||
tcg_gen_ld32s_i64(dest, tcg_env, off);
|
||||
break;
|
||||
case MO_UL:
|
||||
tcg_gen_ld32u_i64(dest, cpu_env, off);
|
||||
tcg_gen_ld32u_i64(dest, tcg_env, off);
|
||||
break;
|
||||
case MO_UQ:
|
||||
tcg_gen_ld_i64(dest, cpu_env, off);
|
||||
tcg_gen_ld_i64(dest, tcg_env, off);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -1237,13 +1237,13 @@ void write_neon_element32(TCGv_i32 src, int reg, int ele, MemOp memop)
|
|||
|
||||
switch (memop) {
|
||||
case MO_8:
|
||||
tcg_gen_st8_i32(src, cpu_env, off);
|
||||
tcg_gen_st8_i32(src, tcg_env, off);
|
||||
break;
|
||||
case MO_16:
|
||||
tcg_gen_st16_i32(src, cpu_env, off);
|
||||
tcg_gen_st16_i32(src, tcg_env, off);
|
||||
break;
|
||||
case MO_32:
|
||||
tcg_gen_st_i32(src, cpu_env, off);
|
||||
tcg_gen_st_i32(src, tcg_env, off);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -1256,10 +1256,10 @@ void write_neon_element64(TCGv_i64 src, int reg, int ele, MemOp memop)
|
|||
|
||||
switch (memop) {
|
||||
case MO_32:
|
||||
tcg_gen_st32_i64(src, cpu_env, off);
|
||||
tcg_gen_st32_i64(src, tcg_env, off);
|
||||
break;
|
||||
case MO_64:
|
||||
tcg_gen_st_i64(src, cpu_env, off);
|
||||
tcg_gen_st_i64(src, tcg_env, off);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
|
@ -1270,24 +1270,24 @@ void write_neon_element64(TCGv_i64 src, int reg, int ele, MemOp memop)
|
|||
|
||||
static inline void iwmmxt_load_reg(TCGv_i64 var, int reg)
|
||||
{
|
||||
tcg_gen_ld_i64(var, cpu_env, offsetof(CPUARMState, iwmmxt.regs[reg]));
|
||||
tcg_gen_ld_i64(var, tcg_env, offsetof(CPUARMState, iwmmxt.regs[reg]));
|
||||
}
|
||||
|
||||
static inline void iwmmxt_store_reg(TCGv_i64 var, int reg)
|
||||
{
|
||||
tcg_gen_st_i64(var, cpu_env, offsetof(CPUARMState, iwmmxt.regs[reg]));
|
||||
tcg_gen_st_i64(var, tcg_env, offsetof(CPUARMState, iwmmxt.regs[reg]));
|
||||
}
|
||||
|
||||
static inline TCGv_i32 iwmmxt_load_creg(int reg)
|
||||
{
|
||||
TCGv_i32 var = tcg_temp_new_i32();
|
||||
tcg_gen_ld_i32(var, cpu_env, offsetof(CPUARMState, iwmmxt.cregs[reg]));
|
||||
tcg_gen_ld_i32(var, tcg_env, offsetof(CPUARMState, iwmmxt.cregs[reg]));
|
||||
return var;
|
||||
}
|
||||
|
||||
static inline void iwmmxt_store_creg(int reg, TCGv_i32 var)
|
||||
{
|
||||
tcg_gen_st_i32(var, cpu_env, offsetof(CPUARMState, iwmmxt.cregs[reg]));
|
||||
tcg_gen_st_i32(var, tcg_env, offsetof(CPUARMState, iwmmxt.cregs[reg]));
|
||||
}
|
||||
|
||||
static inline void gen_op_iwmmxt_movq_wRn_M0(int rn)
|
||||
|
@ -1329,7 +1329,7 @@ static inline void gen_op_iwmmxt_##name##_M0_wRn(int rn) \
|
|||
static inline void gen_op_iwmmxt_##name##_M0_wRn(int rn) \
|
||||
{ \
|
||||
iwmmxt_load_reg(cpu_V1, rn); \
|
||||
gen_helper_iwmmxt_##name(cpu_M0, cpu_env, cpu_M0, cpu_V1); \
|
||||
gen_helper_iwmmxt_##name(cpu_M0, tcg_env, cpu_M0, cpu_V1); \
|
||||
}
|
||||
|
||||
#define IWMMXT_OP_ENV_SIZE(name) \
|
||||
|
@ -1340,7 +1340,7 @@ IWMMXT_OP_ENV(name##l)
|
|||
#define IWMMXT_OP_ENV1(name) \
|
||||
static inline void gen_op_iwmmxt_##name##_M0(void) \
|
||||
{ \
|
||||
gen_helper_iwmmxt_##name(cpu_M0, cpu_env, cpu_M0); \
|
||||
gen_helper_iwmmxt_##name(cpu_M0, tcg_env, cpu_M0); \
|
||||
}
|
||||
|
||||
IWMMXT_OP(maddsq)
|
||||
|
@ -2113,13 +2113,13 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
|
|||
}
|
||||
switch ((insn >> 22) & 3) {
|
||||
case 1:
|
||||
gen_helper_iwmmxt_srlw(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_srlw(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 2:
|
||||
gen_helper_iwmmxt_srll(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_srll(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 3:
|
||||
gen_helper_iwmmxt_srlq(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_srlq(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
}
|
||||
gen_op_iwmmxt_movq_wRn_M0(wrd);
|
||||
|
@ -2139,13 +2139,13 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
|
|||
}
|
||||
switch ((insn >> 22) & 3) {
|
||||
case 1:
|
||||
gen_helper_iwmmxt_sraw(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_sraw(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 2:
|
||||
gen_helper_iwmmxt_sral(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_sral(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 3:
|
||||
gen_helper_iwmmxt_sraq(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_sraq(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
}
|
||||
gen_op_iwmmxt_movq_wRn_M0(wrd);
|
||||
|
@ -2165,13 +2165,13 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
|
|||
}
|
||||
switch ((insn >> 22) & 3) {
|
||||
case 1:
|
||||
gen_helper_iwmmxt_sllw(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_sllw(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 2:
|
||||
gen_helper_iwmmxt_slll(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_slll(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 3:
|
||||
gen_helper_iwmmxt_sllq(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_sllq(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
}
|
||||
gen_op_iwmmxt_movq_wRn_M0(wrd);
|
||||
|
@ -2191,19 +2191,19 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
|
|||
if (gen_iwmmxt_shift(insn, 0xf, tmp)) {
|
||||
return 1;
|
||||
}
|
||||
gen_helper_iwmmxt_rorw(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_rorw(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 2:
|
||||
if (gen_iwmmxt_shift(insn, 0x1f, tmp)) {
|
||||
return 1;
|
||||
}
|
||||
gen_helper_iwmmxt_rorl(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_rorl(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
case 3:
|
||||
if (gen_iwmmxt_shift(insn, 0x3f, tmp)) {
|
||||
return 1;
|
||||
}
|
||||
gen_helper_iwmmxt_rorq(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_rorq(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
break;
|
||||
}
|
||||
gen_op_iwmmxt_movq_wRn_M0(wrd);
|
||||
|
@ -2335,7 +2335,7 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
|
|||
rd0 = (insn >> 16) & 0xf;
|
||||
gen_op_iwmmxt_movq_M0_wRn(rd0);
|
||||
tmp = tcg_constant_i32(((insn >> 16) & 0xf0) | (insn & 0x0f));
|
||||
gen_helper_iwmmxt_shufh(cpu_M0, cpu_env, cpu_M0, tmp);
|
||||
gen_helper_iwmmxt_shufh(cpu_M0, tcg_env, cpu_M0, tmp);
|
||||
gen_op_iwmmxt_movq_wRn_M0(wrd);
|
||||
gen_op_iwmmxt_set_mup();
|
||||
gen_op_iwmmxt_set_cup();
|
||||
|
@ -2857,7 +2857,7 @@ static void gen_msr_banked(DisasContext *s, int r, int sysm, int rn)
|
|||
gen_set_condexec(s);
|
||||
gen_update_pc(s, 0);
|
||||
tcg_reg = load_reg(s, rn);
|
||||
gen_helper_msr_banked(cpu_env, tcg_reg,
|
||||
gen_helper_msr_banked(tcg_env, tcg_reg,
|
||||
tcg_constant_i32(tgtmode),
|
||||
tcg_constant_i32(regno));
|
||||
s->base.is_jmp = DISAS_UPDATE_EXIT;
|
||||
|
@ -2876,7 +2876,7 @@ static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn)
|
|||
gen_set_condexec(s);
|
||||
gen_update_pc(s, 0);
|
||||
tcg_reg = tcg_temp_new_i32();
|
||||
gen_helper_mrs_banked(tcg_reg, cpu_env,
|
||||
gen_helper_mrs_banked(tcg_reg, tcg_env,
|
||||
tcg_constant_i32(tgtmode),
|
||||
tcg_constant_i32(regno));
|
||||
store_reg(s, rn, tcg_reg);
|
||||
|
@ -2901,7 +2901,7 @@ static void gen_rfe(DisasContext *s, TCGv_i32 pc, TCGv_i32 cpsr)
|
|||
* be called after storing the new PC.
|
||||
*/
|
||||
translator_io_start(&s->base);
|
||||
gen_helper_cpsr_write_eret(cpu_env, cpsr);
|
||||
gen_helper_cpsr_write_eret(tcg_env, cpsr);
|
||||
/* Must exit loop to check un-masked IRQs */
|
||||
s->base.is_jmp = DISAS_EXIT;
|
||||
}
|
||||
|
@ -2918,7 +2918,7 @@ static void gen_gvec_fn3_qc(uint32_t rd_ofs, uint32_t rn_ofs, uint32_t rm_ofs,
|
|||
{
|
||||
TCGv_ptr qc_ptr = tcg_temp_new_ptr();
|
||||
|
||||
tcg_gen_addi_ptr(qc_ptr, cpu_env, offsetof(CPUARMState, vfp.qc));
|
||||
tcg_gen_addi_ptr(qc_ptr, tcg_env, offsetof(CPUARMState, vfp.qc));
|
||||
tcg_gen_gvec_3_ptr(rd_ofs, rn_ofs, rm_ofs, qc_ptr,
|
||||
opr_sz, max_sz, 0, fn);
|
||||
}
|
||||
|
@ -4605,11 +4605,11 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
|
|||
case 0:
|
||||
if (arm_dc_feature(s, ARM_FEATURE_AARCH64)
|
||||
&& dc_isar_feature(aa64_tidcp1, s)) {
|
||||
gen_helper_tidcp_el0(cpu_env, tcg_constant_i32(syndrome));
|
||||
gen_helper_tidcp_el0(tcg_env, tcg_constant_i32(syndrome));
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
gen_helper_tidcp_el1(cpu_env, tcg_constant_i32(syndrome));
|
||||
gen_helper_tidcp_el1(tcg_env, tcg_constant_i32(syndrome));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4654,7 +4654,7 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
|
|||
gen_set_condexec(s);
|
||||
gen_update_pc(s, 0);
|
||||
tcg_ri = tcg_temp_new_ptr();
|
||||
gen_helper_access_check_cp_reg(tcg_ri, cpu_env,
|
||||
gen_helper_access_check_cp_reg(tcg_ri, tcg_env,
|
||||
tcg_constant_i32(key),
|
||||
tcg_constant_i32(syndrome),
|
||||
tcg_constant_i32(isread));
|
||||
|
@ -4702,10 +4702,10 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
|
|||
tcg_ri = gen_lookup_cp_reg(key);
|
||||
}
|
||||
tmp64 = tcg_temp_new_i64();
|
||||
gen_helper_get_cp_reg64(tmp64, cpu_env, tcg_ri);
|
||||
gen_helper_get_cp_reg64(tmp64, tcg_env, tcg_ri);
|
||||
} else {
|
||||
tmp64 = tcg_temp_new_i64();
|
||||
tcg_gen_ld_i64(tmp64, cpu_env, ri->fieldoffset);
|
||||
tcg_gen_ld_i64(tmp64, tcg_env, ri->fieldoffset);
|
||||
}
|
||||
tmp = tcg_temp_new_i32();
|
||||
tcg_gen_extrl_i64_i32(tmp, tmp64);
|
||||
|
@ -4722,7 +4722,7 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
|
|||
tcg_ri = gen_lookup_cp_reg(key);
|
||||
}
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_get_cp_reg(tmp, cpu_env, tcg_ri);
|
||||
gen_helper_get_cp_reg(tmp, tcg_env, tcg_ri);
|
||||
} else {
|
||||
tmp = load_cpu_offset(ri->fieldoffset);
|
||||
}
|
||||
|
@ -4752,9 +4752,9 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
|
|||
if (!tcg_ri) {
|
||||
tcg_ri = gen_lookup_cp_reg(key);
|
||||
}
|
||||
gen_helper_set_cp_reg64(cpu_env, tcg_ri, tmp64);
|
||||
gen_helper_set_cp_reg64(tcg_env, tcg_ri, tmp64);
|
||||
} else {
|
||||
tcg_gen_st_i64(tmp64, cpu_env, ri->fieldoffset);
|
||||
tcg_gen_st_i64(tmp64, tcg_env, ri->fieldoffset);
|
||||
}
|
||||
} else {
|
||||
TCGv_i32 tmp = load_reg(s, rt);
|
||||
|
@ -4762,7 +4762,7 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
|
|||
if (!tcg_ri) {
|
||||
tcg_ri = gen_lookup_cp_reg(key);
|
||||
}
|
||||
gen_helper_set_cp_reg(cpu_env, tcg_ri, tmp);
|
||||
gen_helper_set_cp_reg(tcg_env, tcg_ri, tmp);
|
||||
} else {
|
||||
store_cpu_offset(tmp, ri->fieldoffset, 4);
|
||||
}
|
||||
|
@ -5028,7 +5028,7 @@ static void gen_srs(DisasContext *s,
|
|||
/* get_r13_banked() will raise an exception if called from System mode */
|
||||
gen_set_condexec(s);
|
||||
gen_update_pc(s, 0);
|
||||
gen_helper_get_r13_banked(addr, cpu_env, tcg_constant_i32(mode));
|
||||
gen_helper_get_r13_banked(addr, tcg_env, tcg_constant_i32(mode));
|
||||
switch (amode) {
|
||||
case 0: /* DA */
|
||||
offset = -4;
|
||||
|
@ -5069,7 +5069,7 @@ static void gen_srs(DisasContext *s,
|
|||
g_assert_not_reached();
|
||||
}
|
||||
tcg_gen_addi_i32(addr, addr, offset);
|
||||
gen_helper_set_r13_banked(cpu_env, tcg_constant_i32(mode), addr);
|
||||
gen_helper_set_r13_banked(tcg_env, tcg_constant_i32(mode), addr);
|
||||
}
|
||||
s->base.is_jmp = DISAS_UPDATE_EXIT;
|
||||
}
|
||||
|
@ -5618,7 +5618,7 @@ static bool trans_LSRL_ri(DisasContext *s, arg_mve_shl_ri *a)
|
|||
|
||||
static void gen_mve_sqshll(TCGv_i64 r, TCGv_i64 n, int64_t shift)
|
||||
{
|
||||
gen_helper_mve_sqshll(r, cpu_env, n, tcg_constant_i32(shift));
|
||||
gen_helper_mve_sqshll(r, tcg_env, n, tcg_constant_i32(shift));
|
||||
}
|
||||
|
||||
static bool trans_SQSHLL_ri(DisasContext *s, arg_mve_shl_ri *a)
|
||||
|
@ -5628,7 +5628,7 @@ static bool trans_SQSHLL_ri(DisasContext *s, arg_mve_shl_ri *a)
|
|||
|
||||
static void gen_mve_uqshll(TCGv_i64 r, TCGv_i64 n, int64_t shift)
|
||||
{
|
||||
gen_helper_mve_uqshll(r, cpu_env, n, tcg_constant_i32(shift));
|
||||
gen_helper_mve_uqshll(r, tcg_env, n, tcg_constant_i32(shift));
|
||||
}
|
||||
|
||||
static bool trans_UQSHLL_ri(DisasContext *s, arg_mve_shl_ri *a)
|
||||
|
@ -5674,7 +5674,7 @@ static bool do_mve_shl_rr(DisasContext *s, arg_mve_shl_rr *a, WideShiftFn *fn)
|
|||
tcg_gen_concat_i32_i64(rda, rdalo, rdahi);
|
||||
|
||||
/* The helper takes care of the sign-extension of the low 8 bits of Rm */
|
||||
fn(rda, cpu_env, rda, cpu_R[a->rm]);
|
||||
fn(rda, tcg_env, rda, cpu_R[a->rm]);
|
||||
|
||||
tcg_gen_extrl_i64_i32(rdalo, rda);
|
||||
tcg_gen_extrh_i64_i32(rdahi, rda);
|
||||
|
@ -5748,7 +5748,7 @@ static bool trans_SRSHR_ri(DisasContext *s, arg_mve_sh_ri *a)
|
|||
|
||||
static void gen_mve_sqshl(TCGv_i32 r, TCGv_i32 n, int32_t shift)
|
||||
{
|
||||
gen_helper_mve_sqshl(r, cpu_env, n, tcg_constant_i32(shift));
|
||||
gen_helper_mve_sqshl(r, tcg_env, n, tcg_constant_i32(shift));
|
||||
}
|
||||
|
||||
static bool trans_SQSHL_ri(DisasContext *s, arg_mve_sh_ri *a)
|
||||
|
@ -5758,7 +5758,7 @@ static bool trans_SQSHL_ri(DisasContext *s, arg_mve_sh_ri *a)
|
|||
|
||||
static void gen_mve_uqshl(TCGv_i32 r, TCGv_i32 n, int32_t shift)
|
||||
{
|
||||
gen_helper_mve_uqshl(r, cpu_env, n, tcg_constant_i32(shift));
|
||||
gen_helper_mve_uqshl(r, tcg_env, n, tcg_constant_i32(shift));
|
||||
}
|
||||
|
||||
static bool trans_UQSHL_ri(DisasContext *s, arg_mve_sh_ri *a)
|
||||
|
@ -5782,7 +5782,7 @@ static bool do_mve_sh_rr(DisasContext *s, arg_mve_sh_rr *a, ShiftFn *fn)
|
|||
}
|
||||
|
||||
/* The helper takes care of the sign-extension of the low 8 bits of Rm */
|
||||
fn(cpu_R[a->rda], cpu_env, cpu_R[a->rda], cpu_R[a->rm]);
|
||||
fn(cpu_R[a->rda], tcg_env, cpu_R[a->rda], cpu_R[a->rm]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -5928,12 +5928,12 @@ static bool op_qaddsub(DisasContext *s, arg_rrr *a, bool add, bool doub)
|
|||
t0 = load_reg(s, a->rm);
|
||||
t1 = load_reg(s, a->rn);
|
||||
if (doub) {
|
||||
gen_helper_add_saturate(t1, cpu_env, t1, t1);
|
||||
gen_helper_add_saturate(t1, tcg_env, t1, t1);
|
||||
}
|
||||
if (add) {
|
||||
gen_helper_add_saturate(t0, cpu_env, t0, t1);
|
||||
gen_helper_add_saturate(t0, tcg_env, t0, t1);
|
||||
} else {
|
||||
gen_helper_sub_saturate(t0, cpu_env, t0, t1);
|
||||
gen_helper_sub_saturate(t0, tcg_env, t0, t1);
|
||||
}
|
||||
store_reg(s, a->rd, t0);
|
||||
return true;
|
||||
|
@ -5977,7 +5977,7 @@ static bool op_smlaxxx(DisasContext *s, arg_rrrr *a,
|
|||
break;
|
||||
case 1:
|
||||
t1 = load_reg(s, a->ra);
|
||||
gen_helper_add_setq(t0, cpu_env, t0, t1);
|
||||
gen_helper_add_setq(t0, tcg_env, t0, t1);
|
||||
store_reg(s, a->rd, t0);
|
||||
break;
|
||||
case 2:
|
||||
|
@ -6041,7 +6041,7 @@ static bool op_smlawx(DisasContext *s, arg_rrrr *a, bool add, bool mt)
|
|||
tcg_gen_muls2_i32(t0, t1, t0, t1);
|
||||
if (add) {
|
||||
t0 = load_reg(s, a->ra);
|
||||
gen_helper_add_setq(t1, cpu_env, t1, t0);
|
||||
gen_helper_add_setq(t1, tcg_env, t1, t0);
|
||||
}
|
||||
store_reg(s, a->rd, t1);
|
||||
return true;
|
||||
|
@ -6120,7 +6120,7 @@ static bool trans_ESB(DisasContext *s, arg_ESB *a)
|
|||
* Test for EL2 present, and defer test for SEL2 to runtime.
|
||||
*/
|
||||
if (s->current_el <= 1 && arm_dc_feature(s, ARM_FEATURE_EL2)) {
|
||||
gen_helper_vesb(cpu_env);
|
||||
gen_helper_vesb(tcg_env);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -6228,7 +6228,7 @@ static bool trans_MRS_reg(DisasContext *s, arg_MRS_reg *a)
|
|||
tmp = load_cpu_field(spsr);
|
||||
} else {
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_cpsr_read(tmp, cpu_env);
|
||||
gen_helper_cpsr_read(tmp, tcg_env);
|
||||
}
|
||||
store_reg(s, a->rd, tmp);
|
||||
return true;
|
||||
|
@ -6257,7 +6257,7 @@ static bool trans_MRS_v7m(DisasContext *s, arg_MRS_v7m *a)
|
|||
return false;
|
||||
}
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_v7m_mrs(tmp, cpu_env, tcg_constant_i32(a->sysm));
|
||||
gen_helper_v7m_mrs(tmp, tcg_env, tcg_constant_i32(a->sysm));
|
||||
store_reg(s, a->rd, tmp);
|
||||
return true;
|
||||
}
|
||||
|
@ -6271,7 +6271,7 @@ static bool trans_MSR_v7m(DisasContext *s, arg_MSR_v7m *a)
|
|||
}
|
||||
addr = tcg_constant_i32((a->mask << 10) | a->sysm);
|
||||
reg = load_reg(s, a->rn);
|
||||
gen_helper_v7m_msr(cpu_env, addr, reg);
|
||||
gen_helper_v7m_msr(tcg_env, addr, reg);
|
||||
/* If we wrote to CONTROL, the EL might have changed */
|
||||
gen_rebuild_hflags(s, true);
|
||||
gen_lookup_tb(s);
|
||||
|
@ -6302,7 +6302,7 @@ static bool trans_BXJ(DisasContext *s, arg_BXJ *a)
|
|||
if (!arm_dc_feature(s, ARM_FEATURE_V8) &&
|
||||
arm_dc_feature(s, ARM_FEATURE_EL2) &&
|
||||
s->current_el < 2 && s->ns) {
|
||||
gen_helper_check_bxj_trap(cpu_env, tcg_constant_i32(a->rm));
|
||||
gen_helper_check_bxj_trap(tcg_env, tcg_constant_i32(a->rm));
|
||||
}
|
||||
/* Trivial implementation equivalent to bx. */
|
||||
gen_bx(s, load_reg(s, a->rm));
|
||||
|
@ -6480,7 +6480,7 @@ static bool trans_TT(DisasContext *s, arg_TT *a)
|
|||
|
||||
addr = load_reg(s, a->rn);
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_v7m_tt(tmp, cpu_env, addr, tcg_constant_i32((a->A << 1) | a->T));
|
||||
gen_helper_v7m_tt(tmp, tcg_env, addr, tcg_constant_i32((a->A << 1) | a->T));
|
||||
store_reg(s, a->rd, tmp);
|
||||
return true;
|
||||
}
|
||||
|
@ -6510,7 +6510,7 @@ static TCGv_i32 op_addr_rr_pre(DisasContext *s, arg_ldst_rr *a)
|
|||
TCGv_i32 addr = load_reg(s, a->rn);
|
||||
|
||||
if (s->v8m_stackcheck && a->rn == 13 && a->w) {
|
||||
gen_helper_v8m_stackcheck(cpu_env, addr);
|
||||
gen_helper_v8m_stackcheck(tcg_env, addr);
|
||||
}
|
||||
|
||||
if (a->p) {
|
||||
|
@ -6665,9 +6665,9 @@ static TCGv_i32 op_addr_ri_pre(DisasContext *s, arg_ldst_ri *a)
|
|||
if (!a->u) {
|
||||
TCGv_i32 newsp = tcg_temp_new_i32();
|
||||
tcg_gen_addi_i32(newsp, cpu_R[13], ofs);
|
||||
gen_helper_v8m_stackcheck(cpu_env, newsp);
|
||||
gen_helper_v8m_stackcheck(tcg_env, newsp);
|
||||
} else {
|
||||
gen_helper_v8m_stackcheck(cpu_env, cpu_R[13]);
|
||||
gen_helper_v8m_stackcheck(tcg_env, cpu_R[13]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7319,7 +7319,7 @@ static bool op_par_addsub_ge(DisasContext *s, arg_rrr *a,
|
|||
t1 = load_reg(s, a->rm);
|
||||
|
||||
ge = tcg_temp_new_ptr();
|
||||
tcg_gen_addi_ptr(ge, cpu_env, offsetof(CPUARMState, GE));
|
||||
tcg_gen_addi_ptr(ge, tcg_env, offsetof(CPUARMState, GE));
|
||||
gen(t0, t0, t1, ge);
|
||||
|
||||
store_reg(s, a->rd, t0);
|
||||
|
@ -7433,7 +7433,7 @@ static bool op_sat(DisasContext *s, arg_sat *a,
|
|||
tcg_gen_shli_i32(tmp, tmp, shift);
|
||||
}
|
||||
|
||||
gen(tmp, cpu_env, tmp, tcg_constant_i32(a->satimm));
|
||||
gen(tmp, tcg_env, tmp, tcg_constant_i32(a->satimm));
|
||||
|
||||
store_reg(s, a->rd, tmp);
|
||||
return true;
|
||||
|
@ -7540,7 +7540,7 @@ static bool trans_SEL(DisasContext *s, arg_rrr *a)
|
|||
t1 = load_reg(s, a->rn);
|
||||
t2 = load_reg(s, a->rm);
|
||||
t3 = tcg_temp_new_i32();
|
||||
tcg_gen_ld_i32(t3, cpu_env, offsetof(CPUARMState, GE));
|
||||
tcg_gen_ld_i32(t3, tcg_env, offsetof(CPUARMState, GE));
|
||||
gen_helper_sel_flags(t1, t3, t1, t2);
|
||||
store_reg(s, a->rd, t1);
|
||||
return true;
|
||||
|
@ -7618,11 +7618,11 @@ static bool op_smlad(DisasContext *s, arg_rrrr *a, bool m_swap, bool sub)
|
|||
|
||||
if (a->ra != 15) {
|
||||
t2 = load_reg(s, a->ra);
|
||||
gen_helper_add_setq(t1, cpu_env, t1, t2);
|
||||
gen_helper_add_setq(t1, tcg_env, t1, t2);
|
||||
}
|
||||
} else if (a->ra == 15) {
|
||||
/* Single saturation-checking addition */
|
||||
gen_helper_add_setq(t1, cpu_env, t1, t2);
|
||||
gen_helper_add_setq(t1, tcg_env, t1, t2);
|
||||
} else {
|
||||
/*
|
||||
* We need to add the products and Ra together and then
|
||||
|
@ -7804,9 +7804,9 @@ static bool op_div(DisasContext *s, arg_rrr *a, bool u)
|
|||
t1 = load_reg(s, a->rn);
|
||||
t2 = load_reg(s, a->rm);
|
||||
if (u) {
|
||||
gen_helper_udiv(t1, cpu_env, t1, t2);
|
||||
gen_helper_udiv(t1, tcg_env, t1, t2);
|
||||
} else {
|
||||
gen_helper_sdiv(t1, cpu_env, t1, t2);
|
||||
gen_helper_sdiv(t1, tcg_env, t1, t2);
|
||||
}
|
||||
store_reg(s, a->rd, t1);
|
||||
return true;
|
||||
|
@ -7855,7 +7855,7 @@ static TCGv_i32 op_addr_block_pre(DisasContext *s, arg_ldst_block *a, int n)
|
|||
* either the original SP (if incrementing) or our
|
||||
* final SP (if decrementing), so that's what we check.
|
||||
*/
|
||||
gen_helper_v8m_stackcheck(cpu_env, addr);
|
||||
gen_helper_v8m_stackcheck(tcg_env, addr);
|
||||
}
|
||||
|
||||
return addr;
|
||||
|
@ -7916,7 +7916,7 @@ static bool op_stm(DisasContext *s, arg_ldst_block *a, int min_n)
|
|||
|
||||
if (user && i != 15) {
|
||||
tmp = tcg_temp_new_i32();
|
||||
gen_helper_get_user_reg(tmp, cpu_env, tcg_constant_i32(i));
|
||||
gen_helper_get_user_reg(tmp, tcg_env, tcg_constant_i32(i));
|
||||
} else {
|
||||
tmp = load_reg(s, i);
|
||||
}
|
||||
|
@ -7999,7 +7999,7 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a, int min_n)
|
|||
tmp = tcg_temp_new_i32();
|
||||
gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN);
|
||||
if (user) {
|
||||
gen_helper_set_user_reg(cpu_env, tcg_constant_i32(i), tmp);
|
||||
gen_helper_set_user_reg(tcg_env, tcg_constant_i32(i), tmp);
|
||||
} else if (i == a->rn) {
|
||||
loaded_var = tmp;
|
||||
loaded_base = true;
|
||||
|
@ -8026,7 +8026,7 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a, int min_n)
|
|||
/* Restore CPSR from SPSR. */
|
||||
tmp = load_cpu_field(spsr);
|
||||
translator_io_start(&s->base);
|
||||
gen_helper_cpsr_write_eret(cpu_env, tmp);
|
||||
gen_helper_cpsr_write_eret(tcg_env, tmp);
|
||||
/* Must exit loop to check un-masked IRQs */
|
||||
s->base.is_jmp = DISAS_EXIT;
|
||||
}
|
||||
|
@ -8100,7 +8100,7 @@ static bool trans_CLRM(DisasContext *s, arg_CLRM *a)
|
|||
* Clear APSR (by calling the MSR helper with the same argument
|
||||
* as for "MSR APSR_nzcvqg, Rn": mask = 0b1100, SYSM=0)
|
||||
*/
|
||||
gen_helper_v7m_msr(cpu_env, tcg_constant_i32(0xc00), zero);
|
||||
gen_helper_v7m_msr(tcg_env, tcg_constant_i32(0xc00), zero);
|
||||
}
|
||||
clear_eci_state(s);
|
||||
return true;
|
||||
|
@ -8487,7 +8487,7 @@ static bool trans_VCTP(DisasContext *s, arg_VCTP *a)
|
|||
tcg_gen_movcond_i32(TCG_COND_LEU, masklen,
|
||||
masklen, tcg_constant_i32(1 << (4 - a->size)),
|
||||
rn_shifted, tcg_constant_i32(16));
|
||||
gen_helper_mve_vctp(cpu_env, masklen);
|
||||
gen_helper_mve_vctp(tcg_env, masklen);
|
||||
/* This insn updates predication bits */
|
||||
s->base.is_jmp = DISAS_UPDATE_NOCHAIN;
|
||||
mve_update_eci(s);
|
||||
|
@ -8665,12 +8665,12 @@ static bool trans_CPS_v7m(DisasContext *s, arg_CPS_v7m *a)
|
|||
/* FAULTMASK */
|
||||
if (a->F) {
|
||||
addr = tcg_constant_i32(19);
|
||||
gen_helper_v7m_msr(cpu_env, addr, tmp);
|
||||
gen_helper_v7m_msr(tcg_env, addr, tmp);
|
||||
}
|
||||
/* PRIMASK */
|
||||
if (a->I) {
|
||||
addr = tcg_constant_i32(16);
|
||||
gen_helper_v7m_msr(cpu_env, addr, tmp);
|
||||
gen_helper_v7m_msr(tcg_env, addr, tmp);
|
||||
}
|
||||
gen_rebuild_hflags(s, false);
|
||||
gen_lookup_tb(s);
|
||||
|
@ -8740,7 +8740,7 @@ static bool trans_SETEND(DisasContext *s, arg_SETEND *a)
|
|||
return false;
|
||||
}
|
||||
if (a->E != (s->be_data == MO_BE)) {
|
||||
gen_helper_setend(cpu_env);
|
||||
gen_helper_setend(tcg_env);
|
||||
s->base.is_jmp = DISAS_UPDATE_EXIT;
|
||||
}
|
||||
return true;
|
||||
|
@ -9335,7 +9335,7 @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
|
|||
* be possible after an indirect branch, at the start of the TB.
|
||||
*/
|
||||
assert(dc->base.num_insns == 1);
|
||||
gen_helper_exception_pc_alignment(cpu_env, tcg_constant_tl(pc));
|
||||
gen_helper_exception_pc_alignment(tcg_env, tcg_constant_tl(pc));
|
||||
dc->base.is_jmp = DISAS_NORETURN;
|
||||
dc->base.pc_next = QEMU_ALIGN_UP(pc, 4);
|
||||
return;
|
||||
|
@ -9615,7 +9615,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
|
|||
/* nothing more to generate */
|
||||
break;
|
||||
case DISAS_WFI:
|
||||
gen_helper_wfi(cpu_env, tcg_constant_i32(curr_insn_len(dc)));
|
||||
gen_helper_wfi(tcg_env, tcg_constant_i32(curr_insn_len(dc)));
|
||||
/*
|
||||
* The helper doesn't necessarily throw an exception, but we
|
||||
* must go back to the main loop to check for interrupts anyway.
|
||||
|
@ -9623,10 +9623,10 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
|
|||
tcg_gen_exit_tb(NULL, 0);
|
||||
break;
|
||||
case DISAS_WFE:
|
||||
gen_helper_wfe(cpu_env);
|
||||
gen_helper_wfe(tcg_env);
|
||||
break;
|
||||
case DISAS_YIELD:
|
||||
gen_helper_yield(cpu_env);
|
||||
gen_helper_yield(tcg_env);
|
||||
break;
|
||||
case DISAS_SWI:
|
||||
gen_exception(EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb));
|
||||
|
|
|
@ -329,7 +329,7 @@ static inline TCGv_i32 get_ahp_flag(void)
|
|||
{
|
||||
TCGv_i32 ret = tcg_temp_new_i32();
|
||||
|
||||
tcg_gen_ld_i32(ret, cpu_env,
|
||||
tcg_gen_ld_i32(ret, tcg_env,
|
||||
offsetof(CPUARMState, vfp.xregs[ARM_VFP_FPSCR]));
|
||||
tcg_gen_extract_i32(ret, ret, 26, 1);
|
||||
|
||||
|
@ -343,9 +343,9 @@ static inline void set_pstate_bits(uint32_t bits)
|
|||
|
||||
tcg_debug_assert(!(bits & CACHED_PSTATE_BITS));
|
||||
|
||||
tcg_gen_ld_i32(p, cpu_env, offsetof(CPUARMState, pstate));
|
||||
tcg_gen_ld_i32(p, tcg_env, offsetof(CPUARMState, pstate));
|
||||
tcg_gen_ori_i32(p, p, bits);
|
||||
tcg_gen_st_i32(p, cpu_env, offsetof(CPUARMState, pstate));
|
||||
tcg_gen_st_i32(p, tcg_env, offsetof(CPUARMState, pstate));
|
||||
}
|
||||
|
||||
/* Clear bits within PSTATE. */
|
||||
|
@ -355,9 +355,9 @@ static inline void clear_pstate_bits(uint32_t bits)
|
|||
|
||||
tcg_debug_assert(!(bits & CACHED_PSTATE_BITS));
|
||||
|
||||
tcg_gen_ld_i32(p, cpu_env, offsetof(CPUARMState, pstate));
|
||||
tcg_gen_ld_i32(p, tcg_env, offsetof(CPUARMState, pstate));
|
||||
tcg_gen_andi_i32(p, p, ~bits);
|
||||
tcg_gen_st_i32(p, cpu_env, offsetof(CPUARMState, pstate));
|
||||
tcg_gen_st_i32(p, tcg_env, offsetof(CPUARMState, pstate));
|
||||
}
|
||||
|
||||
/* If the singlestep state is Active-not-pending, advance to Active-pending. */
|
||||
|
@ -374,7 +374,7 @@ static inline void gen_swstep_exception(DisasContext *s, int isv, int ex)
|
|||
{
|
||||
/* Fill in the same_el field of the syndrome in the helper. */
|
||||
uint32_t syn = syn_swstep(false, isv, ex);
|
||||
gen_helper_exception_swstep(cpu_env, tcg_constant_i32(syn));
|
||||
gen_helper_exception_swstep(tcg_env, tcg_constant_i32(syn));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -557,7 +557,7 @@ static inline TCGv_ptr fpstatus_ptr(ARMFPStatusFlavour flavour)
|
|||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
tcg_gen_addi_ptr(statusptr, cpu_env, offset);
|
||||
tcg_gen_addi_ptr(statusptr, tcg_env, offset);
|
||||
return statusptr;
|
||||
}
|
||||
|
||||
|
@ -679,7 +679,7 @@ static inline void set_disas_label(DisasContext *s, DisasLabel l)
|
|||
static inline TCGv_ptr gen_lookup_cp_reg(uint32_t key)
|
||||
{
|
||||
TCGv_ptr ret = tcg_temp_new_ptr();
|
||||
gen_helper_lookup_cp_reg(ret, cpu_env, tcg_constant_i32(key));
|
||||
gen_helper_lookup_cp_reg(ret, tcg_env, tcg_constant_i32(key));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue