This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR82964: Fix 128-bit immediate ICEs
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: James Greenhalgh <James dot Greenhalgh at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Wed, 17 Jan 2018 16:22:45 +0000
- Subject: Re: [PATCH] PR82964: Fix 128-bit immediate ICEs
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- Nodisclaimer: True
- References: <DB6PR0801MB2053FB1EE13D95936C2E700683EB0@DB6PR0801MB2053.eurprd08.prod.outlook.com>,<20180116171244.GB9235@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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