shibatch / sleef

SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
https://sleef.org
Boost Software License 1.0
661 stars 131 forks source link

Fix RVV inline header generation #487

Open blapie opened 11 months ago

blapie commented 11 months ago

Just noticed I missed something while reviewing the RVV port. In order to make the inline header file work you need to add an extra line after (almost) each macro so it can be processed correctly.

See the examples in this patch: https://github.com/shibatch/sleef/pull/283/files#diff-ef9773efa1e59a8749e0e62f58bbe5971cce560eeebbc5918601099cb11a5457

Then hopefully you can switch the tests back on in the workflow file.

@luhenry Would you mind having a look at this?

luhenry commented 11 months ago

It's not going to be that trivial as there are conflicting types between SP and DP modes. For example, the following:


#ifdef ENABLE_RVV_SP
// Types that conflict with ENABLE_RVV_DP
#if defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA)
typedef vuint64m2_t vmask;
typedef vbool32_t vopmask;
#elif defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)
typedef vuint64m4_t vmask;
typedef vbool16_t vopmask;
#else
#error "unknown rvv lmul"
#endif
#endif

#ifdef ENABLE_RVV_DP
// Types that conflict with ENABLE_RVV_SP
#if defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA)
typedef vuint64m1_t vmask;
typedef vbool64_t vopmask;
#elif defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)
typedef vuint64m2_t vmask;
typedef vbool32_t vopmask;
#else
#error "unknown rvv lmul"
#endif
#endif

I don't really understand how to fix that up. Please find my WIP at https://github.com/shibatch/sleef/compare/master...rivosinc:sleef:fix-rvv-inline-headers

blapie commented 4 months ago

@luhenry Can we close this one? I think we are way past that now?

luhenry commented 4 months ago

Yes, it's all working now