diff options
author | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-03 13:37:44 +0000 |
---|---|---|
committer | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-03 13:37:44 +0000 |
commit | a6eb30b7d0bfcd443a33692a6a65599b9483b40f (patch) | |
tree | 31ca7ad900d5114b5f8c9dd3d8a148805debc586 /gcc | |
parent | 57c36a835e63f0861b90c8501447aa96471947e5 (diff) | |
download | gcc-a6eb30b7d0bfcd443a33692a6a65599b9483b40f.tar.gz |
* config/cris/cris.h (TARGET_HAS_SWAP): Defined to describe
availability of swap instruction.
* config/cris/cris.md (bswapsi2): Implement using swap instruction.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128043 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 1 | ||||
-rw-r--r-- | gcc/config/cris/cris.md | 7 |
3 files changed, 14 insertions, 0 deletions
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 <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 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. |