===================================================================
@@ -0,0 +1,35 @@
+/* Testcase to check generation of a SH4 and SH2A operand cache prefetch
+ instruction PREF @Rm. */
+/* { dg-do assemble {target sh*-*-*}} */
+/* { dg-options "-O0" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" "-m4*" } } */
+/* { dg-final { scan-assembler "pref"} } */
+
+void
+opt (void)
+{
+ int *p, wk;
+ int data[100];
+
+ /* data prefetch , instructions hit the cache. */
+
+ __builtin_prefetch (&data[0], 0, 0);
+ __builtin_prefetch (&data[0], 0, 1);
+ __builtin_prefetch (&data[0], 0, 2);
+ __builtin_prefetch (&data[0], 0, 3);
+ __builtin_prefetch (&data[0], 1, 0);
+ __builtin_prefetch (&data[0], 1, 1);
+ __builtin_prefetch (&data[0], 1, 2);
+ __builtin_prefetch (&data[0], 1, 3);
+
+
+ for (p = &data[0]; p < &data[9]; p++)
+ {
+ if (*p > *(p + 1))
+ {
+ wk = *p;
+ *p = *(p + 1);
+ *(p + 1) = wk;
+ }
+ }
+}
===================================================================
@@ -1,34 +0,0 @@
-/* Testcase to check generation of a SH2A specific instruction PREF @Rm. */
-/* { dg-do assemble {target sh*-*-*}} */
-/* { dg-options "-O0" } */
-/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */
-/* { dg-final { scan-assembler "pref"} } */
-
-void
-opt (void)
-{
- int *p, wk;
- int data[100];
-
- /* data prefetch , instructions hit the cache. */
-
- __builtin_prefetch (&data[0], 0, 0);
- __builtin_prefetch (&data[0], 0, 1);
- __builtin_prefetch (&data[0], 0, 2);
- __builtin_prefetch (&data[0], 0, 3);
- __builtin_prefetch (&data[0], 1, 0);
- __builtin_prefetch (&data[0], 1, 1);
- __builtin_prefetch (&data[0], 1, 2);
- __builtin_prefetch (&data[0], 1, 3);
-
-
- for (p = &data[0]; p < &data[9]; p++)
- {
- if (*p > *(p + 1))
- {
- wk = *p;
- *p = *(p + 1);
- *(p + 1) = wk;
- }
- }
-}
===================================================================
@@ -13559,14 +13559,6 @@
}
[(set_attr "type" "other")])
-(define_insn "*prefetch_i4"
- [(prefetch (match_operand:SI 0 "register_operand" "r")
- (match_operand:SI 1 "const_int_operand" "n")
- (match_operand:SI 2 "const_int_operand" "n"))]
- "(TARGET_HARD_SH4 || TARGET_SHCOMPACT) && !TARGET_VXWORKS_RTP"
- "pref @%0";
- [(set_attr "type" "other")])
-
;; In user mode, the "pref" instruction will raise a RADDERR exception
;; for accesses to [0x80000000,0xffffffff]. This makes it an unsuitable
;; implementation of __builtin_prefetch for VxWorks RTPs.
@@ -13585,12 +13577,12 @@
operands[0] = force_reg (Pmode, operands[0]);
})
-(define_insn "prefetch_m2a"
+(define_insn "*prefetch"
[(prefetch (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
- "TARGET_SH2A"
- "pref\\t@%0"
+ "(TARGET_SH2A || TARGET_HARD_SH4 || TARGET_SHCOMPACT) && !TARGET_VXWORKS_RTP"
+ "pref @%0"
[(set_attr "type" "other")])
(define_insn "alloco_i"