public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] NEON DImode not
@ 2012-02-29 15:24 Andrew Stubbs
  2012-02-29 20:03 ` Richard Earnshaw
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Stubbs @ 2012-02-29 15:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: patches

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

Hi all,

This patch adds support for the DImode not operation in NEON.

Currently the compiler must move the value to core registers, invert it 
there, and move it back again. This is bonkers because the VMVN 
instruction will do the job perfectly.

The patch adds a pattern to support VMVN in DImode (in addition to the 
vector modes already supported) and retains the support for doing 
bitwise not in core registers where appropriate.

OK for 4.8?

Andrew

[-- Attachment #2: neon-not64.patch --]
[-- Type: text/x-patch, Size: 2105 bytes --]

2012-02-29  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/arm/arm.md (one_cmpldi2): Rename to one_cmpldi2_internal
	and replace with a new define_expand.
	(one_cmpldi2_internal): Exclude splitting for VFP registers.
	* config/arm/neon.md (one_cmpldi2_neon): New pattern.

---
 gcc/config/arm/arm.md  |   13 ++++++++++---
 gcc/config/arm/neon.md |   14 ++++++++++++++
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 751997f..93fde58 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4206,12 +4206,19 @@
   "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP_DOUBLE)"
   "")
 
-(define_insn_and_split "one_cmpldi2"
+(define_expand "one_cmpldi2"
+  [(set (match_operand:DI 0 "s_register_operand" "")
+	(not:DI (match_operand:DI 1 "s_register_operand" "")))]
+  "TARGET_32BIT"
+  "")
+
+(define_insn_and_split "*one_cmpldi2_internal"
   [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
 	(not:DI (match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_32BIT"
+  "TARGET_32BIT && !TARGET_NEON"
   "#"
-  "TARGET_32BIT && reload_completed"
+  "TARGET_32BIT && reload_completed
+   && arm_general_register_operand (operands[0], DImode)"
   [(set (match_dup 0) (not:SI (match_dup 1)))
    (set (match_dup 2) (not:SI (match_dup 3)))]
   "
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index d7caa37..f34d266 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -896,6 +896,20 @@
   [(set_attr "neon_type" "neon_int_1")]
 )
 
+(define_insn "*one_cmpldi2_neon"
+  [(set (match_operand:DI 0 "s_register_operand"	 "=w,?&r,?&r,?w")
+        (not:DI (match_operand:DI 1 "s_register_operand" " w,  0,  r, w")))]
+  "TARGET_NEON"
+  "@
+   vmvn\t%P0, %P1
+   #
+   #
+   vmvn\t%P0, %P1"
+  [(set_attr "neon_type" "neon_int_1,*,*,neon_int_1")
+   (set_attr "arch" "nota8,*,*,onlya8")
+   (set_attr "length" "*,8,8,*")]
+)
+
 (define_insn "abs<mode>2"
   [(set (match_operand:VDQW 0 "s_register_operand" "=w")
 	(abs:VDQW (match_operand:VDQW 1 "s_register_operand" "w")))]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-04-05 14:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 15:24 [PATCH][ARM] NEON DImode not Andrew Stubbs
2012-02-29 20:03 ` Richard Earnshaw
2012-03-01 12:57   ` Andrew Stubbs
2012-03-01 17:07     ` Richard Earnshaw
2012-03-08 16:19       ` Andrew Stubbs
2012-03-08 18:03         ` Richard Henderson
2012-03-27 20:24           ` Andrew Stubbs
2012-03-27 20:43             ` Richard Henderson
2012-03-28 13:37             ` Ramana Radhakrishnan
2012-04-05 14:47               ` Andrew Stubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).