react-native-quick-crypto 1.0.19 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/QuickCrypto.podspec +12 -38
- package/README.md +2 -0
- package/android/CMakeLists.txt +3 -0
- package/cpp/utils/HybridUtils.cpp +39 -77
- package/deps/simdutf/.clang-format +4 -0
- package/deps/simdutf/.github/ISSUE_TEMPLATE/bug_report.md +62 -0
- package/deps/simdutf/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/deps/simdutf/.github/ISSUE_TEMPLATE/feature_request.md +35 -0
- package/deps/simdutf/.github/ISSUE_TEMPLATE/standard-issue-template.md +29 -0
- package/deps/simdutf/.github/pull_request_template.md +51 -0
- package/deps/simdutf/.github/workflows/aarch64.yml +39 -0
- package/deps/simdutf/.github/workflows/alpine.yml +27 -0
- package/deps/simdutf/.github/workflows/amalgamation_demos.yml +34 -0
- package/deps/simdutf/.github/workflows/armv7.yml +32 -0
- package/deps/simdutf/.github/workflows/atomic_fuzz.yml +25 -0
- package/deps/simdutf/.github/workflows/cifuzz.yml +37 -0
- package/deps/simdutf/.github/workflows/clangformat.yml +36 -0
- package/deps/simdutf/.github/workflows/debian-latestcxxstandards.yml +40 -0
- package/deps/simdutf/.github/workflows/debian.yml +33 -0
- package/deps/simdutf/.github/workflows/documentation.yml +36 -0
- package/deps/simdutf/.github/workflows/emscripten.yml +19 -0
- package/deps/simdutf/.github/workflows/loongarch64-gcc-14.2.yml +39 -0
- package/deps/simdutf/.github/workflows/macos-latest.yml +29 -0
- package/deps/simdutf/.github/workflows/msys2-clang.yml +48 -0
- package/deps/simdutf/.github/workflows/msys2.yml +50 -0
- package/deps/simdutf/.github/workflows/ppc64le.yml +29 -0
- package/deps/simdutf/.github/workflows/rvv-1024-clang-18.yml +35 -0
- package/deps/simdutf/.github/workflows/rvv-128-clang-17.yml +35 -0
- package/deps/simdutf/.github/workflows/rvv-256-gcc-14.yml +31 -0
- package/deps/simdutf/.github/workflows/s390x.yml +29 -0
- package/deps/simdutf/.github/workflows/selective-amalgamation.yml +29 -0
- package/deps/simdutf/.github/workflows/typos.yml +19 -0
- package/deps/simdutf/.github/workflows/ubuntu22-cxx20.yml +30 -0
- package/deps/simdutf/.github/workflows/ubuntu22.yml +32 -0
- package/deps/simdutf/.github/workflows/ubuntu22_gcc12.yml +27 -0
- package/deps/simdutf/.github/workflows/ubuntu22sani.yml +29 -0
- package/deps/simdutf/.github/workflows/ubuntu24-cxxstandards.yml +34 -0
- package/deps/simdutf/.github/workflows/ubuntu24-unsignedchar.yml +34 -0
- package/deps/simdutf/.github/workflows/ubuntu24.yml +32 -0
- package/deps/simdutf/.github/workflows/ubuntu24sani.yml +36 -0
- package/deps/simdutf/.github/workflows/ubuntu24sani_clang.yml +29 -0
- package/deps/simdutf/.github/workflows/vs17-arm-ci.yml +21 -0
- package/deps/simdutf/.github/workflows/vs17-ci-cxx20.yml +41 -0
- package/deps/simdutf/.github/workflows/vs17-ci.yml +41 -0
- package/deps/simdutf/.github/workflows/vs17-clang-ci.yml +41 -0
- package/deps/simdutf/.github/workflows/vs17-cxxstandards.yml +36 -0
- package/deps/simdutf/AI_USAGE_POLICY.md +56 -0
- package/deps/simdutf/AUTHORS +6 -0
- package/deps/simdutf/CMakeLists.txt +231 -0
- package/deps/simdutf/CONTRIBUTING.md +214 -0
- package/deps/simdutf/CONTRIBUTORS +1 -0
- package/deps/simdutf/Doxyfile +2584 -0
- package/deps/simdutf/LICENSE-APACHE +201 -0
- package/deps/simdutf/LICENSE-MIT +18 -0
- package/deps/simdutf/Makefile.crosscompile +54 -0
- package/deps/simdutf/README-RVV.md +16 -0
- package/deps/simdutf/README.md +2782 -0
- package/deps/simdutf/SECURITY.md +8 -0
- package/deps/simdutf/benchmarks/CMakeLists.txt +101 -0
- package/deps/simdutf/benchmarks/alignment.cpp +150 -0
- package/deps/simdutf/benchmarks/base64/CMakeLists.txt +30 -0
- package/deps/simdutf/benchmarks/base64/benchmark_base64.cpp +875 -0
- package/deps/simdutf/benchmarks/base64/libbase64_spaces.h +49 -0
- package/deps/simdutf/benchmarks/base64/node_base64.h +227 -0
- package/deps/simdutf/benchmarks/base64/openssl3_base64.h +334 -0
- package/deps/simdutf/benchmarks/benchmark.cpp +65 -0
- package/deps/simdutf/benchmarks/benchmark_to_well_formed_utf16.cpp +347 -0
- package/deps/simdutf/benchmarks/competition/.clang-format-ignore +5 -0
- package/deps/simdutf/benchmarks/competition/CppCon2018/utf_utils.cpp +1276 -0
- package/deps/simdutf/benchmarks/competition/CppCon2018/utf_utils.h +595 -0
- package/deps/simdutf/benchmarks/competition/README.md +7 -0
- package/deps/simdutf/benchmarks/competition/hoehrmann/hoehrmann.h +91 -0
- package/deps/simdutf/benchmarks/competition/inoue2008/inoue_utf8_to_utf16.h +444 -0
- package/deps/simdutf/benchmarks/competition/inoue2008/inoue_utf8_to_utf16_tables.h +13183 -0
- package/deps/simdutf/benchmarks/competition/inoue2008/script.py +73 -0
- package/deps/simdutf/benchmarks/competition/llvm/ConvertUTF.cpp +738 -0
- package/deps/simdutf/benchmarks/competition/llvm/ConvertUTF.h +293 -0
- package/deps/simdutf/benchmarks/competition/u8u16/COPYRIGHT +8 -0
- package/deps/simdutf/benchmarks/competition/u8u16/Makefile +44 -0
- package/deps/simdutf/benchmarks/competition/u8u16/OSL3.0.txt +169 -0
- package/deps/simdutf/benchmarks/competition/u8u16/Profiling/BOM_Profiler.h +148 -0
- package/deps/simdutf/benchmarks/competition/u8u16/Profiling/i386_timer.h +45 -0
- package/deps/simdutf/benchmarks/competition/u8u16/Profiling/ppc_timer.c +34 -0
- package/deps/simdutf/benchmarks/competition/u8u16/README +56 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/config_defs.h +43 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/g4_config.h +27 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/mmx_config.h +16 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/p4_config.h +18 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/p4_ideal_config.h +16 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/spu_config.h +28 -0
- package/deps/simdutf/benchmarks/competition/u8u16/config/ssse3_config.h +20 -0
- package/deps/simdutf/benchmarks/competition/u8u16/iconv_u8u16.c +2 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/altivec_simd.h +440 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_basic_ops.py +121 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_half_operand_versions.py +158 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_test.py +270 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd.h +141 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_basic.h +216 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_built_in.h +119 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_modified.h +2430 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/outline.txt +39 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/spu_simd.h +421 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/sse_simd.h +836 -0
- package/deps/simdutf/benchmarks/competition/u8u16/lib/stdint.h +222 -0
- package/deps/simdutf/benchmarks/competition/u8u16/libu8u16_BE.c +4 -0
- package/deps/simdutf/benchmarks/competition/u8u16/libu8u16_LE.c +5 -0
- package/deps/simdutf/benchmarks/competition/u8u16/proto/u8u16.py +390 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/Makefile +18 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/bytelex.h +448 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/charsets/ASCII_EBCDIC.h +284 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.c +1975 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.pdf +0 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.w +2263 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/multiliteral.h +239 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/u8u16.c +232 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/x8x16.c +194 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/xml_error.c +193 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/xml_error.h +167 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/xmldecl.c +288 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/xmldecl.h +117 -0
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_g4.c +2 -0
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_mmx.c +2 -0
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_p4.c +3 -0
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_p4_ideal.c +2 -0
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_spu.c +2 -0
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_ssse3.c +3 -0
- package/deps/simdutf/benchmarks/competition/u8u16/x8x16_p4.c +2 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/LICENSE +23 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/data/test_minimal.txt +44 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/readme.md +106 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_clang_corr_tests.cmd +11 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_clang_corr_tests.sh +13 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_corr_tests.sh +13 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_example.sh +13 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_file_conv.sh +14 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_iconv_lib.sh +11 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_iconv_sample.sh +8 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_corr_tests.cmd +12 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_example.cmd +13 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_file_conv.cmd +14 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_iconv_lib.cmd +11 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_iconv_sample.cmd +8 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_corr_tests.cmd +11 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_example.cmd +12 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_file_conv.cmd +13 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_iconv_lib.cmd +10 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_iconv_sample.cmd +9 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/html_table.py +25 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/measure.py +94 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/resize.py +20 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/wipe_all.cmd +2 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/wipe_interm.cmd +1 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/CustomMemcpy.h +75 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/PerfDefs.h +47 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/Timing.cpp +17 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/Timing.h +76 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/AllProcessors.cpp +35 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BaseBufferProcessor.cpp +117 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BaseBufferProcessor.h +210 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BufferDecoder.h +158 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BufferEncoder.h +104 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/ProcessorPlugins.h +334 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/ProcessorSelector.h +186 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderLut.cpp +140 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderLut.h +42 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderProcess.h +100 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/Dfa.h +57 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderLut.cpp +85 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderLut.h +27 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderProcess.h +126 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/ProcessTrivial.h +108 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/iconv/iconv.cpp +139 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/iconv/iconv.h +74 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/message/MessageConverter.cpp +65 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/message/MessageConverter.h +91 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/CorrectnessTests.cpp +772 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/Example.cpp +12 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/FileConverter.cpp +486 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/iconv_sample.c +162 -0
- package/deps/simdutf/benchmarks/competition/utf8lut/src/utf8lut.h +15 -0
- package/deps/simdutf/benchmarks/competition/utf8sse4/fromutf8-sse.cpp +292 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/LICENSE +23 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/README.md +1503 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/checked.h +335 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/core.h +338 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/cpp11.h +103 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/cpp17.h +103 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/unchecked.h +274 -0
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8.h +34 -0
- package/deps/simdutf/benchmarks/dataset/README.md +155 -0
- package/deps/simdutf/benchmarks/dataset/emoji.txt +204 -0
- package/deps/simdutf/benchmarks/dataset/scripts/utf8type.py +40 -0
- package/deps/simdutf/benchmarks/dataset/wikipedia_mars/Makefile +80 -0
- package/deps/simdutf/benchmarks/dataset/wikipedia_mars/convert_to_utf6.py +20 -0
- package/deps/simdutf/benchmarks/find/CMakeLists.txt +6 -0
- package/deps/simdutf/benchmarks/find/findbenchmark.cpp +63 -0
- package/deps/simdutf/benchmarks/find/findbenchmarker.h +46 -0
- package/deps/simdutf/benchmarks/shortbench.cpp +555 -0
- package/deps/simdutf/benchmarks/src/CMakeLists.txt +52 -0
- package/deps/simdutf/benchmarks/src/apple_arm_events.h +1104 -0
- package/deps/simdutf/benchmarks/src/benchmark.cpp +3899 -0
- package/deps/simdutf/benchmarks/src/benchmark.h +317 -0
- package/deps/simdutf/benchmarks/src/benchmark_base.cpp +144 -0
- package/deps/simdutf/benchmarks/src/benchmark_base.h +98 -0
- package/deps/simdutf/benchmarks/src/cmdline.cpp +176 -0
- package/deps/simdutf/benchmarks/src/cmdline.h +35 -0
- package/deps/simdutf/benchmarks/src/event_counter.h +162 -0
- package/deps/simdutf/benchmarks/src/linux-perf-events.h +104 -0
- package/deps/simdutf/benchmarks/stream.cpp +209 -0
- package/deps/simdutf/benchmarks/threaded.cpp +123 -0
- package/deps/simdutf/cmake/CPM.cmake +1363 -0
- package/deps/simdutf/cmake/JoinPaths.cmake +23 -0
- package/deps/simdutf/cmake/add_cpp_test.cmake +68 -0
- package/deps/simdutf/cmake/simdutf-config.cmake.in +2 -0
- package/deps/simdutf/cmake/simdutf-flags.cmake +26 -0
- package/deps/simdutf/cmake/toolchains-ci/riscv64-linux-gnu.cmake +4 -0
- package/deps/simdutf/cmake/toolchains-dev/README.md +32 -0
- package/deps/simdutf/cmake/toolchains-dev/aarch64.cmake +14 -0
- package/deps/simdutf/cmake/toolchains-dev/loongarch64.cmake +22 -0
- package/deps/simdutf/cmake/toolchains-dev/powerpc64.cmake +16 -0
- package/deps/simdutf/cmake/toolchains-dev/powerpc64le.cmake +16 -0
- package/deps/simdutf/cmake/toolchains-dev/riscv64.cmake +16 -0
- package/deps/simdutf/cmake/toolchains-dev/rvv-spike.cmake +38 -0
- package/deps/simdutf/doc/avx512.png +0 -0
- package/deps/simdutf/doc/logo.png +0 -0
- package/deps/simdutf/doc/logo.svg +165 -0
- package/deps/simdutf/doc/node2023.png +0 -0
- package/deps/simdutf/doc/shortinput.md +78 -0
- package/deps/simdutf/doc/utf16utf8.png +0 -0
- package/deps/simdutf/doc/utf8utf16.png +0 -0
- package/deps/simdutf/doc/widelogo.png +0 -0
- package/deps/simdutf/doxygen.py +50 -0
- package/deps/simdutf/fuzz/.clang-format +9 -0
- package/deps/simdutf/fuzz/CMakeLists.txt +45 -0
- package/deps/simdutf/fuzz/README.md +168 -0
- package/deps/simdutf/fuzz/atomic_base64.cpp +448 -0
- package/deps/simdutf/fuzz/base64.cpp +278 -0
- package/deps/simdutf/fuzz/build.sh +83 -0
- package/deps/simdutf/fuzz/conversion.cpp +669 -0
- package/deps/simdutf/fuzz/helpers/.clang-format-ignore +1 -0
- package/deps/simdutf/fuzz/helpers/common.h +135 -0
- package/deps/simdutf/fuzz/helpers/nameof.hpp +1258 -0
- package/deps/simdutf/fuzz/main.cpp +72 -0
- package/deps/simdutf/fuzz/minimize_and_cleanse.sh +87 -0
- package/deps/simdutf/fuzz/misc.cpp +216 -0
- package/deps/simdutf/fuzz/random_fuzz.sh +154 -0
- package/deps/simdutf/fuzz/roundtrip.cpp +588 -0
- package/deps/simdutf/fuzz/safe_conversion.cpp +104 -0
- package/deps/simdutf/include/simdutf/avx512.h +79 -0
- package/deps/simdutf/include/simdutf/base64_implementation.h +158 -0
- package/deps/simdutf/include/simdutf/base64_tables.h +887 -0
- package/deps/simdutf/include/simdutf/common_defs.h +186 -0
- package/deps/simdutf/include/simdutf/compiler_check.h +50 -0
- package/deps/simdutf/include/simdutf/constexpr_ptr.h +138 -0
- package/deps/simdutf/include/simdutf/encoding_types.h +189 -0
- package/deps/simdutf/include/simdutf/error.h +126 -0
- package/deps/simdutf/include/simdutf/implementation.h +7081 -0
- package/deps/simdutf/include/simdutf/internal/isadetection.h +325 -0
- package/deps/simdutf/include/simdutf/portability.h +285 -0
- package/deps/simdutf/include/simdutf/scalar/ascii.h +86 -0
- package/deps/simdutf/include/simdutf/scalar/atomic_util.h +105 -0
- package/deps/simdutf/include/simdutf/scalar/base64.h +911 -0
- package/deps/simdutf/include/simdutf/scalar/latin1.h +26 -0
- package/deps/simdutf/include/simdutf/scalar/latin1_to_utf16/latin1_to_utf16.h +52 -0
- package/deps/simdutf/include/simdutf/scalar/latin1_to_utf32/latin1_to_utf32.h +27 -0
- package/deps/simdutf/include/simdutf/scalar/latin1_to_utf8/latin1_to_utf8.h +191 -0
- package/deps/simdutf/include/simdutf/scalar/swap_bytes.h +35 -0
- package/deps/simdutf/include/simdutf/scalar/utf16.h +226 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/utf16_to_latin1.h +108 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/valid_utf16_to_latin1.h +40 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/utf16_to_utf32.h +86 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/valid_utf16_to_utf32.h +44 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/utf16_to_utf8.h +295 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/valid_utf16_to_utf8.h +91 -0
- package/deps/simdutf/include/simdutf/scalar/utf32.h +82 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/utf32_to_latin1.h +68 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/valid_utf32_to_latin1.h +67 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/utf32_to_utf16.h +84 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/valid_utf32_to_utf16.h +44 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/utf32_to_utf8.h +142 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/valid_utf32_to_utf8.h +72 -0
- package/deps/simdutf/include/simdutf/scalar/utf8.h +326 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/utf8_to_latin1.h +225 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/valid_utf8_to_latin1.h +87 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/utf8_to_utf16.h +342 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/valid_utf8_to_utf16.h +106 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/utf8_to_utf32.h +299 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/valid_utf8_to_utf32.h +83 -0
- package/deps/simdutf/include/simdutf/simdutf_version.h +26 -0
- package/deps/simdutf/include/simdutf.h +26 -0
- package/deps/simdutf/include/simdutf_c.h +342 -0
- package/deps/simdutf/riscv/Dockerfile +16 -0
- package/deps/simdutf/riscv/README.md +24 -0
- package/deps/simdutf/riscv/remove-docker-station +8 -0
- package/deps/simdutf/riscv/run-docker-station +31 -0
- package/deps/simdutf/scripts/.flake8 +2 -0
- package/deps/simdutf/scripts/Makefile +2 -0
- package/deps/simdutf/scripts/README_ADD_FUNCTION.md +49 -0
- package/deps/simdutf/scripts/add_function.py +330 -0
- package/deps/simdutf/scripts/amalgamation_tests.py +156 -0
- package/deps/simdutf/scripts/base64/Makefile +2 -0
- package/deps/simdutf/scripts/base64/README.md +2 -0
- package/deps/simdutf/scripts/base64/avx512.py +76 -0
- package/deps/simdutf/scripts/base64/neon_decode.py +143 -0
- package/deps/simdutf/scripts/base64/neon_generate_lut.py +101 -0
- package/deps/simdutf/scripts/base64/sse.py +252 -0
- package/deps/simdutf/scripts/base64/sseregular.py +160 -0
- package/deps/simdutf/scripts/base64/sseurl.py +283 -0
- package/deps/simdutf/scripts/base64/table.py +59 -0
- package/deps/simdutf/scripts/base64bench_print.py +145 -0
- package/deps/simdutf/scripts/benchmark-all.py +119 -0
- package/deps/simdutf/scripts/benchmark_print.py +324 -0
- package/deps/simdutf/scripts/check_feature_macros.py +156 -0
- package/deps/simdutf/scripts/check_typos.sh +13 -0
- package/deps/simdutf/scripts/clang_format.sh +35 -0
- package/deps/simdutf/scripts/clang_format_docker.sh +38 -0
- package/deps/simdutf/scripts/common.py +24 -0
- package/deps/simdutf/scripts/compilation_benchmark.py +55 -0
- package/deps/simdutf/scripts/compile_many_variations.sh +64 -0
- package/deps/simdutf/scripts/create_latex_table.py +62 -0
- package/deps/simdutf/scripts/docker/Dockerfile +14 -0
- package/deps/simdutf/scripts/docker/Makefile +9 -0
- package/deps/simdutf/scripts/docker/README.md +30 -0
- package/deps/simdutf/scripts/docker/llvm.gpg +0 -0
- package/deps/simdutf/scripts/ppc64_convert_utf16_to_utf8.py +155 -0
- package/deps/simdutf/scripts/prepare_doxygen.sh +21 -0
- package/deps/simdutf/scripts/release.py +197 -0
- package/deps/simdutf/scripts/shortinputplots.py +97 -0
- package/deps/simdutf/scripts/sse_convert_utf16_to_utf8.py +422 -0
- package/deps/simdutf/scripts/sse_convert_utf32_to_utf16.py +105 -0
- package/deps/simdutf/scripts/sse_utf8_utf16_decode.py +186 -0
- package/deps/simdutf/scripts/sse_validate_utf16le_proof.py +137 -0
- package/deps/simdutf/scripts/sse_validate_utf16le_testcases.py +129 -0
- package/deps/simdutf/scripts/table.py +207 -0
- package/deps/simdutf/scripts/tests/new.txt +33 -0
- package/deps/simdutf/scripts/tests/old.txt +33 -0
- package/deps/simdutf/scripts/tests/results.txt +272 -0
- package/deps/simdutf/simdutf.pc.in +11 -0
- package/deps/simdutf/singleheader/.flake8 +2 -0
- package/deps/simdutf/singleheader/CMakeLists.txt +64 -0
- package/deps/simdutf/singleheader/README-dev.md +81 -0
- package/deps/simdutf/singleheader/README.md +19 -0
- package/deps/simdutf/singleheader/amalgamate.py +513 -0
- package/deps/simdutf/singleheader/amalgamation_demo.c +59 -0
- package/deps/simdutf/singleheader/amalgamation_demo.cpp +54 -0
- package/deps/simdutf/singleheader/test-features.py +262 -0
- package/deps/simdutf/src/CMakeLists.txt +78 -0
- package/deps/simdutf/src/arm64/arm_base64.cpp +791 -0
- package/deps/simdutf/src/arm64/arm_convert_latin1_to_utf16.cpp +24 -0
- package/deps/simdutf/src/arm64/arm_convert_latin1_to_utf32.cpp +24 -0
- package/deps/simdutf/src/arm64/arm_convert_latin1_to_utf8.cpp +70 -0
- package/deps/simdutf/src/arm64/arm_convert_utf16_to_latin1.cpp +61 -0
- package/deps/simdutf/src/arm64/arm_convert_utf16_to_utf32.cpp +185 -0
- package/deps/simdutf/src/arm64/arm_convert_utf16_to_utf8.cpp +780 -0
- package/deps/simdutf/src/arm64/arm_convert_utf32_to_latin1.cpp +60 -0
- package/deps/simdutf/src/arm64/arm_convert_utf32_to_utf16.cpp +208 -0
- package/deps/simdutf/src/arm64/arm_convert_utf32_to_utf8.cpp +505 -0
- package/deps/simdutf/src/arm64/arm_convert_utf8_to_latin1.cpp +69 -0
- package/deps/simdutf/src/arm64/arm_convert_utf8_to_utf16.cpp +313 -0
- package/deps/simdutf/src/arm64/arm_convert_utf8_to_utf32.cpp +179 -0
- package/deps/simdutf/src/arm64/arm_find.cpp +199 -0
- package/deps/simdutf/src/arm64/arm_utf16fix.cpp +185 -0
- package/deps/simdutf/src/arm64/arm_validate_utf16.cpp +165 -0
- package/deps/simdutf/src/arm64/arm_validate_utf32le.cpp +65 -0
- package/deps/simdutf/src/arm64/implementation.cpp +1442 -0
- package/deps/simdutf/src/encoding_types.cpp +67 -0
- package/deps/simdutf/src/error.cpp +3 -0
- package/deps/simdutf/src/fallback/implementation.cpp +589 -0
- package/deps/simdutf/src/generic/ascii_validation.h +50 -0
- package/deps/simdutf/src/generic/base64.h +233 -0
- package/deps/simdutf/src/generic/base64lengths.h +63 -0
- package/deps/simdutf/src/generic/buf_block_reader.h +109 -0
- package/deps/simdutf/src/generic/find.h +75 -0
- package/deps/simdutf/src/generic/utf16/change_endianness.h +24 -0
- package/deps/simdutf/src/generic/utf16/count_code_points_bytemask.h +58 -0
- package/deps/simdutf/src/generic/utf16/to_well_formed.h +93 -0
- package/deps/simdutf/src/generic/utf16/utf32_length_from_utf16.h +15 -0
- package/deps/simdutf/src/generic/utf16/utf8_length_from_utf16.h +35 -0
- package/deps/simdutf/src/generic/utf16/utf8_length_from_utf16_bytemask.h +199 -0
- package/deps/simdutf/src/generic/utf16.h +73 -0
- package/deps/simdutf/src/generic/utf32.h +136 -0
- package/deps/simdutf/src/generic/utf8/utf16_length_from_utf8_bytemask.h +53 -0
- package/deps/simdutf/src/generic/utf8.h +92 -0
- package/deps/simdutf/src/generic/utf8_to_latin1/utf8_to_latin1.h +316 -0
- package/deps/simdutf/src/generic/utf8_to_latin1/valid_utf8_to_latin1.h +78 -0
- package/deps/simdutf/src/generic/utf8_to_utf16/utf8_to_utf16.h +332 -0
- package/deps/simdutf/src/generic/utf8_to_utf16/valid_utf8_to_utf16.h +74 -0
- package/deps/simdutf/src/generic/utf8_to_utf32/utf8_to_utf32.h +318 -0
- package/deps/simdutf/src/generic/utf8_to_utf32/valid_utf8_to_utf32.h +42 -0
- package/deps/simdutf/src/generic/utf8_validation/utf8_lookup4_algorithm.h +223 -0
- package/deps/simdutf/src/generic/utf8_validation/utf8_validator.h +84 -0
- package/deps/simdutf/src/generic/validate_utf16.h +164 -0
- package/deps/simdutf/src/generic/validate_utf32.h +99 -0
- package/deps/simdutf/src/haswell/avx2_base64.cpp +837 -0
- package/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf16.cpp +28 -0
- package/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf32.cpp +20 -0
- package/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf8.cpp +83 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf16_to_latin1.cpp +83 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf32.cpp +210 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf8.cpp +602 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf32_to_latin1.cpp +116 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf16.cpp +164 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf8.cpp +569 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf8_to_latin1.cpp +60 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf16.cpp +195 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf32.cpp +135 -0
- package/deps/simdutf/src/haswell/avx2_utf16fix.cpp +173 -0
- package/deps/simdutf/src/haswell/avx2_validate_utf16.cpp +17 -0
- package/deps/simdutf/src/haswell/implementation.cpp +1447 -0
- package/deps/simdutf/src/icelake/icelake_ascii_validation.inl.cpp +19 -0
- package/deps/simdutf/src/icelake/icelake_base64.inl.cpp +630 -0
- package/deps/simdutf/src/icelake/icelake_common.inl.cpp +37 -0
- package/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf16.inl.cpp +36 -0
- package/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf32.inl.cpp +23 -0
- package/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf8.inl.cpp +107 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf16_to_latin1.inl.cpp +103 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf32.inl.cpp +136 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf8.inl.cpp +206 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf32_to_latin1.inl.cpp +74 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf16.inl.cpp +338 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf8.inl.cpp +574 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf8_to_latin1.inl.cpp +104 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf8_to_utf16.inl.cpp +75 -0
- package/deps/simdutf/src/icelake/icelake_convert_valid_utf8_to_latin1.inl.cpp +69 -0
- package/deps/simdutf/src/icelake/icelake_find.inl.cpp +146 -0
- package/deps/simdutf/src/icelake/icelake_from_utf8.inl.cpp +266 -0
- package/deps/simdutf/src/icelake/icelake_from_valid_utf8.inl.cpp +136 -0
- package/deps/simdutf/src/icelake/icelake_macros.inl.cpp +143 -0
- package/deps/simdutf/src/icelake/icelake_utf16fix.cpp +138 -0
- package/deps/simdutf/src/icelake/icelake_utf32_validation.inl.cpp +63 -0
- package/deps/simdutf/src/icelake/icelake_utf8_common.inl.cpp +753 -0
- package/deps/simdutf/src/icelake/icelake_utf8_length_from_utf16.inl.cpp +269 -0
- package/deps/simdutf/src/icelake/icelake_utf8_validation.inl.cpp +116 -0
- package/deps/simdutf/src/icelake/implementation.cpp +1903 -0
- package/deps/simdutf/src/implementation.cpp +2526 -0
- package/deps/simdutf/src/lasx/implementation.cpp +1531 -0
- package/deps/simdutf/src/lasx/lasx_base64.cpp +695 -0
- package/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf16.cpp +76 -0
- package/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf32.cpp +55 -0
- package/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf8.cpp +65 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf16_to_latin1.cpp +64 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf32.cpp +183 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf8.cpp +550 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf32_to_latin1.cpp +73 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf16.cpp +218 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf8.cpp +589 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf8_to_latin1.cpp +72 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf16.cpp +296 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf32.cpp +190 -0
- package/deps/simdutf/src/lasx/lasx_find.cpp +64 -0
- package/deps/simdutf/src/lasx/lasx_validate_utf16.cpp +13 -0
- package/deps/simdutf/src/lasx/lasx_validate_utf32le.cpp +84 -0
- package/deps/simdutf/src/lsx/implementation.cpp +1417 -0
- package/deps/simdutf/src/lsx/lsx_base64.cpp +675 -0
- package/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf16.cpp +39 -0
- package/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf32.cpp +27 -0
- package/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf8.cpp +56 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf16_to_latin1.cpp +64 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf32.cpp +133 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf8.cpp +518 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf32_to_latin1.cpp +66 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf16.cpp +155 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp +459 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf8_to_latin1.cpp +75 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf16.cpp +291 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf32.cpp +179 -0
- package/deps/simdutf/src/lsx/lsx_find.cpp +60 -0
- package/deps/simdutf/src/lsx/lsx_validate_utf16.cpp +13 -0
- package/deps/simdutf/src/lsx/lsx_validate_utf32le.cpp +68 -0
- package/deps/simdutf/src/ppc64/implementation.cpp +992 -0
- package/deps/simdutf/src/ppc64/ppc64_base64.cpp +480 -0
- package/deps/simdutf/src/ppc64/ppc64_base64_internal_tests.cpp +401 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf16.cpp +12 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf32.cpp +12 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf8.cpp +149 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_latin1.cpp +67 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf32.cpp +87 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf8.cpp +296 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_latin1.cpp +57 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf16.cpp +117 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf8.cpp +166 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_latin1.cpp +69 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf16.cpp +211 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf32.cpp +153 -0
- package/deps/simdutf/src/ppc64/ppc64_utf16_to_utf8_tables.h +1011 -0
- package/deps/simdutf/src/ppc64/ppc64_utf8_length_from_latin1.cpp +37 -0
- package/deps/simdutf/src/ppc64/ppc64_validate_utf16.cpp +19 -0
- package/deps/simdutf/src/ppc64/templates.cpp +91 -0
- package/deps/simdutf/src/rvv/implementation.cpp +138 -0
- package/deps/simdutf/src/rvv/rvv_find.cpp +27 -0
- package/deps/simdutf/src/rvv/rvv_helpers.inl.cpp +23 -0
- package/deps/simdutf/src/rvv/rvv_latin1_to.inl.cpp +71 -0
- package/deps/simdutf/src/rvv/rvv_length_from.inl.cpp +164 -0
- package/deps/simdutf/src/rvv/rvv_utf16_to.inl.cpp +399 -0
- package/deps/simdutf/src/rvv/rvv_utf16fix.cpp +110 -0
- package/deps/simdutf/src/rvv/rvv_utf32_to.inl.cpp +307 -0
- package/deps/simdutf/src/rvv/rvv_utf8_to.inl.cpp +435 -0
- package/deps/simdutf/src/rvv/rvv_validate.inl.cpp +275 -0
- package/deps/simdutf/src/simdutf/arm64/begin.h +2 -0
- package/deps/simdutf/src/simdutf/arm64/bitmanipulation.h +34 -0
- package/deps/simdutf/src/simdutf/arm64/end.h +2 -0
- package/deps/simdutf/src/simdutf/arm64/implementation.h +307 -0
- package/deps/simdutf/src/simdutf/arm64/intrinsics.h +10 -0
- package/deps/simdutf/src/simdutf/arm64/simd.h +547 -0
- package/deps/simdutf/src/simdutf/arm64/simd16-inl.h +403 -0
- package/deps/simdutf/src/simdutf/arm64/simd32-inl.h +129 -0
- package/deps/simdutf/src/simdutf/arm64/simd64-inl.h +28 -0
- package/deps/simdutf/src/simdutf/arm64.h +43 -0
- package/deps/simdutf/src/simdutf/fallback/begin.h +1 -0
- package/deps/simdutf/src/simdutf/fallback/bitmanipulation.h +13 -0
- package/deps/simdutf/src/simdutf/fallback/end.h +1 -0
- package/deps/simdutf/src/simdutf/fallback/implementation.h +331 -0
- package/deps/simdutf/src/simdutf/fallback.h +42 -0
- package/deps/simdutf/src/simdutf/haswell/begin.h +15 -0
- package/deps/simdutf/src/simdutf/haswell/bitmanipulation.h +35 -0
- package/deps/simdutf/src/simdutf/haswell/end.h +13 -0
- package/deps/simdutf/src/simdutf/haswell/implementation.h +338 -0
- package/deps/simdutf/src/simdutf/haswell/intrinsics.h +67 -0
- package/deps/simdutf/src/simdutf/haswell/simd.h +363 -0
- package/deps/simdutf/src/simdutf/haswell/simd16-inl.h +261 -0
- package/deps/simdutf/src/simdutf/haswell/simd32-inl.h +111 -0
- package/deps/simdutf/src/simdutf/haswell/simd64-inl.h +34 -0
- package/deps/simdutf/src/simdutf/haswell.h +63 -0
- package/deps/simdutf/src/simdutf/icelake/begin.h +14 -0
- package/deps/simdutf/src/simdutf/icelake/bitmanipulation.h +44 -0
- package/deps/simdutf/src/simdutf/icelake/end.h +12 -0
- package/deps/simdutf/src/simdutf/icelake/implementation.h +346 -0
- package/deps/simdutf/src/simdutf/icelake/intrinsics.h +138 -0
- package/deps/simdutf/src/simdutf/icelake/simd.h +17 -0
- package/deps/simdutf/src/simdutf/icelake/simd16-inl.h +90 -0
- package/deps/simdutf/src/simdutf/icelake/simd32-inl.h +47 -0
- package/deps/simdutf/src/simdutf/icelake.h +81 -0
- package/deps/simdutf/src/simdutf/lasx/begin.h +8 -0
- package/deps/simdutf/src/simdutf/lasx/bitmanipulation.h +25 -0
- package/deps/simdutf/src/simdutf/lasx/end.h +8 -0
- package/deps/simdutf/src/simdutf/lasx/implementation.h +310 -0
- package/deps/simdutf/src/simdutf/lasx/intrinsics.h +319 -0
- package/deps/simdutf/src/simdutf/lasx/simd.h +551 -0
- package/deps/simdutf/src/simdutf/lasx/simd16-inl.h +234 -0
- package/deps/simdutf/src/simdutf/lasx/simd32-inl.h +74 -0
- package/deps/simdutf/src/simdutf/lasx/simd64-inl.h +52 -0
- package/deps/simdutf/src/simdutf/lasx.h +49 -0
- package/deps/simdutf/src/simdutf/lsx/begin.h +2 -0
- package/deps/simdutf/src/simdutf/lsx/bitmanipulation.h +25 -0
- package/deps/simdutf/src/simdutf/lsx/end.h +2 -0
- package/deps/simdutf/src/simdutf/lsx/implementation.h +309 -0
- package/deps/simdutf/src/simdutf/lsx/intrinsics.h +196 -0
- package/deps/simdutf/src/simdutf/lsx/simd.h +421 -0
- package/deps/simdutf/src/simdutf/lsx/simd16-inl.h +242 -0
- package/deps/simdutf/src/simdutf/lsx/simd32-inl.h +69 -0
- package/deps/simdutf/src/simdutf/lsx/simd64-inl.h +50 -0
- package/deps/simdutf/src/simdutf/lsx.h +52 -0
- package/deps/simdutf/src/simdutf/ppc64/begin.h +1 -0
- package/deps/simdutf/src/simdutf/ppc64/bitmanipulation.h +29 -0
- package/deps/simdutf/src/simdutf/ppc64/end.h +1 -0
- package/deps/simdutf/src/simdutf/ppc64/implementation.h +348 -0
- package/deps/simdutf/src/simdutf/ppc64/intrinsics.h +19 -0
- package/deps/simdutf/src/simdutf/ppc64/simd.h +177 -0
- package/deps/simdutf/src/simdutf/ppc64/simd16-inl.h +327 -0
- package/deps/simdutf/src/simdutf/ppc64/simd32-inl.h +247 -0
- package/deps/simdutf/src/simdutf/ppc64/simd8-inl.h +618 -0
- package/deps/simdutf/src/simdutf/ppc64.h +40 -0
- package/deps/simdutf/src/simdutf/rvv/begin.h +7 -0
- package/deps/simdutf/src/simdutf/rvv/end.h +7 -0
- package/deps/simdutf/src/simdutf/rvv/implementation.h +321 -0
- package/deps/simdutf/src/simdutf/rvv/intrinsics.h +131 -0
- package/deps/simdutf/src/simdutf/rvv.h +41 -0
- package/deps/simdutf/src/simdutf/westmere/begin.h +8 -0
- package/deps/simdutf/src/simdutf/westmere/bitmanipulation.h +37 -0
- package/deps/simdutf/src/simdutf/westmere/end.h +8 -0
- package/deps/simdutf/src/simdutf/westmere/implementation.h +338 -0
- package/deps/simdutf/src/simdutf/westmere/intrinsics.h +38 -0
- package/deps/simdutf/src/simdutf/westmere/simd.h +379 -0
- package/deps/simdutf/src/simdutf/westmere/simd16-inl.h +242 -0
- package/deps/simdutf/src/simdutf/westmere/simd32-inl.h +151 -0
- package/deps/simdutf/src/simdutf/westmere/simd64-inl.h +33 -0
- package/deps/simdutf/src/simdutf/westmere.h +59 -0
- package/deps/simdutf/src/simdutf.cpp +152 -0
- package/deps/simdutf/src/simdutf_c.cpp +525 -0
- package/deps/simdutf/src/tables/utf16_to_utf8_tables.h +768 -0
- package/deps/simdutf/src/tables/utf32_to_utf16_tables.h +53 -0
- package/deps/simdutf/src/tables/utf8_to_utf16_tables.h +826 -0
- package/deps/simdutf/src/westmere/implementation.cpp +1479 -0
- package/deps/simdutf/src/westmere/internal/loader.cpp +7 -0
- package/deps/simdutf/src/westmere/internal/write_v_u16_11bits_to_utf8.cpp +66 -0
- package/deps/simdutf/src/westmere/sse_base64.cpp +672 -0
- package/deps/simdutf/src/westmere/sse_convert_latin1_to_utf16.cpp +21 -0
- package/deps/simdutf/src/westmere/sse_convert_latin1_to_utf32.cpp +31 -0
- package/deps/simdutf/src/westmere/sse_convert_latin1_to_utf8.cpp +71 -0
- package/deps/simdutf/src/westmere/sse_convert_utf16_to_latin1.cpp +70 -0
- package/deps/simdutf/src/westmere/sse_convert_utf16_to_utf32.cpp +206 -0
- package/deps/simdutf/src/westmere/sse_convert_utf16_to_utf8.cpp +504 -0
- package/deps/simdutf/src/westmere/sse_convert_utf32_to_latin1.cpp +82 -0
- package/deps/simdutf/src/westmere/sse_convert_utf32_to_utf16.cpp +209 -0
- package/deps/simdutf/src/westmere/sse_convert_utf32_to_utf8.cpp +589 -0
- package/deps/simdutf/src/westmere/sse_convert_utf8_to_latin1.cpp +58 -0
- package/deps/simdutf/src/westmere/sse_convert_utf8_to_utf16.cpp +197 -0
- package/deps/simdutf/src/westmere/sse_convert_utf8_to_utf32.cpp +141 -0
- package/deps/simdutf/src/westmere/sse_utf16fix.cpp +82 -0
- package/deps/simdutf/src/westmere/sse_validate_utf16.cpp +17 -0
- package/deps/simdutf/tests/CMakeLists.txt +483 -0
- package/deps/simdutf/tests/atomic_base64_tests.cpp +2845 -0
- package/deps/simdutf/tests/base64_tests.cpp +3617 -0
- package/deps/simdutf/tests/basic_fuzzer.cpp +805 -0
- package/deps/simdutf/tests/bele_tests.cpp +182 -0
- package/deps/simdutf/tests/constexpr_base64_tests.cpp +387 -0
- package/deps/simdutf/tests/convert_latin1_to_utf16be_tests.cpp +52 -0
- package/deps/simdutf/tests/convert_latin1_to_utf16le_tests.cpp +80 -0
- package/deps/simdutf/tests/convert_latin1_to_utf32_tests.cpp +66 -0
- package/deps/simdutf/tests/convert_latin1_to_utf8_tests.cpp +120 -0
- package/deps/simdutf/tests/convert_utf16_to_utf8_safe_tests.cpp +203 -0
- package/deps/simdutf/tests/convert_utf16_to_utf8_with_replacement_tests.cpp +276 -0
- package/deps/simdutf/tests/convert_utf16be_to_latin1_tests.cpp +109 -0
- package/deps/simdutf/tests/convert_utf16be_to_latin1_tests_with_errors.cpp +136 -0
- package/deps/simdutf/tests/convert_utf16be_to_utf32_tests.cpp +193 -0
- package/deps/simdutf/tests/convert_utf16be_to_utf32_with_errors_tests.cpp +381 -0
- package/deps/simdutf/tests/convert_utf16be_to_utf8_tests.cpp +259 -0
- package/deps/simdutf/tests/convert_utf16be_to_utf8_with_errors_tests.cpp +266 -0
- package/deps/simdutf/tests/convert_utf16le_to_latin1_tests.cpp +148 -0
- package/deps/simdutf/tests/convert_utf16le_to_latin1_tests_with_errors.cpp +176 -0
- package/deps/simdutf/tests/convert_utf16le_to_utf32_tests.cpp +213 -0
- package/deps/simdutf/tests/convert_utf16le_to_utf32_with_errors_tests.cpp +318 -0
- package/deps/simdutf/tests/convert_utf16le_to_utf8_tests.cpp +343 -0
- package/deps/simdutf/tests/convert_utf16le_to_utf8_with_errors_tests.cpp +271 -0
- package/deps/simdutf/tests/convert_utf32_to_latin1_tests.cpp +111 -0
- package/deps/simdutf/tests/convert_utf32_to_latin1_with_errors_tests.cpp +96 -0
- package/deps/simdutf/tests/convert_utf32_to_utf16be_tests.cpp +148 -0
- package/deps/simdutf/tests/convert_utf32_to_utf16be_with_errors_tests.cpp +192 -0
- package/deps/simdutf/tests/convert_utf32_to_utf16le_tests.cpp +166 -0
- package/deps/simdutf/tests/convert_utf32_to_utf16le_with_errors_tests.cpp +215 -0
- package/deps/simdutf/tests/convert_utf32_to_utf8_tests.cpp +181 -0
- package/deps/simdutf/tests/convert_utf32_to_utf8_with_errors_tests.cpp +261 -0
- package/deps/simdutf/tests/convert_utf8_to_latin1_tests.cpp +516 -0
- package/deps/simdutf/tests/convert_utf8_to_latin1_with_errors_tests.cpp +579 -0
- package/deps/simdutf/tests/convert_utf8_to_utf16be_tests.cpp +412 -0
- package/deps/simdutf/tests/convert_utf8_to_utf16be_with_errors_tests.cpp +480 -0
- package/deps/simdutf/tests/convert_utf8_to_utf16le_tests.cpp +671 -0
- package/deps/simdutf/tests/convert_utf8_to_utf16le_with_errors_tests.cpp +455 -0
- package/deps/simdutf/tests/convert_utf8_to_utf32_tests.cpp +1204 -0
- package/deps/simdutf/tests/convert_utf8_to_utf32_with_errors_tests.cpp +337 -0
- package/deps/simdutf/tests/convert_valid_utf16be_to_latin1_tests.cpp +37 -0
- package/deps/simdutf/tests/convert_valid_utf16be_to_utf32_tests.cpp +97 -0
- package/deps/simdutf/tests/convert_valid_utf16be_to_utf8_tests.cpp +126 -0
- package/deps/simdutf/tests/convert_valid_utf16le_to_latin1_tests.cpp +71 -0
- package/deps/simdutf/tests/convert_valid_utf16le_to_utf32_tests.cpp +122 -0
- package/deps/simdutf/tests/convert_valid_utf16le_to_utf8_tests.cpp +244 -0
- package/deps/simdutf/tests/convert_valid_utf32_to_latin1_tests.cpp +49 -0
- package/deps/simdutf/tests/convert_valid_utf32_to_utf16be_tests.cpp +92 -0
- package/deps/simdutf/tests/convert_valid_utf32_to_utf16le_tests.cpp +114 -0
- package/deps/simdutf/tests/convert_valid_utf32_to_utf8_tests.cpp +109 -0
- package/deps/simdutf/tests/convert_valid_utf8_to_latin1_tests.cpp +84 -0
- package/deps/simdutf/tests/convert_valid_utf8_to_utf16be_tests.cpp +124 -0
- package/deps/simdutf/tests/convert_valid_utf8_to_utf16le_tests.cpp +221 -0
- package/deps/simdutf/tests/convert_valid_utf8_to_utf32_tests.cpp +155 -0
- package/deps/simdutf/tests/count_utf16be.cpp +64 -0
- package/deps/simdutf/tests/count_utf16le.cpp +61 -0
- package/deps/simdutf/tests/count_utf8.cpp +87 -0
- package/deps/simdutf/tests/detect_encodings_tests.cpp +312 -0
- package/deps/simdutf/tests/embed/valid_utf8.txt +1 -0
- package/deps/simdutf/tests/embed_tests.cpp +22 -0
- package/deps/simdutf/tests/find_tests.cpp +77 -0
- package/deps/simdutf/tests/fixed_string_tests.cpp +153 -0
- package/deps/simdutf/tests/helpers/CMakeLists.txt +25 -0
- package/deps/simdutf/tests/helpers/compiletime_conversions.h +222 -0
- package/deps/simdutf/tests/helpers/fixed_string.h +267 -0
- package/deps/simdutf/tests/helpers/random_int.cpp +30 -0
- package/deps/simdutf/tests/helpers/random_int.h +39 -0
- package/deps/simdutf/tests/helpers/random_utf16.cpp +123 -0
- package/deps/simdutf/tests/helpers/random_utf16.h +52 -0
- package/deps/simdutf/tests/helpers/random_utf32.cpp +41 -0
- package/deps/simdutf/tests/helpers/random_utf32.h +40 -0
- package/deps/simdutf/tests/helpers/random_utf8.cpp +93 -0
- package/deps/simdutf/tests/helpers/random_utf8.h +36 -0
- package/deps/simdutf/tests/helpers/test.cpp +231 -0
- package/deps/simdutf/tests/helpers/test.h +193 -0
- package/deps/simdutf/tests/helpers/transcode_test_base.cpp +1257 -0
- package/deps/simdutf/tests/helpers/transcode_test_base.h +683 -0
- package/deps/simdutf/tests/helpers/utf16.h +27 -0
- package/deps/simdutf/tests/installation_tests/find/CMakeLists.txt +43 -0
- package/deps/simdutf/tests/installation_tests/from_fetch/CMakeLists.txt +47 -0
- package/deps/simdutf/tests/internal_tests.cpp +27 -0
- package/deps/simdutf/tests/null_safety_tests.cpp +94 -0
- package/deps/simdutf/tests/random_fuzzer.cpp +779 -0
- package/deps/simdutf/tests/readme_tests.cpp +274 -0
- package/deps/simdutf/tests/reference/CMakeLists.txt +23 -0
- package/deps/simdutf/tests/reference/decode_utf16.h +81 -0
- package/deps/simdutf/tests/reference/decode_utf32.h +47 -0
- package/deps/simdutf/tests/reference/encode_latin1.cpp +1 -0
- package/deps/simdutf/tests/reference/encode_latin1.h +32 -0
- package/deps/simdutf/tests/reference/encode_utf16.cpp +49 -0
- package/deps/simdutf/tests/reference/encode_utf16.h +20 -0
- package/deps/simdutf/tests/reference/encode_utf32.cpp +1 -0
- package/deps/simdutf/tests/reference/encode_utf32.h +36 -0
- package/deps/simdutf/tests/reference/encode_utf8.cpp +1 -0
- package/deps/simdutf/tests/reference/encode_utf8.h +40 -0
- package/deps/simdutf/tests/reference/validate_utf16.cpp +60 -0
- package/deps/simdutf/tests/reference/validate_utf16.h +14 -0
- package/deps/simdutf/tests/reference/validate_utf16_to_latin1.cpp +35 -0
- package/deps/simdutf/tests/reference/validate_utf16_to_latin1.h +13 -0
- package/deps/simdutf/tests/reference/validate_utf32.cpp +27 -0
- package/deps/simdutf/tests/reference/validate_utf32.h +12 -0
- package/deps/simdutf/tests/reference/validate_utf32_to_latin1.cpp +27 -0
- package/deps/simdutf/tests/reference/validate_utf32_to_latin1.h +12 -0
- package/deps/simdutf/tests/reference/validate_utf8.cpp +82 -0
- package/deps/simdutf/tests/reference/validate_utf8.h +11 -0
- package/deps/simdutf/tests/reference/validate_utf8_to_latin1.cpp +43 -0
- package/deps/simdutf/tests/reference/validate_utf8_to_latin1.h +12 -0
- package/deps/simdutf/tests/select_implementation.cpp +43 -0
- package/deps/simdutf/tests/simdutf_c_tests.cpp +244 -0
- package/deps/simdutf/tests/span_tests.cpp +401 -0
- package/deps/simdutf/tests/special_tests.cpp +559 -0
- package/deps/simdutf/tests/straight_c_test.c +187 -0
- package/deps/simdutf/tests/text_encoding_tests.cpp +77 -0
- package/deps/simdutf/tests/to_well_formed_utf16_tests.cpp +377 -0
- package/deps/simdutf/tests/utf8_length_from_utf16_tests.cpp +202 -0
- package/deps/simdutf/tests/validate_ascii_basic_tests.cpp +165 -0
- package/deps/simdutf/tests/validate_ascii_with_errors_tests.cpp +77 -0
- package/deps/simdutf/tests/validate_utf16be_basic_tests.cpp +175 -0
- package/deps/simdutf/tests/validate_utf16be_with_errors_tests.cpp +188 -0
- package/deps/simdutf/tests/validate_utf16le_basic_tests.cpp +268 -0
- package/deps/simdutf/tests/validate_utf16le_with_errors_tests.cpp +274 -0
- package/deps/simdutf/tests/validate_utf32_basic_tests.cpp +92 -0
- package/deps/simdutf/tests/validate_utf32_with_errors_tests.cpp +114 -0
- package/deps/simdutf/tests/validate_utf8_basic_tests.cpp +178 -0
- package/deps/simdutf/tests/validate_utf8_brute_force_tests.cpp +88 -0
- package/deps/simdutf/tests/validate_utf8_puzzler_tests.cpp +33 -0
- package/deps/simdutf/tests/validate_utf8_with_errors_tests.cpp +228 -0
- package/deps/simdutf/tools/CMakeLists.txt +85 -0
- package/deps/simdutf/tools/fastbase64.cpp +250 -0
- package/deps/simdutf/tools/sutf.cpp +556 -0
- package/deps/simdutf/tools/sutf.h +40 -0
- package/package.json +2 -2
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/*===--- ConvertUTF.h - Universal Character Names conversions ---------------===
|
|
2
|
+
*
|
|
3
|
+
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
4
|
+
* See https://llvm.org/LICENSE.txt for license information.
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
6
|
+
*
|
|
7
|
+
*==------------------------------------------------------------------------==*/
|
|
8
|
+
/*
|
|
9
|
+
* Copyright 2001-2004 Unicode, Inc.
|
|
10
|
+
*
|
|
11
|
+
* Disclaimer
|
|
12
|
+
*
|
|
13
|
+
* This source code is provided as is by Unicode, Inc. No claims are
|
|
14
|
+
* made as to fitness for any particular purpose. No warranties of any
|
|
15
|
+
* kind are expressed or implied. The recipient agrees to determine
|
|
16
|
+
* applicability of information provided. If this file has been
|
|
17
|
+
* purchased on magnetic or optical media from Unicode, Inc., the
|
|
18
|
+
* sole remedy for any claim will be exchange of defective media
|
|
19
|
+
* within 90 days of receipt.
|
|
20
|
+
*
|
|
21
|
+
* Limitations on Rights to Redistribute This Code
|
|
22
|
+
*
|
|
23
|
+
* Unicode, Inc. hereby grants the right to freely use the information
|
|
24
|
+
* supplied in this file in the creation of products supporting the
|
|
25
|
+
* Unicode Standard, and to make copies of this file in any form
|
|
26
|
+
* for internal or external distribution as long as this notice
|
|
27
|
+
* remains attached.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/* ---------------------------------------------------------------------
|
|
31
|
+
Conversions between UTF32, UTF-16, and UTF-8. Header file.
|
|
32
|
+
Several funtions are included here, forming a complete set of
|
|
33
|
+
conversions between the three formats. UTF-7 is not included
|
|
34
|
+
here, but is handled in a separate source file.
|
|
35
|
+
Each of these routines takes pointers to input buffers and output
|
|
36
|
+
buffers. The input buffers are const.
|
|
37
|
+
Each routine converts the text between *sourceStart and sourceEnd,
|
|
38
|
+
putting the result into the buffer between *targetStart and
|
|
39
|
+
targetEnd. Note: the end pointers are *after* the last item: e.g.
|
|
40
|
+
*(sourceEnd - 1) is the last item.
|
|
41
|
+
The return result indicates whether the conversion was successful,
|
|
42
|
+
and if not, whether the problem was in the source or target buffers.
|
|
43
|
+
(Only the first encountered problem is indicated.)
|
|
44
|
+
After the conversion, *sourceStart and *targetStart are both
|
|
45
|
+
updated to point to the end of last text successfully converted in
|
|
46
|
+
the respective buffers.
|
|
47
|
+
Input parameters:
|
|
48
|
+
sourceStart - pointer to a pointer to the source buffer.
|
|
49
|
+
The contents of this are modified on return so that
|
|
50
|
+
it points at the next thing to be converted.
|
|
51
|
+
targetStart - similarly, pointer to pointer to the target buffer.
|
|
52
|
+
sourceEnd, targetEnd - respectively pointers to the ends of the
|
|
53
|
+
two buffers, for overflow checking only.
|
|
54
|
+
These conversion functions take a ConversionFlags argument. When this
|
|
55
|
+
flag is set to strict, both irregular sequences and isolated surrogates
|
|
56
|
+
will cause an error. When the flag is set to lenient, both irregular
|
|
57
|
+
sequences and isolated surrogates are converted.
|
|
58
|
+
Whether the flag is strict or lenient, all illegal sequences will cause
|
|
59
|
+
an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
|
|
60
|
+
or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
|
|
61
|
+
must check for illegal sequences.
|
|
62
|
+
When the flag is set to lenient, characters over 0x10FFFF are converted
|
|
63
|
+
to the replacement character; otherwise (when the flag is set to strict)
|
|
64
|
+
they constitute an error.
|
|
65
|
+
Output parameters:
|
|
66
|
+
The value "sourceIllegal" is returned from some routines if the input
|
|
67
|
+
sequence is malformed. When "sourceIllegal" is returned, the source
|
|
68
|
+
value will point to the illegal value that caused the problem. E.g.,
|
|
69
|
+
in UTF-8 when a sequence is malformed, it points to the start of the
|
|
70
|
+
malformed sequence.
|
|
71
|
+
Author: Mark E. Davis, 1994.
|
|
72
|
+
Rev History: Rick McGowan, fixes & updates May 2001.
|
|
73
|
+
Fixes & updates, Sept 2001.
|
|
74
|
+
------------------------------------------------------------------------ */
|
|
75
|
+
|
|
76
|
+
#ifndef LLVM_SUPPORT_CONVERTUTF_H
|
|
77
|
+
#define LLVM_SUPPORT_CONVERTUTF_H
|
|
78
|
+
|
|
79
|
+
#include <cstddef>
|
|
80
|
+
#include <string>
|
|
81
|
+
#include <system_error>
|
|
82
|
+
|
|
83
|
+
// Wrap everything in namespace llvm so that programs can link with llvm and
|
|
84
|
+
// their own version of the unicode libraries.
|
|
85
|
+
|
|
86
|
+
namespace llvm {
|
|
87
|
+
|
|
88
|
+
/* ---------------------------------------------------------------------
|
|
89
|
+
The following 4 definitions are compiler-specific.
|
|
90
|
+
The C standard does not guarantee that wchar_t has at least
|
|
91
|
+
16 bits, so wchar_t is no less portable than unsigned short!
|
|
92
|
+
All should be unsigned values to avoid sign extension during
|
|
93
|
+
bit mask & shift operations.
|
|
94
|
+
------------------------------------------------------------------------ */
|
|
95
|
+
|
|
96
|
+
typedef unsigned int UTF32; /* at least 32 bits */
|
|
97
|
+
typedef unsigned short UTF16; /* at least 16 bits */
|
|
98
|
+
typedef unsigned char UTF8; /* typically 8 bits */
|
|
99
|
+
typedef unsigned char Boolean; /* 0 or 1 */
|
|
100
|
+
|
|
101
|
+
/* Some fundamental constants */
|
|
102
|
+
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
|
|
103
|
+
#define UNI_MAX_BMP (UTF32)0x0000FFFF
|
|
104
|
+
#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
|
|
105
|
+
#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
|
|
106
|
+
#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
|
|
107
|
+
|
|
108
|
+
#define UNI_MAX_UTF8_BYTES_PER_CODE_POINT 4
|
|
109
|
+
|
|
110
|
+
#define UNI_UTF16_BYTE_ORDER_MARK_NATIVE 0xFEFF
|
|
111
|
+
#define UNI_UTF16_BYTE_ORDER_MARK_SWAPPED 0xFFFE
|
|
112
|
+
|
|
113
|
+
typedef enum {
|
|
114
|
+
conversionOK, /* conversion successful */
|
|
115
|
+
sourceExhausted, /* partial character in source, but hit end */
|
|
116
|
+
targetExhausted, /* insuff. room in target for conversion */
|
|
117
|
+
sourceIllegal /* source sequence is illegal/malformed */
|
|
118
|
+
} ConversionResult;
|
|
119
|
+
|
|
120
|
+
typedef enum {
|
|
121
|
+
strictConversion = 0,
|
|
122
|
+
lenientConversion
|
|
123
|
+
} ConversionFlags;
|
|
124
|
+
|
|
125
|
+
ConversionResult ConvertUTF8toUTF16 (
|
|
126
|
+
const UTF8** sourceStart, const UTF8* sourceEnd,
|
|
127
|
+
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Convert a partial UTF8 sequence to UTF32. If the sequence ends in an
|
|
131
|
+
* incomplete code unit sequence, returns \c sourceExhausted.
|
|
132
|
+
*/
|
|
133
|
+
ConversionResult ConvertUTF8toUTF32Partial(
|
|
134
|
+
const UTF8** sourceStart, const UTF8* sourceEnd,
|
|
135
|
+
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Convert a partial UTF8 sequence to UTF32. If the sequence ends in an
|
|
139
|
+
* incomplete code unit sequence, returns \c sourceIllegal.
|
|
140
|
+
*/
|
|
141
|
+
ConversionResult ConvertUTF8toUTF32(
|
|
142
|
+
const UTF8** sourceStart, const UTF8* sourceEnd,
|
|
143
|
+
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
|
|
144
|
+
|
|
145
|
+
ConversionResult ConvertUTF16toUTF8 (
|
|
146
|
+
const UTF16** sourceStart, const UTF16* sourceEnd,
|
|
147
|
+
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
|
|
148
|
+
|
|
149
|
+
ConversionResult ConvertUTF32toUTF8 (
|
|
150
|
+
const UTF32** sourceStart, const UTF32* sourceEnd,
|
|
151
|
+
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
|
|
152
|
+
|
|
153
|
+
ConversionResult ConvertUTF16toUTF32 (
|
|
154
|
+
const UTF16** sourceStart, const UTF16* sourceEnd,
|
|
155
|
+
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
|
|
156
|
+
|
|
157
|
+
ConversionResult ConvertUTF32toUTF16 (
|
|
158
|
+
const UTF32** sourceStart, const UTF32* sourceEnd,
|
|
159
|
+
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
|
|
160
|
+
|
|
161
|
+
Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
|
|
162
|
+
|
|
163
|
+
Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
|
|
164
|
+
|
|
165
|
+
unsigned getNumBytesForUTF8(UTF8 firstByte);
|
|
166
|
+
|
|
167
|
+
/*************************************************************************/
|
|
168
|
+
/* Below are LLVM-specific wrappers of the functions above. */
|
|
169
|
+
|
|
170
|
+
template <typename T> class ArrayRef;
|
|
171
|
+
template <typename T> class SmallVectorImpl;
|
|
172
|
+
class StringRef;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Convert an UTF8 StringRef to UTF8, UTF16, or UTF32 depending on
|
|
176
|
+
* WideCharWidth. The converted data is written to ResultPtr, which needs to
|
|
177
|
+
* point to at least WideCharWidth * (Source.Size() + 1) bytes. On success,
|
|
178
|
+
* ResultPtr will point one after the end of the copied string. On failure,
|
|
179
|
+
* ResultPtr will not be changed, and ErrorPtr will be set to the location of
|
|
180
|
+
* the first character which could not be converted.
|
|
181
|
+
* \return true on success.
|
|
182
|
+
*/
|
|
183
|
+
bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
|
|
184
|
+
char *&ResultPtr, const UTF8 *&ErrorPtr);
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Converts a UTF-8 StringRef to a std::wstring.
|
|
188
|
+
* \return true on success.
|
|
189
|
+
*/
|
|
190
|
+
bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result);
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Converts a UTF-8 C-string to a std::wstring.
|
|
194
|
+
* \return true on success.
|
|
195
|
+
*/
|
|
196
|
+
bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Converts a std::wstring to a UTF-8 encoded std::string.
|
|
200
|
+
* \return true on success.
|
|
201
|
+
*/
|
|
202
|
+
bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Convert an Unicode code point to UTF8 sequence.
|
|
207
|
+
*
|
|
208
|
+
* \param Source a Unicode code point.
|
|
209
|
+
* \param [in,out] ResultPtr pointer to the output buffer, needs to be at least
|
|
210
|
+
* \c UNI_MAX_UTF8_BYTES_PER_CODE_POINT bytes. On success \c ResultPtr is
|
|
211
|
+
* updated one past end of the converted sequence.
|
|
212
|
+
*
|
|
213
|
+
* \returns true on success.
|
|
214
|
+
*/
|
|
215
|
+
bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Convert the first UTF8 sequence in the given source buffer to a UTF32
|
|
219
|
+
* code point.
|
|
220
|
+
*
|
|
221
|
+
* \param [in,out] source A pointer to the source buffer. If the conversion
|
|
222
|
+
* succeeds, this pointer will be updated to point to the byte just past the
|
|
223
|
+
* end of the converted sequence.
|
|
224
|
+
* \param sourceEnd A pointer just past the end of the source buffer.
|
|
225
|
+
* \param [out] target The converted code
|
|
226
|
+
* \param flags Whether the conversion is strict or lenient.
|
|
227
|
+
*
|
|
228
|
+
* \returns conversionOK on success
|
|
229
|
+
*
|
|
230
|
+
* \sa ConvertUTF8toUTF32
|
|
231
|
+
*/
|
|
232
|
+
inline ConversionResult convertUTF8Sequence(const UTF8 **source,
|
|
233
|
+
const UTF8 *sourceEnd,
|
|
234
|
+
UTF32 *target,
|
|
235
|
+
ConversionFlags flags) {
|
|
236
|
+
if (*source == sourceEnd)
|
|
237
|
+
return sourceExhausted;
|
|
238
|
+
unsigned size = getNumBytesForUTF8(**source);
|
|
239
|
+
if ((ptrdiff_t)size > sourceEnd - *source)
|
|
240
|
+
return sourceExhausted;
|
|
241
|
+
return ConvertUTF8toUTF32(source, *source + size, &target, target + 1, flags);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Returns true if a blob of text starts with a UTF-16 big or little endian byte
|
|
246
|
+
* order mark.
|
|
247
|
+
*/
|
|
248
|
+
bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
|
|
252
|
+
*
|
|
253
|
+
* \param [in] SrcBytes A buffer of what is assumed to be UTF-16 encoded text.
|
|
254
|
+
* \param [out] Out Converted UTF-8 is stored here on success.
|
|
255
|
+
* \returns true on success
|
|
256
|
+
*/
|
|
257
|
+
bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Converts a UTF16 string into a UTF8 std::string.
|
|
261
|
+
*
|
|
262
|
+
* \param [in] Src A buffer of UTF-16 encoded text.
|
|
263
|
+
* \param [out] Out Converted UTF-8 is stored here on success.
|
|
264
|
+
* \returns true on success
|
|
265
|
+
*/
|
|
266
|
+
bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Converts a UTF-8 string into a UTF-16 string with native endianness.
|
|
270
|
+
*
|
|
271
|
+
* \returns true on success
|
|
272
|
+
*/
|
|
273
|
+
bool convertUTF8ToUTF16String(StringRef SrcUTF8,
|
|
274
|
+
SmallVectorImpl<UTF16> &DstUTF16);
|
|
275
|
+
|
|
276
|
+
#if defined(_WIN32)
|
|
277
|
+
namespace sys {
|
|
278
|
+
namespace windows {
|
|
279
|
+
std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
|
|
280
|
+
/// Convert to UTF16 from the current code page used in the system
|
|
281
|
+
std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
|
|
282
|
+
std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
|
|
283
|
+
SmallVectorImpl<char> &utf8);
|
|
284
|
+
/// Convert from UTF16 to the current code page used in the system
|
|
285
|
+
std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len,
|
|
286
|
+
SmallVectorImpl<char> &utf8);
|
|
287
|
+
} // namespace windows
|
|
288
|
+
} // namespace sys
|
|
289
|
+
#endif
|
|
290
|
+
|
|
291
|
+
} /* end namespace llvm */
|
|
292
|
+
|
|
293
|
+
#endif
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright (C) 2007 International Characters Inc.
|
|
2
|
+
Licensed to the public under the Open Software License version 3.0.
|
|
3
|
+
Patents pending in Canada, the United States, and other countries.
|
|
4
|
+
International Characters is a trademark of International Characters Inc.
|
|
5
|
+
Commercial software licenses are also available.
|
|
6
|
+
Contact info@international-characters.com.
|
|
7
|
+
For further information see www.international-characters.com.
|
|
8
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
CC= g++ $(CFLAGS)
|
|
2
|
+
CFLAGS= -O3 -DBUFFER_PROFILING
|
|
3
|
+
OS = $(shell uname)
|
|
4
|
+
ICONV_FLAGS=
|
|
5
|
+
ifeq ($(OS),Darwin)
|
|
6
|
+
ICONV_FLAGS=-liconv
|
|
7
|
+
endif
|
|
8
|
+
|
|
9
|
+
u8u16_64: u8u16_p4.c config/p4_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h
|
|
10
|
+
$(CC) -o u8u16_64 u8u16_p4.c -march=nocona -m64
|
|
11
|
+
|
|
12
|
+
u8u16_64_noopt: u8u16_p4.c config/p4_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h
|
|
13
|
+
$(CC) -o u8u16_64_noopt u8u16_p4.c -march=nocona -m64 -DNO_OPTIMIZATION
|
|
14
|
+
|
|
15
|
+
u8u16_p4: u8u16_p4.c config/p4_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h
|
|
16
|
+
$(CC) -o u8u16_p4 u8u16_p4.c -march=pentium4
|
|
17
|
+
|
|
18
|
+
u8u16_p4_noopt: u8u16_p4.c config/p4_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h
|
|
19
|
+
$(CC) -o u8u16_p4_noopt u8u16_p4.c -march=pentium4 -DNO_OPTIMIZATION
|
|
20
|
+
|
|
21
|
+
u8u16_ssse3: u8u16_p4.c config/p4_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h
|
|
22
|
+
$(CC) -o u8u16_ssse3 u8u16_ssse3.c -march=core2
|
|
23
|
+
|
|
24
|
+
x8x16_p4: x8x16_p4.c config/p4_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h \
|
|
25
|
+
src/x8x16.c src/xmldecl.h src/xmldecl.c src/bytelex.h src/multiliteral.h
|
|
26
|
+
$(CC) -o x8x16_p4 x8x16_p4.c -march=pentium4
|
|
27
|
+
|
|
28
|
+
u8u16_p4_ideal: u8u16_p4_ideal.c config/p4_ideal_config.h src/u8u16.c src/libu8u16.c lib/sse_simd.h
|
|
29
|
+
$(CC) -o u8u16_p4_ideal u8u16_p4_ideal.c -march=pentium4
|
|
30
|
+
|
|
31
|
+
u8u16_g4: u8u16_g4.c config/g4_config.h src/u8u16.c src/libu8u16.c lib/altivec_simd.h
|
|
32
|
+
$(CC) -o u8u16_g4 u8u16_g4.c -maltivec -faltivec
|
|
33
|
+
|
|
34
|
+
u8u16_mmx: u8u16_mmx.c config/mmx_config.h src/u8u16.c src/libu8u16.c \
|
|
35
|
+
lib/mmx_simd.h lib/mmx_simd_basic.h lib/mmx_simd_built_in.h lib/mmx_simd_modified.h
|
|
36
|
+
$(CC) -o u8u16_mmx u8u16_mmx.c -march=pentium-mmx
|
|
37
|
+
|
|
38
|
+
iconv_u8u16: iconv_u8u16.c src/u8u16.c src/libu8u16.c
|
|
39
|
+
$(CC) -o iconv_u8u16 iconv_u8u16.c $(ICONV_FLAGS)
|
|
40
|
+
|
|
41
|
+
clean:
|
|
42
|
+
rm -f u8u16_64 u8u16_p4 x8x16_p4 u8u16_p4_ideal u8u16_g4 u8u16_mmx iconv_u8u16
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Open Software License ("OSL") v. 3.0
|
|
2
|
+
|
|
3
|
+
This Open Software License (the "License") applies to any original work of
|
|
4
|
+
authorship (the "Original Work") whose owner (the "Licensor") has placed the
|
|
5
|
+
following licensing notice adjacent to the copyright notice for the Original
|
|
6
|
+
Work:
|
|
7
|
+
|
|
8
|
+
Licensed under the Open Software License version 3.0
|
|
9
|
+
|
|
10
|
+
1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
|
|
11
|
+
non-exclusive, sublicensable license, for the duration of the copyright, to do
|
|
12
|
+
the following:
|
|
13
|
+
|
|
14
|
+
a) to reproduce the Original Work in copies, either alone or as part of a
|
|
15
|
+
collective work;
|
|
16
|
+
|
|
17
|
+
b) to translate, adapt, alter, transform, modify, or arrange the Original Work,
|
|
18
|
+
thereby creating derivative works ("Derivative Works") based upon the Original
|
|
19
|
+
Work;
|
|
20
|
+
|
|
21
|
+
c) to distribute or communicate copies of the Original Work and Derivative Works
|
|
22
|
+
to the public, with the proviso that copies of Original Work or Derivative Works
|
|
23
|
+
that You distribute or communicate shall be licensed under this Open Software
|
|
24
|
+
License;
|
|
25
|
+
|
|
26
|
+
d) to perform the Original Work publicly; and
|
|
27
|
+
|
|
28
|
+
e) to display the Original Work publicly.
|
|
29
|
+
|
|
30
|
+
2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
|
|
31
|
+
non-exclusive, sublicensable license, under patent claims owned or controlled by
|
|
32
|
+
the Licensor that are embodied in the Original Work as furnished by the
|
|
33
|
+
Licensor, for the duration of the patents, to make, use, sell, offer for sale,
|
|
34
|
+
have made, and import the Original Work and Derivative Works.
|
|
35
|
+
|
|
36
|
+
3) Grant of Source Code License. The term "Source Code" means the preferred form
|
|
37
|
+
of the Original Work for making modifications to it and all available
|
|
38
|
+
documentation describing how to modify the Original Work. Licensor agrees to
|
|
39
|
+
provide a machine-readable copy of the Source Code of the Original Work along
|
|
40
|
+
with each copy of the Original Work that Licensor distributes. Licensor reserves
|
|
41
|
+
the right to satisfy this obligation by placing a machine-readable copy of the
|
|
42
|
+
Source Code in an information repository reasonably calculated to permit
|
|
43
|
+
inexpensive and convenient access by You for as long as Licensor continues to
|
|
44
|
+
distribute the Original Work.
|
|
45
|
+
|
|
46
|
+
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
|
|
47
|
+
of any contributors to the Original Work, nor any of their trademarks or service
|
|
48
|
+
marks, may be used to endorse or promote products derived from this Original
|
|
49
|
+
Work without express prior permission of the Licensor. Except as expressly
|
|
50
|
+
stated herein, nothing in this License grants any license to Licensor's
|
|
51
|
+
trademarks, copyrights, patents, trade secrets or any other intellectual
|
|
52
|
+
property. No patent license is granted to make, use, sell, offer for sale, have
|
|
53
|
+
made, or import embodiments of any patent claims other than the licensed claims
|
|
54
|
+
defined in Section 2. No license is granted to the trademarks of Licensor even
|
|
55
|
+
if such marks are included in the Original Work. Nothing in this License shall
|
|
56
|
+
be interpreted to prohibit Licensor from licensing under terms different from
|
|
57
|
+
this License any Original Work that Licensor otherwise would have a right to
|
|
58
|
+
license.
|
|
59
|
+
|
|
60
|
+
5) External Deployment. The term "External Deployment" means the use,
|
|
61
|
+
distribution, or communication of the Original Work or Derivative Works in any
|
|
62
|
+
way such that the Original Work or Derivative Works may be used by anyone other
|
|
63
|
+
than You, whether those works are distributed or communicated to those persons
|
|
64
|
+
or made available as an application intended for use over a network. As an
|
|
65
|
+
express condition for the grants of license hereunder, You must treat any
|
|
66
|
+
External Deployment by You of the Original Work or a Derivative Work as a
|
|
67
|
+
distribution under section 1(c).
|
|
68
|
+
|
|
69
|
+
6) Attribution Rights. You must retain, in the Source Code of any Derivative
|
|
70
|
+
Works that You create, all copyright, patent, or trademark notices from the
|
|
71
|
+
Source Code of the Original Work, as well as any notices of licensing and any
|
|
72
|
+
descriptive text identified therein as an "Attribution Notice." You must cause
|
|
73
|
+
the Source Code for any Derivative Works that You create to carry a prominent
|
|
74
|
+
Attribution Notice reasonably calculated to inform recipients that You have
|
|
75
|
+
modified the Original Work.
|
|
76
|
+
|
|
77
|
+
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the
|
|
78
|
+
copyright in and to the Original Work and the patent rights granted herein by
|
|
79
|
+
Licensor are owned by the Licensor or are sublicensed to You under the terms of
|
|
80
|
+
this License with the permission of the contributor(s) of those copyrights and
|
|
81
|
+
patent rights. Except as expressly stated in the immediately preceding sentence,
|
|
82
|
+
the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT
|
|
83
|
+
WARRANTY, either express or implied, including, without limitation, the
|
|
84
|
+
warranties of non-infringement, merchantability or fitness for a particular
|
|
85
|
+
purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
|
|
86
|
+
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
|
|
87
|
+
license to the Original Work is granted by this License except under this
|
|
88
|
+
disclaimer.
|
|
89
|
+
|
|
90
|
+
8) Limitation of Liability. Under no circumstances and under no legal theory,
|
|
91
|
+
whether in tort (including negligence), contract, or otherwise, shall the
|
|
92
|
+
Licensor be liable to anyone for any indirect, special, incidental, or
|
|
93
|
+
consequential damages of any character arising as a result of this License or
|
|
94
|
+
the use of the Original Work including, without limitation, damages for loss of
|
|
95
|
+
goodwill, work stoppage, computer failure or malfunction, or any and all other
|
|
96
|
+
commercial damages or losses. This limitation of liability shall not apply to
|
|
97
|
+
the extent applicable law prohibits such limitation.
|
|
98
|
+
|
|
99
|
+
9) Acceptance and Termination. If, at any time, You expressly assented to this
|
|
100
|
+
License, that assent indicates your clear and irrevocable acceptance of this
|
|
101
|
+
License and all of its terms and conditions. If You distribute or communicate
|
|
102
|
+
copies of the Original Work or a Derivative Work, You must make a reasonable
|
|
103
|
+
effort under the circumstances to obtain the express assent of recipients to the
|
|
104
|
+
terms of this License. This License conditions your rights to undertake the
|
|
105
|
+
activities listed in Section 1, including your right to create Derivative Works
|
|
106
|
+
based upon the Original Work, and doing so without honoring these terms and
|
|
107
|
+
conditions is prohibited by copyright law and international treaty. Nothing in
|
|
108
|
+
this License is intended to affect copyright exceptions and limitations
|
|
109
|
+
(including "fair use" or "fair dealing"). This License shall terminate
|
|
110
|
+
immediately and You may no longer exercise any of the rights granted to You by
|
|
111
|
+
this License upon your failure to honor the conditions in Section 1(c).
|
|
112
|
+
|
|
113
|
+
10) Termination for Patent Action. This License shall terminate automatically
|
|
114
|
+
and You may no longer exercise any of the rights granted to You by this License
|
|
115
|
+
as of the date You commence an action, including a cross-claim or counterclaim,
|
|
116
|
+
against Licensor or any licensee alleging that the Original Work infringes a
|
|
117
|
+
patent. This termination provision shall not apply for an action alleging patent
|
|
118
|
+
infringement by combinations of the Original Work with other software or
|
|
119
|
+
hardware.
|
|
120
|
+
|
|
121
|
+
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
|
|
122
|
+
License may be brought only in the courts of a jurisdiction wherein the Licensor
|
|
123
|
+
resides or in which Licensor conducts its primary business, and under the laws
|
|
124
|
+
of that jurisdiction excluding its conflict-of-law provisions. The application
|
|
125
|
+
of the United Nations Convention on Contracts for the International Sale of
|
|
126
|
+
Goods is expressly excluded. Any use of the Original Work outside the scope of
|
|
127
|
+
this License or after its termination shall be subject to the requirements and
|
|
128
|
+
penalties of copyright or patent law in the appropriate jurisdiction. This
|
|
129
|
+
section shall survive the termination of this License.
|
|
130
|
+
|
|
131
|
+
12) Attorneys' Fees. In any action to enforce the terms of this License or
|
|
132
|
+
seeking damages relating thereto, the prevailing party shall be entitled to
|
|
133
|
+
recover its costs and expenses, including, without limitation, reasonable
|
|
134
|
+
attorneys' fees and costs incurred in connection with such action, including any
|
|
135
|
+
appeal of such action. This section shall survive the termination of this
|
|
136
|
+
License.
|
|
137
|
+
|
|
138
|
+
13) Miscellaneous. If any provision of this License is held to be unenforceable,
|
|
139
|
+
such provision shall be reformed only to the extent necessary to make it
|
|
140
|
+
enforceable.
|
|
141
|
+
|
|
142
|
+
14) Definition of "You" in This License. "You" throughout this License, whether
|
|
143
|
+
in upper or lower case, means an individual or a legal entity exercising rights
|
|
144
|
+
under, and complying with all of the terms of, this License. For legal entities,
|
|
145
|
+
"You" includes any entity that controls, is controlled by, or is under common
|
|
146
|
+
control with you. For purposes of this definition, "control" means (i) the
|
|
147
|
+
power, direct or indirect, to cause the direction or management of such entity,
|
|
148
|
+
whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or
|
|
149
|
+
more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
150
|
+
|
|
151
|
+
15) Right to Use. You may use the Original Work in all ways not otherwise
|
|
152
|
+
restricted or conditioned by this License or by law, and Licensor promises not
|
|
153
|
+
to interfere with or be responsible for such uses by You.
|
|
154
|
+
|
|
155
|
+
16) Modification of This License. This License is Copyright (c) 2005 Lawrence
|
|
156
|
+
Rosen. Permission is granted to copy, distribute, or communicate this License
|
|
157
|
+
without modification. Nothing in this License permits You to modify this License
|
|
158
|
+
as applied to the Original Work or to Derivative Works. However, You may modify
|
|
159
|
+
the text of this License and copy, distribute or communicate your modified
|
|
160
|
+
version (the "Modified License") and apply it to other original works of
|
|
161
|
+
authorship subject to the following conditions: (i) You may not indicate in any
|
|
162
|
+
way that your Modified License is the "Open Software License" or "OSL" and you
|
|
163
|
+
may not use those names in the name of your Modified License; (ii) You must
|
|
164
|
+
replace the notice specified in the first paragraph above with the notice
|
|
165
|
+
"Licensed under <insert your license name here>" or with a notice of your own
|
|
166
|
+
that is not confusingly similar to the notice in this License; and (iii) You may
|
|
167
|
+
not claim that your original works are open source software unless your Modified
|
|
168
|
+
License has been approved by Open Source Initiative (OSI) and You comply with
|
|
169
|
+
its license review and certification process.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
BOM_Profiler.h - Binary Order of Magnitude Execution Time Profiler
|
|
3
|
+
Copyright (C) 2010 Robert D. Cameron and Dan Lin
|
|
4
|
+
Version 0.4
|
|
5
|
+
Licensed to the general public under Academic Free License version 3.0
|
|
6
|
+
|
|
7
|
+
BOM_Profiler provides a lightweight multiplatform execution time profiling
|
|
8
|
+
utility based on processor cycle counters. It uses a binary logarithmic
|
|
9
|
+
histogram technique that is useful in both highlighting patterns of
|
|
10
|
+
cycle time distributions as well as identifing outliers in timing events
|
|
11
|
+
due to interruptions for operating system services.
|
|
12
|
+
|
|
13
|
+
In essence, BOM profiler is designed to collect statistics over a number
|
|
14
|
+
of repetitions of particular timed events. Statistics are gathered in the
|
|
15
|
+
form of a logarithmic histogram of cycle times for processing a fixed number
|
|
16
|
+
of elements between calls to start_BOM_interval and end_BOM_interval.
|
|
17
|
+
For example, an interval may correspond to processing 1024 single-byte
|
|
18
|
+
elements by a particular routine.
|
|
19
|
+
|
|
20
|
+
A timer t is created and initialized by a call to t = init_BOM_timer().
|
|
21
|
+
Given a timer t, start_BOM_interval(t) initiates an interval measurement
|
|
22
|
+
which completes with end_BOM_interval(t, n), where n is the number of
|
|
23
|
+
elements processed.
|
|
24
|
+
|
|
25
|
+
dump_BOM_table(t) prints out a rudimentary histogram of the recorded
|
|
26
|
+
intervals for a particular timer.
|
|
27
|
+
|
|
28
|
+
Although the basic concept of BOM_Profiler is architecture independent,
|
|
29
|
+
processor-dependent routines for accessing time-stamp counters and
|
|
30
|
+
determining the binary order of magnitude are included through external
|
|
31
|
+
files.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
#ifndef BOM_Profiler_H
|
|
37
|
+
#define BOM_Profiler_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
#include "i386_timer.h"
|
|
41
|
+
|
|
42
|
+
#define BIT_COUNT 64
|
|
43
|
+
#define MAX_TIMER_ENTRIES (1<<18)
|
|
44
|
+
#define TIMER_SCALE_FACTOR 1000
|
|
45
|
+
|
|
46
|
+
struct BOM_Table {
|
|
47
|
+
// current timing interval information
|
|
48
|
+
int timer_on;
|
|
49
|
+
int full;
|
|
50
|
+
timestamp_t interval_start[MAX_TIMER_ENTRIES];
|
|
51
|
+
timestamp_t interval_end[MAX_TIMER_ENTRIES];
|
|
52
|
+
unsigned int interval_elems[MAX_TIMER_ENTRIES];
|
|
53
|
+
unsigned int current_entry;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
typedef struct BOM_Table BOM_Table;
|
|
57
|
+
|
|
58
|
+
BOM_Table * init_BOM_timer () {
|
|
59
|
+
BOM_Table * timer_table = (BOM_Table *) malloc(sizeof(BOM_Table));
|
|
60
|
+
if (!timer_table) {
|
|
61
|
+
printf("Couldn't initialize BOM timer.\n");
|
|
62
|
+
exit(-1);
|
|
63
|
+
}
|
|
64
|
+
timer_table -> current_entry = 0;
|
|
65
|
+
timer_table -> full = 0;
|
|
66
|
+
timer_table -> timer_on = 0;
|
|
67
|
+
return timer_table;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
static inline void start_BOM_interval(BOM_Table * timer_table) {
|
|
72
|
+
timer_table->timer_on = 1;
|
|
73
|
+
timer_table->interval_start[timer_table->current_entry] = read_cycle_counter();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static inline void end_BOM_interval(BOM_Table * timer_table, unsigned int elems) {
|
|
77
|
+
if (timer_table->timer_on) {
|
|
78
|
+
timer_table->interval_end[timer_table->current_entry] = read_cycle_counter();
|
|
79
|
+
timer_table->interval_elems[timer_table->current_entry] = elems;
|
|
80
|
+
timer_table->current_entry++;
|
|
81
|
+
if(timer_table->current_entry >= MAX_TIMER_ENTRIES) {
|
|
82
|
+
timer_table->full=1;
|
|
83
|
+
timer_table->current_entry=0;
|
|
84
|
+
}
|
|
85
|
+
timer_table->timer_on = 0;
|
|
86
|
+
}
|
|
87
|
+
else
|
|
88
|
+
fprintf(stderr,"Time interval end without a start!\n");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
void dump_BOM_table(BOM_Table * timer_table) {
|
|
92
|
+
// an array of counts and timings per binary order of magnitude
|
|
93
|
+
int BOM_count[BIT_COUNT];
|
|
94
|
+
unsigned int BOM_elems[BIT_COUNT];
|
|
95
|
+
timestamp_t BOM_total_time[BIT_COUNT];
|
|
96
|
+
|
|
97
|
+
int BOM, b;
|
|
98
|
+
int this_count;
|
|
99
|
+
int cum_count = 0;
|
|
100
|
+
unsigned int entry = 0;
|
|
101
|
+
unsigned int total_entries;
|
|
102
|
+
unsigned int this_elems = 0;
|
|
103
|
+
unsigned int cum_elems = 0;
|
|
104
|
+
timestamp_t this_time;
|
|
105
|
+
timestamp_t cum_time = 0ULL;
|
|
106
|
+
timestamp_t this_avg;
|
|
107
|
+
timestamp_t cum_avg;
|
|
108
|
+
timestamp_t accumulated_cycles;
|
|
109
|
+
|
|
110
|
+
for (b = 0; b < BIT_COUNT; b++) {
|
|
111
|
+
BOM_count[b] = 0;
|
|
112
|
+
BOM_elems[b] = 0;
|
|
113
|
+
BOM_total_time[b] = 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
total_entries = timer_table->full ? MAX_TIMER_ENTRIES : timer_table->current_entry;
|
|
118
|
+
for(entry = 0; entry < total_entries; entry++){
|
|
119
|
+
accumulated_cycles = timer_table->interval_end[entry] - timer_table->interval_start[entry];
|
|
120
|
+
if (accumulated_cycles > 0ULL) {
|
|
121
|
+
BOM = binary_order_of_magnitude(accumulated_cycles*TIMER_SCALE_FACTOR/timer_table->interval_elems[entry]);
|
|
122
|
+
BOM_count[BOM]++;
|
|
123
|
+
BOM_elems[BOM] += timer_table->interval_elems[entry];
|
|
124
|
+
BOM_total_time[BOM] += accumulated_cycles;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
printf("Binary Order of Magnitude Profile\n");
|
|
129
|
+
for (b = 0; b < BIT_COUNT; b++) {
|
|
130
|
+
this_count = BOM_count[b];
|
|
131
|
+
cum_count += this_count;
|
|
132
|
+
this_time = BOM_total_time[b];
|
|
133
|
+
cum_time += this_time;
|
|
134
|
+
this_elems = BOM_elems[b];
|
|
135
|
+
cum_elems += this_elems;
|
|
136
|
+
if (this_count == 0) this_avg = 0ULL;
|
|
137
|
+
else this_avg = (TIMER_SCALE_FACTOR*this_time)/(this_elems);
|
|
138
|
+
if (cum_count == 0) cum_avg = 0ULL;
|
|
139
|
+
else cum_avg = (TIMER_SCALE_FACTOR*cum_time)/(cum_elems);
|
|
140
|
+
if (this_count > 0) { // Only report intervals with nonzero counts.
|
|
141
|
+
printf("BOM %i: %i ", b, this_count);
|
|
142
|
+
printf("(avg time: %i %s/kElem) ", (int) this_avg, cycle_counter_units);
|
|
143
|
+
printf("Cumulative: %i ", cum_count);
|
|
144
|
+
printf("(avg: %i %s/kElem)\n", (int) cum_avg, cycle_counter_units);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
#endif
|