qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	Huang Tao <eric.huang@linux.alibaba.com>,
	qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, zhiwei_liu@linux.alibaba.com,
	liwei1518@gmail.com,  bin.meng@windriver.com,
	alistair.francis@wdc.com, palmer@dabbelt.com
Subject: Re: [PATCH 2/4] target/riscv: Add right functions to set agnostic elements
Date: Tue, 19 Mar 2024 13:32:08 -1000	[thread overview]
Message-ID: <675f13e6-4030-4099-a97b-f5bd38d030e9@linaro.org> (raw)
In-Reply-To: <c765adcb-2702-45d3-b875-6eaa6b6d7d0c@ventanamicro.com>

On 3/19/24 11:57, Daniel Henrique Barboza wrote:
> This seems correct but a bit over complicated at first glance. I wonder if we have
> something simpler already done somewhere.
> 
> Richard, does ARM (or any other arch) do anything of the sort? Aside from more trivial
> byte swaps using bswap64() I didn't find anything similar.

No, nothing quite like.

> We recently posted a big endian related fix here:
> 
> [PATCH for 9.0 v15 03/10] target/riscv/vector_helper.c: fix 'vmvr_v' memcpy endianess
> 
> But not sure how to apply it here.

It's almost exactly the same, only with memset instead of memcpy.

     if (HOST_BIG_ENDIAN && idx % 8 != 0) {
         uint32_t j = ROUND_UP(idx, 8);
         memset(vd + H(j - 1), -1, j - idx);
         idx = j;
     }
     memset(vd + idx, -1, tot - idx);


I'll note that you don't need to change the api of vext_set_elems_1s -- so most of these 
patches are not required.


r~


  reply	other threads:[~2024-03-19 23:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  9:20 [PATCH 0/4] target/riscv: Fix the element agnostic function problem Huang Tao
2024-03-06  9:20 ` [PATCH 1/4] target/riscv: Rename vext_set_elems_1s function Huang Tao
2024-03-19 21:37   ` Daniel Henrique Barboza
2024-03-06  9:20 ` [PATCH 2/4] target/riscv: Add right functions to set agnostic elements Huang Tao
2024-03-19 21:57   ` Daniel Henrique Barboza
2024-03-19 23:32     ` Richard Henderson [this message]
2024-03-20  2:41       ` Huang Tao
2024-03-06  9:20 ` [PATCH 3/4] target/riscv: Replace element agnostic for vector instructions Huang Tao
2024-03-06  9:20 ` [PATCH 4/4] target/riscv: Delete the former element agnostic function Huang Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=675f13e6-4030-4099-a97b-f5bd38d030e9@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=eric.huang@linux.alibaba.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).