This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR82964: Fix 128-bit immediate ICEs


Hi Wilco,


On 17 January 2018 at 17:22, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
> James Greenhalgh wrote:
>
>> -  /* Do not allow wide int constants - this requires support in movti.  */
>> +  /* Only allow simple 128-bit immediates.  */
>>    if (CONST_WIDE_INT_P (x))
>> -    return false;
>> +    return aarch64_mov128_immediate (x);
>
>> I can see why this could be correct, but it is unclear why it is neccessary
>> to fix the bug. What goes wrong if we leave this as "return false".
>
> It's not necessary, things only go wrong if you return true for a wider set of
> immediates than those directly supported by the movti pattern - and that may
> be a regalloc issue.
>
> However removing it (returning false in all cases) actually improves code quality
> due to a bug in memset expansion. Therefore I'll commit it as returning false
> for now (there was no change in test results) and update it once memset is fixed
> and inlining works as expected.
>
> Returning true means memset(p, 32, 63) expands as:
>
>         mov     x2, 2314885530818453536
>         mov     x3, 2314885530818453536
>         mov     x6, 2314885530818453536
>         mov     w5, 538976288
>         mov     w4, 8224
>         mov     w1, 32
>         stp     x2, x3, [x0]
>         stp     x2, x3, [x0, 16]
>         stp     x2, x3, [x0, 32]
>         str     x6, [x0, 48]
>         str     w5, [x0, 56]
>         strh    w4, [x0, 60]
>         strb    w1, [x0, 62]
>         ret
>
> Wilco
>
>

After this patch (r256800), I have noticed new failures on aarch64:
    gcc.target/aarch64/f16_mov_immediate_1.c scan-assembler-times
mov\tw[0-9]+, #?19520 3 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_1.c scan-assembler-times
movi\tv[0-9]+\\.2s, 0x4c, lsl 8 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_1.c scan-assembler-times
movi\tv[0-9]+\\.2s, 0xbc, lsl 8 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_2.c scan-assembler-times
fmov\th[0-9], w[0-9]+ 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_2.c scan-assembler-times
mov\tw[0-9]+, 19520 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_2.c scan-assembler-times
movi\tv[0-9]+\\.2s, 0x5c, lsl 8 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_2.c scan-assembler-times
movi\tv[0-9]+\\.2s, 0x7c, lsl 8 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_2.c scan-assembler-times
movi\tv[0-9]+\\.2s, 0x80, lsl 8 1 (found 0 times)
    gcc.target/aarch64/f16_mov_immediate_2.c scan-assembler-times
movi\tv[0-9]+\\.4h, ?#0 1 (found 0 times)

Christophe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]