aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2007-06-10 22:39:22 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2007-06-10 20:39:22 +0000
commit79f5e442625680fbd5c12517419e990609bb2810 (patch)
treeaa6fde364b39cc3fab0e7d98faf468b947ade3d2 /gcc/config
parent6bdff197e6b8397129441e85a53fbb3c738c3d57 (diff)
downloadgcc-79f5e442625680fbd5c12517419e990609bb2810.zip
gcc-79f5e442625680fbd5c12517419e990609bb2810.tar.gz
gcc-79f5e442625680fbd5c12517419e990609bb2810.tar.bz2
tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL.
* tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL. * tree-predcom.c (mark_virtual_ops_for_renaming): Exported. * tree-ssa-loop-prefetch.c: Include optabs.h. (FENCE_FOLLOWING_MOVNT): New macro. (struct mem_ref): Add independent_p and storent_p fields. (record_ref): Initalize the new fields. (gather_memory_references_ref): Return true if the reference could be analysed. (gather_memory_references): Check whether all memory accesses in loop were recorded. (should_issue_prefetch_p): Return false for nontemporal stores. (nontemporal_store_p, mark_nontemporal_store, emit_mfence_after_loop, may_use_storent_in_loop_p, mark_nontemporal_stores): New functions. (determine_loop_nest_reuse): Detect independent memory references. (loop_prefetch_arrays): Call mark_nontemporal_stores. * tree-flow.h (mark_virtual_ops_for_renaming): Declare. * Makefile.in (tree-ssa-loop-prefetch.o): Add OPTABS_H dependency. * config/i386/i386.h (x86_mfence): Declare. (FENCE_FOLLOWING_MOVNT): Return x86_mfence. * config/i386/i386.c (x86_mfence): New variable. (ix86_init_mmx_sse_builtins): Initialize x86_mfence. * tree-pretty-print.c (dump_generic_node): Mark nontemporal stores. * optabs.c (init_optabs): Initialize storent_optab. * optabs.h (enum optab_index): Add OTI_storent. (storent_optab): Declare. * genopinit.c (optabs): Add initialization for storent_optab. * tree.h (MOVE_NONTEMPORAL): New macro. * expr.c (expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, expand_expr_real_1): Propagate nontemporality of the expanded store. (emit_storent_insn): New function. * expr.h (expand_assignment, store_expr): Declaration changed. * function.c (assign_parm_setup_reg): Pass false as nontemporality to expand_assignment. * stmt.c (expand_asm_expr): Ditto. * calls.c (initialize_argument_information): Pass false as nontemporality to store_expr. * config/i386/sse.md (storentv4sf, storentv2df, storentv2di, storentsi): New. * gcc.dg/tree-ssa/prefetch-7.c: New test. From-SVN: r125604
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c5
-rw-r--r--gcc/config/i386/i386.h5
-rw-r--r--gcc/config/i386/sse.md32
3 files changed, 41 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index eb7ff51..f8019bd 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1500,6 +1500,9 @@ int ix86_section_threshold = 65536;
char internal_label_prefix[16];
int internal_label_prefix_len;
+/* Fence to use after loop using movnt. */
+tree x86_mfence;
+
/* Register class used for passing given 64bit part of the argument.
These represent classes as documented by the PS ABI, with the exception
of SSESF, SSEDF classes, that are basically SSE class, just gcc will
@@ -18120,7 +18123,7 @@ ix86_init_mmx_sse_builtins (void)
def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_clflush", void_ftype_pcvoid, IX86_BUILTIN_CLFLUSH);
def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_lfence", void_ftype_void, IX86_BUILTIN_LFENCE);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_mfence", void_ftype_void, IX86_BUILTIN_MFENCE);
+ x86_mfence = def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_mfence", void_ftype_void, IX86_BUILTIN_MFENCE);
def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_loaddqu", v16qi_ftype_pcchar, IX86_BUILTIN_LOADDQU);
def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_storedqu", void_ftype_pchar_v16qi, IX86_BUILTIN_STOREDQU);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 730f32b..693f8ee 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -386,6 +386,11 @@ extern int ix86_isa_flags;
#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0
#endif
+/* Fence to use after loop using storent. */
+
+extern tree x86_mfence;
+#define FENCE_FOLLOWING_MOVNT x86_mfence
+
/* Once GDB has been enhanced to deal with functions without frame
pointers, we can change this to allow for elimination of
the frame pointer in leaf functions. */
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index deb3c43..a7a5649 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -317,6 +317,38 @@
(set_attr "prefix_rep" "1")
(set_attr "mode" "TI")])
+; Expand patterns for non-temporal stores. At the moment, only those
+; that directly map to insns are defined; it would be possible to
+; define patterns for other modes that would expand to several insns.
+
+(define_expand "storentv4sf"
+ [(set (match_operand:V4SF 0 "memory_operand" "=m")
+ (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "x")]
+ UNSPEC_MOVNT))]
+ "TARGET_SSE"
+ "")
+
+(define_expand "storentv2df"
+ [(set (match_operand:V2DF 0 "memory_operand" "=m")
+ (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "x")]
+ UNSPEC_MOVNT))]
+ "TARGET_SSE2"
+ "")
+
+(define_expand "storentv2di"
+ [(set (match_operand:V2DI 0 "memory_operand" "=m")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")]
+ UNSPEC_MOVNT))]
+ "TARGET_SSE2"
+ "")
+
+(define_expand "storentsi"
+ [(set (match_operand:SI 0 "memory_operand" "=m")
+ (unspec:SI [(match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_MOVNT))]
+ "TARGET_SSE2"
+ "")
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Parallel single-precision floating point arithmetic