2012/4/25 Vitaly Repeshko <vita...@chromium.org>

> On Wed, Apr 25, 2012 at 1:24 AM, Alexandre Rames
> <alexandre.ra...@gmail.com> wrote:
> > Not using the intrinsic shouldn't make any difference here.
> >
> > But __popcnt is the intrinsic, not the instruction. Shouldn't MS compiler
> > automatically detect hardware support and use another solution if the
> popcnt
> > isn't available.
>
> Maybe it should, but it's not what the MSDN page says it does. If it
> did, this code code would have to check some global flag every time,
> which would be more expensive than the operation itself, or require
> some patching in runtime.
>
> He probably meant compile time checking.
I used to implement some sse and avx intrinsics in Sun compiler and it also
does not provide generic implementation (emulation) for instruction related
intrinsics.
Btw their declarations are guarded by corresponding ifdefs in system
headers, so you cannot place a call to intrinsic which is not supported by
the target arch.
As for some other intrinsics (not instruction related), e.g. memcpy,
strlen, compiler provides multiple implementations that make full use of
available instruction set.

Alexei


> -- Vitaly
>
> >
> > On Wed, Apr 25, 2012 at 9:22 AM, Florian Schneider <
> fschnei...@chromium.org>
> > wrote:
> >>
> >> Hm, interesting. I assume that we don't instruct g++ or msvc to generate
> >> any fancy SSE4.1 instructions anyway because V8 has to run on old
> non-SSE
> >> hardware - in which case the benefit of using the compiler intrinsics is
> >> probably void.
> >>
> >> Den 24. apr. 2012 19.20 skrev Vitaly Repeshko <vita...@chromium.org>:
> >>
> >>> FYI. http://msdn.microsoft.com/en-us/library/bb385231.aspx says "If
> >>> you run code that uses this intrinsic on hardware that does not
> >>> support the popcnt instruction, the results are unpredictable."
> >>>
> >>>
> >>> -- Vitaly
> >>>
> >>> On Tue, Apr 24, 2012 at 10:03 AM, Florian Schneider
> >>> <fschnei...@chromium.org> wrote:
> >>> > You're welcome. The Win32 builder still not happy. I'm not so
> familiar
> >>> > with
> >>> > our Windows buildbot configuration, so I'm fixing it for now by just
> >>> > avoiding the problematic compiler intrinsic
> >>> > (http://code.google.com/p/v8/source/detail?r=11428) It should not
> make
> >>> > a big
> >>> > difference, should it?
> >>> >
> >>> >
> >>> >
> >>> > Den 24. apr. 2012 18.14 skrev Alexandre Rames
> >>> > <alexandre.ra...@gmail.com>:
> >>> >
> >>> >> Thanks!
> >>> >>
> >>> >>
> >>> >> On Tue, Apr 24, 2012 at 4:36 PM, <fschnei...@chromium.org> wrote:
> >>> >>>
> >>> >>> Thanks. Still LGTM.
> >>> >>>
> >>> >>> I'll re-land it
> >>> >>>
> >>> >>> http://codereview.chromium.org/9638018/
> >>> >>
> >>> >>
> >>> >
> >>> > --
> >>> > v8-dev mailing list
> >>> > v8-dev@googlegroups.com
> >>> > http://groups.google.com/group/v8-dev
> >>>
> >>> --
> >>> v8-dev mailing list
> >>> v8-dev@googlegroups.com
> >>> http://groups.google.com/group/v8-dev
> >>
> >>
> >
> > --
> > v8-dev mailing list
> > v8-dev@googlegroups.com
> > http://groups.google.com/group/v8-dev
>

-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to