Code Monkey home page Code Monkey logo

Comments (4)

Alasdair avatar Alasdair commented on August 24, 2024 1

I think it's probably best to just remove these intrinsics for portability now that arm based macs are something we will want to support

from sail.

Alasdair avatar Alasdair commented on August 24, 2024

I think the only one I really use is bzhi_u64. I remember the performance boost was nice (but not earth shattering) on my Intel desktop in the Lab, but now I'm using an AMD ryzen on my home computer and I think the bmi instructions are actually slower than the shift and mask version:

bzhi_u64(bits,len) = bits & (UINT64_MAX >> (64 - len))

So it might be worth making it optional anyway

from sail.

MattWindsor91 avatar MattWindsor91 commented on August 24, 2024

I just ran into this, or something similar, on trying to compile sail-riscv on an Apple M1 computer (ie, AArch64) - the inclusion of x86intrin.h in sail.c produced the following (rather strange) error:

In file included from sail.c:10:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/x86intrin.h:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/immintrin.h:14:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:50:12: error: invalid conversion between vector type
      '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and many other similar errors.

On my copy there are instances of _pdep_u64 and _bzhi_u64 in sail.c, both of which can presumably be stubbed out with less efficient C equivalents on things without x86 BMI2 - I'm not sure if there are any other x86 specific things in sail? Apologies if what I'm trying to do is explicitly unsupported/will cause issues elsewhere.

from sail.

Alasdair avatar Alasdair commented on August 24, 2024

Removed in 55a91e5

from sail.

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.