Frando / rust-faust

Easily use FAUST DSPs in Rust
Apache License 2.0
55 stars 12 forks source link

Move the platform specific assembly build at build time #19

Closed plule closed 1 year ago

plule commented 1 year ago

The conditional if cfg!(...) for platform specific optimization was evaluated at run time. Due to this, all the branches are compiled and the asm! macro fails on incompatible platform. This only happens in debug as in release the incompatible branches are optimized out early. This also used to work in previous rust versions, so possibly a change in asm! or in the debug optimization broke it.

Rewrite this platform specific code in a way that everything is evaluated at build time, by having conditional blocks with early returns instead of runtime if/else.

Jikstra commented 1 year ago

Nice :) Thank you!