aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-12-11 22:40:27 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-12-11 22:40:27 -0800
commit14291bc7fa7e391243dfa1077d96c8246374d319 (patch)
treea52a8160ddc621b801a25bf5456b2c0ff598fc8c
parent8deb7514502cebe4e025bd278a511fd930dc28e0 (diff)
downloadgcc-14291bc7fa7e391243dfa1077d96c8246374d319.zip
gcc-14291bc7fa7e391243dfa1077d96c8246374d319.tar.gz
gcc-14291bc7fa7e391243dfa1077d96c8246374d319.tar.bz2
alpha.h (TARGET_FIXUP_EV5_PREFETCH): New.
* config/alpha/alpha.h (TARGET_FIXUP_EV5_PREFETCH): New. * config/alpha/linux.h (TARGET_FIXUP_EV5_PREFETCH): New. * config/alpha/alpha.md (prefetch): New. From-SVN: r47922
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/alpha/alpha.h3
-rw-r--r--gcc/config/alpha/alpha.md38
-rw-r--r--gcc/config/alpha/linux.h4
4 files changed, 51 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2cdcef5..3911062 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2001-12-11 Richard Henderson <rth@redhat.com>
+ * config/alpha/alpha.h (TARGET_FIXUP_EV5_PREFETCH): New.
+ * config/alpha/linux.h (TARGET_FIXUP_EV5_PREFETCH): New.
+ * config/alpha/alpha.md (prefetch): New.
+
+2001-12-11 Richard Henderson <rth@redhat.com>
+
* combine.c (simplify_and_const_int): Simplify (AND (PLUS X Y) C)
if C has only low bits set and doesn't intersect with X or Y.
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 504fe88..3fc2796 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -206,6 +206,9 @@ extern enum alpha_fp_trap_mode alpha_fptm;
#ifndef TARGET_LD_BUGGY_LDGP
#define TARGET_LD_BUGGY_LDGP 0
#endif
+#ifndef TARGET_FIXUP_EV5_PREFETCH
+#define TARGET_FIXUP_EV5_PREFETCH 0
+#endif
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index c5c8009..d1634aa 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -6716,6 +6716,44 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
[(set_attr "length" "16")
(set_attr "type" "multi")])
+;; Prefetch data.
+;;
+;; On EV4, these instructions are nops -- no load occurs.
+;;
+;; On EV5, these instructions act as a normal load, and thus can trap
+;; if the address is invalid. The OS may (or may not) handle this in
+;; the entMM fault handler and suppress the fault. If so, then this
+;; has the effect of a read prefetch instruction.
+;;
+;; On EV6, these become official prefetch instructions.
+
+(define_insn "prefetch"
+ [(prefetch (match_operand:DI 0 "address_operand" "p")
+ (match_operand:DI 1 "const_int_operand" "n")
+ (match_operand:DI 2 "const_int_operand" "n"))]
+ "TARGET_FIXUP_EV5_PREFETCH || TARGET_CPU_EV6"
+{
+ /* Interpret "no temporal locality" as this data should be evicted once
+ it is used. The "evict next" alternatives load the data into the cache
+ and leave the LRU eviction counter pointing to that block. */
+ static const char * const alt[2][2] = {
+ {
+ "lds $f31,%a0", /* read, evict next */
+ "ldl $31,%a0", /* read, evict last */
+ },
+ {
+ "ldt $f31,%a0", /* write, evict next */
+ "ldq $31,%a0", /* write, evict last */
+ }
+ };
+
+ bool write = INTVAL (operands[1]) != 0;
+ bool lru = INTVAL (operands[2]) != 0;
+
+ return alt[write][lru];
+}
+ [(set_attr "type" "ild")])
+
;; Close the trap shadow of preceding instructions. This is generated
;; by alpha_reorg.
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index e2a6e60..8a1b93f 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -46,6 +46,10 @@ SUB_CPP_PREDEFINES
#undef TARGET_CAN_FAULT_IN_PROLOGUE
#define TARGET_CAN_FAULT_IN_PROLOGUE 1
+/* OS fixes up EV5 data fault on prefetch. */
+#undef TARGET_FIXUP_EV5_PREFETCH
+#define TARGET_FIXUP_EV5_PREFETCH 1
+
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"