Giter Club home page Giter Club logo

Comments (2)

mackron avatar mackron commented on June 14, 2024

Thanks. This is an awkward one. So this is actually coming from dr_flac, which I amalgamate into miniaudio using a tool. It's used in a tight loop deep in the decoding logic and is important that it's used if available. dr_flac will do a runtime support check to ensure the instruction is not executed if unavailable, so I don't think it's causing any harm in practice at runtime, but I'm not sure how to disable this error. I want it to still be compiled into the executable even if the compiler is targeting i386. Do you have any suggestions?

Is compilation actually succeeding, or is this presenting as an error instead of a warning? If it's a warning, since I'm doing a runtime check, I suppose silencing the warning work?

from miniaudio.

barracuda156 avatar barracuda156 commented on June 14, 2024

@mackron It causes the build to fail, but admittedly this is a minority case, and it should not be disabled for everyone because it fails here.
This seems to be a somewhat common problem, because many multimedia-related projects either simply assume that all x86 SIMD are available on all x86 cpus or rely on a compiler version check, which is of no help in fact, since a compiler may support a given flag, while assembler may not, and that will break everything.

I do not really have a neat solution here. In principle, it should be checked that an instruction from a specific SIMD type can be actually compiled (instead of using a macro to check GCC/Clang version or check support for passing -mavx etc. flags – that is useless) – that gonna ensure that both compiler and assembler can handle those. But this may be bothersome to implement, and very few users will perhaps benefit from that.
As a simple and safe solution maybe just add a configure option to turn off AXV stuff (or even SIMD altogether)? So that default behavior does not change, but if someone gets a problem, there will be a neat way to have this compiled correctly.

Given that miniaudio can be borrowed by other projects, so there will be no native configure, a macro will do: say, if someone needs to avoid AVX, just pass a cppflag -DNO_AVX, or smth to that effect.

from miniaudio.

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.