regex direct support for sse4 intrinsics

2012-03-26 Thread Jay Norwood
The sse4 capabilities include a range mode of string matching, that lets you match characters in a 16 byte string based on a 16 byte set of start and stop character ranges. See the _SIDD_CMP_RANGES mode in the table. For example, the pattern in some of our examples for finding the start of a wo

Re: regex direct support for sse4 intrinsics

2012-03-26 Thread Dmitry Olshansky
On 26.03.2012 22:14, Jay Norwood wrote: The sse4 capabilities include a range mode of string matching, that lets you match characters in a 16 byte string based on a 16 byte set of start and stop character ranges. See the _SIDD_CMP_RANGES mode in the table. For example, the pattern in some of ou

Re: regex direct support for sse4 intrinsics

2012-03-26 Thread Timon Gehr
On 03/26/2012 09:10 PM, Dmitry Olshansky wrote: Speaking more of run-time version of regex, it is essentially running a VM that executes instructions that do various kinds of match-this, match-that. The VM dispatch code is quite slow, the optimal _threaded_ code requires either doing it in _asse

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread bearophile
Dmitry Olshansky: > Speaking more of run-time version of regex, it is essentially running a > VM that executes instructions that do various kinds of match-this, > match-that. The VM dispatch code is quite slow, the optimal _threaded_ > code requires either doing it in _assembly_ or _computed_ g

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Martin Nowak
Both GCC and LLVM back-ends support computed gotos (despite the asm produced by LLVM on them is not as good as GCC one). If people feel the desire to add compiler-specific computed gotos to D, they will risk adding them with a different syntax on each present and future compiler. What did y

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Martin Nowak
GotoStatement: http://dlang.org/statement.html#GotoStatement

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread bearophile
Martin Nowak: > What did you had in mind? > > The following would only require a minor syntax change. > > auto codeaddr = &Label; > goto codeaddr + 0x10; Something like this: Label1: //... Label2: //... Label3: //... enum void*[3] targs = [&Label1, &Label2, &Label3]; int i = 2; // run-time

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Dmitry Olshansky
On 27.03.2012 1:07, Timon Gehr wrote: On 03/26/2012 09:10 PM, Dmitry Olshansky wrote: Speaking more of run-time version of regex, it is essentially running a VM that executes instructions that do various kinds of match-this, match-that. The VM dispatch code is quite slow, the optimal _threaded_

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread kraybourne
On 3/27/12 13:37 , bearophile wrote: Something like this: Label1: //... Label2: //... Label3: //... enum void*[3] targs = [&Label1,&Label2,&Label3]; int i = 2; // run-time value goto targs[i]; +1, this would be sweet

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Martin Nowak
enum void*[3] targs = [&Label1, &Label2, &Label3]; int i = 2; // run-time value goto targs[i]; Yeah, that would work with the extension.

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread bearophile
Martin Nowak: The following would only require a minor syntax change. auto codeaddr = &Label; goto codeaddr + 0x10; GotoStatement: goto Identifier ; goto Expression ; // NEW goto default ; goto case ; goto case Expression ; You also need to support &Label, that currently

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Timon Gehr
On 03/27/2012 01:37 PM, bearophile wrote: See: http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Labels-as-Values.html (I'd like to know why GCC uses&&Label instead of&Label). Because labels reside in their own namespace.

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread bearophile
Timon Gehr: On 03/27/2012 01:37 PM, bearophile wrote: See: http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Labels-as-Values.html (I'd like to know why GCC uses&&Label instead of&Label). Because labels reside in their own namespace. I see. That's probably true in D too. But if possible I think th

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Martin Nowak
On Tue, 27 Mar 2012 17:01:51 +0200, bearophile < You also need to support &Label, that currently is "Error: undefined identifier Label". Bye, bearophile That doesn't require a syntax addition. One would only need to lookup the label and detect naming collisions with other declarations.

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread Tove
On Tuesday, 27 March 2012 at 09:51:07 UTC, bearophile wrote: Dmitry Olshansky: Speaking more of run-time version of regex, it is essentially running a VM that executes instructions that do various kinds of match-this, match-that. The VM dispatch code is quite slow, the optimal _threaded_ code

Re: regex direct support for sse4 intrinsics

2012-03-27 Thread bearophile
Tove: I'm very surprised by your findings by computed gotos... the compiler I am most used to(rvct for arm)... seems proficient in emitting jump table instructions(TBB, TBH) for thumb2... but based on your findings I will definitely re-check the generated asm. You have also to take in accou