Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad detection of SSE2 #13

Open
inikep opened this issue Oct 15, 2016 · 2 comments
Open

bad detection of SSE2 #13

inikep opened this issue Oct 15, 2016 · 2 comments

Comments

@inikep
Copy link

inikep commented Oct 15, 2016

Prefeching is not working with gcc 4.8.4 (without -msse2):
https://travis-ci.org/inikep/lzbench/jobs/167837663

To properly check if <emmintrin.h> is available in gcc you should use:

#ifdef __SSE2__
    #include <emmintrin.h> /* requires SSE2 */
#endif
@Bulat-Ziganshin
Copy link

irrespective of this particular implementation

  1. prefetching command is a part of sse1
  2. on older cpus one can use volatile char x = *ptr instead. but it will probably will decrease perfromance on cpus that can't speculatively perform memory access, and useful only for newer cpus (pentium pro/pentium2/amd k6/k7)

@inikep
Copy link
Author

inikep commented Oct 28, 2016

True, it's supported from Visual C++ 6.0 and with gcc -msse so this should work:

#if defined(_MSC_VER) || defined(__SSE__)
#  include <xmmintrin.h>
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants