This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/14552] compiled trivial vector intrinsic code is ineffiencent


------- Additional Comments From uros at kss-loka dot si  2005-06-22 10:14 -------
Just for fun, I have compiled the testcase with MMX/x87 mode switching patch 
included, to check MMX vector extensions. This little patch is needed to enable 
MMX vector extensions (only MMX vector add expander is shown):

diff -upr /export/home/uros/gcc-back/gcc/config/i386/i386.h i386/i386.h
--- /export/home/uros/gcc-back/gcc/config/i386/i386.h	2005-06-08 
07:05:22.000000000 +0200
+++ i386/i386.h	2005-06-22 10:41:31.000000000 +0200
@@ -843,7 +845,8 @@ do {							
		\
 
 /* ??? No autovectorization into MMX or 3DNOW until we can reliably
    place emms and femms instructions.  */
-#define UNITS_PER_SIMD_WORD (TARGET_SSE ? 16 : UNITS_PER_WORD)
+#define UNITS_PER_SIMD_WORD						\
+    (TARGET_SSE ? 16 : TARGET_MMX ? 8 : UNITS_PER_WORD)
 
 #define VALID_FP_MODE_P(MODE)						\
     ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode		\
diff -upr /export/home/uros/gcc-back/gcc/config/i386/mmx.md i386/mmx.md
--- /export/home/uros/gcc-back/gcc/config/i386/mmx.md	2005-04-20 
21:56:15.000000000 +0200
+++ i386/mmx.md	2005-06-22 11:00:35.000000000 +0200
@@ -553,6 +553,13 @@
 ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(define_expand "add<mode>3"
+  [(set (match_operand:MMXMODEI 0 "register_operand" "")
+	(plus:MMXMODEI (match_operand:MMXMODEI 1 "nonimmediate_operand" "")
+		       (match_operand:MMXMODEI 2 "nonimmediate_operand" "")))]
+  "TARGET_MMX"
+  "ix86_fixup_binary_operands_no_copy (PLUS, <MODE>mode, operands);")
+
 (define_insn "mmx_add<mode>3"
   [(set (match_operand:MMXMODEI 0 "register_operand" "=y")
         (plus:MMXMODEI

After that, the testcase from description is compiled to (with -fomit-frame-
pointer):

test:
	movq	w, %mm0
	paddw	%mm0, %mm0
	movq	%mm0, w
	movq	%mm0, dw
	emms
	ret



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uros at kss-loka dot si


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14552


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]