Re: [mpm@selenic.com: Re: buggy ia64_fls() ? (was Re: /dev/random problem on 2.6.12-rc1)]

From: David Mosberger <davidm_at_napali.hpl.hp.com>
Date: 2005-04-09 09:19:57
>>>>> On Fri, 8 Apr 2005 16:15:43 -0700, Matt Mackall <mpm@selenic.com> said:

  >> Fixing fls() is trivial:

  >> static inline int fls (int x) { if (!x) return 0; return
  >> ia64_fls((unsigned int) x) + 1; }

  Matt> I was trying desperately to avoid the branch, as I understand
  Matt> there are issues there on IA64.

That shouldn't be necessary.  The branch will be predicated anyhow:

                   cmp4.eq p7,p6=0,r32;;
             (p07) mov r8=r0
             (p07) br.ret.dptk.many b0

Direct branches (and returns) are generally very fast on Itanium 2.
Only indirect branches need some help from the compiler, an area
where GCC/ia64 doesn't do well at the moment.

	--david
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Apr 8 19:20:13 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:37 EST