From df638b278031353139556858c9cff304b4bc26c9 Mon Sep 17 00:00:00 2001 From: Jesper Nilsson Date: Mon, 3 Sep 2007 13:37:44 +0000 Subject: [PATCH] cris.h (TARGET_HAS_SWAP): Defined to describe availability of swap instruction. * 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/cris/cris.h | 1 + gcc/config/cris/cris.md | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 127f9a95356..09c06fd0c28 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-09-03 Jesper Nilsson + + * 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 * doc/invoke.texi (-fmodulo-sched-allow-regmoves): Update diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index b7b4bba43e7..7a2f714586e 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -279,6 +279,7 @@ extern int target_flags; #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) diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index 974e1d685b3..765bd8602c4 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -2671,6 +2671,13 @@ "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. -- 2.30.2