200x-xx-xx Sandra Loosemore <sandra@codesourcery.com>

gcc/
200x-xx-xx  Sandra Loosemore  <sandra@codesourcery.com>

	* longlong.h (count_leading_zeros, COUNT_LEADING_ZEROS_0): Add
	ColdFire alternatives.
	* config/m68k/m68k.h (CLZ_DEFINED_VALUE_AT_ZERO): New macro.
	* config/m68k/m68k.md (clzsi2):  Define for ColdFire
	architectures that support ff1 instruction.

From-SVN: r120959
This commit is contained in:
Sandra Loosemore 2007-01-19 08:34:59 -05:00 committed by Richard Sandiford
parent f233b84c17
commit 7a6525d680
4 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2007-01-19 Sandra Loosemore <sandra@codesourcery.com>
* longlong.h (count_leading_zeros, COUNT_LEADING_ZEROS_0): Add
ColdFire alternatives.
* config/m68k/m68k.h (CLZ_DEFINED_VALUE_AT_ZERO): New macro.
* config/m68k/m68k.md (clzsi2): Define for ColdFire
architectures that support ff1 instruction.
2007-01-19 Richard Sandiford <richard@codesourcery.com>
Julian Brown <julian@codesourcery.com>

View File

@ -1006,6 +1006,9 @@ __transfer_from_trampoline () \
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
/* The ColdFire FF1 instruction returns 32 for zero. */
#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
#define STORE_FLAG_VALUE (-1)
#define Pmode SImode

View File

@ -3961,6 +3961,15 @@
return "f<FP:prec>abs%.<FP:prec> %1,%0";
})
;; bit indexing instructions
;; ColdFire ff1 instruction implements clz.
(define_insn "clzsi2"
[(set (match_operand:SI 0 "register_operand" "=d")
(clz:SI (match_operand:SI 1 "register_operand" "0")))]
"TARGET_ISAAPLUS || TARGET_ISAC"
"ff1 %0")
;; one complement instructions
;; "one_cmpldi2" is mainly here to help combine().

View File

@ -521,6 +521,11 @@ UDItype __umulsidi3 (USItype, USItype);
__asm__ ("bfffo %1{%b2:%b2},%0" \
: "=d" ((USItype) (count)) \
: "od" ((USItype) (x)), "n" (0))
/* Some ColdFire architectures have a ff1 instruction supported via
__builtin_clz. */
#elif defined (__mcfisaaplus__) || defined (__mcfisac__)
#define count_leading_zeros(count,x) ((count) = __builtin_clz (x))
#define COUNT_LEADING_ZEROS_0 32
#endif
#endif /* mc68000 */