qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 05/41] s390x/tcg: Implement VECTOR ADD WITH C


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v1 05/41] s390x/tcg: Implement VECTOR ADD WITH CARRY COMPUTE CARRY
Date: Fri, 12 Apr 2019 11:58:56 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/11/19 12:08 AM, David Hildenbrand wrote:
> +static DisasJumpType op_vaccc(DisasContext *s, DisasOps *o)
> +{
> +    if (get_field(s->fields, m5) != ES_128) {
> +        gen_program_exception(s, PGM_SPECIFICATION);
> +        return DISAS_NORETURN;
> +    }
> +
> +    gen_gvec_4_ool(get_field(s->fields, v1), get_field(s->fields, v2),
> +                   get_field(s->fields, v3), get_field(s->fields, v4), 0,
> +                   gen_helper_gvec_vaccc128);
> +    return DISAS_NEXT;
> +}

An inline expansion could be

One possible expansion is

  tcg_gen_andi_i64(tl, cl, 1);
  tcg_gen_add2_i64(tl, th, tl, zero, al, zero);
  tcg_gen_add2_i64(tl, th, tl, th, bl, zero);
  tcg_gen_add2_i64(tl, th, th, zero, ah, zero);
  tcg_gen_add2_i64(tl, th, tl, th, bl, zero);
  /* carry out in th */

This is 8 insns for the addition vs the hw optimal 6, but we're not exactly an
optimizing compiler either.  ;-)


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]