From 8973b11245fab9bce34ce548c6a3dacf436a690b Mon Sep 17 00:00:00 2001 From: Sergey Grechanik Date: Tue, 7 Jun 2011 14:46:42 +0000 Subject: [PATCH] arm.c (coproc_secondary_reload_class): Return NO_REGS for constant vectors. 2011-06-07 Sergey Grechanik * config/arm/arm.c (coproc_secondary_reload_class): Return NO_REGS for constant vectors. testsuite: * gcc.target/arm/neon-reload-class.c: New test. From-SVN: r174749 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ .../gcc.target/arm/neon-reload-class.c | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/arm/neon-reload-class.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f3656fd27c2..1e19906d9d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Sergey Grechanik + + * config/arm/arm.c (coproc_secondary_reload_class): Return NO_REGS for + constant vectors. + 2011-06-07 Richard Guenther * stor-layout.c (initialize_sizetypes): Initialize all diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 057f9bae9c0..1037d9db8b7 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9079,7 +9079,7 @@ coproc_secondary_reload_class (enum machine_mode mode, rtx x, bool wb) /* The neon move patterns handle all legitimate vector and struct addresses. */ if (TARGET_NEON - && MEM_P (x) + && (MEM_P (x) || GET_CODE (x) == CONST_VECTOR) && (GET_MODE_CLASS (mode) == MODE_VECTOR_INT || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT || VALID_NEON_STRUCT_MODE (mode))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 179569065eb..05849cc82dd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-06-07 Sergey Grechanik + + * gcc.target/arm/neon-reload-class.c: New test. + 2011-06-07 Dodji Seketeli PR debug/49130 diff --git a/gcc/testsuite/gcc.target/arm/neon-reload-class.c b/gcc/testsuite/gcc.target/arm/neon-reload-class.c new file mode 100644 index 00000000000..c63aa04960c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/neon-reload-class.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-O2 -ftree-vectorize" } */ +/* { dg-add-options arm_neon } */ + + +void +_op_blend_p_caa_dp(unsigned *s, unsigned* e, unsigned *d, unsigned c) { + while (d < e) { + *d = ( (((((*s) >> 8) & 0x00ff00ff) * (c)) & 0xff00ff00) + (((((*s) & 0x00ff00ff) * (c)) >> 8) & 0x00ff00ff) ); + d++; + s++; + } +} + +/* These constants should be emitted as immediates rather than loaded from memory. */ + +/* { dg-final { scan-assembler-not "(\\.d?word|mov(w|t))" } } */ -- 2.30.2