From d3bd561b77151c9704f0503dc44597e382e42903 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Wed, 3 Sep 2025 16:08:30 -0400 Subject: [PATCH] fixing amalgamation. --- include/simdjson/builtin.h | 2 ++ include/simdjson/rvv/begin.h | 14 +------------- include/simdjson/rvv/end.h | 11 +++++------ singleheader/amalgamate.py | 6 ++++-- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/include/simdjson/builtin.h b/include/simdjson/builtin.h index 4788007f8..b1e08ace3 100644 --- a/include/simdjson/builtin.h +++ b/include/simdjson/builtin.h @@ -24,6 +24,8 @@ #include "simdjson/lsx.h" #elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(lasx) #include "simdjson/lasx.h" +#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(rvv) +#include "simdjson/rvv.h" #else #error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION #endif diff --git a/include/simdjson/rvv/begin.h b/include/simdjson/rvv/begin.h index 91a4338e3..10d5dbfce 100644 --- a/include/simdjson/rvv/begin.h +++ b/include/simdjson/rvv/begin.h @@ -1,15 +1,7 @@ -#ifndef SIMDJSON_RVV_BEGIN_H -#define SIMDJSON_RVV_BEGIN_H - -#ifndef SIMDJSON_CONDITIONAL_INCLUDE -#include "simdjson/base.h" -#endif - - -#undef SIMDJSON_IMPLEMENTATION #define SIMDJSON_IMPLEMENTATION rvv // include RVV intrinsics and definitions +#include "simdjson/rvv/base.h" #include "simdjson/rvv/intrinsics.h" #include "simdjson/rvv/bitmanipulation.h" #include "simdjson/rvv/bitmask.h" @@ -17,8 +9,4 @@ #include "simdjson/rvv/simd.h" #include "simdjson/rvv/stringparsing_defs.h" -#ifndef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT #define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1 -#endif - -#endif // SIMDJSON_RVV_BEGIN_H \ No newline at end of file diff --git a/include/simdjson/rvv/end.h b/include/simdjson/rvv/end.h index 313b80bbd..27ff15a99 100644 --- a/include/simdjson/rvv/end.h +++ b/include/simdjson/rvv/end.h @@ -1,7 +1,6 @@ -#ifndef SIMDJSON_RVV_END_H -#define SIMDJSON_RVV_END_H +#ifndef SIMDJSON_CONDITIONAL_INCLUDE +#include "simdjson/rvv/base.h" +#endif // SIMDJSON_CONDITIONAL_INCLUDE -// Symmetrical to arm64/end.h: currently empty, exists only for structural completeness. -// Any local macros to be cleaned up can be placed here in the future. - -#endif // SIMDJSON_RVV_END_H \ No newline at end of file +#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT +#undef SIMDJSON_IMPLEMENTATION diff --git a/singleheader/amalgamate.py b/singleheader/amalgamate.py index 6b556a783..d4cb9d1b0 100755 --- a/singleheader/amalgamate.py +++ b/singleheader/amalgamate.py @@ -22,6 +22,9 @@ rules = """ We refer your to the HACKING.md file for more information on how the project is organized. +If you are trying to add a new implementation, you need to edit the amalgamate.py script +to add your implementation to the IMPLEMENTATIONS list. + To help understand the error, here are the rules for including files in simdjson: All implementation-specific files, including arm64.h, arm64/implementation.h and @@ -68,7 +71,7 @@ else: RelativeRoot = str # Literal['src','include'] # Literal not supported in Python 3.7 (CI) RELATIVE_ROOTS: List[RelativeRoot] = ['src', 'include' ] Implementation = str # Literal['arm64', 'fallback', 'haswell', 'icelake', 'ppc64', 'westmere', 'lsx', 'lasx'] # Literal not supported in Python 3.7 (CI) -IMPLEMENTATIONS: List[Implementation] = [ 'arm64', 'haswell', 'icelake', 'lasx', 'lsx', 'ppc64', 'westmere', 'fallback' ] +IMPLEMENTATIONS: List[Implementation] = [ 'arm64', 'haswell', 'icelake', 'lasx', 'lsx', 'ppc64', 'westmere', 'fallback', 'rvv' ] GENERIC_INCLUDE = "simdjson/generic" GENERIC_SRC = "generic" BUILTIN = "simdjson/builtin" @@ -355,7 +358,6 @@ class Amalgamator: self.include_stack.append(file) file.processed = False - self.write(f"/* begin file {self.file_to_str(file)} */") if file == BUILTIN_BEGIN_H: