diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2007-09-03 13:37:44 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2007-09-03 13:37:44 +0000 |
commit | df638b278031353139556858c9cff304b4bc26c9 (patch) | |
tree | 31ca7ad900d5114b5f8c9dd3d8a148805debc586 /gcc/config | |
parent | 127494408fdf1e484d219fab9bba6d77205b868b (diff) | |
download | gcc-df638b278031353139556858c9cff304b4bc26c9.zip gcc-df638b278031353139556858c9cff304b4bc26c9.tar.gz gcc-df638b278031353139556858c9cff304b4bc26c9.tar.bz2 |
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
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/cris/cris.h | 1 | ||||
-rw-r--r-- | gcc/config/cris/cris.md | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index b7b4bba..7a2f714 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 974e1d68..765bd86 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. |