qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 08/16] target/arm: Use SVEContLdSt in sve_ld1_r


From: Richard Henderson
Subject: Re: [PATCH 08/16] target/arm: Use SVEContLdSt in sve_ld1_r
Date: Fri, 17 Apr 2020 20:41:07 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/16/20 6:26 AM, Peter Maydell wrote:
> On Wed, 11 Mar 2020 at 06:44, Richard Henderson
> <address@hidden> wrote:
>>
>> First use of the new helper functions, so we can remove the
>> unused markup.  No longer need a scratch for user-only, as
>> we completely probe the page set before reading; system mode
>> still requires a scratch for MMIO.
>>
>> Signed-off-by: Richard Henderson <address@hidden>
> 
>> +    /* The entire operation is in RAM, on valid pages. */
>> +
>> +    memset(vd, 0, reg_max);
>> +    mem_off = info.mem_off_first[0];
>> +    reg_off = info.reg_off_first[0];
>> +    reg_last = info.reg_off_last[0];
>> +    host = info.page[0].host;
>> +
>> +    while (reg_off <= reg_last) {
>> +        uint64_t pg = vg[reg_off >> 6];
>> +        do {
>> +            if ((pg >> (reg_off & 63)) & 1) {
>> +                host_fn(vd, reg_off, host + mem_off);
>> +            }
>> +            reg_off += 1 << esz;
>> +            mem_off += 1 << msz;
>> +        } while (reg_off <= reg_last && (reg_off & 63));
>> +    }
>> +
>> +    /*
>> +     * Use the slow path to manage the cross-page misalignment.
>> +     * But we know this is RAM and cannot trap.
>> +     */
>> +    mem_off = info.mem_off_split;
>> +    if (unlikely(mem_off >= 0)) {
>> +        tlb_fn(env, vd, info.reg_off_split, addr + mem_off, retaddr);
>> +    }
>> +
>> +    mem_off = info.mem_off_first[1];
>> +    if (unlikely(mem_off >= 0)) {
>> +        reg_off = info.reg_off_first[1];
>> +        reg_last = info.reg_off_last[1];
>> +        host = info.page[1].host;
>> +
>> +        do {
>> +            uint64_t pg = vg[reg_off >> 6];
>> +            do {
>> +                if ((pg >> (reg_off & 63)) & 1) {
>> +                    host_fn(vd, reg_off, host + mem_off);
>> +                }
>> +                reg_off += 1 << esz;
>> +                mem_off += 1 << msz;
>> +            } while (reg_off & 63);
>> +        } while (reg_off <= reg_last);
> 
> Does this loop for the second page need to be phrased
> differently than the loop for the first page was? I was
> expecting the two chunks of code to be identical, and they
> almost are, but not quite...

Yes, they do need to be different.  In particular, the first page may only have
the one element that crosses the page boundary, so we may have reg_first >
reg_last.  The second page is never has that problem.


r~



reply via email to

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