Commit e636e508 by Jesper Nilsson Committed by Hans-Peter Nilsson

cris.h (TARGET_HAS_LZ, [...]): Defined to describe availability and behavior of CLZ.

	* config/cris/cris.h (TARGET_HAS_LZ, CLZ_DEFINED_VALUE_AT_ZERO):
	Defined to describe availability and behavior of CLZ.
	* config/cris/cris.md (clzsi2): Implement using lz instruction.
	* config/cris/cris.opt: Tweak comment for "-metrax4".
	* config/cris/arit.c (LZ): When defined, define as __builtin_clz.
	* longlong.h [__CRIS__ && __CRIS_arch_version >= 3]
	(count_leading_zeros): Define.

Co-Authored-By: Hans-Peter Nilsson <hp@axis.com>

From-SVN: r128034
parent f568cd7b
2007-09-03 Jesper Nilsson <jesper.nilsson@axis.com>
Hans-Peter Nilsson <hp@axis.com>
* config/cris/cris.h (TARGET_HAS_LZ, CLZ_DEFINED_VALUE_AT_ZERO):
Defined to describe availability and behavior of CLZ.
* config/cris/cris.md (clzsi2): Implement using lz instruction.
* config/cris/cris.opt: Tweak comment for "-metrax4".
* config/cris/arit.c (LZ): When defined, define as __builtin_clz.
* longlong.h [__CRIS__ && __CRIS_arch_version >= 3]
(count_leading_zeros): Define.
2007-09-01 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* ggc-page.c (ggc_pch_read): Call validate_free_objects.
......
......@@ -48,8 +48,7 @@ Boston, MA 02110-1301, USA.
#include "config.h"
#if defined (__CRIS_arch_version) && __CRIS_arch_version >= 3
#define LZ(v) __extension__ \
({ int tmp_; __asm__ ("lz %1,%0" : "=r" (tmp_) : "r" (v)); tmp_; })
#define LZ(v) __builtin_clz (v)
#endif
......
......@@ -278,6 +278,7 @@ extern int target_flags;
#define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_BASE
#define TARGET_HAS_MUL_INSNS (cris_cpu_version >= CRIS_CPU_NG)
#define TARGET_HAS_LZ (cris_cpu_version >= CRIS_CPU_ETRAX4)
#define CRIS_SUBTARGET_HANDLE_OPTION(x, y, z)
......@@ -1407,6 +1408,8 @@ enum cris_pic_symbol_type
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
#define Pmode SImode
#define FUNCTION_MODE QImode
......
......@@ -2663,7 +2663,14 @@
(subreg:BW (match_dup 3) 0))]
""
"operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode);")
(define_insn "clzsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(clz:SI (match_operand:SI 1 "register_operand" "r")))]
"TARGET_HAS_LZ"
"lz %1,%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.
......
......@@ -45,7 +45,7 @@ Target Report Mask(MUL_BUG)
Work around bug in multiplication instruction
; TARGET_ETRAX4_ADD: Instruction-set additions from Etrax 4 and up.
; (Just "lz", which we don't really generate from GCC -- yet).
; (Just "lz".)
metrax4
Target Report Mask(ETRAX4_ADD)
Compile for ETRAX 4 (CRIS v3)
......
......@@ -226,6 +226,10 @@ UDItype __umulsidi3 (USItype, USItype);
#define UDIV_TIME 100
#endif /* __arm__ */
#if defined (__CRIS__) && __CRIS_arch_version >= 3
#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X))
#endif /* __CRIS__ */
#if defined (__hppa) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("add %4,%5,%1\n\taddc %2,%3,%0" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment