Table lookups - this is pretty definitive

Dmitry Olshansky dmitry.olsh at gmail.com
Wed Apr 2 14:17:48 PDT 2014


03-Apr-2014 00:46, Walter Bright пишет:
> On 4/2/2014 12:38 PM, Dmitry Olshansky wrote:
>> Ideally we'd need:
>> a) A collection of meaningful (high-level compared to std.simd)
>> primitives that
>> can be accelerated by SIMD, in Phobos. Such as searching, bit-counting
>> etc.
>
> memchr is already optimized by SIMD, and std.algorithm.find uses memchr.
> In general, enormous effort has been poured into optimizing C standard
> library functions. If an algorithm can be implemented using such
> functions, we ought to.
>

This is all good and well, but...
memchr is working on the level of a single byte, leaving nothing for 2, 
4, 8 byte-wide needles. Not type-safe. No fallback for CTFE.

Obviously C standard is lacking many things, hence the endless row of 
extensions.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list