swesterfeld / spectmorph

SpectMorph: spectral audio morphing
http://www.spectmorph.org
GNU Lesser General Public License v2.1
67 stars 6 forks source link

__m128 alternatives outside #ifdef __SSE__ ? #12

Closed XieJiSS closed 2 years ago

XieJiSS commented 3 years ago

Some platforms do not have __m128.

Is it possible to replace it with unsigned __int128, etc.? I'm not sure whether this will break data alignment or not.

swesterfeld commented 3 years ago

I am assuming you report this because SpectMorph doesn't compile on your platform (which platform?). My suggestion would be to replace

      __m128 out[(block_size + 2) / 4 + 1];   // SSE alignment (should be done by compiler)
      float *spectrum = reinterpret_cast <float *> (&out[0]);

with

      alignas (16) float spectrum[block_size + 2]; // SSE alignment

This should ensure alignment without using any __foo tricks which may not be supported on some platforms. Please try if that fixes building SpectMorph for you.

XieJiSS commented 3 years ago

@swesterfeld Yes, I'm trying to build SpectMorph on RISC-V (more specifically, rv64gc). Thanks for your help, now I can make it compiles successfully. I'll try to make a PR regarding this (and an additional fix for another compile error) ASAP.