Skip to content

Commit cec10d1

Browse files
author
Simon Hosie
committed
Basic rvv consistency fixes for inline headers
1 parent 760f34a commit cec10d1

File tree

5 files changed

+24
-26
lines changed

5 files changed

+24
-26
lines changed

.github/workflows/build_and_test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ jobs:
225225
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_DISABLE_VXE2=ON"
226226
elif [[ ${{ matrix.arch }} = "riscv64" ]]; then
227227
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_RVVM1=ON -DSLEEF_ENFORCE_RVVM2=ON"
228-
# Disable inline headers, they just don't compile on riscv64
229-
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_INLINE_HEADERS=OFF"
230228
fi
231229
232230
cmake -S . -B _build-${{ matrix.arch }} -GNinja \

src/libm-tester/iutsimd.c

+16-4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
#include <arm_sve.h>
5858
#endif
5959

60+
#if defined(__riscv) && defined(__riscv_v)
61+
#include <riscv_vector.h>
62+
#endif
63+
6064
#if defined(__VSX__)
6165
#include <altivec.h>
6266
#endif
@@ -344,27 +348,35 @@ typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2;
344348
#endif
345349

346350
#ifdef ENABLE_RVVM1
351+
#include "renamervvm1.h"
352+
#if !defined(USE_INLINE_HEADER)
347353
#define CONFIG 1
348354
#include "helperrvv.h"
349-
#include "renamervvm1.h"
355+
#endif
350356
#endif
351357

352358
#ifdef ENABLE_RVVM1NOFMA
359+
#include "renamervvm1nofma.h"
360+
#if !defined(USE_INLINE_HEADER)
353361
#define CONFIG 2
354362
#include "helperrvv.h"
355-
#include "renamervvm1nofma.h"
363+
#endif
356364
#endif
357365

358366
#ifdef ENABLE_RVVM2
367+
#include "renamervvm2.h"
368+
#if !defined(USE_INLINE_HEADER)
359369
#define CONFIG 1
360370
#include "helperrvv.h"
361-
#include "renamervvm2.h"
371+
#endif
362372
#endif
363373

364374
#ifdef ENABLE_RVVM2NOFMA
375+
#include "renamervvm2nofma.h"
376+
#if !defined(USE_INLINE_HEADER)
365377
#define CONFIG 2
366378
#include "helperrvv.h"
367-
#include "renamervvm2nofma.h"
379+
#endif
368380
#endif
369381

370382
#ifdef ENABLE_PUREC_SCALAR

src/libm/sleefsimddp.c

-16
Original file line numberDiff line numberDiff line change
@@ -224,51 +224,35 @@ extern const double Sleef_rempitabdp[];
224224
// RISC-V
225225
#ifdef ENABLE_RVVM1
226226
#define CONFIG 1
227-
#if !defined(SLEEF_GENHEADER)
228227
#define ENABLE_RVV_DP
229228
#include "helperrvv.h"
230-
#else
231-
#include "macroonlyRVVM1.h"
232-
#endif
233229
#ifdef DORENAME
234230
#include "renamervvm1.h"
235231
#endif
236232
#endif
237233

238234
#ifdef ENABLE_RVVM1NOFMA
239235
#define CONFIG 2
240-
#if !defined(SLEEF_GENHEADER)
241236
#define ENABLE_RVV_DP
242237
#include "helperrvv.h"
243-
#else
244-
#include "macroonlyRVVM1NOFMA.h"
245-
#endif
246238
#ifdef DORENAME
247239
#include "renamervvm1nofma.h"
248240
#endif
249241
#endif /* ENABLE_RVVM1NOFMA */
250242

251243
#ifdef ENABLE_RVVM2
252244
#define CONFIG 1
253-
#if !defined(SLEEF_GENHEADER)
254245
#define ENABLE_RVV_DP
255246
#include "helperrvv.h"
256-
#else
257-
#include "macroonlyRVVM2.h"
258-
#endif
259247
#ifdef DORENAME
260248
#include "renamervvm2.h"
261249
#endif
262250
#endif
263251

264252
#ifdef ENABLE_RVVM2NOFMA
265253
#define CONFIG 2
266-
#if !defined(SLEEF_GENHEADER)
267254
#define ENABLE_RVV_DP
268255
#include "helperrvv.h"
269-
#else
270-
#include "macroonlyRVVM2NOFMA.h"
271-
#endif
272256
#ifdef DORENAME
273257
#include "renamervvm2nofma.h"
274258
#endif

src/libm/sleefsimdsp.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ extern const float Sleef_rempitabsp[];
324324
// RISC-V
325325
#ifdef ENABLE_RVVM1
326326
#define CONFIG 1
327-
#if !defined(SLEEF_GENHEADER)
328327
#define ENABLE_RVV_SP
328+
#if !defined(SLEEF_GENHEADER)
329329
#include "helperrvv.h"
330330
#else
331331
#include "macroonlyRVVM1.h"
@@ -337,8 +337,8 @@ extern const float Sleef_rempitabsp[];
337337

338338
#ifdef ENABLE_RVVM1NOFMA
339339
#define CONFIG 2
340-
#if !defined(SLEEF_GENHEADER)
341340
#define ENABLE_RVV_SP
341+
#if !defined(SLEEF_GENHEADER)
342342
#include "helperrvv.h"
343343
#else
344344
#include "macroonlyRVVM1NOFMA.h"
@@ -350,8 +350,8 @@ extern const float Sleef_rempitabsp[];
350350

351351
#ifdef ENABLE_RVVM2
352352
#define CONFIG 1
353-
#if !defined(SLEEF_GENHEADER)
354353
#define ENABLE_RVV_SP
354+
#if !defined(SLEEF_GENHEADER)
355355
#include "helperrvv.h"
356356
#else
357357
#include "macroonlyRVVM2.h"
@@ -363,8 +363,8 @@ extern const float Sleef_rempitabsp[];
363363

364364
#ifdef ENABLE_RVVM2NOFMA
365365
#define CONFIG 2
366-
#if !defined(SLEEF_GENHEADER)
367366
#define ENABLE_RVV_SP
367+
#if !defined(SLEEF_GENHEADER)
368368
#include "helperrvv.h"
369369
#else
370370
#include "macroonlyRVVM2NOFMA.h"

src/quad-tester/qiutsimd.c

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
#include <arm_sve.h>
6161
#endif
6262

63+
#if defined(__riscv) && defined(__riscv_v)
64+
#include <riscv_vector.h>
65+
#endif
66+
6367
#if defined(__VSX__)
6468
#include <altivec.h>
6569
#endif

0 commit comments

Comments
 (0)