This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AARCH64]Use shl for vec_shr_<mode> rtx pattern.
- From: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Renlin Li <renlin dot li at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Alan Lawrence <alan dot lawrence at arm dot com>
- Date: Wed, 29 Apr 2015 13:06:10 +0100
- Subject: Re: [PATCH][AARCH64]Use shl for vec_shr_<mode> rtx pattern.
- Authentication-results: sourceware.org; auth=none
- References: <553FAA25 dot 7010001 at arm dot com>
On 28 April 2015 at 16:41, Renlin Li <renlin.li@arm.com> wrote:
> Hi all,
>
> unsigned shift left dosen't support immediate shift. Previouly, gcc will
> generate asm instruction like this: "ushl d1, d0, 32", which is not a legal
> insn and will be rejected by assembler. This patch change the use of ushl in
> vec_shr_<mode> into shl.
>
> A test case is added, and it passes on both aarch64-none-elf and
> aarch64_be-none-elf tool-chain.
>
> Okay to commit?
>
> Regards,
> Renlin Li
>
> gcc/ChangeLog:
>
> 2015-04-28 Renlin Li <renlin.li@arm.com>
>
> * config/aarch64/aarch64-simd.md (vec_shr_<mode>): Use shl.
>
> gcc/testsuite/ChangeLog:
>
> 2015-04-28 Renlin Li <renlin.li@arm.com>
> Alan Lawrence <alan.lawrence@arm.com>
>
> * gcc.target/aarch64/vect-reduc-or_1.c: New.
I think there is another issue here, this change:
if (BYTES_BIG_ENDIAN)
- return "ushl %d0, %d1, %2";
+ return "shl %d0, %d1, %2";
else
return "ushr %d0, %d1, %2";
is in the context of:
(define_insn "vec_shr_<mode>"
[(set (match_operand:VD 0 "register_operand" "=w")
(lshiftrt:VD (match_operand:VD 1 "register_operand" "w")
(match_operand:SI 2 "immediate_operand" "i")))]
The RTL describes a right shift of the bits within each element in the
vector while the optab expects a right shift of the elements within
the vector?
/Marcus