mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 90e9d3c90f |
@@ -88,7 +88,6 @@ objs
|
||||
# Build outputs
|
||||
/build*/
|
||||
/visual_studio/
|
||||
/originbuild/
|
||||
|
||||
# Fuzzer outputs generated by instructions in fuzz/Fuzzing.md
|
||||
/corpus.zip
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Implementation selection
|
||||
#
|
||||
set(SIMDJSON_ALL_IMPLEMENTATIONS fallback westmere haswell icelake arm64 ppc64 rvv)
|
||||
set(SIMDJSON_ALL_IMPLEMENTATIONS fallback westmere haswell icelake arm64 ppc64)
|
||||
|
||||
set(
|
||||
SIMDJSON_IMPLEMENTATION ""
|
||||
@@ -15,7 +15,7 @@ set(
|
||||
SIMDJSON_EXCLUDE_IMPLEMENTATION ""
|
||||
CACHE STRING "\
|
||||
Semicolon-separated list of implementations to exclude \
|
||||
(icelake/haswell/westmere/arm64/ppc64/rvv/fallback). By default, excludes any \
|
||||
(icelake/haswell/westmere/arm64/ppc64/fallback). By default, excludes any \
|
||||
implementations that are unsupported at compile time or cannot be selected at \
|
||||
runtime."
|
||||
)
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#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
|
||||
|
||||
@@ -21,8 +21,6 @@ namespace simdjson {
|
||||
namespace lsx {}
|
||||
#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(lasx)
|
||||
namespace lasx {}
|
||||
#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(rvv)
|
||||
namespace rvv {}
|
||||
#else
|
||||
#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#include "simdjson/lsx/implementation.h"
|
||||
#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(lasx)
|
||||
#include "simdjson/lasx/implementation.h"
|
||||
#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(rvv)
|
||||
#include "simdjson/rvv/implementation.h"
|
||||
#else
|
||||
#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include "simdjson/lsx/ondemand.h"
|
||||
#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(lasx)
|
||||
#include "simdjson/lasx/ondemand.h"
|
||||
#elif SIMDJSON_BUILTIN_IMPLEMENTATION_IS(rvv)
|
||||
#include "simdjson/rvv/ondemand.h"
|
||||
#else
|
||||
#error Unknown SIMDJSON_BUILTIN_IMPLEMENTATION
|
||||
#endif
|
||||
|
||||
@@ -199,6 +199,17 @@ double from_chars(const char *first, const char* end) noexcept;
|
||||
// We assume by default static linkage
|
||||
#define SIMDJSON_DLLIMPORTEXPORT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Workaround for the vcpkg package manager. Only vcpkg should
|
||||
* ever touch the next line. The SIMDJSON_USING_LIBRARY macro is otherwise unused.
|
||||
*/
|
||||
#if SIMDJSON_USING_LIBRARY
|
||||
#define SIMDJSON_DLLIMPORTEXPORT __declspec(dllimport)
|
||||
#endif
|
||||
/**
|
||||
* End of workaround for the vcpkg package manager.
|
||||
*/
|
||||
#else
|
||||
#define SIMDJSON_DLLIMPORTEXPORT
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define SIMDJSON_IMPLEMENTATION_ID_westmere 6
|
||||
#define SIMDJSON_IMPLEMENTATION_ID_lsx 7
|
||||
#define SIMDJSON_IMPLEMENTATION_ID_lasx 8
|
||||
#define SIMDJSON_IMPLEMENTATION_ID_rvv 9
|
||||
|
||||
#define SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL) SIMDJSON_CAT(SIMDJSON_IMPLEMENTATION_ID_, IMPL)
|
||||
#define SIMDJSON_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_IMPLEMENTATION)
|
||||
@@ -24,15 +23,6 @@
|
||||
// in which we include them.
|
||||
//
|
||||
|
||||
#ifndef SIMDJSON_IMPLEMENTATION_RVV
|
||||
#define SIMDJSON_IMPLEMENTATION_RVV (SIMDJSON_IS_RISCV64 && SIMDJSON_IS_RVV)
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_RVV && SIMDJSON_IS_RISCV64 && SIMDJSON_IS_RVV
|
||||
#define SIMDJSON_CAN_ALWAYS_RUN_RVV 1
|
||||
#else
|
||||
#define SIMDJSON_CAN_ALWAYS_RUN_RVV 0
|
||||
#endif
|
||||
|
||||
#ifndef SIMDJSON_IMPLEMENTATION_ARM64
|
||||
#define SIMDJSON_IMPLEMENTATION_ARM64 (SIMDJSON_IS_ARM64)
|
||||
#endif
|
||||
@@ -138,7 +128,7 @@
|
||||
|
||||
// Default Fallback to on unless a builtin implementation has already been selected.
|
||||
#ifndef SIMDJSON_IMPLEMENTATION_FALLBACK
|
||||
#if SIMDJSON_CAN_ALWAYS_RUN_ARM64 || SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL || SIMDJSON_CAN_ALWAYS_RUN_WESTMERE || SIMDJSON_CAN_ALWAYS_RUN_PPC64 || SIMDJSON_CAN_ALWAYS_RUN_LSX || SIMDJSON_CAN_ALWAYS_RUN_LASX || SIMDJSON_CAN_ALWAYS_RUN_RVV
|
||||
#if SIMDJSON_CAN_ALWAYS_RUN_ARM64 || SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL || SIMDJSON_CAN_ALWAYS_RUN_WESTMERE || SIMDJSON_CAN_ALWAYS_RUN_PPC64 || SIMDJSON_CAN_ALWAYS_RUN_LSX || SIMDJSON_CAN_ALWAYS_RUN_LASX
|
||||
// if anything at all except fallback can always run, then disable fallback.
|
||||
#define SIMDJSON_IMPLEMENTATION_FALLBACK 0
|
||||
#else
|
||||
@@ -164,8 +154,6 @@
|
||||
#define SIMDJSON_BUILTIN_IMPLEMENTATION lsx
|
||||
#elif SIMDJSON_CAN_ALWAYS_RUN_LASX
|
||||
#define SIMDJSON_BUILTIN_IMPLEMENTATION lasx
|
||||
#elif SIMDJSON_CAN_ALWAYS_RUN_RVV
|
||||
#define SIMDJSON_BUILTIN_IMPLEMENTATION rvv
|
||||
#elif SIMDJSON_CAN_ALWAYS_RUN_FALLBACK
|
||||
#define SIMDJSON_BUILTIN_IMPLEMENTATION fallback
|
||||
#else
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#ifndef SIMDJSON_RVV_H
|
||||
#define SIMDJSON_RVV_H
|
||||
|
||||
#include "simdjson/rvv/begin.h"
|
||||
#include "simdjson/generic/amalgamated.h"
|
||||
#include "simdjson/rvv/end.h"
|
||||
|
||||
#endif // SIMDJSON_RVV_H
|
||||
@@ -1,8 +0,0 @@
|
||||
#ifndef SIMDJSON_RVV_BASE_H
|
||||
#define SIMDJSON_RVV_BASE_H
|
||||
|
||||
#ifndef SIMDJSON_CONDITIONAL_INCLUDE
|
||||
#include "simdjson/base.h"
|
||||
#endif // SIMDJSON_CONDITIONAL_INCLUDE
|
||||
|
||||
#endif // SIMDJSON_RVV_BASE_H
|
||||
@@ -1,12 +0,0 @@
|
||||
#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"
|
||||
#include "simdjson/rvv/numberparsing_defs.h"
|
||||
#include "simdjson/rvv/simd.h"
|
||||
#include "simdjson/rvv/stringparsing_defs.h"
|
||||
|
||||
#define SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT 1
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef SIMDJSON_CONDITIONAL_INCLUDE
|
||||
#include "simdjson/rvv/base.h"
|
||||
#endif // SIMDJSON_CONDITIONAL_INCLUDE
|
||||
|
||||
#undef SIMDJSON_SKIP_BACKSLASH_SHORT_CIRCUIT
|
||||
#undef SIMDJSON_IMPLEMENTATION
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef SIMDJSON_RVV_IMPLEMENTATION_H
|
||||
#define SIMDJSON_RVV_IMPLEMENTATION_H
|
||||
|
||||
#ifndef SIMDJSON_CONDITIONAL_INCLUDE
|
||||
#define SIMDJSON_CONDITIONAL_INCLUDE
|
||||
#include "simdjson/base.h"
|
||||
#include "simdjson/implementation.h"
|
||||
#include "simdjson/internal/instruction_set.h"
|
||||
#endif // SIMDJSON_CONDITIONAL_INCLUDE
|
||||
|
||||
namespace simdjson {
|
||||
namespace rvv {
|
||||
|
||||
class implementation final: public simdjson::implementation {
|
||||
public:
|
||||
simdjson_inline implementation() : simdjson::implementation("rvv", "RISC-V Vector Extension", 0) {}
|
||||
simdjson_warn_unused error_code create_dom_parser_implementation(
|
||||
size_t capacity,
|
||||
size_t max_depth,
|
||||
std::unique_ptr<internal::dom_parser_implementation>& dst
|
||||
) const noexcept final;
|
||||
simdjson_warn_unused error_code minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept final;
|
||||
simdjson_warn_unused bool validate_utf8(const char *buf, size_t len) const noexcept final;
|
||||
};
|
||||
|
||||
} // namespace rvv
|
||||
} // namespace simdjson
|
||||
|
||||
#endif // SIMDJSON_RVV_IMPLEMENTATION_H
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef SIMDJSON_RVV_ONDEMAND_H
|
||||
#define SIMDJSON_RVV_ONDEMAND_H
|
||||
|
||||
#include "simdjson/rvv/begin.h"
|
||||
#include "simdjson/generic/ondemand/amalgamated.h"
|
||||
#include "simdjson/rvv/end.h"
|
||||
|
||||
#endif // SIMDJSON_RVV_ONDEMAND_H
|
||||
|
||||
@@ -22,9 +22,6 @@ 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
|
||||
@@ -71,7 +68,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', 'rvv' ]
|
||||
IMPLEMENTATIONS: List[Implementation] = [ 'arm64', 'haswell', 'icelake', 'lasx', 'lsx', 'ppc64', 'westmere', 'fallback' ]
|
||||
GENERIC_INCLUDE = "simdjson/generic"
|
||||
GENERIC_SRC = "generic"
|
||||
BUILTIN = "simdjson/builtin"
|
||||
@@ -358,6 +355,7 @@ 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:
|
||||
|
||||
@@ -21,19 +21,6 @@ bool implementation::supported_by_runtime_system() const {
|
||||
|
||||
#define SIMDJSON_CONDITIONAL_INCLUDE
|
||||
|
||||
#if SIMDJSON_IMPLEMENTATION_RVV
|
||||
#include <simdjson/rvv/implementation.h>
|
||||
namespace simdjson {
|
||||
namespace internal {
|
||||
static const rvv::implementation* get_rvv_singleton() {
|
||||
static const rvv::implementation rvv_singleton{};
|
||||
return &rvv_singleton;
|
||||
}
|
||||
} // namespace internal
|
||||
} // namespace simdjson
|
||||
#endif // SIMDJSON_IMPLEMENTATION_RVV
|
||||
|
||||
|
||||
#if SIMDJSON_IMPLEMENTATION_ARM64
|
||||
#include <simdjson/arm64/implementation.h>
|
||||
namespace simdjson {
|
||||
@@ -143,7 +130,6 @@ namespace internal {
|
||||
+ SIMDJSON_IMPLEMENTATION_HASWELL + SIMDJSON_IMPLEMENTATION_WESTMERE \
|
||||
+ SIMDJSON_IMPLEMENTATION_ARM64 + SIMDJSON_IMPLEMENTATION_PPC64 \
|
||||
+ SIMDJSON_IMPLEMENTATION_LSX + SIMDJSON_IMPLEMENTATION_LASX \
|
||||
+ SIMDJSON_IMPLEMENTATION_RVV \
|
||||
+ SIMDJSON_IMPLEMENTATION_FALLBACK == 1)
|
||||
|
||||
#if SIMDJSON_SINGLE_IMPLEMENTATION
|
||||
@@ -170,9 +156,6 @@ namespace internal {
|
||||
#if SIMDJSON_IMPLEMENTATION_LASX
|
||||
get_lasx_singleton();
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_RVV
|
||||
get_rvv_singleton();
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_FALLBACK
|
||||
get_fallback_singleton();
|
||||
#endif
|
||||
@@ -233,9 +216,6 @@ static const std::initializer_list<const implementation *>& get_available_implem
|
||||
#if SIMDJSON_IMPLEMENTATION_LASX
|
||||
get_lasx_singleton(),
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_RVV
|
||||
get_rvv_singleton(),
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_FALLBACK
|
||||
get_fallback_singleton(),
|
||||
#endif
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
#ifndef SIMDJSON_SRC_RVV_CPP
|
||||
#define SIMDJSON_SRC_RVV_CPP
|
||||
|
||||
#include "simdjson/rvv/implementation.h"
|
||||
|
||||
|
||||
|
||||
namespace simdjson {
|
||||
namespace rvv {
|
||||
error_code implementation::create_dom_parser_implementation(
|
||||
size_t, size_t,
|
||||
std::unique_ptr<simdjson::internal::dom_parser_implementation>&) const noexcept {
|
||||
return error_code::UNSUPPORTED_ARCHITECTURE;
|
||||
}
|
||||
} // namespace rvv
|
||||
} // namespace simdjson
|
||||
#endif // SIMDJSON_SRC_RVV_CPP
|
||||
@@ -41,9 +41,6 @@ SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS
|
||||
#if SIMDJSON_IMPLEMENTATION_LASX
|
||||
#include <lasx.cpp>
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_RVV
|
||||
#include <rvv.cpp>
|
||||
#endif
|
||||
#if SIMDJSON_IMPLEMENTATION_FALLBACK
|
||||
#include <fallback.cpp>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user