]> gcc.gnu.org Git - gcc.git/commitdiff
cris.h (TARGET_HAS_SWAP): Defined to describe availability of swap instruction.
authorJesper Nilsson <jesper.nilsson@axis.com>
Mon, 3 Sep 2007 13:37:44 +0000 (13:37 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 3 Sep 2007 13:37:44 +0000 (13:37 +0000)
* 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
gcc/config/cris/cris.h
gcc/config/cris/cris.md

index 127f9a9535654457ee3fb44bc24ecbdd0cd6e1c3..09c06fd0c286ba77295bc021abfa6c0e3228b019 100644 (file)
@@ -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
index b7b4bba43e7207cf1f76d375a74d9ac38b865acf..7a2f714586ef8d4c2fd4e0b9d1cf26eec3728e2a 100644 (file)
@@ -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)
 
index 974e1d685b3da0ab6e1086c435d91a562f249e53..765bd8602c44acc1eaa632ccf794e453f52bb2b9 100644 (file)
   "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.
This page took 0.107944 seconds and 5 git commands to generate.