freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] assembler or builtin?


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] assembler or builtin?
Date: Thu, 10 Jul 2014 22:43:39 -0400

On Mon, Jul 7, 2014 at 4:24 PM, Behdad Esfahbod <address@hidden> wrote:
> On 14-07-07 03:01 PM, Alexei Podtelezhnikov wrote:
>> Many architectures have special instructions for the most significant
>> bit: BSR on x86, CLZ on ARM. Some compilers have builtin functions for
>> that too: __builtin_clz in gcc, _BitScanReverse in VC2005 and up. What
>> would be a preferred way of using this functionality in freetype
>> for FT_MSB?
>
> I suggest using the builtins and letting the compiler designers write the
> assembler.

The proposed patch is attached. It utilizes gcc builtins to optimize
FT_MSB. FT_CONFIG_OPTION_NO_ASSEMBLER will disable it if necessary.
Please comment.

Attachment: msb.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]