This is the mail archive of the gcc-patches@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]

PATCH: Add TARGET_USE_VECTOR_FP_CONVERTS to x86 backend


Hi,

FP to FP splitters in i386.md check both feature and target with

(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)

instead of just feature. This patch adds TARGET_USE_VECTOR_FP_CONVERTS
and turns the splitter condition to just TARGET_USE_VECTOR_FP_CONVERTS.
OK for trunk?

Thanks.


H.J.
---
2008-10-08  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (initial_ix86_tune_features): Add
	X86_TUNE_USE_VECTOR_FP_CONVERTS.
	* config/i386/i386.h (ix86_tune_indices): Likewise.
	(TARGET_USE_VECTOR_FP_CONVERTS): New.

	* config/i386/i386.md: Check TARGET_USE_VECTOR_FP_CONVERTS
	instead of (TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
	for FP to FP splitters.

--- gcc/config/i386/i386.c.cvt	2008-10-08 02:46:34.000000000 -0700
+++ gcc/config/i386/i386.c	2008-10-08 02:54:11.000000000 -0700
@@ -1434,6 +1434,10 @@ static unsigned int initial_ix86_tune_fe
      replacement is long decoded, so this split helps here as well.  */
   m_K6,
 
+  /* X86_TUNE_USE_VECTOR_FP_CONVERTS: Prefer vector packed SSE conversion
+     from FP to FP. */
+  m_AMDFAM10 | m_GENERIC,
+
   /* X86_TUNE_USE_VECTOR_CONVERTS: Prefer vector packed SSE conversion
      from integer to FP. */
   m_AMDFAM10,
--- gcc/config/i386/i386.h.cvt	2008-10-08 02:46:34.000000000 -0700
+++ gcc/config/i386/i386.h	2008-10-08 02:53:17.000000000 -0700
@@ -292,6 +292,7 @@ enum ix86_tune_indices {
   X86_TUNE_MOVE_M1_VIA_OR,
   X86_TUNE_NOT_UNPAIRABLE,
   X86_TUNE_NOT_VECTORMODE,
+  X86_TUNE_USE_VECTOR_FP_CONVERTS,
   X86_TUNE_USE_VECTOR_CONVERTS,
   X86_TUNE_FUSE_CMP_AND_BRANCH,
 
@@ -375,6 +376,8 @@ extern unsigned char ix86_tune_features[
 #define	TARGET_MOVE_M1_VIA_OR	ix86_tune_features[X86_TUNE_MOVE_M1_VIA_OR]
 #define TARGET_NOT_UNPAIRABLE	ix86_tune_features[X86_TUNE_NOT_UNPAIRABLE]
 #define TARGET_NOT_VECTORMODE	ix86_tune_features[X86_TUNE_NOT_VECTORMODE]
+#define TARGET_USE_VECTOR_FP_CONVERTS \
+	ix86_tune_features[X86_TUNE_USE_VECTOR_FP_CONVERTS]
 #define TARGET_USE_VECTOR_CONVERTS \
 	ix86_tune_features[X86_TUNE_USE_VECTOR_CONVERTS]
 #define TARGET_FUSE_CMP_AND_BRANCH \
--- gcc/config/i386/i386.md.cvt	2008-10-08 02:46:34.000000000 -0700
+++ gcc/config/i386/i386.md	2008-10-08 02:52:53.000000000 -0700
@@ -4216,7 +4216,7 @@
   [(set (match_operand:DF 0 "register_operand" "")
         (float_extend:DF
 	  (match_operand:SF 1 "nonimmediate_operand" "")))]
-  "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+  "TARGET_USE_VECTOR_FP_CONVERTS
    && optimize_insn_for_speed_p ()
    && reload_completed && SSE_REG_P (operands[0])"
    [(set (match_dup 2)
@@ -4356,7 +4356,7 @@
   [(set (match_operand:SF 0 "register_operand" "")
         (float_truncate:SF
 	  (match_operand:DF 1 "nonimmediate_operand" "")))]
-  "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+  "TARGET_USE_VECTOR_FP_CONVERTS
    && optimize_insn_for_speed_p ()
    && reload_completed && SSE_REG_P (operands[0])"
    [(set (match_dup 2)


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