gcc, Arm: Fix MVE move from GPR -> GPR

This patch fixes the pattern mve_mov for the case where both MVE vectors are in
R registers and the move does not get optimized away.  I use the same approach
as we do for NEON, where we use four register moves.

gcc/ChangeLog:
2020-03-20  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/arm/mve.md (mve_mov<mode>): Fix R->R case.

gcc/testsuite/ChangeLog:
2020-03-20  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c: New test.
This commit is contained in:
Andre Simoes Dias Vieira 2020-03-20 09:07:10 +00:00 committed by Andre Vieira
parent 4119cd693d
commit 0efe7d8796
4 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2020-03-20 Andre Vieira <andre.simoesdiasvieira@arm.com>
* config/arm/mve.md (mve_mov<mode>): Fix R->R case.
2020-03-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/94224

View File

@ -663,7 +663,7 @@
else
return "vldrb.8 %q0, %E1";
case 5:
return output_move_neon (operands);
return output_move_quad (operands);
case 7:
return "vstrb.8 %q1, %E0";
default:
@ -671,7 +671,7 @@
return "";
}
}
[(set_attr "type" "mve_move,mve_move,mve_move,mve_move,mve_load,mve_move,mve_move,mve_store")
[(set_attr "type" "mve_move,mve_move,mve_move,mve_move,mve_load,multiple,mve_move,mve_store")
(set_attr "length" "4,8,8,4,8,8,4,4")
(set_attr "thumb2_pool_range" "*,*,*,*,1018,*,*,*")
(set_attr "neg_pool_range" "*,*,*,*,996,*,*,*")])

View File

@ -1,3 +1,7 @@
2020-03-20 Andre Vieira <andre.simoesdiasvieira@arm.com>
* gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c: New test.
2020-03-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/94224

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
/* { dg-add-options arm_v8_1m_mve_fp } */
/* { dg-additional-options "-O2 -mfloat-abi=softfp" } */
#include "arm_mve.h"
extern int bar (float16x8_t, float16_t);
extern void foobar (float16_t);
int
foo (float16x8_t a, float16_t b)
{
foobar (b);
return bar (a, b);
}