tcg/arm: Tighten tlb indexing offset test

We are not going to use ldrd for loading the comparator
for 32-bit guests, so don't limit cmp_off to 8 bits then.
This eliminates one insn in the tlb load for some guests.

Backports commit 95ede84f4de18747d03d79c148013cff99acd60b from qemu
This commit is contained in:
Richard Henderson 2018-03-04 22:57:02 -05:00 committed by Lioncash
parent e4d05c2567
commit 504bdad70d
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1211,7 +1211,9 @@ static TCGReg tcg_out_tlb_read(TCGContext *s, TCGReg addrlo, TCGReg addrhi,
}
/* We checked that the offset is contained within 16 bits above. */
if (add_off > 0xfff || (use_armv6_instructions && cmp_off > 0xff)) {
if (add_off > 0xfff
|| (use_armv6_instructions && TARGET_LONG_BITS == 64
&& cmp_off > 0xff)) {
tcg_out_dat_imm(s, COND_AL, ARITH_ADD, TCG_REG_R2, base,
(24 << 7) | (cmp_off >> 8));
base = TCG_REG_R2;