[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 08/20] tcg-arm: Implement deposit for armv7
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v3 08/20] tcg-arm: Implement deposit for armv7 |
Date: |
Thu, 28 Mar 2013 16:15:12 +0000 |
On 28 March 2013 15:32, Richard Henderson <address@hidden> wrote:
> We have BFI and BFC available for implementing it.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> tcg/arm/tcg-target.c | 36 ++++++++++++++++++++++++++++++++++++
> tcg/arm/tcg-target.h | 5 ++++-
> 2 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
> index 88f5689..4950eaf 100644
> --- a/tcg/arm/tcg-target.c
> +++ b/tcg/arm/tcg-target.c
> @@ -702,6 +702,35 @@ static inline void tcg_out_bswap32(TCGContext *s, int
> cond, int rd, int rn)
> }
> }
>
> +bool tcg_target_deposit_valid(int ofs, int len)
> +{
> + /* ??? Without bfi, we could improve over generic code by combining
> + the right-shift from a non-zero ofs with the orr. We do run into
> + problems when rd == rs, and the mask generated from ofs+len don't
> + fit into an immediate. We would have to be careful not to pessimize
> + wrt the optimizations performed on the expanded code. */
> + return use_armv7_instructions;
Strictly speaking BFI is v6T2, but there doesn't seem much point
in making the distinction given it would only affect the rare
ARM1156. (Personally I don't think there's much point worrying about
optmising codegen for anything pre-v7 at all.)
> +}
> +
> +static inline void tcg_out_deposit(TCGContext *s, int cond, TCGReg rd,
> + TCGArg a1, int ofs, int len, bool
> const_a1)
> +{
> + if (const_a1) {
> + uint32_t mask = (2u << (len - 1)) - 1;
What guarantees us that we won't see a length of 0?
The tcg/README description doesn't say that's invalid
and I don't think the optimize pass handles it (maybe I
missed it).
-- PMM
- Re: [Qemu-devel] [PATCH v3 05/20] tcg-arm: Handle constant arguments to add2/sub2, (continued)
[Qemu-devel] [PATCH v3 03/20] tcg-arm: Allow constant first argument to sub, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 06/20] tcg-arm: Improve constant generation, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 07/20] tcg-arm: Fold epilogue into INDEX_op_exit_tb, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 08/20] tcg-arm: Implement deposit for armv7, Richard Henderson, 2013/03/28
- Re: [Qemu-devel] [PATCH v3 08/20] tcg-arm: Implement deposit for armv7,
Peter Maydell <=
[Qemu-devel] [PATCH v3 09/20] tcg-arm: Implement division instructions, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 10/20] tcg-arm: Use TCG_REG_TMP name for the tcg temporary, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 11/20] tcg-arm: Use R12 for the tcg temporary, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 12/20] tcg-arm: Cleanup multiply subroutines, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 13/20] tcg-arm: Cleanup tcg_out_goto_label, Richard Henderson, 2013/03/28
[Qemu-devel] [PATCH v3 14/20] tcg-arm: Cleanup goto_tb handling, Richard Henderson, 2013/03/28