From 37103f1bc4c53bf2cfe2d9360b617b4388add771 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 10 Nov 2018 11:19:12 -0500 Subject: [PATCH] target/arm: Promote consecutive memory ops for aa32 For a sequence of loads or stores from a single register, little-endian operations can be promoted to an 8-byte op. This can reduce the number of operations by a factor of 8. Backports commit e23f12b3a252352b575908ca7b94587acd004641 from qemu --- qemu/target/arm/translate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qemu/target/arm/translate.c b/qemu/target/arm/translate.c index 23a8f440..781003c6 100644 --- a/qemu/target/arm/translate.c +++ b/qemu/target/arm/translate.c @@ -5159,6 +5159,16 @@ static int disas_neon_ls_insn(DisasContext *s, uint32_t insn) if (size == 3 && (interleave | spacing) != 1) { return 1; } + /* For our purposes, bytes are always little-endian. */ + if (size == 0) { + endian = MO_LE; + } + /* Consecutive little-endian elements from a single register + * can be promoted to a larger little-endian operation. + */ + if (interleave == 1 && endian == MO_LE) { + size = 3; + } tmp64 = tcg_temp_new_i64(tcg_ctx); addr = tcg_temp_new_i32(tcg_ctx); tmp2 = tcg_const_i32(tcg_ctx, 1 << size);