summaryrefslogtreecommitdiffstats
path: root/target/arm/translate-vfp.inc.c
diff options
context:
space:
mode:
authorPeter Maydell2019-06-11 17:39:45 +0200
committerPeter Maydell2019-06-13 16:14:04 +0200
commit79b02a3b5231c5b8cd31e50cd549968dd0a05c49 (patch)
treeb1f9b932e6f4718ee8880e84957ac73b0216a39d /target/arm/translate-vfp.inc.c
parenttarget/arm: Convert VFP two-register transfer insns to decodetree (diff)
downloadqemu-79b02a3b5231c5b8cd31e50cd549968dd0a05c49.tar.gz
qemu-79b02a3b5231c5b8cd31e50cd549968dd0a05c49.tar.xz
qemu-79b02a3b5231c5b8cd31e50cd549968dd0a05c49.zip
target/arm: Convert VFP VLDR and VSTR to decodetree
Convert the VFP single load/store insns VLDR and VSTR to decodetree. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/arm/translate-vfp.inc.c')
-rw-r--r--target/arm/translate-vfp.inc.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c
index 5f081221b8..40f2cac3e2 100644
--- a/target/arm/translate-vfp.inc.c
+++ b/target/arm/translate-vfp.inc.c
@@ -853,3 +853,76 @@ static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_sp *a)
return true;
}
+
+static bool trans_VLDR_VSTR_sp(DisasContext *s, arg_VLDR_VSTR_sp *a)
+{
+ uint32_t offset;
+ TCGv_i32 addr;
+
+ if (!vfp_access_check(s)) {
+ return true;
+ }
+
+ offset = a->imm << 2;
+ if (!a->u) {
+ offset = -offset;
+ }
+
+ if (s->thumb && a->rn == 15) {
+ /* This is actually UNPREDICTABLE */
+ addr = tcg_temp_new_i32();
+ tcg_gen_movi_i32(addr, s->pc & ~2);
+ } else {
+ addr = load_reg(s, a->rn);
+ }
+ tcg_gen_addi_i32(addr, addr, offset);
+ if (a->l) {
+ gen_vfp_ld(s, false, addr);
+ gen_mov_vreg_F0(false, a->vd);
+ } else {
+ gen_mov_F0_vreg(false, a->vd);
+ gen_vfp_st(s, false, addr);
+ }
+ tcg_temp_free_i32(addr);
+
+ return true;
+}
+
+static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_sp *a)
+{
+ uint32_t offset;
+ TCGv_i32 addr;
+
+ /* UNDEF accesses to D16-D31 if they don't exist */
+ if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) {
+ return false;
+ }
+
+ if (!vfp_access_check(s)) {
+ return true;
+ }
+
+ offset = a->imm << 2;
+ if (!a->u) {
+ offset = -offset;
+ }
+
+ if (s->thumb && a->rn == 15) {
+ /* This is actually UNPREDICTABLE */
+ addr = tcg_temp_new_i32();
+ tcg_gen_movi_i32(addr, s->pc & ~2);
+ } else {
+ addr = load_reg(s, a->rn);
+ }
+ tcg_gen_addi_i32(addr, addr, offset);
+ if (a->l) {
+ gen_vfp_ld(s, true, addr);
+ gen_mov_vreg_F0(true, a->vd);
+ } else {
+ gen_mov_F0_vreg(true, a->vd);
+ gen_vfp_st(s, true, addr);
+ }
+ tcg_temp_free_i32(addr);
+
+ return true;
+}