Giter Site home page Giter Site logo

Comments (6)

mr-c avatar mr-c commented on June 22, 2024

Maybe controversial: When SIMD is being used, include the simde header in the generated code (like we do with the scalar operations) so the user doesn't need to have a compatible dev repo of SIMDe in their include path to compile the wasm2c output.

This is fine by me, and from the Debian side it would be nice to have a switch to easily use an installed copy of SIMDe instead of the bundled amalgated version.

from wabt.

keithw avatar keithw commented on June 22, 2024

This is fine by me, and from the Debian side it would be nice to have a switch to easily use an installed copy of SIMDe instead of the bundled amalgated version.

Sounds reasonable... maybe --external-simde or something?

from wabt.

mr-c avatar mr-c commented on June 22, 2024

Sounds reasonable... maybe --external-simde or something?

Oh, I was thinking at compile time of wasm2c output one would use -DEXTERNAL_SIMDE=/usr/include/ or similar

from wabt.

keithw avatar keithw commented on June 22, 2024

After attempting it, I'm realizing that pasting the simde header into the wasm2c generated code is going to be painful because:

  • if the module's public interface has a public-facing v128, or contains a v128 global, we have to include the header in the generated .h file (not just the .c file), and
  • the amalgamated header is 17,000 lines

Even if I try to split out the v128 definition into its own header, it still ends up pulling in about 8,000 lines because it wants simde-common.h which wants a bunch of stuff. I'm not seeing an easy way to get simde_v128 robustly without thousands of lines. And I don't really want wasm2c to be pasting all that into a generated .h file. :-(

Maaaybe the better path forward is really just to have an #include <simde/wasm/simd128.h> (in either the .h file or the .c file, depending on whether the public interface includes a v128 or there's a v128 global) and tell the user they'll need to have a compatible version of simde on hand to compile the wasm2c output. :-/

from wabt.

shravanrn avatar shravanrn commented on June 22, 2024

Seems reasonable. Based on the above, I suspect us taking ownership of amalgamating simd is going to lead to a bunch of work. Would be happy to include it as part of the output, but it would probably be easier to leave their file structure as is.

from wabt.

keithw avatar keithw commented on June 22, 2024

Merged in WebAssembly/website#334

from wabt.

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.