From 479ccabc33e25efefa9925320764c929b387a152 Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Wed, 15 Apr 2020 12:53:46 +0100 Subject: [PATCH] Arm: MVE: Add mve vec_duplicate pattern This patch fixes an ICE we were seeing due to a missing vec_duplicate pattern. gcc/ChangeLog: 2020-04-15 Andre Vieira * config/arm/mve.md (mve_vec_duplicate): New pattern. (V_sz_elem2): Remove unused mode attribute. gcc/testsuite/ChangeLog: 2020-04-15 Andre Vieira Srinath Parvathaneni * gcc.target/arm/mve/intrinsics/mve_vec_duplicate.c: New test. --- gcc/ChangeLog | 5 +++++ gcc/config/arm/mve.md | 9 +++++++-- gcc/testsuite/ChangeLog | 5 +++++ .../arm/mve/intrinsics/mve_vec_duplicate.c | 13 +++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vec_duplicate.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 82e0cd61b00..80e21dced64 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-04-15 Andre Vieira + + * config/arm/mve.md (mve_vec_duplicate): New pattern. + (V_sz_elem2): Remove unused mode attribute. + 2020-04-15 Matthew Malcomson * config/arm/arm.md (arm_movdi): Disallow for MVE. diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index 7054f7bf096..9cb18ef50e8 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -17,8 +17,6 @@ ;; along with GCC; see the file COPYING3. If not see ;; . -(define_mode_attr V_sz_elem2 [(V16QI "s8") (V8HI "u16") (V4SI "u32") - (V2DI "u64")]) (define_mode_iterator MVE_types [V16QI V8HI V4SI V2DI TI V8HF V4SF V2DF]) (define_mode_iterator MVE_VLD_ST [V16QI V8HI V4SI V8HF V4SF]) (define_mode_iterator MVE_0 [V8HF V4SF]) @@ -11302,6 +11300,13 @@ [(set_attr "type" "mve_move") (set_attr "length" "8")]) +(define_insn "*mve_vec_duplicate" + [(set (match_operand:MVE_VLD_ST 0 "s_register_operand" "=w") + (vec_duplicate:MVE_VLD_ST (match_operand: 1 "general_operand" "r")))] + "TARGET_HAVE_MVE || TARGET_HAVE_MVE_FLOAT" + "vdup.\t%q0, %1" + [(set_attr "type" "mve_move")]) + ;; CDE instructions on MVE registers. (define_insn "arm_vcx1qv16qi" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0804bf57457..e4fc22197e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-04-15 Andre Vieira + Srinath Parvathaneni + + * gcc.target/arm/mve/intrinsics/mve_vec_duplicate.c: New test. + 2020-04-15 Jakub Jelinek PR c/94593 diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vec_duplicate.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vec_duplicate.c new file mode 100644 index 00000000000..eda836151b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_vec_duplicate.c @@ -0,0 +1,13 @@ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +float32x4_t a; + +void foo (void) +{ + a = 1.41176471f - 0.47058824f * a; +} + -- 2.30.2