* config/cris/cris.h (TARGET_HAS_SWAP): Defined to describe
availability of swap instruction.
* config/cris/cris.md (bswapsi2): Implement using swap instruction.
From-SVN: r128043
+2007-09-03 Jesper Nilsson <jesper.nilsson@axis.com>
+
+ * config/cris/cris.h (TARGET_HAS_SWAP): Defined to describe
+ availability of swap instruction.
+ * config/cris/cris.md (bswapsi2): Implement using swap instruction.
+
2007-09-03 Revital Eres <eres@il.ibm.com>
* doc/invoke.texi (-fmodulo-sched-allow-regmoves): Update
#define TARGET_HAS_MUL_INSNS (cris_cpu_version >= CRIS_CPU_NG)
#define TARGET_HAS_LZ (cris_cpu_version >= CRIS_CPU_ETRAX4)
+#define TARGET_HAS_SWAP (cris_cpu_version >= CRIS_CPU_SVINTO)
#define CRIS_SUBTARGET_HANDLE_OPTION(x, y, z)
"lz %1,%0"
[(set_attr "slottable" "yes")])
+(define_insn "bswapsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (bswap:SI (match_operand:SI 1 "register_operand" "0")))]
+ "TARGET_HAS_SWAP"
+ "swapwb %0"
+ [(set_attr "slottable" "yes")])
+
;; Bound-insn. Defined to be the same as an unsigned minimum, which is an
;; operation supported by gcc. Used in casesi, but used now and then in
;; normal code too.