[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA
From: |
Richard Henderson |
Subject: |
Re: [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA |
Date: |
Wed, 22 Jul 2020 11:00:26 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 7/22/20 2:15 AM, frank.chang@sifive.com wrote:
> -static void vext_clear(void *tail, uint32_t cnt, uint32_t tot)
> +static void vext_clear(void *tail, uint32_t vta, uint32_t cnt, uint32_t tot)
> {
> + if (vta == 0) {
> + /* tail element undisturbed */
> + return;
> + }
> +
> /*
> + * Tail element agnostic.
> * Split the remaining range to two parts.
> * The first part is in the last uint64_t unit.
> * The second part start from the next uint64_t unit.
> @@ -152,41 +168,50 @@ static void vext_clear(void *tail, uint32_t cnt,
> uint32_t tot)
> if (cnt % 8) {
> part1 = 8 - (cnt % 8);
> part2 = tot - cnt - part1;
> - memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
> - memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
> + memset((void *)((uintptr_t)tail & ~(7ULL)), 1, part1);
> + memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 1, part2);
> } else {
> - memset(tail, 0, part2);
> + memset(tail, 1, part2);
> }
> }
"1s" surely means all bits set to 1, not each byte to 1.
Is there any reason to do anything with VTA/VMA at all? One alternative for
"agnostic" is to leave the values undisturbed. So the quickest thing for qemu
to do is remove all of this code. Then we don't have to pass the values in
translate either.
Which is exactly what is recommended in the 4th paragraph of the notes
following the VTA/VMA description.
r~
- [RFC v2 12/76] target/riscv: rvv-0.9: add vcsr register, (continued)
- [RFC v2 12/76] target/riscv: rvv-0.9: add vcsr register, frank . chang, 2020/07/22
- [RFC v2 13/76] target/riscv: rvv-0.9: add vlenb register, frank . chang, 2020/07/22
- [RFC v2 14/76] target/riscv: rvv-0.9: remove MLEN calculations, frank . chang, 2020/07/22
- [RFC v2 15/76] target/riscv: rvv-0.9: add fractional LMUL, frank . chang, 2020/07/22
- [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA, frank . chang, 2020/07/22
- Re: [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA,
Richard Henderson <=
- [RFC v2 17/76] target/riscv: rvv-0.9: update check functions, frank . chang, 2020/07/22
- [RFC v2 18/76] target/riscv: introduce more imm value modes in translator functions, frank . chang, 2020/07/22
- [RFC v2 19/76] target/riscv: rvv-0.9: add narrower_nanbox_fpr helper, frank . chang, 2020/07/22
- [RFC v2 20/76] target/riscv: rvv-0.9: apply narrower nanbox helper in opfvf_trans, frank . chang, 2020/07/22
- [RFC v2 21/76] target/riscv: rvv-0.9: configure instructions, frank . chang, 2020/07/22