[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/20] target/arm: Rewrite helper_sve_ld1*_r usi
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH 12/20] target/arm: Rewrite helper_sve_ld1*_r using pages |
Date: |
Fri, 10 Aug 2018 10:13:01 +0100 |
User-agent: |
mu4e 1.1.0; emacs 26.1.50 |
Richard Henderson <address@hidden> writes:
> Uses tlb_vaddr_to_host for correct operation with softmmu.
> Optimize for accesses within a single page or pair of pages.
>
> Perf report comparison for cortex-strings test-strlen
> with aarch64-linux-user:
>
<snip>
> +/*
> + * Common helper for all contiguous one-register predicated loads.
> + */
> +static void sve_ld1_r(CPUARMState *env, void *vg, const target_ulong addr,
> + uint32_t desc, const uintptr_t retaddr,
> + const int esz, const int msz,
> + sve_ld1_host_fn *host_fn,
> + sve_ld1_tlb_fn *tlb_fn)
> +{
> + void *vd = &env->vfp.zregs[simd_data(desc)];
> + const int diffsz = esz - msz;
> + const intptr_t reg_max = simd_oprsz(desc);
> + const intptr_t mem_max = reg_max >> diffsz;
> + const int mmu_idx = cpu_mmu_index(env, false);
> + ARMVectorReg scratch;
> + void *host, *result;
> + intptr_t split;
> +
> + set_helper_retaddr(retaddr);
> +
> + host = tlb_vaddr_to_host(env, addr, MMU_DATA_LOAD, mmu_idx);
> + if (test_host_page(host)) {
> + split = max_for_page(addr, 0, mem_max);
> + if (likely(split == mem_max)) {
> + /* The load is entirely within a valid page. For softmmu,
> + * no faults. For user-only, if the first byte does not
> + * fault then none of them will fault, so Vd will never be
> + * partially modified.
> + */
> + host_fn(vd, vg, host, 0, mem_max);
> + set_helper_retaddr(0);
> + return;
> + }
> + }
> +
> + /* Perform the predicated read into a temporary, thus ensuring
> + * if the load of the last element faults, Vd is not modified.
> + */
> + result = &scratch;
> +#ifdef CONFIG_USER_ONLY
> + host_fn(vd, vg, host, 0, mem_max);
> +#else
> + memset(result, 0, reg_max);
> + for (intptr_t reg_off = find_next_active(vg, 0, reg_max, esz);
Hmm this blew up CI complaining about c99-isms, but QEMU is supposed to
be c99 compliant.
https://travis-ci.org/stsquad/qemu/builds/414248994
--
Alex Bennée
- Re: [Qemu-devel] [PATCH 07/20] target/arm: Fix is_a64 for user-only, (continued)
[Qemu-devel] [PATCH 09/20] target/arm: Handle SVE vector length changes in system mode, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 10/20] target/arm: Adjust aarch64_cpu_dump_state for system mode SVE, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 11/20] target/arm: Clear unused predicate bits for LD1RQ, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 12/20] target/arm: Rewrite helper_sve_ld1*_r using pages, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 14/20] target/arm: Rewrite helper_sve_st[1234]*_r, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 16/20] target/arm: Split contiguous stores for endianness, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 13/20] target/arm: Rewrite helper_sve_ld[234]*_r, Richard Henderson, 2018/08/09
[Qemu-devel] [PATCH 15/20] target/arm: Split contiguous loads for endianness, Richard Henderson, 2018/08/09