Git Product home page Git Product logo

Comments (3)

danking avatar danking commented on May 18, 2024

FWIW, I expected the behavior to be to emit pandn i.e.:

__m128i _mm_andnot_si128 (__m128i a, __m128i b)

from libsimdpp.

p12tic avatar p12tic commented on May 18, 2024

Hi, I suspect that the issue is not related to libsimdpp itself as AVX equipped CPU should support the instruction in question.

Processors that support AVX also support the version of vpandn that operates on XMM registers (ref). The v in vpandn only indicates that the instruction is using VEX prefix, which is a separate instruction encoding scheme introduced on AVX. Most SSE-SSE4 instructions are available in VEX-prefixed form on AVX. AVX2 is a requirement only for instructions that operate on YMM registers.

Using non VEX instructions along with VEX instructions introduces a large performance penalty, so compilers try to use vpandn for _mm_andnot_si128 instead of older pandn from AVX onwards.

Could you please check whether running any code that just uses __m128i _mm_andnot_si128 (__m128i a, __m128i b) works on your CPU when that code is compiled for AVX? Not being able to run 128-bit vpandn instruction on AVX is very strange. The fact that CAN_RUN_X86_AVX test succeeded is even more strange, because that means that it's possible to run certain instructions with VEX prefixes but not others.

from libsimdpp.

danking avatar danking commented on May 18, 2024

Upon further investigation, I cannot reproduce the SIGILL. The only plausible explanation I have is that while moving some source code around I brought along an old binary and failed to cleanly recompile before trying to execute it. Everything is copacetic now.

My primary confusion came from looking at the assembly and the faulty thinking that vpandn was an AVX2 instruction. The Intel Intrinsics Guide doesn't list a vpandn when filtered to AVX, heh. Thanks for the pointer to http://www.felixcloutier.com/x86/, I'll be sure to check there before filing any more errant bugs 😬.

Thanks for your time and the library!

from libsimdpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.