On Fri, Jan 07, 2011 at 02:42:59PM -0800, Richard Henderson wrote:
> Signed-off-by: Richard Henderson
> ---
> tcg/hppa/tcg-target.c | 58 +++-
> tcg/hppa/tcg-target.h |1 +
> 2 files changed, 53 insertions(+), 6 deletions(-)
>
> diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
> index 7f4653e..2c5df57 100644
> --- a/tcg/hppa/tcg-target.c
> +++ b/tcg/hppa/tcg-target.c
> @@ -467,6 +467,22 @@ static inline void tcg_out_dep(TCGContext *s, int ret,
> int arg,
>| INSN_SHDEP_CP(31 - ofs) | INSN_DEP_LEN(len));
> }
>
> +static inline void tcg_out_depi(TCGContext *s, int ret, int arg,
^^^
> +unsigned ofs, unsigned len)
> +{
> +assert(ofs < 32 && len <= 32 - ofs);
> +tcg_out32(s, INSN_DEPI | INSN_R2(ret) | INSN_IM5(val)
^^^
The parameter should be named val, too.
[...]
> static void tcg_out_shl(TCGContext *s, int ret, int arg, int creg)
> @@ -1407,6 +1420,38 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
> opc, const TCGArg *args,
> }
> break;
>
> +case INDEX_op_deposit_i32:
> +{
> +unsigned ofs = args[3] >> 8, len = args[3] & 0xff;
> +int arg2 = args[2];
> +int arg1 = args[1];
> +int arg0 = args[0];
> +
> +if (const_args[1]) {
Surely const_args[1] && arg1 == 0?
> +if (const_args[2]) {
> +tcg_out_movi(s, TCG_TYPE_I32, arg0,
> + (arg2 & ((1u << len) - 1)) << ofs);
> +} else {
> +tcg_out_zdep(s, arg0, arg2, ofs, len);
> +}
Otherwise, looks good at first glance.
It'll be a few days before I can test on an HPPA box, though.
Cheers,
--
Stuart Brady