qemu-s390x
[Top][All Lists]
Advanced

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

Re: [qemu-s390x] [Qemu-devel] [PATCH v1 31/41] s390x/tcg: Implement VECT


From: Richard Henderson
Subject: Re: [qemu-s390x] [Qemu-devel] [PATCH v1 31/41] s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE
Date: Fri, 12 Apr 2019 14:54:57 -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_vsldb(DisasContext *s, DisasOps *o)
> +{
> +    int src_idx = get_field(s->fields, i4) & 0xf;
> +
> +    if (src_idx == 0) {
> +        gen_gvec_mov(get_field(s->fields, v1), get_field(s->fields, v2));
> +    } else {
> +        gen_gvec_3_ool(get_field(s->fields, v1), get_field(s->fields, v2),
> +                       get_field(s->fields, v3), src_idx,
> +                       gen_helper_gvec_vsldb);
> +        return DISAS_NEXT;

You could also expand this inline using your new extract2 primitive.

  int i4 = get_field(s->fields, i4);
  int left_shift, right_shift;

  left_shift = (i4 & 7) * 8;
  right_shift = 64 - left_shift;

  if ((i4 & 8) == 0) {
      read_vec_element_i64(t0, get_field(s->fields, v2), 0, ES_64);
      read_vec_element_i64(t1, get_field(s->fields, v2), 1, ES_64);
      read_vec_element_i64(t2, get_field(s->fields, v3), 0, ES_64);
  } else {
      read_vec_element_i64(t0, get_field(s->fields, v2), 1, ES_64);
      read_vec_element_i64(t1, get_field(s->fields, v3), 0, ES_64);
      read_vec_element_i64(t2, get_field(s->fields, v3), 1, ES_64);
  }
  tcg_gen_extract2_i64(t0, t1, t0, right_shift);
  tcg_gen_extract2_i64(t1, t2, t1, right_shift);
  write_vec_element_i64(t0, get_field(s->fields, v1), 0, ES_64);
  write_vec_element_i64(t1, get_field(s->fields, v1), 1, ES_64);


r~



reply via email to

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