Table lookups - this is pretty definitive
Dmitry Olshansky
dmitry.olsh at gmail.com
Wed Apr 2 12:38:50 PDT 2014
02-Apr-2014 20:52, Daniel N пишет:
>> On Tuesday, 1 April 2014 at 18:35:50 UTC, Walter Bright wrote:
>>> Try this benchmark comparing various classification schemes:
>>>
>>> bool isIdentifierChar1(ubyte c)
>>> {
>>> return ((c >= '0' || c == '$') &&
>>> (c <= '9' || c >= 'A') &&
>>> (c <= 'Z' || c >= 'a' || c == '_') &&
>>> (c <= 'z'));
>>> }
>
> Considering SSE4.2 was released already back in 2008 and was designed to
> accelerate this very use-case...
>
> Maybe it's more beneficial to add a few new code-paths... SSE4.2, NEON,
> etc.
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.
b) A way to automatically use whatever is best and supported by the
hardware. GCC got a zero-overhead stuff for that since around 4.6 (?).
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list