+2008-11-24 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ PR target/35018
+ * config/m68k/m68k.md (ok_for_coldfire, enabled): New attributes.
+ (addsi_lshrsi_31): Add ColdFire-friendly alternatives.
+
2008-11-24 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (UNSPECV_CMPXCHG): Rename from
(define_attr "size" "1,2,3"
(symbol_ref "m68k_sched_attr_size (insn)"))
+;; Alternative is OK for ColdFire.
+(define_attr "ok_for_coldfire" "yes,no" (const_string "yes"))
+
+;; Define 'enabled' attribute.
+(define_attr "enabled" ""
+ (cond [(and (ne (symbol_ref "TARGET_COLDFIRE") (const_int 0))
+ (eq_attr "ok_for_coldfire" "no"))
+ (const_int 0)]
+ (const_int 1)))
\f
;; Mode macros for floating point operations.
;; Valid floating point modes
})
(define_insn "addsi_lshrsi_31"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
- (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm,dm,d<Q>")
+ (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm,r<Q>,rm")
(const_int 31))
(match_dup 1)))]
""
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (operands[3]));
return "";
-})
+}
+ [(set_attr "ok_for_coldfire" "no,yes,yes")])
(define_expand "addsi3"
[(set (match_operand:SI 0 "nonimmediate_operand" "")
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Os -mcpu=5249" } */
+
+static inline void vect_add(int *x, int *y, int n)
+{
+ asm volatile ("nop;"
+ : [n] "+d" (n), [x] "+a" (x), [y] "+a" (y)
+ : : "%d0", "%d1", "%d2", "%d3", "%a0", "%a1", "%a2", "%a3",
+ "cc", "memory");
+}
+
+extern void vect_copy (int *, int *, int);
+
+void vorbis_synthesis_blockin(int *blocksizes)
+{
+ int j, *pcm, *p;
+
+ int n=blocksizes[*p]/2;
+ int n0=blocksizes[0]/2;
+ int n1=blocksizes[1]/2;
+
+ for(j=0;j<*p;j++)
+ {
+ vect_add(p, pcm, n1);
+ vect_add(pcm, p, n0);
+ vect_add(p, pcm, n0);
+ vect_add(p, pcm, n0);
+ vect_copy(pcm, p, n);
+ }
+}
+