From 0efe7d8796e00a5737017fe472680b653bd83d90 Mon Sep 17 00:00:00 2001 From: Andre Simoes Dias Vieira Date: Fri, 20 Mar 2020 09:07:10 +0000 Subject: [PATCH] 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 * config/arm/mve.md (mve_mov): Fix R->R case. gcc/testsuite/ChangeLog: 2020-03-20 Andre Vieira * gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c: New test. --- gcc/ChangeLog | 4 ++++ gcc/config/arm/mve.md | 4 ++-- gcc/testsuite/ChangeLog | 4 ++++ .../arm/mve/intrinsics/mve_move_gpr_to_gpr.c | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 00dd10c7f1f..ccda62fdd42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2020-03-20 Andre Vieira + + * config/arm/mve.md (mve_mov): Fix R->R case. + 2020-03-20 Jakub Jelinek PR tree-optimization/94224 diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index 5667882e941..b80a2a66044 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -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,*,*,*")]) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d11f3fe0171..a039f9658ae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-03-20 Andre Vieira + + * gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c: New test. + 2020-03-20 Jakub Jelinek PR tree-optimization/94224 diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c new file mode 100644 index 00000000000..791b8529a05 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_move_gpr_to_gpr.c @@ -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); +} + -- 2.30.2