authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-07 06:48:29+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-07 06:48:29+02:00
log9fe22a29b34e274af4f1d67a08c7757d2d0bc1fa
treef07150b07bce601b2378cb6f1de41233f00b3eac
parent6c78e9250de36f2e21e710940e6f8d0e8516556f
parent0375ec45ab2036b4a971f09d9710c577c11da492
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

Merge branch 'llvm23'


923 files changed, 30386 insertions(+), 18366 deletions(-)

CMakeLists.txt+3-6
...@@ -133,9 +133,9 @@ else()...@@ -133,9 +133,9 @@ else()
133 set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")133 set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
134endif()134endif()
135135
136find_package(llvm 22)136find_package(llvm 23)
137find_package(clang 22)137find_package(clang 23)
138find_package(lld 22)138find_package(lld 23)
139139
140if(ZIG_STATIC_ZLIB)140if(ZIG_STATIC_ZLIB)
141 if (MSVC)141 if (MSVC)
...@@ -614,9 +614,6 @@ else()...@@ -614,9 +614,6 @@ else()
614 set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99")614 set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99")
615 set(ZIG1_COMPILE_FLAGS "-std=c99 -Oz -fno-strict-aliasing")615 set(ZIG1_COMPILE_FLAGS "-std=c99 -Oz -fno-strict-aliasing")
616 set(ZIG2_COMPILE_FLAGS "-std=c99 -Oz -fno-sanitize=undefined -fno-stack-protector -fno-strict-aliasing")616 set(ZIG2_COMPILE_FLAGS "-std=c99 -Oz -fno-sanitize=undefined -fno-stack-protector -fno-strict-aliasing")
617 if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ZIG_HOST_TARGET_ARCH STREQUAL "s390x")
618 string(REPLACE -Oz -O0 ZIG2_COMPILE_FLAGS "${ZIG2_COMPILE_FLAGS}") # llvm 22 assertion failure
619 endif()
620 # Must match the condition in build.zig.617 # Must match the condition in build.zig.
621 if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH EQUAL "hexagon" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$")618 if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH EQUAL "hexagon" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$")
622 set(ZIG1_COMPILE_FLAGS "${ZIG1_COMPILE_FLAGS} -ffunction-sections -fdata-sections")619 set(ZIG1_COMPILE_FLAGS "${ZIG1_COMPILE_FLAGS} -ffunction-sections -fdata-sections")
README.md+41-41
...@@ -47,7 +47,7 @@ Ensure you have the required dependencies:...@@ -47,7 +47,7 @@ Ensure you have the required dependencies:
4747
48 * CMake >= 3.1548 * CMake >= 3.15
49 * System C/C++ Toolchain49 * System C/C++ Toolchain
50 * LLVM, Clang, LLD development libraries, version 22.x, compiled with the50 * LLVM, Clang, LLD development libraries, version 23.x, compiled with the
51 same system C/C++ toolchain.51 same system C/C++ toolchain.
52 - If the system package manager lacks these libraries, or has them misconfigured,52 - If the system package manager lacks these libraries, or has them misconfigured,
53 see below for how to build them from source.53 see below for how to build them from source.
...@@ -257,15 +257,15 @@ that you have **no** trailing slash (`/` or `\`) at the end of the...@@ -257,15 +257,15 @@ that you have **no** trailing slash (`/` or `\`) at the end of the
257257
258Install [CMake](https://cmake.org/), version 3.20.0 or newer.258Install [CMake](https://cmake.org/), version 3.20.0 or newer.
259259
260[Download LLVM, Clang, and LLD sources](https://releases.llvm.org/download.html#22.0.0)260[Download LLVM, Clang, and LLD sources](https://releases.llvm.org/download.html#23.0.0)
261The downloads from llvm lead to the github release pages, where the source's261The downloads from llvm lead to the github release pages, where the source's
262will be listed as : `llvm-22.X.X.src.tar.xz`, `clang-22.X.X.src.tar.xz`,262will be listed as : `llvm-23.X.X.src.tar.xz`, `clang-23.X.X.src.tar.xz`,
263`lld-22.X.X.src.tar.xz`. Unzip each to their own directory. Ensure no263`lld-23.X.X.src.tar.xz`. Unzip each to their own directory. Ensure no
264directories have spaces in them. For example:264directories have spaces in them. For example:
265265
266 * `C:\Users\Andy\llvm-22.0.0.src`266 * `C:\Users\Andy\llvm-23.0.0.src`
267 * `C:\Users\Andy\clang-22.0.0.src`267 * `C:\Users\Andy\clang-23.0.0.src`
268 * `C:\Users\Andy\lld-22.0.0.src`268 * `C:\Users\Andy\lld-23.0.0.src`
269269
270Install [Build Tools for Visual Studio270Install [Build Tools for Visual Studio
2712019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019).2712019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019).
...@@ -298,9 +298,9 @@ Using the start menu, run **x64 Native Tools Command Prompt for VS 2019** and ex...@@ -298,9 +298,9 @@ Using the start menu, run **x64 Native Tools Command Prompt for VS 2019** and ex
298##### Release Mode298##### Release Mode
299299
300```bat300```bat
301mkdir C:\Users\Andy\llvm-22.0.0.src\build-release301mkdir C:\Users\Andy\llvm-23.0.0.src\build-release
302cd C:\Users\Andy\llvm-22.0.0.src\build-release302cd C:\Users\Andy\llvm-23.0.0.src\build-release
303"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-release-mt -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-release-mt -303"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-release-mt -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-release-mt -
304DLLVM_ENABLE_ZLIB=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_USE_CRT_RELEASE=MT304DLLVM_ENABLE_ZLIB=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_USE_CRT_RELEASE=MT
305msbuild /m -p:Configuration=Release INSTALL.vcxproj305msbuild /m -p:Configuration=Release INSTALL.vcxproj
306```306```
...@@ -308,10 +308,10 @@ msbuild /m -p:Configuration=Release INSTALL.vcxproj...@@ -308,10 +308,10 @@ msbuild /m -p:Configuration=Release INSTALL.vcxproj
308##### Debug Mode308##### Debug Mode
309309
310```bat310```bat
311mkdir C:\Users\Andy\llvm-22.0.0.src\build-debug311mkdir C:\Users\Andy\llvm-23.0.0.src\build-debug
312cd C:\Users\Andy\llvm-22.0.0.src\build-debug312cd C:\Users\Andy\llvm-23.0.0.src\build-debug
313"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-debug -313"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-debug -
314DLLVM_ENABLE_ZLIB=OFF -DCMAKE_PREFIX_PATH=C:\Users\andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-debug -DCMAKE_BUILD_TYPE=Debug -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR" -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_USE_CRT_DEBUG=MTd314DLLVM_ENABLE_ZLIB=OFF -DCMAKE_PREFIX_PATH=C:\Users\andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-debug -DCMAKE_BUILD_TYPE=Debug -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR" -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_USE_CRT_DEBUG=MTd
315msbuild /m INSTALL.vcxproj315msbuild /m INSTALL.vcxproj
316```316```
317317
...@@ -322,18 +322,18 @@ Using the start menu, run **x64 Native Tools Command Prompt for VS 2019** and ex...@@ -322,18 +322,18 @@ Using the start menu, run **x64 Native Tools Command Prompt for VS 2019** and ex
322##### Release Mode322##### Release Mode
323323
324```bat324```bat
325mkdir C:\Users\Andy\lld-22.0.0.src\build-release325mkdir C:\Users\Andy\lld-23.0.0.src\build-release
326cd C:\Users\Andy\lld-22.0.0.src\build-release326cd C:\Users\Andy\lld-23.0.0.src\build-release
327"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang+lld-14.0.6-x86_64-windows-msvc-release-mt -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-release-mt -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT327"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang+lld-14.0.6-x86_64-windows-msvc-release-mt -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-release-mt -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT
328msbuild /m -p:Configuration=Release INSTALL.vcxproj328msbuild /m -p:Configuration=Release INSTALL.vcxproj
329```329```
330330
331##### Debug Mode331##### Debug Mode
332332
333```bat333```bat
334mkdir C:\Users\Andy\lld-22.0.0.src\build-debug334mkdir C:\Users\Andy\lld-23.0.0.src\build-debug
335cd C:\Users\Andy\lld-22.0.0.src\build-debug335cd C:\Users\Andy\lld-23.0.0.src\build-debug
336"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-debug -DCMAKE_PREFIX_PATH=C:\Users\andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-debug -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_CRT_DEBUG=MTd336"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-debug -DCMAKE_PREFIX_PATH=C:\Users\andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-debug -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_CRT_DEBUG=MTd
337msbuild /m INSTALL.vcxproj337msbuild /m INSTALL.vcxproj
338```338```
339339
...@@ -344,18 +344,18 @@ Using the start menu, run **x64 Native Tools Command Prompt for VS 2019** and ex...@@ -344,18 +344,18 @@ Using the start menu, run **x64 Native Tools Command Prompt for VS 2019** and ex
344##### Release Mode344##### Release Mode
345345
346```bat346```bat
347mkdir C:\Users\Andy\clang-22.0.0.src\build-release347mkdir C:\Users\Andy\clang-23.0.0.src\build-release
348cd C:\Users\Andy\clang-22.0.0.src\build-release348cd C:\Users\Andy\clang-23.0.0.src\build-release
349"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-release-mt -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-release-mt -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT349"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-release-mt -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-release-mt -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT
350msbuild /m -p:Configuration=Release INSTALL.vcxproj350msbuild /m -p:Configuration=Release INSTALL.vcxproj
351```351```
352352
353##### Debug Mode353##### Debug Mode
354354
355```bat355```bat
356mkdir C:\Users\Andy\clang-22.0.0.src\build-debug356mkdir C:\Users\Andy\clang-23.0.0.src\build-debug
357cd C:\Users\Andy\clang-22.0.0.src\build-debug357cd C:\Users\Andy\clang-23.0.0.src\build-debug
358"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-debug -DCMAKE_PREFIX_PATH=C:\Users\andy\llvm+clang+lld-22.0.0-x86_64-windows-msvc-debug -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_CRT_DEBUG=MTd358"c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:\Users\andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-debug -DCMAKE_PREFIX_PATH=C:\Users\andy\llvm+clang+lld-23.0.0-x86_64-windows-msvc-debug -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_CRT_DEBUG=MTd
359msbuild /m INSTALL.vcxproj359msbuild /m INSTALL.vcxproj
360```360```
361361
...@@ -371,14 +371,14 @@ This is the generally recommended approach....@@ -371,14 +371,14 @@ This is the generally recommended approach.
371371
372```sh372```sh
373cd ~/Downloads373cd ~/Downloads
374git clone --depth 1 --branch release/22.x https://github.com/llvm/llvm-project llvm-project-22374git clone --depth 1 --branch release/23.x https://github.com/llvm/llvm-project llvm-project-23
375cd llvm-project-22375cd llvm-project-23
376git checkout release/22.x376git checkout release/23.x
377377
378mkdir build-release378mkdir build-release
379cd build-release379cd build-release
380cmake ../llvm \380cmake ../llvm \
381 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm22-assert \381 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm23-assert \
382 -DCMAKE_BUILD_TYPE=Release \382 -DCMAKE_BUILD_TYPE=Release \
383 -DLLVM_ENABLE_PROJECTS="lld;clang" \383 -DLLVM_ENABLE_PROJECTS="lld;clang" \
384 -DLLVM_ENABLE_LIBXML2=OFF \384 -DLLVM_ENABLE_LIBXML2=OFF \
...@@ -399,16 +399,16 @@ others are in Release mode....@@ -399,16 +399,16 @@ others are in Release mode.
399399
400```sh400```sh
401cd ~/Downloads401cd ~/Downloads
402git clone --depth 1 --branch release/22.x https://github.com/llvm/llvm-project llvm-project-22402git clone --depth 1 --branch release/23.x https://github.com/llvm/llvm-project llvm-project-23
403cd llvm-project-22403cd llvm-project-23
404git checkout release/22.x404git checkout release/23.x
405405
406# LLVM406# LLVM
407mkdir llvm/build-debug407mkdir llvm/build-debug
408cd llvm/build-debug408cd llvm/build-debug
409cmake .. \409cmake .. \
410 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm22-debug \410 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm23-debug \
411 -DCMAKE_PREFIX_PATH=$HOME/local/llvm22-debug \411 -DCMAKE_PREFIX_PATH=$HOME/local/llvm23-debug \
412 -DCMAKE_BUILD_TYPE=Debug \412 -DCMAKE_BUILD_TYPE=Debug \
413 -DLLVM_ENABLE_LIBXML2=OFF \413 -DLLVM_ENABLE_LIBXML2=OFF \
414 -DLLVM_ENABLE_TERMINFO=OFF \414 -DLLVM_ENABLE_TERMINFO=OFF \
...@@ -422,8 +422,8 @@ cd ../.....@@ -422,8 +422,8 @@ cd ../..
422mkdir lld/build-debug422mkdir lld/build-debug
423cd lld/build-debug423cd lld/build-debug
424cmake .. \424cmake .. \
425 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm22-debug \425 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm23-debug \
426 -DCMAKE_PREFIX_PATH=$HOME/local/llvm22-debug \426 -DCMAKE_PREFIX_PATH=$HOME/local/llvm23-debug \
427 -DCMAKE_BUILD_TYPE=Release \427 -DCMAKE_BUILD_TYPE=Release \
428 -DLLVM_PARALLEL_LINK_JOBS=1 \428 -DLLVM_PARALLEL_LINK_JOBS=1 \
429 -DCMAKE_CXX_STANDARD=17 \429 -DCMAKE_CXX_STANDARD=17 \
...@@ -435,8 +435,8 @@ cd ../.....@@ -435,8 +435,8 @@ cd ../..
435mkdir clang/build-debug435mkdir clang/build-debug
436cd clang/build-debug436cd clang/build-debug
437cmake .. \437cmake .. \
438 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm22-debug \438 -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm23-debug \
439 -DCMAKE_PREFIX_PATH=$HOME/local/llvm22-debug \439 -DCMAKE_PREFIX_PATH=$HOME/local/llvm23-debug \
440 -DCMAKE_BUILD_TYPE=Release \440 -DCMAKE_BUILD_TYPE=Release \
441 -DLLVM_PARALLEL_LINK_JOBS=1 \441 -DLLVM_PARALLEL_LINK_JOBS=1 \
442 -DLLVM_INCLUDE_TESTS=OFF \442 -DLLVM_INCLUDE_TESTS=OFF \
...@@ -446,8 +446,8 @@ cd ../.....@@ -446,8 +446,8 @@ cd ../..
446```446```
447447
448Then add to your Zig CMake line that you got from the README.md:448Then add to your Zig CMake line that you got from the README.md:
449`-DCMAKE_PREFIX_PATH=$HOME/local/llvm22-debug` or449`-DCMAKE_PREFIX_PATH=$HOME/local/llvm23-debug` or
450`-DCMAKE_PREFIX_PATH=$HOME/local/llvm22-assert` depending on whether you want450`-DCMAKE_PREFIX_PATH=$HOME/local/llvm23-assert` depending on whether you want
451Debug or Release LLVM.451Debug or Release LLVM.
452452
453453
build.zig+8-4
...@@ -1362,20 +1362,23 @@ const clang_libs = [_][]const u8{...@@ -1362,20 +1362,23 @@ const clang_libs = [_][]const u8{
1362 "clangStaticAnalyzerCheckers",1362 "clangStaticAnalyzerCheckers",
1363 "clangStaticAnalyzerCore",1363 "clangStaticAnalyzerCore",
1364 "clangCrossTU",1364 "clangCrossTU",
1365 "clangFrontend",
1366 "clangDriver",1365 "clangDriver",
1366 "clangScalableStaticAnalysisAnalyses",
1367 "clangScalableStaticAnalysisCore",
1368 "clangScalableStaticAnalysisFrontend",
1369 "clangScalableStaticAnalysisSourceTransformation",
1370 "clangDependencyScanning",
1371 "clangFrontend",
1367 "clangOptions",1372 "clangOptions",
1368 "clangSerialization",1373 "clangSerialization",
1369 "clangSema",1374 "clangSema",
1370 "clangAnalysisLifetimeSafety",1375 "clangAnalysisLifetimeSafety",
1371 "clangAnalysis",1376 "clangAnalysis",
1372 "clangASTMatchers",1377 "clangASTMatchers",
1373 "clangAST",
1374 "clangParse",1378 "clangParse",
1375 "clangSema",
1376 "clangAPINotes",1379 "clangAPINotes",
1377 "clangBasic",
1378 "clangEdit",1380 "clangEdit",
1381 "clangUnifiedSymbolResolution",
1379 "clangLex",1382 "clangLex",
1380 "clangRewriteFrontend",1383 "clangRewriteFrontend",
1381 "clangRewrite",1384 "clangRewrite",
...@@ -1387,6 +1390,7 @@ const clang_libs = [_][]const u8{...@@ -1387,6 +1390,7 @@ const clang_libs = [_][]const u8{
1387 "clangSupport",1390 "clangSupport",
1388 "clangInstallAPI",1391 "clangInstallAPI",
1389 "clangAST",1392 "clangAST",
1393 "clangBasic",
1390};1394};
1391const lld_libs = [_][]const u8{1395const lld_libs = [_][]const u8{
1392 "lldMinGW",1396 "lldMinGW",
ci/aarch64-freebsd-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-freebsd-none"8TARGET="aarch64-freebsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-freebsd-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-freebsd-none"8TARGET="aarch64-freebsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-linux-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-linux-musl"8TARGET="aarch64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-linux-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-linux-musl"8TARGET="aarch64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-macos-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-macos-none"8TARGET="aarch64-macos-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/$CACHE_BASENAME"11PREFIX="$HOME/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-macos-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-macos-none"8TARGET="aarch64-macos-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/$CACHE_BASENAME"11PREFIX="$HOME/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-netbsd-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-netbsd-none"8TARGET="aarch64-netbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-netbsd-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-netbsd-none"8TARGET="aarch64-netbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-openbsd-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-openbsd-none"8TARGET="aarch64-openbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.2030+f955266cf"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-openbsd-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="aarch64-openbsd-none"8TARGET="aarch64-openbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.2030+f955266cf"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/aarch64-windows-debug.ps1+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1$TARGET = "aarch64-windows-gnu"1$TARGET = "aarch64-windows-gnu"
2$MCPU = "baseline"2$MCPU = "baseline"
3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
4$ZIG = "$PREFIX_PATH\bin\zig.exe"4$ZIG = "$PREFIX_PATH\bin\zig.exe"
5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }
66
ci/aarch64-windows-release.ps1+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1$TARGET = "aarch64-windows-gnu"1$TARGET = "aarch64-windows-gnu"
2$MCPU = "baseline"2$MCPU = "baseline"
3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
4$ZIG = "$PREFIX_PATH\bin\zig.exe"4$ZIG = "$PREFIX_PATH\bin\zig.exe"
5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }
66
ci/loongarch64-linux-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="loongarch64-linux-musl"8TARGET="loongarch64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/loongarch64-linux-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="loongarch64-linux-musl"8TARGET="loongarch64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/powerpc64le-linux-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="powerpc64le-linux-musl"8TARGET="powerpc64le-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/powerpc64le-linux-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="powerpc64le-linux-musl"8TARGET="powerpc64le-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/riscv64-linux-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="riscv64-linux-musl"8TARGET="riscv64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/riscv64-linux-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="riscv64-linux-musl"8TARGET="riscv64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/s390x-linux-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="s390x-linux-musl"8TARGET="s390x-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/s390x-linux-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="s390x-linux-musl"8TARGET="s390x-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-freebsd-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-freebsd-none"8TARGET="x86_64-freebsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-freebsd-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-freebsd-none"8TARGET="x86_64-freebsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-linux-debug-llvm.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-linux-musl"8TARGET="x86_64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-linux-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-linux-musl"8TARGET="x86_64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-linux-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-linux-musl"8TARGET="x86_64-linux-musl"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-netbsd-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-netbsd-none"8TARGET="x86_64-netbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-netbsd-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-netbsd-none"8TARGET="x86_64-netbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-openbsd-debug.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-openbsd-none"8TARGET="x86_64-openbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-openbsd-release.sh+1-1
...@@ -7,7 +7,7 @@ set -e...@@ -7,7 +7,7 @@ set -e
77
8TARGET="x86_64-openbsd-none"8TARGET="x86_64-openbsd-none"
9MCPU="baseline"9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
11PREFIX="$HOME/deps/$CACHE_BASENAME"11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"12ZIG="$PREFIX/bin/zig"
1313
ci/x86_64-windows-debug.ps1+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1$TARGET = "x86_64-windows-gnu"1$TARGET = "x86_64-windows-gnu"
2$MCPU = "baseline"2$MCPU = "baseline"
3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
4$ZIG = "$PREFIX_PATH\bin\zig.exe"4$ZIG = "$PREFIX_PATH\bin\zig.exe"
5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }
66
ci/x86_64-windows-release.ps1+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1$TARGET = "x86_64-windows-gnu"1$TARGET = "x86_64-windows-gnu"
2$MCPU = "baseline"2$MCPU = "baseline"
3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"3$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.18.0-dev.92+1e1964473"
4$ZIG = "$PREFIX_PATH\bin\zig.exe"4$ZIG = "$PREFIX_PATH\bin\zig.exe"
5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }5$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 }
66
cmake/Findclang.cmake+11-5
...@@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h...@@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
17if(${LLVM_LINK_MODE} STREQUAL "shared")17if(${LLVM_LINK_MODE} STREQUAL "shared")
18 find_library(CLANG_LIBRARIES18 find_library(CLANG_LIBRARIES
19 NAMES19 NAMES
20 libclang-cpp.so.2220 libclang-cpp.so.23
21 libclang-cpp.so.22.121 libclang-cpp.so.23.1
22 clang-cpp-22.022 clang-cpp-23.0
23 clang-cpp22023 clang-cpp230
24 clang-cpp24 clang-cpp
25 NAMES_PER_DIR25 NAMES_PER_DIR
26 HINTS "${LLVM_LIBDIRS}"26 HINTS "${LLVM_LIBDIRS}"
...@@ -48,8 +48,13 @@ else()...@@ -48,8 +48,13 @@ else()
48 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)48 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
49 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)49 FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
50 FIND_AND_ADD_CLANG_LIB(clangCrossTU)50 FIND_AND_ADD_CLANG_LIB(clangCrossTU)
51 FIND_AND_ADD_CLANG_LIB(clangFrontend)
52 FIND_AND_ADD_CLANG_LIB(clangDriver)51 FIND_AND_ADD_CLANG_LIB(clangDriver)
52 FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisAnalyses)
53 FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisCore)
54 FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisFrontend)
55 FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisSourceTransformation)
56 FIND_AND_ADD_CLANG_LIB(clangDependencyScanning)
57 FIND_AND_ADD_CLANG_LIB(clangFrontend)
53 FIND_AND_ADD_CLANG_LIB(clangOptions)58 FIND_AND_ADD_CLANG_LIB(clangOptions)
54 FIND_AND_ADD_CLANG_LIB(clangSerialization)59 FIND_AND_ADD_CLANG_LIB(clangSerialization)
55 FIND_AND_ADD_CLANG_LIB(clangSema)60 FIND_AND_ADD_CLANG_LIB(clangSema)
...@@ -59,6 +64,7 @@ else()...@@ -59,6 +64,7 @@ else()
59 FIND_AND_ADD_CLANG_LIB(clangParse)64 FIND_AND_ADD_CLANG_LIB(clangParse)
60 FIND_AND_ADD_CLANG_LIB(clangAPINotes)65 FIND_AND_ADD_CLANG_LIB(clangAPINotes)
61 FIND_AND_ADD_CLANG_LIB(clangEdit)66 FIND_AND_ADD_CLANG_LIB(clangEdit)
67 FIND_AND_ADD_CLANG_LIB(clangUnifiedSymbolResolution)
62 FIND_AND_ADD_CLANG_LIB(clangLex)68 FIND_AND_ADD_CLANG_LIB(clangLex)
63 FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)69 FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)
64 FIND_AND_ADD_CLANG_LIB(clangRewrite)70 FIND_AND_ADD_CLANG_LIB(clangRewrite)
cmake/Findlld.cmake+19-19
...@@ -9,23 +9,23 @@...@@ -9,23 +9,23 @@
9find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h9find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
10 HINTS ${LLVM_INCLUDE_DIRS}10 HINTS ${LLVM_INCLUDE_DIRS}
11 PATHS11 PATHS
12 /usr/lib/llvm-22/include12 /usr/lib/llvm-23/include
13 /usr/local/llvm220/include13 /usr/local/llvm230/include
14 /usr/local/llvm22/include14 /usr/local/llvm23/include
15 /usr/local/opt/lld@22/include15 /usr/local/opt/lld@23/include
16 /opt/homebrew/opt/lld@22/include16 /opt/homebrew/opt/lld@23/include
17 /home/linuxbrew/.linuxbrew/opt/lld@22/include17 /home/linuxbrew/.linuxbrew/opt/lld@23/include
18 /mingw64/include)18 /mingw64/include)
1919
20find_library(LLD_LIBRARY NAMES lld-22.0 lld220 lld NAMES_PER_DIR20find_library(LLD_LIBRARY NAMES lld-23.0 lld230 lld NAMES_PER_DIR
21 HINTS ${LLVM_LIBDIRS}21 HINTS ${LLVM_LIBDIRS}
22 PATHS22 PATHS
23 /usr/lib/llvm-22/lib23 /usr/lib/llvm-23/lib
24 /usr/local/llvm220/lib24 /usr/local/llvm230/lib
25 /usr/local/llvm22/lib25 /usr/local/llvm23/lib
26 /usr/local/opt/lld@22/lib26 /usr/local/opt/lld@23/lib
27 /opt/homebrew/opt/lld@22/lib27 /opt/homebrew/opt/lld@23/lib
28 /home/linuxbrew/.linuxbrew/opt/lld@22/lib28 /home/linuxbrew/.linuxbrew/opt/lld@23/lib
29)29)
30if(EXISTS ${LLD_LIBRARY})30if(EXISTS ${LLD_LIBRARY})
31 set(LLD_LIBRARIES ${LLD_LIBRARY})31 set(LLD_LIBRARIES ${LLD_LIBRARY})
...@@ -36,12 +36,12 @@ else()...@@ -36,12 +36,12 @@ else()
36 HINTS ${LLVM_LIBDIRS}36 HINTS ${LLVM_LIBDIRS}
37 PATHS37 PATHS
38 ${LLD_LIBDIRS}38 ${LLD_LIBDIRS}
39 /usr/lib/llvm-22/lib39 /usr/lib/llvm-23/lib
40 /usr/local/llvm220/lib40 /usr/local/llvm230/lib
41 /usr/local/llvm22/lib41 /usr/local/llvm23/lib
42 /usr/local/opt/lld@22/lib42 /usr/local/opt/lld@23/lib
43 /opt/homebrew/opt/lld@22/lib43 /opt/homebrew/opt/lld@23/lib
44 /home/linuxbrew/.linuxbrew/opt/lld@22/lib44 /home/linuxbrew/.linuxbrew/opt/lld@23/lib
45 /mingw64/lib45 /mingw64/lib
46 /c/msys64/mingw64/lib46 /c/msys64/mingw64/lib
47 c:/msys64/mingw64/lib)47 c:/msys64/mingw64/lib)
cmake/Findllvm.cmake+6-6
...@@ -17,12 +17,12 @@ if(ZIG_USE_LLVM_CONFIG)...@@ -17,12 +17,12 @@ if(ZIG_USE_LLVM_CONFIG)
17 # terminate when the right LLVM version is not found.17 # terminate when the right LLVM version is not found.
18 unset(LLVM_CONFIG_EXE CACHE)18 unset(LLVM_CONFIG_EXE CACHE)
19 find_program(LLVM_CONFIG_EXE19 find_program(LLVM_CONFIG_EXE
20 NAMES llvm-config-22 llvm-config-22.0 llvm-config220 llvm-config22 llvm-config NAMES_PER_DIR20 NAMES llvm-config-23 llvm-config-23.0 llvm-config230 llvm-config23 llvm-config NAMES_PER_DIR
21 PATHS21 PATHS
22 "/mingw64/bin"22 "/mingw64/bin"
23 "/c/msys64/mingw64/bin"23 "/c/msys64/mingw64/bin"
24 "c:/msys64/mingw64/bin"24 "c:/msys64/mingw64/bin"
25 "C:/Libraries/llvm-22.0.0/bin")25 "C:/Libraries/llvm-23.0.0/bin")
2626
27 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")27 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
28 if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")28 if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")
...@@ -40,9 +40,9 @@ if(ZIG_USE_LLVM_CONFIG)...@@ -40,9 +40,9 @@ if(ZIG_USE_LLVM_CONFIG)
40 OUTPUT_STRIP_TRAILING_WHITESPACE)40 OUTPUT_STRIP_TRAILING_WHITESPACE)
4141
42 get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)42 get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)
43 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 22 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 23 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 23)43 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 23 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 24 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 24)
44 # Save the error message, in case this is the last llvm-config we find44 # Save the error message, in case this is the last llvm-config we find
45 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 22.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")45 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 23.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
4646
47 # Ignore this directory and try the search again47 # Ignore this directory and try the search again
48 list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")48 list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")
...@@ -66,9 +66,9 @@ if(ZIG_USE_LLVM_CONFIG)...@@ -66,9 +66,9 @@ if(ZIG_USE_LLVM_CONFIG)
66 if (LLVM_CONFIG_ERROR)66 if (LLVM_CONFIG_ERROR)
67 # Save the error message, in case this is the last llvm-config we find67 # Save the error message, in case this is the last llvm-config we find
68 if (ZIG_SHARED_LLVM)68 if (ZIG_SHARED_LLVM)
69 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 22.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")69 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 23.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
70 else()70 else()
71 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 22.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")71 list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 23.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
72 endif()72 endif()
7373
74 # Ignore this directory and try the search again74 # Ignore this directory and try the search again
lib/c/wchar.zig+1-6
...@@ -14,7 +14,6 @@ comptime {...@@ -14,7 +14,6 @@ comptime {
14 symbol(&wmemcpy, "wmemcpy");14 symbol(&wmemcpy, "wmemcpy");
15 symbol(&wmemmove, "wmemmove");15 symbol(&wmemmove, "wmemmove");
16 symbol(&wmemset, "wmemset");16 symbol(&wmemset, "wmemset");
17 symbol(&wcslen, "wcslen");
18 symbol(&wcsnlen, "wcsnlen");17 symbol(&wcsnlen, "wcsnlen");
19 symbol(&wcscmp, "wcscmp");18 symbol(&wcscmp, "wcscmp");
20 symbol(&wcsncmp, "wcsncmp");19 symbol(&wcsncmp, "wcsncmp");
...@@ -81,10 +80,6 @@ fn wmemset(dest: [*]wchar_t, elem: wchar_t, len: usize) callconv(.c) [*]wchar_t...@@ -81,10 +80,6 @@ fn wmemset(dest: [*]wchar_t, elem: wchar_t, len: usize) callconv(.c) [*]wchar_t
81 return dest;80 return dest;
82}81}
8382
84fn wcslen(str: [*:0]const wchar_t) callconv(.c) usize {
85 return std.mem.len(str);
86}
87
88fn wcsnlen(str: [*:0]const wchar_t, max: usize) callconv(.c) usize {83fn wcsnlen(str: [*:0]const wchar_t, max: usize) callconv(.c) usize {
89 for (0..max) |i| {84 for (0..max) |i| {
90 if (str[i] == 0) return i;85 if (str[i] == 0) return i;
...@@ -199,7 +194,7 @@ fn wcswcs(noalias haystack: [*:0]const wchar_t, noalias needle: [*:0]const wchar...@@ -199,7 +194,7 @@ fn wcswcs(noalias haystack: [*:0]const wchar_t, noalias needle: [*:0]const wchar
199}194}
200195
201fn wcsdup(str: [*:0]const wchar_t) callconv(.c) ?[*:0]wchar_t {196fn wcsdup(str: [*:0]const wchar_t) callconv(.c) ?[*:0]wchar_t {
202 const len = wcslen(str);197 const len = c.wcslen(str);
203 const size = (len + 1) * @sizeOf(wchar_t);198 const size = (len + 1) * @sizeOf(wchar_t);
204 const d_opaque = c.malloc(size) orelse return null;199 const d_opaque = c.malloc(size) orelse return null;
205 const d: [*]wchar_t = @ptrCast(@alignCast(d_opaque));200 const d: [*]wchar_t = @ptrCast(@alignCast(d_opaque));
lib/compiler/aro/aro/Compilation.zig-1
...@@ -675,7 +675,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {...@@ -675,7 +675,6 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void {
675 .{ .amx_fp8, "__AMX_FP8__" },675 .{ .amx_fp8, "__AMX_FP8__" },
676 .{ .amx_movrs, "__AMX_MOVRS__" },676 .{ .amx_movrs, "__AMX_MOVRS__" },
677 .{ .amx_avx512, "__AMX_AVX512__" },677 .{ .amx_avx512, "__AMX_AVX512__" },
678 .{ .amx_tf32, "__AMX_TF32__" },
679 .{ .cmpccxadd, "__CMPCCXADD__" },678 .{ .cmpccxadd, "__CMPCCXADD__" },
680 .{ .raoint, "__RAOINT__" },679 .{ .raoint, "__RAOINT__" },
681 .{ .avxifma, "__AVXIFMA__" },680 .{ .avxifma, "__AVXIFMA__" },
lib/compiler_rt.zig+5
...@@ -162,6 +162,7 @@ comptime {...@@ -162,6 +162,7 @@ comptime {
162 symbol(&bcmp, "bcmp");162 symbol(&bcmp, "bcmp");
163 _ = @import("compiler_rt/ssp.zig");163 _ = @import("compiler_rt/ssp.zig");
164 symbol(&strlen, "strlen");164 symbol(&strlen, "strlen");
165 symbol(&wcslen, "wcslen");
165 }166 }
166167
167 _ = @import("compiler_rt/elf.zig");168 _ = @import("compiler_rt/elf.zig");
...@@ -178,6 +179,10 @@ fn strlen(s: [*:0]const c_char) callconv(.c) usize {...@@ -178,6 +179,10 @@ fn strlen(s: [*:0]const c_char) callconv(.c) usize {
178 return std.mem.len(s);179 return std.mem.len(s);
179}180}
180181
182fn wcslen(s: [*:0]const std.c.wchar_t) callconv(.c) usize {
183 return std.mem.len(s);
184}
185
181fn memcmp(vl: [*]const u8, vr: [*]const u8, n: usize) callconv(.c) c_int {186fn memcmp(vl: [*]const u8, vr: [*]const u8, n: usize) callconv(.c) c_int {
182 var i: usize = 0;187 var i: usize = 0;
183 while (i < n) : (i += 1) {188 while (i < n) : (i += 1) {
lib/compiler_rt/float_from_int.zig-9
...@@ -287,10 +287,6 @@ comptime {...@@ -287,10 +287,6 @@ comptime {
287 } else {287 } else {
288 if (builtin.cpu.arch == .x86) {288 if (builtin.cpu.arch == .x86) {
289 symbol(&__floatuntitf_x86, "__floatuntitf");289 symbol(&__floatuntitf_x86, "__floatuntitf");
290 } else if (builtin.cpu.arch == .x86_64 and
291 (builtin.os.tag == .windows or builtin.os.tag == .uefi))
292 {
293 symbol(&__floatuntitf_x86_64_windows, "__floatuntitf");
294 } else {290 } else {
295 symbol(&__floatuntitf, "__floatuntitf");291 symbol(&__floatuntitf, "__floatuntitf");
296 }292 }
...@@ -452,11 +448,6 @@ fn __floatuntitf(a: u128) callconv(.c) compiler_rt.f128.Abi {...@@ -452,11 +448,6 @@ fn __floatuntitf(a: u128) callconv(.c) compiler_rt.f128.Abi {
452fn __floatuntitf_x86(a: f128) callconv(.c) compiler_rt.f128.Abi {448fn __floatuntitf_x86(a: f128) callconv(.c) compiler_rt.f128.Abi {
453 return compiler_rt.f128.toAbi(f128_floatFromInt_u128(@bitCast(a)));449 return compiler_rt.f128.toAbi(f128_floatFromInt_u128(@bitCast(a)));
454}450}
455fn __floatuntitf_x86_64_windows(a_lo: u64, a_hi: u64) callconv(.c) compiler_rt.f128.Abi {
456 return compiler_rt.f128.toAbi(f128_floatFromInt_u128(@bitCast(
457 packed struct { lo: u64, hi: u64 }{ .lo = a_lo, .hi = a_hi },
458 )));
459}
460pub fn f128_floatFromInt_u128(a: u128) f128 {451pub fn f128_floatFromInt_u128(a: u128) f128 {
461 return floatFromInt(f128, a);452 return floatFromInt(f128, a);
462}453}
lib/compiler_rt/udivmodei4.zig+1
...@@ -164,6 +164,7 @@ test "__udivei4/__umodei4" {...@@ -164,6 +164,7 @@ test "__udivei4/__umodei4" {
164 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;164 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
165 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;165 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
166 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;166 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
167 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch == .sparc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37056
167168
168 const RndGen = std.Random.DefaultPrng;169 const RndGen = std.Random.DefaultPrng;
169 var rnd = RndGen.init(42);170 var rnd = RndGen.init(42);
lib/include/__clang_spirv_libdevice_declares.h created+170
...@@ -0,0 +1,170 @@
1/*===-- __clang_spirv_libdevice_declares.h - decls for libdevice functions --===
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
10#ifndef __CLANG_SPIRV_LIBDEVICE_DECLARES_H__
11#define __CLANG_SPIRV_LIBDEVICE_DECLARES_H__
12
13#if defined(__cplusplus)
14extern "C" {
15#else
16_Pragma("push_macro(\"bool\")");
17#define bool _Bool
18#endif
19
20#define _CLC_OVERLOAD [[clang::overloadable]]
21#define _CLC_CONSTFN [[gnu::const]]
22// TODO: Add vector versions of the API in case it is required.
23_CLC_OVERLOAD _CLC_CONSTFN unsigned int __spirv_ocl_s_abs(int);
24_CLC_OVERLOAD _CLC_CONSTFN unsigned long __spirv_ocl_s_abs(long);
25_CLC_OVERLOAD _CLC_CONSTFN unsigned long long __spirv_ocl_s_abs(long long);
26_CLC_OVERLOAD _CLC_CONSTFN int __spirv_ocl_s_max(int, int);
27_CLC_OVERLOAD _CLC_CONSTFN long __spirv_ocl_s_max(long, long);
28_CLC_OVERLOAD _CLC_CONSTFN long long __spirv_ocl_s_max(long long, long long);
29_CLC_OVERLOAD _CLC_CONSTFN int __spirv_ocl_s_min(int, int);
30_CLC_OVERLOAD _CLC_CONSTFN long __spirv_ocl_s_min(long, long);
31_CLC_OVERLOAD _CLC_CONSTFN long long __spirv_ocl_s_min(long long, long long);
32_CLC_OVERLOAD _CLC_CONSTFN unsigned int __spirv_ocl_u_max(unsigned int,
33 unsigned int);
34_CLC_OVERLOAD _CLC_CONSTFN unsigned long __spirv_ocl_u_max(unsigned long,
35 unsigned long);
36_CLC_OVERLOAD _CLC_CONSTFN unsigned long long
37__spirv_ocl_u_max(unsigned long long, unsigned long long);
38_CLC_OVERLOAD _CLC_CONSTFN unsigned int __spirv_ocl_u_min(unsigned int,
39 unsigned int);
40_CLC_OVERLOAD _CLC_CONSTFN unsigned long __spirv_ocl_u_min(unsigned long,
41 unsigned long);
42_CLC_OVERLOAD _CLC_CONSTFN unsigned long long
43__spirv_ocl_u_min(unsigned long long, unsigned long long);
44_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_acos(float);
45_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_acos(double);
46_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_acosh(float);
47_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_acosh(double);
48_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_asin(float);
49_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_asin(double);
50_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_asinh(float);
51_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_asinh(double);
52_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_atan(float);
53_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_atan(double);
54_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_atan2(float, float);
55_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_atan2(double, double);
56_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_atanh(float);
57_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_atanh(double);
58_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_cbrt(float);
59_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_cbrt(double);
60_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_ceil(float);
61_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_ceil(double);
62_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_cos(float);
63_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_cos(double);
64_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_cosh(float);
65_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_cosh(double);
66_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_cospi(float);
67_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_cospi(double);
68_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_erf(float);
69_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_erf(double);
70_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_erfc(float);
71_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_erfc(double);
72_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_exp(float);
73_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_exp(double);
74_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_exp2(float);
75_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_exp2(double);
76_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_exp10(float);
77_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_exp10(double);
78_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_expm1(float);
79_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_expm1(double);
80_CLC_OVERLOAD _CLC_CONSTFN bool __spirv_IsNan(float);
81_CLC_OVERLOAD _CLC_CONSTFN bool __spirv_IsNan(double);
82_CLC_OVERLOAD _CLC_CONSTFN bool __spirv_IsInf(float);
83_CLC_OVERLOAD _CLC_CONSTFN bool __spirv_IsInf(double);
84_CLC_OVERLOAD _CLC_CONSTFN bool __spirv_IsFinite(float);
85_CLC_OVERLOAD _CLC_CONSTFN bool __spirv_IsFinite(double);
86_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_copysign(float, float);
87_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_copysign(double, double);
88_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_ldexp(float, int);
89_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_ldexp(double, int);
90_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fabs(float);
91_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fabs(double);
92_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_logb(float);
93_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_logb(double);
94_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fmax(float, float);
95_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fmax(double, double);
96_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fmin(float, float);
97_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fmin(double, double);
98_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fdim(float, float);
99_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fdim(double, double);
100_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_floor(float);
101_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_floor(double);
102_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fma(float, float, float);
103_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fma(double, double, double);
104_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fmod(float, float);
105_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fmod(double, double);
106_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_frexp(float, int *);
107_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_frexp(double, int *);
108_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_hypot(float, float);
109_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_hypot(double, double);
110_CLC_OVERLOAD _CLC_CONSTFN int __spirv_ocl_ilogb(float);
111_CLC_OVERLOAD _CLC_CONSTFN int __spirv_ocl_ilogb(double);
112_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_lgamma(float);
113_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_lgamma(double);
114_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_round(float);
115_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_round(double);
116_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_log(float);
117_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_log(double);
118_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_log10(float);
119_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_log10(double);
120_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_log1p(float);
121_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_log1p(double);
122_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_log2(float);
123_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_log2(double);
124_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_modf(float, float *);
125_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_modf(double, double *);
126_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_nan(int);
127_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_nan(unsigned int);
128_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_nan(long);
129_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_nan(unsigned long);
130_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_nextafter(float, float);
131_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_nextafter(double, double);
132_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_sqrt(float);
133_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_sqrt(double);
134_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_rsqrt(float);
135_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_rsqrt(double);
136_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_pow(float, float);
137_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_pow(double, double);
138_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_pown(float, int);
139_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_pown(double, int);
140_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_remainder(float, float);
141_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_remainder(double, double);
142_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_remquo(float, float, int *);
143_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_remquo(double, double, int *);
144_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_sin(float);
145_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_sin(double);
146_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_sincos(float, float *);
147_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_sincos(double, double *);
148_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_sinh(float);
149_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_sinh(double);
150_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_sinpi(float);
151_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_sinpi(double);
152_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_tan(float);
153_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_tan(double);
154_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_tanh(float);
155_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_tanh(double);
156_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_tgamma(float);
157_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_tgamma(double);
158_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_trunc(float);
159_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_trunc(double);
160_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_rint(float);
161_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_rint(double);
162_CLC_OVERLOAD _CLC_CONSTFN float __spirv_ocl_fclamp(float, float, float);
163_CLC_OVERLOAD _CLC_CONSTFN double __spirv_ocl_fclamp(double, double, double);
164
165#if defined(__cplusplus)
166} // extern "C"
167#else
168_Pragma("pop_macro(\"bool\")");
169#endif
170#endif // __CLANG_SPIRV_LIBDEVICE_DECLARES_H__
lib/include/__clang_spirv_math.h created+719
...@@ -0,0 +1,719 @@
1/*===---- __clang_spirv_math.h - Device-side SPIRV math support ------------===
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#ifndef __CLANG_SPIRV_MATH_H__
10#define __CLANG_SPIRV_MATH_H__
11
12#if !defined(__SPIRV__) && !defined(__OPENMP_SPIRV__)
13#error "This file is for SPIRV and OpenMP SPIRV device compilation only."
14#endif
15
16// The __CLANG_GPU_DISABLE_MATH_WRAPPERS macro provides a way to let standard
17// libcalls reach the link step instead of being eagerly replaced.
18#ifndef __CLANG_GPU_DISABLE_MATH_WRAPPERS
19
20// __DEVICE__ is a helper macro with common set of attributes for the wrappers
21// we implement in this file. We need static in order to avoid emitting unused
22// functions and __forceinline__ helps inlining these wrappers at -O1.
23#pragma push_macro("__DEVICE__")
24#ifdef __OPENMP_SPIRV__
25#if defined(__cplusplus)
26#define __DEVICE__ static constexpr __attribute__((always_inline, nothrow))
27#else
28#define __DEVICE__ static __attribute__((always_inline, nothrow))
29#endif
30#else
31#define __DEVICE__ static __device__ __forceinline__
32#endif
33
34__DEVICE__
35float __cosf(float __x) { return __spirv_ocl_cos(__x); }
36__DEVICE__
37float __exp10f(float __x) { return __spirv_ocl_exp10(__x); }
38__DEVICE__
39float __expf(float __x) { return __spirv_ocl_exp(__x); }
40
41__DEVICE__
42float __fadd_rd(float __x, float __y) {
43 float sum = __x + __y;
44 float rounded = __spirv_ocl_floor(sum);
45 if (rounded > sum)
46 rounded -= 1.0f;
47 return rounded;
48}
49
50__DEVICE__
51float __fadd_rn(float __x, float __y) { return __spirv_ocl_rint(__x + __y); }
52__DEVICE__
53float __fadd_ru(float __x, float __y) { return __spirv_ocl_ceil(__x + __y); }
54__DEVICE__
55float __fadd_rz(float __x, float __y) { return __spirv_ocl_trunc(__x + __y); }
56
57__DEVICE__
58float __fdiv_rd(float __x, float __y) {
59 float res = __x / __y;
60 float rounded = __spirv_ocl_floor(res);
61 if (rounded > res)
62 rounded -= 1.0f;
63 return rounded;
64}
65__DEVICE__
66float __fdiv_rn(float __x, float __y) { return __spirv_ocl_rint(__x / __y); }
67__DEVICE__
68float __fdiv_ru(float __x, float __y) { return __spirv_ocl_ceil(__x / __y); }
69__DEVICE__
70float __fdiv_rz(float __x, float __y) { return __spirv_ocl_trunc(__x / __y); }
71__DEVICE__
72float __fdividef(float __x, float __y) { return __x / __y; }
73
74__DEVICE__
75float __fmaf_rd(float __x, float __y, float __z) {
76 float res = __x * __y + __z;
77 float rounded = __spirv_ocl_floor(res);
78 if (rounded > res)
79 rounded -= 1.0f;
80 return rounded;
81}
82__DEVICE__
83float __fmaf_rn(float __x, float __y, float __z) {
84 return __spirv_ocl_rint(__x * __y + __z);
85}
86__DEVICE__
87float __fmaf_ru(float __x, float __y, float __z) {
88 return __spirv_ocl_ceil(__x * __y + __z);
89}
90__DEVICE__
91float __fmaf_rz(float __x, float __y, float __z) {
92 return __spirv_ocl_trunc(__x * __y + __z);
93}
94
95__DEVICE__
96float __fmul_rd(float __x, float __y) {
97 float res = __x * __y;
98 float rounded = __spirv_ocl_floor(res);
99 if (rounded > res)
100 rounded -= 1.0f;
101 return rounded;
102}
103__DEVICE__
104float __fmul_rn(float __x, float __y) { return __spirv_ocl_rint(__x * __y); }
105__DEVICE__
106float __fmul_ru(float __x, float __y) { return __spirv_ocl_ceil(__x * __y); }
107__DEVICE__
108float __fmul_rz(float __x, float __y) { return __spirv_ocl_trunc(__x * __y); }
109
110__DEVICE__
111float __frcp_rd(float __x) { return __fdiv_rd(1.0f, __x); }
112__DEVICE__
113float __frcp_rn(float __x) { return __fdiv_rn(1.0f, __x); }
114__DEVICE__
115float __frcp_ru(float __x) { return __fdiv_ru(1.0f, __x); }
116__DEVICE__
117float __frcp_rz(float __x) { return __fdiv_rz(1.0f, __x); }
118__DEVICE__
119
120float __frsqrt_rn(float __x) {
121 return __spirv_ocl_rint(__spirv_ocl_rsqrt(__x));
122}
123
124__DEVICE__
125float __fsqrt_rd(float __x) {
126 float res = __spirv_ocl_sqrt(__x);
127 float rounded = __spirv_ocl_floor(res);
128 if (rounded > res)
129 rounded -= 1.0f;
130 return rounded;
131}
132__DEVICE__
133float __fsqrt_rn(float __x) { return __spirv_ocl_rint(__spirv_ocl_sqrt(__x)); }
134__DEVICE__
135float __fsqrt_ru(float __x) { return __spirv_ocl_ceil(__spirv_ocl_sqrt(__x)); }
136__DEVICE__
137float __fsqrt_rz(float __x) { return __spirv_ocl_trunc(__spirv_ocl_sqrt(__x)); }
138
139__DEVICE__
140float __fsub_rd(float __x, float __y) {
141 float res = __x - __y;
142 float rounded = __spirv_ocl_floor(res);
143 if (rounded > res)
144 rounded -= 1.0f;
145 return rounded;
146}
147__DEVICE__
148float __fsub_rn(float __x, float __y) { return __spirv_ocl_rint(__x - __y); }
149__DEVICE__
150float __fsub_ru(float __x, float __y) { return __spirv_ocl_ceil(__x - __y); }
151__DEVICE__
152float __fsub_rz(float __x, float __y) { return __spirv_ocl_trunc(__x - __y); }
153__DEVICE__
154float __log10f(float __x) { return __spirv_ocl_log10(__x); }
155__DEVICE__
156float __log2f(float __x) { return __spirv_ocl_log2(__x); }
157__DEVICE__
158float __logf(float __x) { return __spirv_ocl_log(__x); }
159__DEVICE__
160float __powf(float __x, float __y) { return __spirv_ocl_pow(__x, __y); }
161
162__DEVICE__
163float __saturatef(float __x) { return __spirv_ocl_fclamp(__x, 0.0f, 1.0f); }
164
165__DEVICE__
166void __sincosf(float __x, float *__sinptr, float *__cosptr) {
167 *__sinptr = __spirv_ocl_sincos(__x, __cosptr);
168}
169
170__DEVICE__
171float __sinf(float __x) { return __spirv_ocl_sin(__x); }
172
173__DEVICE__
174float __tanf(float __x) { return __spirv_ocl_tan(__x); }
175
176__DEVICE__
177int __finitef(float __x) { return !__spirv_IsInf(__x) && !__spirv_IsNan(__x); }
178__DEVICE__
179int __isinff(float __x) { return __spirv_IsInf(__x); }
180__DEVICE__
181int __isnanf(float __x) { return __spirv_IsNan(__x); }
182__DEVICE__
183int __signbitf(float __x) { return __builtin_signbitf(__x); }
184
185__DEVICE__
186int __finite(double __x) { return !__spirv_IsInf(__x) && !__spirv_IsNan(__x); }
187
188__DEVICE__
189int __isinf(double __x) { return __spirv_IsInf(__x); }
190
191__DEVICE__
192int __isnan(double __x) { return __spirv_IsNan(__x); }
193__DEVICE__
194int __signbit(double __x) { return __builtin_signbit(__x); }
195
196__DEVICE__
197double __dadd_rd(double __x, double __y) {
198 double sum = __x + __y;
199 double rounded = __spirv_ocl_floor(sum);
200 if (rounded > sum)
201 rounded -= 1.0;
202 return rounded;
203}
204__DEVICE__
205double __dadd_rn(double __x, double __y) { return __spirv_ocl_rint(__x + __y); }
206__DEVICE__
207double __dadd_ru(double __x, double __y) { return __spirv_ocl_ceil(__x + __y); }
208__DEVICE__
209double __dadd_rz(double __x, double __y) {
210 return __spirv_ocl_trunc(__x + __y);
211}
212__DEVICE__
213double __ddiv_rd(double __x, double __y) {
214 double res = __x / __y;
215 double rounded = __spirv_ocl_floor(res);
216 if (rounded > res)
217 rounded -= 1.0;
218 return rounded;
219}
220__DEVICE__
221double __ddiv_rn(double __x, double __y) { return __spirv_ocl_rint(__x / __y); }
222__DEVICE__
223double __ddiv_ru(double __x, double __y) { return __spirv_ocl_ceil(__x / __y); }
224__DEVICE__
225double __ddiv_rz(double __x, double __y) {
226 return __spirv_ocl_trunc(__x / __y);
227}
228
229__DEVICE__
230double __dmul_rd(double __x, double __y) {
231 double res = __x * __y;
232 double rounded = __spirv_ocl_floor(res);
233 if (rounded > res)
234 rounded -= 1.0;
235 return rounded;
236}
237__DEVICE__
238double __dmul_rn(double __x, double __y) { return __spirv_ocl_rint(__x * __y); }
239__DEVICE__
240double __dmul_ru(double __x, double __y) { return __spirv_ocl_ceil(__x * __y); }
241__DEVICE__
242double __dmul_rz(double __x, double __y) {
243 return __spirv_ocl_trunc(__x * __y);
244}
245
246__DEVICE__
247double __drcp_rd(double __x) { return __ddiv_rd(1.0, __x); }
248__DEVICE__
249double __drcp_rn(double __x) { return __ddiv_rn(1.0, __x); }
250__DEVICE__
251double __drcp_ru(double __x) { return __ddiv_ru(1.0, __x); }
252__DEVICE__
253double __drcp_rz(double __x) { return __ddiv_rz(1.0, __x); }
254
255__DEVICE__
256double __dsqrt_rd(double __x) {
257 double res = __spirv_ocl_sqrt(__x);
258 double rounded = __spirv_ocl_floor(res);
259 if (rounded > res)
260 rounded -= 1.0;
261 return rounded;
262}
263__DEVICE__
264double __dsqrt_rn(double __x) {
265 return __spirv_ocl_rint(__spirv_ocl_sqrt(__x));
266}
267__DEVICE__
268double __dsqrt_ru(double __x) {
269 return __spirv_ocl_ceil(__spirv_ocl_sqrt(__x));
270}
271__DEVICE__
272double __dsqrt_rz(double __x) {
273 return __spirv_ocl_trunc(__spirv_ocl_sqrt(__x));
274}
275
276__DEVICE__
277double __dsub_rd(double __x, double __y) {
278 double res = __x - __y;
279 double rounded = __spirv_ocl_floor(res);
280 if (rounded > res)
281 rounded -= 1.0;
282 return rounded;
283}
284__DEVICE__
285double __dsub_rn(double __x, double __y) { return __spirv_ocl_rint(__x - __y); }
286__DEVICE__
287double __dsub_ru(double __x, double __y) { return __spirv_ocl_ceil(__x - __y); }
288__DEVICE__
289double __dsub_rz(double __x, double __y) {
290 return __spirv_ocl_trunc(__x - __y);
291}
292
293__DEVICE__
294double __fma_rd(double __x, double __y, double __z) {
295 double res = __x * __y + __z;
296 double rounded = __spirv_ocl_floor(res);
297 if (rounded > res)
298 rounded -= 1.0;
299 return rounded;
300}
301__DEVICE__
302double __fma_rn(double __x, double __y, double __z) {
303 return __spirv_ocl_rint(__x * __y + __z);
304}
305__DEVICE__
306double __fma_ru(double __x, double __y, double __z) {
307 return __spirv_ocl_ceil(__x * __y + __z);
308}
309__DEVICE__
310double __fma_rz(double __x, double __y, double __z) {
311 return __spirv_ocl_trunc(__x * __y + __z);
312}
313
314__DEVICE__ int abs(int __a) { return __spirv_ocl_s_abs(__a); }
315__DEVICE__ double fabs(double __a) { return __spirv_ocl_fabs(__a); }
316__DEVICE__ double acos(double __a) { return __spirv_ocl_acos(__a); }
317__DEVICE__ float acosf(float __a) { return __spirv_ocl_acos(__a); }
318__DEVICE__ double acosh(double __a) { return __spirv_ocl_acosh(__a); }
319__DEVICE__ float acoshf(float __a) { return __spirv_ocl_acosh(__a); }
320__DEVICE__ double asin(double __a) { return __spirv_ocl_asin(__a); }
321__DEVICE__ float asinf(float __a) { return __spirv_ocl_asin(__a); }
322__DEVICE__ double asinh(double __a) { return __spirv_ocl_asinh(__a); }
323__DEVICE__ float asinhf(float __a) { return __spirv_ocl_asinh(__a); }
324__DEVICE__ double atan(double __a) { return __spirv_ocl_atan(__a); }
325__DEVICE__ double atan2(double __a, double __b) {
326 return __spirv_ocl_atan2(__a, __b);
327}
328__DEVICE__ float atan2f(float __a, float __b) {
329 return __spirv_ocl_atan2(__a, __b);
330}
331__DEVICE__ float atanf(float __a) { return __spirv_ocl_atan(__a); }
332__DEVICE__ double atanh(double __a) { return __spirv_ocl_atanh(__a); }
333__DEVICE__ float atanhf(float __a) { return __spirv_ocl_atanh(__a); }
334__DEVICE__ double cbrt(double __a) { return __spirv_ocl_cbrt(__a); }
335__DEVICE__ float cbrtf(float __a) { return __spirv_ocl_cbrt(__a); }
336__DEVICE__ double ceil(double __a) { return __spirv_ocl_ceil(__a); }
337__DEVICE__ float ceilf(float __a) { return __spirv_ocl_ceil(__a); }
338__DEVICE__ double copysign(double __a, double __b) {
339 return __spirv_ocl_copysign(__a, __b);
340}
341__DEVICE__ float copysignf(float __a, float __b) {
342 return __spirv_ocl_copysign(__a, __b);
343}
344__DEVICE__ double cos(double __a) { return __spirv_ocl_cos(__a); }
345__DEVICE__ float cosf(float __a) { return __spirv_ocl_cos(__a); }
346__DEVICE__ double cosh(double __a) { return __spirv_ocl_cosh(__a); }
347__DEVICE__ float coshf(float __a) { return __spirv_ocl_cosh(__a); }
348__DEVICE__ double cospi(double __a) { return __spirv_ocl_cospi(__a); }
349__DEVICE__ float cospif(float __a) { return __spirv_ocl_cospi(__a); }
350__DEVICE__ double erf(double __a) { return __spirv_ocl_erf(__a); }
351__DEVICE__ double erfc(double __a) { return __spirv_ocl_erfc(__a); }
352__DEVICE__ float erfcf(float __a) { return __spirv_ocl_erfc(__a); }
353__DEVICE__ double erfcx(double __a) {
354 return __spirv_ocl_exp(__a * __a) * __spirv_ocl_erfc(__a);
355}
356__DEVICE__ float erfcxf(float __a) {
357 return __spirv_ocl_exp(__a * __a) * __spirv_ocl_erfc(__a);
358}
359__DEVICE__ float erff(float __a) { return __spirv_ocl_erf(__a); }
360__DEVICE__ double exp(double __a) { return __spirv_ocl_exp(__a); }
361__DEVICE__ double exp10(double __a) { return __spirv_ocl_exp10(__a); }
362__DEVICE__ float exp10f(float __a) { return __spirv_ocl_exp10(__a); }
363__DEVICE__ double exp2(double __a) { return __spirv_ocl_exp2(__a); }
364__DEVICE__ float exp2f(float __a) { return __spirv_ocl_exp2(__a); }
365__DEVICE__ float expf(float __a) { return __spirv_ocl_exp(__a); }
366__DEVICE__ double expm1(double __a) { return __spirv_ocl_expm1(__a); }
367__DEVICE__ float expm1f(float __a) { return __spirv_ocl_expm1(__a); }
368__DEVICE__ float fabsf(float __a) { return __spirv_ocl_fabs(__a); }
369__DEVICE__ double fdim(double __a, double __b) {
370 return __spirv_ocl_fdim(__a, __b);
371}
372__DEVICE__ float fdimf(float __a, float __b) {
373 return __spirv_ocl_fdim(__a, __b);
374}
375__DEVICE__ double fdivide(double __a, double __b) { return __a / __b; }
376__DEVICE__ float fdividef(float __a, float __b) { return __a / __b; }
377__DEVICE__ double floor(double __f) { return __spirv_ocl_floor(__f); }
378__DEVICE__ float floorf(float __f) { return __spirv_ocl_floor(__f); }
379__DEVICE__ double fma(double __a, double __b, double __c) {
380 return __spirv_ocl_fma(__a, __b, __c);
381}
382__DEVICE__ float fmaf(float __a, float __b, float __c) {
383 return __spirv_ocl_fma(__a, __b, __c);
384}
385__DEVICE__ double fmax(double __a, double __b) {
386 return __spirv_ocl_fmax(__a, __b);
387}
388__DEVICE__ float fmaxf(float __a, float __b) {
389 return __spirv_ocl_fmax(__a, __b);
390}
391__DEVICE__ double fmin(double __a, double __b) {
392 return __spirv_ocl_fmin(__a, __b);
393}
394__DEVICE__ float fminf(float __a, float __b) {
395 return __spirv_ocl_fmin(__a, __b);
396}
397__DEVICE__ double fmod(double __a, double __b) {
398 return __spirv_ocl_fmod(__a, __b);
399}
400__DEVICE__ float fmodf(float __a, float __b) {
401 return __spirv_ocl_fmod(__a, __b);
402}
403__DEVICE__ double frexp(double __a, int *__b) {
404 return __spirv_ocl_frexp(__a, __b);
405}
406__DEVICE__ float frexpf(float __a, int *__b) {
407 return __spirv_ocl_frexp(__a, __b);
408}
409__DEVICE__ double hypot(double __a, double __b) {
410 return __spirv_ocl_hypot(__a, __b);
411}
412__DEVICE__ float hypotf(float __a, float __b) {
413 return __spirv_ocl_hypot(__a, __b);
414}
415__DEVICE__ int ilogb(double __a) { return __spirv_ocl_ilogb(__a); }
416__DEVICE__ int ilogbf(float __a) { return __spirv_ocl_ilogb(__a); }
417__DEVICE__ long labs(long __a) { return __spirv_ocl_s_abs(__a); };
418__DEVICE__ double ldexp(double __a, int __b) {
419 return __spirv_ocl_ldexp(__a, __b);
420}
421__DEVICE__ float ldexpf(float __a, int __b) {
422 return __spirv_ocl_ldexp(__a, __b);
423}
424__DEVICE__ double lgamma(double __a) { return __spirv_ocl_lgamma(__a); }
425__DEVICE__ float lgammaf(float __a) { return __spirv_ocl_lgamma(__a); }
426__DEVICE__ long long llabs(long long __a) { return __spirv_ocl_s_abs(__a); }
427__DEVICE__ long long llmax(long long __a, long long __b) {
428 return __spirv_ocl_s_max(__a, __b);
429}
430__DEVICE__ long long llmin(long long __a, long long __b) {
431 return __spirv_ocl_s_min(__a, __b);
432}
433__DEVICE__ long long llrint(double __a) { return __builtin_rint(__a); }
434__DEVICE__ long long llrintf(float __a) { return __builtin_rintf(__a); }
435__DEVICE__ long long llround(double __a) { return __builtin_round(__a); }
436__DEVICE__ long long llroundf(float __a) { return __builtin_roundf(__a); }
437__DEVICE__ double round(double __a) { return __spirv_ocl_round(__a); }
438__DEVICE__ float roundf(float __a) { return __spirv_ocl_round(__a); }
439__DEVICE__ double log(double __a) { return __spirv_ocl_log(__a); }
440__DEVICE__ double log10(double __a) { return __spirv_ocl_log10(__a); }
441__DEVICE__ float log10f(float __a) { return __spirv_ocl_log10(__a); }
442__DEVICE__ double log1p(double __a) { return __spirv_ocl_log1p(__a); }
443__DEVICE__ float log1pf(float __a) { return __spirv_ocl_log1p(__a); }
444__DEVICE__ double log2(double __a) { return __spirv_ocl_log2(__a); }
445__DEVICE__ float log2f(float __a) { return __spirv_ocl_log2(__a); }
446__DEVICE__ double logb(double __a) { return __spirv_ocl_logb(__a); }
447__DEVICE__ float logbf(float __a) { return __spirv_ocl_logb(__a); }
448__DEVICE__ float logf(float __a) { return __spirv_ocl_log(__a); }
449__DEVICE__ long lrint(double __a) { return __builtin_rint(__a); }
450__DEVICE__ long lrintf(float __a) { return __builtin_rintf(__a); }
451__DEVICE__ long lround(double __a) { return __builtin_round(__a); }
452__DEVICE__ long lroundf(float __a) { return __builtin_roundf(__a); }
453__DEVICE__ int max(int __a, int __b) { return __spirv_ocl_s_max(__a, __b); }
454__DEVICE__ int min(int __a, int __b) { return __spirv_ocl_s_min(__a, __b); }
455__DEVICE__ double modf(double __a, double *__b) {
456 return __spirv_ocl_modf(__a, __b);
457}
458__DEVICE__ float modff(float __a, float *__b) {
459 return __spirv_ocl_modf(__a, __b);
460}
461__DEVICE__ double nearbyint(double __a) { return __spirv_ocl_rint(__a); }
462__DEVICE__ float nearbyintf(float __a) { return __spirv_ocl_rint(__a); }
463__DEVICE__ double nextafter(double __a, double __b) {
464 return __spirv_ocl_nextafter(__a, __b);
465}
466__DEVICE__ float nextafterf(float __a, float __b) {
467 return __spirv_ocl_nextafter(__a, __b);
468}
469
470__DEVICE__ double norm(int __dim, const double *__a) {
471 double __r = 0;
472 while (__dim--) {
473 __r += __a[0] * __a[0];
474 ++__a;
475 }
476
477 return __spirv_ocl_sqrt(__r);
478}
479__DEVICE__ double norm3d(double __a, double __b, double __c) {
480 return __spirv_ocl_sqrt(__a * __a + __b * __b + __c * __c);
481}
482__DEVICE__ float norm3df(float __a, float __b, float __c) {
483 return __spirv_ocl_sqrt(__a * __a + __b * __b + __c * __c);
484}
485__DEVICE__ double norm4d(double __a, double __b, double __c, double __d) {
486 return __spirv_ocl_sqrt(__a * __a + __b * __b + __c * __c + __d * __d);
487}
488__DEVICE__ float norm4df(float __a, float __b, float __c, float __d) {
489 return __spirv_ocl_sqrt(__a * __a + __b * __b + __c * __c + __d * __d);
490}
491__DEVICE__ double normcdf(double __a) {
492 return 0.5 * (1.0 + __spirv_ocl_erf(__a * __spirv_ocl_rsqrt(2.0)));
493}
494__DEVICE__ float normcdff(float __a) {
495 return 0.5f * (1.0f + __spirv_ocl_erf(__a * __spirv_ocl_rsqrt(2.0f)));
496}
497__DEVICE__ float normf(int __dim, const float *__a) {
498 float __r = 0;
499 while (__dim--) {
500 __r += __a[0] * __a[0];
501 ++__a;
502 }
503 return __spirv_ocl_sqrt(__r);
504}
505__DEVICE__ double pow(double __a, double __b) {
506 return __spirv_ocl_pow(__a, __b);
507}
508__DEVICE__ float powf(float __a, float __b) {
509 return __spirv_ocl_pow(__a, __b);
510}
511__DEVICE__ double powi(double __a, int __b) { return pow(__a, (double)__b); }
512__DEVICE__ float powif(float __a, int __b) { return pow(__a, (float)__b); }
513__DEVICE__ double rcbrt(double __a) { return 1.0 / __spirv_ocl_cbrt(__a); }
514__DEVICE__ float rcbrtf(float __a) { return 1.0f / __spirv_ocl_cbrt(__a); }
515__DEVICE__ double remainder(double __a, double __b) {
516 return __spirv_ocl_remainder(__a, __b);
517}
518__DEVICE__ float remainderf(float __a, float __b) {
519 return __spirv_ocl_remainder(__a, __b);
520}
521__DEVICE__ double remquo(double __a, double __b, int *__c) {
522 return __spirv_ocl_remquo(__a, __b, __c);
523}
524__DEVICE__ float remquof(float __a, float __b, int *__c) {
525 return __spirv_ocl_remquo(__a, __b, __c);
526}
527__DEVICE__ double rhypot(double __a, double __b) {
528 return __spirv_ocl_hypot(__a, __b);
529}
530__DEVICE__ float rhypotf(float __a, float __b) {
531 return __spirv_ocl_hypot(__a, __b);
532}
533__DEVICE__ double rint(double __a) { return __spirv_ocl_rint(__a); }
534__DEVICE__ float rintf(float __a) { return __spirv_ocl_rint(__a); }
535__DEVICE__ double rnorm(int __dim, const double *__a) {
536 double __r = 0;
537 while (__dim--) {
538 __r += __a[0] * __a[0];
539 ++__a;
540 }
541
542 return __spirv_ocl_rsqrt(__r);
543}
544__DEVICE__ double rnorm3d(double __a, double __b, double __c) {
545 return __spirv_ocl_rsqrt(__a * __a + __b * __b + __c * __c);
546}
547__DEVICE__ float rnorm3df(float __a, float __b, float __c) {
548 return __spirv_ocl_rsqrt(__a * __a + __b * __b + __c * __c);
549}
550__DEVICE__ double rnorm4d(double __a, double __b, double __c, double __d) {
551 return __spirv_ocl_rsqrt(__a * __a + __b * __b + __c * __c + __d * __d);
552}
553__DEVICE__ float rnorm4df(float __a, float __b, float __c, float __d) {
554 return __spirv_ocl_rsqrt(__a * __a + __b * __b + __c * __c + __d * __d);
555}
556__DEVICE__ float rnormf(int __dim, const float *__a) {
557 float __r = 0;
558 while (__dim--) {
559 __r += __a[0] * __a[0];
560 ++__a;
561 }
562
563 return __spirv_ocl_rsqrt(__r);
564}
565__DEVICE__ double rsqrt(double __a) { return __spirv_ocl_rsqrt(__a); }
566__DEVICE__ float rsqrtf(float __a) { return __spirv_ocl_rsqrt(__a); }
567__DEVICE__ double scalbn(double __a, int __b) {
568 return __spirv_ocl_ldexp(__a, __b);
569}
570__DEVICE__ float scalbnf(float __a, int __b) {
571 return __spirv_ocl_ldexp(__a, __b);
572}
573__DEVICE__ double scalbln(double __a, long __b) {
574 if (__b > INT_MAX)
575 return __a > 0 ? HUGE_VAL : -HUGE_VAL;
576 if (__b < INT_MIN)
577 return __a > 0 ? 0.0 : -0.0;
578 return scalbn(__a, (int)__b);
579}
580__DEVICE__ float scalblnf(float __a, long __b) {
581 if (__b > INT_MAX)
582 return __a > 0 ? HUGE_VALF : -HUGE_VALF;
583 if (__b < INT_MIN)
584 return __a > 0 ? 0.f : -0.f;
585 return scalbnf(__a, (int)__b);
586}
587__DEVICE__ double sin(double __a) { return __spirv_ocl_sin(__a); }
588__DEVICE__ void sincos(double __a, double *__s, double *__c) {
589 *__s = __spirv_ocl_sincos(__a, __c);
590}
591__DEVICE__ void sincosf(float __a, float *__s, float *__c) {
592 *__s = __spirv_ocl_sincos(__a, __c);
593}
594__DEVICE__ void sincospi(double __a, double *__s, double *__c) {
595 *__s = __spirv_ocl_sinpi(__a);
596 *__c = __spirv_ocl_cospi(__a);
597}
598__DEVICE__ void sincospif(float __a, float *__s, float *__c) {
599 *__s = __spirv_ocl_sinpi(__a);
600 *__c = __spirv_ocl_cospi(__a);
601}
602__DEVICE__ float sinf(float __a) { return __spirv_ocl_sin(__a); }
603__DEVICE__ double sinh(double __a) { return __spirv_ocl_sinh(__a); }
604__DEVICE__ float sinhf(float __a) { return __spirv_ocl_sinh(__a); }
605__DEVICE__ double sinpi(double __a) { return __spirv_ocl_sinpi(__a); }
606__DEVICE__ float sinpif(float __a) { return __spirv_ocl_sinpi(__a); }
607__DEVICE__ double sqrt(double __a) { return __spirv_ocl_sqrt(__a); }
608__DEVICE__ float sqrtf(float __a) { return __spirv_ocl_sqrt(__a); }
609__DEVICE__ double tan(double __a) { return __spirv_ocl_tan(__a); }
610__DEVICE__ float tanf(float __a) { return __spirv_ocl_tan(__a); }
611__DEVICE__ double tanh(double __a) { return __spirv_ocl_tanh(__a); }
612__DEVICE__ float tanhf(float __a) { return __spirv_ocl_tanh(__a); }
613__DEVICE__ double tgamma(double __a) { return __spirv_ocl_tgamma(__a); }
614__DEVICE__ float tgammaf(float __a) { return __spirv_ocl_tgamma(__a); }
615__DEVICE__ double trunc(double __a) { return __spirv_ocl_trunc(__a); }
616__DEVICE__ float truncf(float __a) { return __spirv_ocl_trunc(__a); }
617__DEVICE__ unsigned long long ullmax(unsigned long long __a,
618 unsigned long long __b) {
619 return __spirv_ocl_u_max(__a, __b);
620}
621__DEVICE__ unsigned long long ullmin(unsigned long long __a,
622 unsigned long long __b) {
623 return __spirv_ocl_u_min(__a, __b);
624}
625__DEVICE__ unsigned int umax(unsigned int __a, unsigned int __b) {
626 return __spirv_ocl_u_max(__a, __b);
627}
628__DEVICE__ unsigned int umin(unsigned int __a, unsigned int __b) {
629 return __spirv_ocl_u_min(__a, __b);
630}
631
632#if !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
633#define isfinite(__x) _Generic((__x), float: __finitef, double: __finite)(__x)
634#define isinf(__x) _Generic((__x), float: __isinff, double: __isinf)(__x)
635#define isnan(__x) _Generic((__x), float: __isnanf, double: __isnan)(__x)
636#define signbit(__x) _Generic((__x), float: __signbitf, double: __signbit)(__x)
637#endif // !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
638
639__DEVICE__
640unsigned long __make_mantissa_base8(const char *__tagp) {
641 unsigned long __r = 0;
642 while (*__tagp != '\0') {
643 char __tmp = *__tagp;
644
645 if (__tmp >= '0' && __tmp <= '7')
646 __r = (__r * 8u) + __tmp - '0';
647 else
648 return 0;
649
650 ++__tagp;
651 }
652
653 return __r;
654}
655
656__DEVICE__
657unsigned long __make_mantissa_base10(const char *__tagp) {
658 unsigned long __r = 0;
659 while (*__tagp != '\0') {
660 char __tmp = *__tagp;
661
662 if (__tmp >= '0' && __tmp <= '9')
663 __r = (__r * 10u) + __tmp - '0';
664 else
665 return 0;
666
667 ++__tagp;
668 }
669
670 return __r;
671}
672
673__DEVICE__
674unsigned long __make_mantissa_base16(const char *__tagp) {
675 unsigned long __r = 0;
676 while (*__tagp != '\0') {
677 char __tmp = *__tagp;
678
679 if (__tmp >= '0' && __tmp <= '9')
680 __r = (__r * 16u) + __tmp - '0';
681 else if (__tmp >= 'a' && __tmp <= 'f')
682 __r = (__r * 16u) + __tmp - 'a' + 10;
683 else if (__tmp >= 'A' && __tmp <= 'F')
684 __r = (__r * 16u) + __tmp - 'A' + 10;
685 else
686 return 0;
687
688 ++__tagp;
689 }
690
691 return __r;
692}
693
694__DEVICE__
695unsigned long __make_mantissa(const char *__tagp) {
696 if (!__tagp)
697 return 0;
698 if (*__tagp == '0') {
699 ++__tagp;
700
701 if (*__tagp == 'x' || *__tagp == 'X')
702 return __make_mantissa_base16(++__tagp);
703 else
704 return __make_mantissa_base8(__tagp);
705 }
706
707 return __make_mantissa_base10(__tagp);
708}
709
710float nanf(const char *__tagp) {
711 return __spirv_ocl_nan((unsigned int)__make_mantissa(__tagp));
712}
713double nan(const char *__tagp) {
714 return __spirv_ocl_nan(__make_mantissa(__tagp));
715}
716
717#pragma pop_macro("__DEVICE__")
718#endif // __CLANG_GPU_DISABLE_MATH_WRAPPERS
719#endif // __CLANG_SPIRV_MATH_H__
lib/include/altivec.h+79-9
...@@ -2117,7 +2117,7 @@ vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {...@@ -2117,7 +2117,7 @@ vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
2117}2117}
2118#endif2118#endif
21192119
2120#ifdef __VSX__2120#ifdef __POWER8_VECTOR__
2121static __inline__ vector bool long long __ATTRS_o_ai2121static __inline__ vector bool long long __ATTRS_o_ai
2122vec_cmpne(vector double __a, vector double __b) {2122vec_cmpne(vector double __a, vector double __b) {
2123 return (vector bool long long)2123 return (vector bool long long)
...@@ -6404,6 +6404,18 @@ vec_mulh(vector unsigned long long __a, vector unsigned long long __b) {...@@ -6404,6 +6404,18 @@ vec_mulh(vector unsigned long long __a, vector unsigned long long __b) {
6404}6404}
6405#endif6405#endif
64066406
6407#ifdef __FUTURE_VECTOR__
6408static __inline__ vector signed short
6409 __ATTRS_o_ai vec_mulh(vector signed short __a, vector signed short __b) {
6410 return __builtin_altivec_vmulhsh(__a, __b);
6411}
6412
6413static __inline__ vector unsigned short __ATTRS_o_ai
6414vec_mulh(vector unsigned short __a, vector unsigned short __b) {
6415 return __builtin_altivec_vmulhuh(__a, __b);
6416}
6417#endif
6418
6407/* vec_mulo */6419/* vec_mulo */
64086420
6409static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,6421static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
...@@ -17809,6 +17821,7 @@ vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {...@@ -17809,6 +17821,7 @@ vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {
17809/* vec_xl_be */17821/* vec_xl_be */
1781017822
17811#ifdef __LITTLE_ENDIAN__17823#ifdef __LITTLE_ENDIAN__
17824#ifdef __VSX__
17812static __inline__ vector signed char __ATTRS_o_ai17825static __inline__ vector signed char __ATTRS_o_ai
17813vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {17826vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {
17814 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);17827 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
...@@ -17850,7 +17863,6 @@ vec_xl_be(signed long long __offset, const float *__ptr) {...@@ -17850,7 +17863,6 @@ vec_xl_be(signed long long __offset, const float *__ptr) {
17850 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);17863 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17851}17864}
1785217865
17853#ifdef __VSX__
17854static __inline__ vector signed long long __ATTRS_o_ai17866static __inline__ vector signed long long __ATTRS_o_ai
17855vec_xl_be(signed long long __offset, const signed long long *__ptr) {17867vec_xl_be(signed long long __offset, const signed long long *__ptr) {
17856 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);17868 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
...@@ -17865,7 +17877,6 @@ static __inline__ vector double __ATTRS_o_ai...@@ -17865,7 +17877,6 @@ static __inline__ vector double __ATTRS_o_ai
17865vec_xl_be(signed long long __offset, const double *__ptr) {17877vec_xl_be(signed long long __offset, const double *__ptr) {
17866 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);17878 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17867}17879}
17868#endif
1786917880
17870#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \17881#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17871 defined(__SIZEOF_INT128__)17882 defined(__SIZEOF_INT128__)
...@@ -17879,8 +17890,9 @@ vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {...@@ -17879,8 +17890,9 @@ vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
17879 return vec_xl(__offset, __ptr);17890 return vec_xl(__offset, __ptr);
17880}17891}
17881#endif17892#endif
17882#else17893#endif // __VSX__
17883 #define vec_xl_be vec_xl17894#else // ! __LITTLE_ENDIAN__
17895#define vec_xl_be vec_xl
17884#endif17896#endif
1788517897
17886#if defined(__POWER10_VECTOR__) && defined(__VSX__) && \17898#if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
...@@ -18130,6 +18142,7 @@ vec_xst_trunc(vector unsigned __int128 __vec, ptrdiff_t __offset,...@@ -18130,6 +18142,7 @@ vec_xst_trunc(vector unsigned __int128 __vec, ptrdiff_t __offset,
18130/* vec_xst_be */18142/* vec_xst_be */
1813118143
18132#ifdef __LITTLE_ENDIAN__18144#ifdef __LITTLE_ENDIAN__
18145#ifdef __VSX__
18133static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,18146static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
18134 signed long long __offset,18147 signed long long __offset,
18135 signed char *__ptr) {18148 signed char *__ptr) {
...@@ -18186,7 +18199,6 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,...@@ -18186,7 +18199,6 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
18186 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);18199 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
18187}18200}
1818818201
18189#ifdef __VSX__
18190static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,18202static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
18191 signed long long __offset,18203 signed long long __offset,
18192 signed long long *__ptr) {18204 signed long long *__ptr) {
...@@ -18204,7 +18216,6 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,...@@ -18204,7 +18216,6 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
18204 double *__ptr) {18216 double *__ptr) {
18205 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);18217 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18206}18218}
18207#endif
1820818219
18209#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \18220#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18210 defined(__SIZEOF_INT128__)18221 defined(__SIZEOF_INT128__)
...@@ -18220,8 +18231,9 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,...@@ -18220,8 +18231,9 @@ static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
18220 vec_xst(__vec, __offset, __ptr);18231 vec_xst(__vec, __offset, __ptr);
18221}18232}
18222#endif18233#endif
18223#else18234#endif // VSX
18224 #define vec_xst_be vec_xst18235#else // ! __LITTLE_ENDIAN__
18236#define vec_xst_be vec_xst
18225#endif18237#endif
1822618238
18227#ifdef __POWER9_VECTOR__18239#ifdef __POWER9_VECTOR__
...@@ -19314,6 +19326,64 @@ vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {...@@ -19314,6 +19326,64 @@ vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {
19314#endif /* __SIZEOF_INT128__ */19326#endif /* __SIZEOF_INT128__ */
19315#endif /* __POWER10_VECTOR__ */19327#endif /* __POWER10_VECTOR__ */
1931619328
19329#ifdef __FUTURE_VECTOR__
19330
19331/* vec_uncompress* - Deeply Compressed Weights builtins */
19332
19333static __inline__ vector unsigned char __ATTRS_o_ai
19334vec_uncompresshn(vector unsigned char __a, vector unsigned char __b) {
19335 return __builtin_altivec_vucmprhn(__a, __b);
19336}
19337
19338static __inline__ vector unsigned char __ATTRS_o_ai
19339vec_uncompressln(vector unsigned char __a, vector unsigned char __b) {
19340 return __builtin_altivec_vucmprln(__a, __b);
19341}
19342
19343static __inline__ vector unsigned char __ATTRS_o_ai
19344vec_uncompresshb(vector unsigned char __a, vector unsigned char __b) {
19345 return __builtin_altivec_vucmprhb(__a, __b);
19346}
19347
19348static __inline__ vector unsigned char __ATTRS_o_ai
19349vec_uncompresslb(vector unsigned char __a, vector unsigned char __b) {
19350 return __builtin_altivec_vucmprlb(__a, __b);
19351}
19352
19353static __inline__ vector unsigned char __ATTRS_o_ai
19354vec_uncompresshh(vector unsigned char __a, vector unsigned char __b) {
19355 return __builtin_altivec_vucmprhh(__a, __b);
19356}
19357
19358static __inline__ vector unsigned char __ATTRS_o_ai
19359vec_uncompresslh(vector unsigned char __a, vector unsigned char __b) {
19360 return __builtin_altivec_vucmprlh(__a, __b);
19361}
19362
19363static __inline__ vector unsigned char __ATTRS_o_ai
19364vec_unpack_hsn_to_byte(vector unsigned char __a) {
19365 return __builtin_altivec_vupkhsntob(__a);
19366}
19367
19368static __inline__ vector unsigned char __ATTRS_o_ai
19369vec_unpack_lsn_to_byte(vector unsigned char __a) {
19370 return __builtin_altivec_vupklsntob(__a);
19371}
19372
19373#define vec_unpack_int4_to_bf16(__a, __imm) \
19374 __builtin_altivec_vupkint4tobf16((__a), (__imm))
19375
19376#define vec_unpack_int8_to_bf16(__a, __imm) \
19377 __builtin_altivec_vupkint8tobf16((__a), (__imm))
19378
19379#define vec_unpack_int4_to_fp32(__a, __imm) \
19380 __builtin_altivec_vupkint4tofp32((__a), (__imm))
19381
19382#define vec_unpack_int8_to_fp32(__a, __imm) \
19383 __builtin_altivec_vupkint8tofp32((__a), (__imm))
19384
19385#endif /* __FUTURE_VECTOR__ */
19386
19317#ifdef __POWER8_VECTOR__19387#ifdef __POWER8_VECTOR__
19318#define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))19388#define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))
19319#define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))19389#define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))
lib/include/amdhsa_abi.h created+83
...@@ -0,0 +1,83 @@
1//===-- amdhsa_abi.h - AMDHSA ABI definition utilities --------------------===//
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#ifndef __AMDHSA_ABI_H
10#define __AMDHSA_ABI_H
11
12#include <stddef.h>
13#include <stdint.h>
14
15typedef struct __attribute__((aligned(8))) amdhsa_implicit_kernarg_v5 {
16 uint32_t block_count[3];
17 uint16_t group_size[3];
18 uint16_t remainder[3];
19 char reserved0[16];
20 uint64_t global_offset[3];
21 uint16_t grid_dims;
22 char reserved1[6];
23 __attribute__((opencl_global)) void *printf_buffer;
24 __attribute__((opencl_global)) void *hostcall_buffer;
25 __attribute__((opencl_global)) void *multigrid_sync_arg;
26 __attribute__((opencl_global)) void *heap_v1;
27 __attribute__((opencl_global)) void *default_queue;
28 __attribute__((opencl_global)) void *completion_action;
29 char reserved2[72];
30 uint32_t private_base; // Unused on gfx9+
31 uint32_t shared_base; // Unused on gfx9+
32 __attribute__((opencl_global)) void *queue_ptr;
33 char reserved3[48];
34} amdhsa_implicit_kernarg_v5;
35
36_Static_assert(sizeof(amdhsa_implicit_kernarg_v5) == 256, "wrong struct size");
37
38_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[0]) == 0,
39 "wrong offset");
40_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[1]) == 4,
41 "wrong offset");
42_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[2]) == 8,
43 "wrong offset");
44_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[0]) == 12,
45 "wrong offset");
46_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[1]) == 14,
47 "wrong offset");
48_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[2]) == 16,
49 "wrong offset");
50_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[0]) == 18,
51 "wrong offset");
52_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[1]) == 20,
53 "wrong offset");
54_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[2]) == 22,
55 "wrong offset");
56_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[0]) == 40,
57 "wrong offset");
58_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[1]) == 48,
59 "wrong offset");
60_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[2]) == 56,
61 "wrong offset");
62_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, grid_dims) == 64,
63 "wrong offset");
64_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, printf_buffer) == 72,
65 "wrong offset");
66_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, hostcall_buffer) == 80,
67 "wrong offset");
68_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, multigrid_sync_arg) == 88,
69 "wrong offset");
70_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, heap_v1) == 96,
71 "wrong offset");
72_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, default_queue) == 104,
73 "wrong offset");
74_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, completion_action) == 112,
75 "wrong offset");
76_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, private_base) == 192,
77 "wrong offset");
78_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, shared_base) == 196,
79 "wrong offset");
80_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, queue_ptr) == 200,
81 "wrong offset");
82
83#endif // __AMDHSA_ABI_H
lib/include/amo.h+89
...@@ -124,6 +124,95 @@ static inline int64_t amo_ldat_sswap(int64_t *ptr, int64_t val) {...@@ -124,6 +124,95 @@ static inline int64_t amo_ldat_sswap(int64_t *ptr, int64_t val) {
124 return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SWAP);124 return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SWAP);
125}125}
126126
127/* AMO Store Operation Codes (FC values) */
128enum _AMO_ST {
129 _AMO_ST_ADD = 0x00, /* Store Add */
130 _AMO_ST_XOR = 0x01, /* Store Xor */
131 _AMO_ST_IOR = 0x02, /* Store Ior */
132 _AMO_ST_AND = 0x03, /* Store And */
133 _AMO_ST_UMAX = 0x04, /* Store Unsigned Maximum */
134 _AMO_ST_SMAX = 0x05, /* Store Signed Maximum */
135 _AMO_ST_UMIN = 0x06, /* Store Unsigned Minimum */
136 _AMO_ST_SMIN = 0x07, /* Store Signed Minimum */
137 _AMO_ST_TWIN = 0x18 /* Store Twin */
138};
139
140/* 32-bit unsigned AMO store operations */
141static inline void amo_stwat_add(uint32_t *ptr, uint32_t val) {
142 __builtin_amo_stwat(ptr, val, _AMO_ST_ADD);
143}
144
145static inline void amo_stwat_xor(uint32_t *ptr, uint32_t val) {
146 __builtin_amo_stwat(ptr, val, _AMO_ST_XOR);
147}
148
149static inline void amo_stwat_ior(uint32_t *ptr, uint32_t val) {
150 __builtin_amo_stwat(ptr, val, _AMO_ST_IOR);
151}
152
153static inline void amo_stwat_and(uint32_t *ptr, uint32_t val) {
154 __builtin_amo_stwat(ptr, val, _AMO_ST_AND);
155}
156
157static inline void amo_stwat_umax(uint32_t *ptr, uint32_t val) {
158 __builtin_amo_stwat(ptr, val, _AMO_ST_UMAX);
159}
160
161static inline void amo_stwat_umin(uint32_t *ptr, uint32_t val) {
162 __builtin_amo_stwat(ptr, val, _AMO_ST_UMIN);
163}
164
165/* 32-bit signed AMO store operations */
166static inline void amo_stwat_sadd(int32_t *ptr, int32_t val) {
167 __builtin_amo_stwat_s(ptr, val, _AMO_ST_ADD);
168}
169
170static inline void amo_stwat_smax(int32_t *ptr, int32_t val) {
171 __builtin_amo_stwat_s(ptr, val, _AMO_ST_SMAX);
172}
173
174static inline void amo_stwat_smin(int32_t *ptr, int32_t val) {
175 __builtin_amo_stwat_s(ptr, val, _AMO_ST_SMIN);
176}
177
178/* 64-bit unsigned AMO store operations */
179static inline void amo_stdat_add(uint64_t *ptr, uint64_t val) {
180 __builtin_amo_stdat(ptr, val, _AMO_ST_ADD);
181}
182
183static inline void amo_stdat_xor(uint64_t *ptr, uint64_t val) {
184 __builtin_amo_stdat(ptr, val, _AMO_ST_XOR);
185}
186
187static inline void amo_stdat_ior(uint64_t *ptr, uint64_t val) {
188 __builtin_amo_stdat(ptr, val, _AMO_ST_IOR);
189}
190
191static inline void amo_stdat_and(uint64_t *ptr, uint64_t val) {
192 __builtin_amo_stdat(ptr, val, _AMO_ST_AND);
193}
194
195static inline void amo_stdat_umax(uint64_t *ptr, uint64_t val) {
196 __builtin_amo_stdat(ptr, val, _AMO_ST_UMAX);
197}
198
199static inline void amo_stdat_umin(uint64_t *ptr, uint64_t val) {
200 __builtin_amo_stdat(ptr, val, _AMO_ST_UMIN);
201}
202
203/* 64-bit signed AMO store operations */
204static inline void amo_stdat_sadd(int64_t *ptr, int64_t val) {
205 __builtin_amo_stdat_s(ptr, val, _AMO_ST_ADD);
206}
207
208static inline void amo_stdat_smax(int64_t *ptr, int64_t val) {
209 __builtin_amo_stdat_s(ptr, val, _AMO_ST_SMAX);
210}
211
212static inline void amo_stdat_smin(int64_t *ptr, int64_t val) {
213 __builtin_amo_stdat_s(ptr, val, _AMO_ST_SMIN);
214}
215
127#ifdef __cplusplus216#ifdef __cplusplus
128}217}
129#endif218#endif
lib/include/amxtf32intrin.h deleted-108
...@@ -1,108 +0,0 @@
1/*===------------- amxtf32intrin.h - AMX_TF32 intrinsics -*- C++ -*---------===
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
10#ifndef __IMMINTRIN_H
11#error "Never use <amxtf32intrin.h> directly; include <immintrin.h> instead."
12#endif // __IMMINTRIN_H
13
14#ifndef __AMX_TF32INTRIN_H
15#define __AMX_TF32INTRIN_H
16#ifdef __x86_64__
17
18#define __DEFAULT_FN_ATTRS_TF32 \
19 __attribute__((__always_inline__, __nodebug__, __target__("amx-tf32")))
20
21/// Do Matrix Multiplication of \a a and \a b, and then do Matrix Plus
22/// with \a srcdst.
23/// All the calculation is base on float32 but with the lower 13-bit set to 0.
24///
25/// \headerfile <immintrin.h>
26///
27/// \code
28/// void _tile_mmultf32ps(constexpr int srcdst, constexpr int a, \
29/// constexpr int b);
30/// \endcode
31///
32/// This intrinsic corresponds to the <c> TMMULTF32PS </c> instruction.
33///
34/// \param srcdst
35/// The destination tile. Max size is 1024 Bytes.
36/// \param a
37/// The 1st source tile. Max size is 1024 Bytes.
38/// \param b
39/// The 2nd source tile. Max size is 1024 Bytes.
40///
41/// \code{.operation}
42/// DEFINE zero_lower_mantissa_bits_fp32(x[31:0]) {
43/// dword[12:0] := 0
44/// dword[31:13] := x[31:13]
45/// return dword
46/// }
47///
48/// DEFINE silence_snan_fp32(x[31:0]) {
49/// IF (x.exponent == 255 and x.fraction != 0 and x.fraction[22] == 0)
50/// x.fraction[22] := 1
51/// return x
52/// }
53///
54/// elements_a := a.colsb / 4
55/// elements_dest := srcdst.colsb / 4
56///
57/// FOR m = 0 TO (srcdst.rows-1)
58/// tmp[511:0] := 0
59/// FOR k = 0 TO (elements_a-1)
60/// FOR n = 0 TO (elements_dest-1)
61/// af := silence_snan_fp32(a.row[m].fp32[k])
62/// bf := silence_snan_fp32(b.row[k].fp32[n])
63/// tmp.fp32[n] += zero_lower_mantissa_bits_fp32(af)
64/// * zero_lower_mantissa_bits_fp32(bf)
65/// ENDFOR
66/// ENDFOR
67///
68/// FOR n = 0 TO (elements_dest-1)
69/// tmp.fp32[n] += srcdst.row[m].fp32[n]
70/// ENDFOR
71/// write_row_and_zero(srcdst, m, tmp, srcdst.colsb)
72///
73/// ENDFOR
74///
75/// zero_upper_rows(srcdst, srcdst.rows)
76/// zero_tileconfig_start()
77/// \endcode
78#define _tile_mmultf32ps(srcdst, a, b) \
79 __builtin_ia32_tmmultf32ps((srcdst), (a), (b))
80
81static __inline__ _tile1024i __DEFAULT_FN_ATTRS_TF32
82_tile_mmultf32ps_internal(unsigned short m, unsigned short n, unsigned short k,
83 _tile1024i dst, _tile1024i src1, _tile1024i src2) {
84 return __builtin_ia32_tmmultf32ps_internal(m, n, k, dst, src1, src2);
85}
86
87/// Do Matrix Multiplication of src0 and src1, and then do Matrix Plus with dst.
88/// All the calculation is base on float32 but with the lower 13-bit set to 0.
89///
90/// \headerfile <immintrin.h>
91///
92/// This intrinsic corresponds to the <c> TMMULTF32PS </c> instruction.
93///
94/// \param dst
95/// The destination tile. Max size is 1024 Bytes.
96/// \param src0
97/// The 1st source tile. Max size is 1024 Bytes.
98/// \param src1
99/// The 2nd source tile. Max size is 1024 Bytes.
100__DEFAULT_FN_ATTRS_TF32
101static void __tile_mmultf32ps(__tile1024i *dst, __tile1024i src0,
102 __tile1024i src1) {
103 dst->tile = _tile_mmultf32ps_internal(src0.row, src1.col, src0.col, dst->tile,
104 src0.tile, src1.tile);
105}
106
107#endif // __x86_64__
108#endif // __AMX_TF32INTRIN_H
lib/include/andes_vector.h+5
...@@ -13,4 +13,9 @@...@@ -13,4 +13,9 @@
1313
14#pragma clang riscv intrinsic andes_vector14#pragma clang riscv intrinsic andes_vector
1515
16#define __riscv_intrinsic_xandesvbfhcvt 1
17#define __riscv_intrinsic_xandesvdot 1
18#define __riscv_intrinsic_xandesvpackfph 1
19#define __riscv_intrinsic_xandesvsintload 1
20
16#endif //_ANDES_VECTOR_H_21#endif //_ANDES_VECTOR_H_
lib/include/arm64_neon.h created+21
...@@ -0,0 +1,21 @@
1/*===---- arm64_neon.h - ARM64 NEON intrinsics -----------------------------===
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
10/* Only include this if we're compiling for the windows platform. */
11#ifndef _MSC_VER
12#include_next <arm64_neon.h>
13#else
14
15#ifndef __ARM64_NEON_H
16#define __ARM64_NEON_H
17
18#include <arm_neon.h>
19
20#endif /* __ARM64_NEON_H */
21#endif /* _MSC_VER */
lib/include/arm64intr.h+10
...@@ -15,6 +15,16 @@...@@ -15,6 +15,16 @@
15#ifndef __ARM64INTR_H15#ifndef __ARM64INTR_H
16#define __ARM64INTR_H16#define __ARM64INTR_H
1717
18/* Encode an AArch64 system register for use with
19 _ReadStatusReg/_WriteStatusReg. op0 must be 2 or 3; only the low bit is
20 stored. */
21#define ARM64_SYSREG(op0, op1, CRn, CRm, op2) \
22 ((((op0) & 0x1) << 14) | (((op1) & 0x7) << 11) | (((CRn) & 0xF) << 7) | \
23 (((CRm) & 0xF) << 3) | ((op2) & 0x7))
24
25#define ARM64_FPCR ARM64_SYSREG(3, 3, 4, 4, 0)
26#define ARM64_FPSR ARM64_SYSREG(3, 3, 4, 4, 1)
27
18typedef enum28typedef enum
19{29{
20 _ARM64_BARRIER_SY = 0xF,30 _ARM64_BARRIER_SY = 0xF,
lib/include/arm_acle.h+1
...@@ -115,6 +115,7 @@ __swp(uint32_t __x, volatile uint32_t *__p) {...@@ -115,6 +115,7 @@ __swp(uint32_t __x, volatile uint32_t *__p) {
115#else115#else
116#define __plix(cache_level, retention_policy, addr) \116#define __plix(cache_level, retention_policy, addr) \
117 __builtin_arm_prefetch(addr, 0, cache_level, retention_policy, 0)117 __builtin_arm_prefetch(addr, 0, cache_level, retention_policy, 0)
118#define __pldir(addr) __builtin_arm_prefetch_ir(addr)
118#endif119#endif
119120
120/* 7.7 NOP */121/* 7.7 NOP */
lib/include/arm_neon.h+3922-3754
...@@ -145,1431 +145,125 @@ typedef struct poly64x2x4_t {...@@ -145,1431 +145,125 @@ typedef struct poly64x2x4_t {
145#endif145#endif
146#endif146#endif
147#ifdef __LITTLE_ENDIAN__147#ifdef __LITTLE_ENDIAN__
148#define splatq_lane_bf16(__p0, __p1) __extension__ ({ \148__ai __attribute__((target("bf16,neon"))) float32x4_t vbfdotq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
149 bfloat16x8_t __ret; \149 float32x4_t __ret;
150 bfloat16x4_t __s0 = __p0; \150 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfdotq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
151 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_lane_bf16(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \151 return __ret;
152 __ret; \152}
153})
154#else
155#define splatq_lane_bf16(__p0, __p1) __extension__ ({ \
156 bfloat16x8_t __ret; \
157 bfloat16x4_t __s0 = __p0; \
158 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
159 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_lane_bf16(__builtin_bit_cast(int8x8_t, __rev0), __p1, 11)); \
160 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
161 __ret; \
162})
163#define __noswap_splatq_lane_bf16(__p0, __p1) __extension__ ({ \
164 bfloat16x8_t __ret; \
165 bfloat16x4_t __s0 = __p0; \
166 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_lane_bf16(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
167 __ret; \
168})
169#endif
170
171#ifdef __LITTLE_ENDIAN__
172#define splat_lane_bf16(__p0, __p1) __extension__ ({ \
173 bfloat16x4_t __ret; \
174 bfloat16x4_t __s0 = __p0; \
175 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_lane_bf16(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
176 __ret; \
177})
178#else
179#define splat_lane_bf16(__p0, __p1) __extension__ ({ \
180 bfloat16x4_t __ret; \
181 bfloat16x4_t __s0 = __p0; \
182 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
183 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_lane_bf16(__builtin_bit_cast(int8x8_t, __rev0), __p1, 11)); \
184 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
185 __ret; \
186})
187#define __noswap_splat_lane_bf16(__p0, __p1) __extension__ ({ \
188 bfloat16x4_t __ret; \
189 bfloat16x4_t __s0 = __p0; \
190 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_lane_bf16(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
191 __ret; \
192})
193#endif
194
195#ifdef __LITTLE_ENDIAN__
196#define splatq_laneq_bf16(__p0, __p1) __extension__ ({ \
197 bfloat16x8_t __ret; \
198 bfloat16x8_t __s0 = __p0; \
199 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_laneq_bf16(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
200 __ret; \
201})
202#else
203#define splatq_laneq_bf16(__p0, __p1) __extension__ ({ \
204 bfloat16x8_t __ret; \
205 bfloat16x8_t __s0 = __p0; \
206 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
207 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_laneq_bf16(__builtin_bit_cast(int8x16_t, __rev0), __p1, 43)); \
208 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
209 __ret; \
210})
211#define __noswap_splatq_laneq_bf16(__p0, __p1) __extension__ ({ \
212 bfloat16x8_t __ret; \
213 bfloat16x8_t __s0 = __p0; \
214 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_laneq_bf16(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
215 __ret; \
216})
217#endif
218
219#ifdef __LITTLE_ENDIAN__
220#define splat_laneq_bf16(__p0, __p1) __extension__ ({ \
221 bfloat16x4_t __ret; \
222 bfloat16x8_t __s0 = __p0; \
223 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_laneq_bf16(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
224 __ret; \
225})
226#else
227#define splat_laneq_bf16(__p0, __p1) __extension__ ({ \
228 bfloat16x4_t __ret; \
229 bfloat16x8_t __s0 = __p0; \
230 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
231 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_laneq_bf16(__builtin_bit_cast(int8x16_t, __rev0), __p1, 43)); \
232 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
233 __ret; \
234})
235#define __noswap_splat_laneq_bf16(__p0, __p1) __extension__ ({ \
236 bfloat16x4_t __ret; \
237 bfloat16x8_t __s0 = __p0; \
238 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_laneq_bf16(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
239 __ret; \
240})
241#endif
242
243#ifdef __LITTLE_ENDIAN__
244__ai __attribute__((target("bf16,neon"))) float32x4_t vbfdotq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
245 float32x4_t __ret;
246 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfdotq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
247 return __ret;
248}
249#else
250__ai __attribute__((target("bf16,neon"))) float32x4_t vbfdotq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
251 float32x4_t __ret;
252 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
253 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
254 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
255 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfdotq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
256 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
257 return __ret;
258}
259__ai __attribute__((target("bf16,neon"))) float32x4_t __noswap_vbfdotq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
260 float32x4_t __ret;
261 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfdotq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
262 return __ret;
263}
264#endif
265
266#ifdef __LITTLE_ENDIAN__
267__ai __attribute__((target("bf16,neon"))) float32x2_t vbfdot_f32(float32x2_t __p0, bfloat16x4_t __p1, bfloat16x4_t __p2) {
268 float32x2_t __ret;
269 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vbfdot_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), __builtin_bit_cast(int8x8_t, __p2), 9));
270 return __ret;
271}
272#else
273__ai __attribute__((target("bf16,neon"))) float32x2_t vbfdot_f32(float32x2_t __p0, bfloat16x4_t __p1, bfloat16x4_t __p2) {
274 float32x2_t __ret;
275 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
276 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
277 bfloat16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_64_16);
278 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vbfdot_f32(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __builtin_bit_cast(int8x8_t, __rev2), 9));
279 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
280 return __ret;
281}
282__ai __attribute__((target("bf16,neon"))) float32x2_t __noswap_vbfdot_f32(float32x2_t __p0, bfloat16x4_t __p1, bfloat16x4_t __p2) {
283 float32x2_t __ret;
284 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vbfdot_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), __builtin_bit_cast(int8x8_t, __p2), 9));
285 return __ret;
286}
287#endif
288
289#ifdef __LITTLE_ENDIAN__
290__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlalbq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
291 float32x4_t __ret;
292 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlalbq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
293 return __ret;
294}
295#else
296__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlalbq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
297 float32x4_t __ret;
298 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
299 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
300 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
301 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlalbq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
302 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
303 return __ret;
304}
305__ai __attribute__((target("bf16,neon"))) float32x4_t __noswap_vbfmlalbq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
306 float32x4_t __ret;
307 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlalbq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
308 return __ret;
309}
310#endif
311
312#ifdef __LITTLE_ENDIAN__
313__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlaltq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
314 float32x4_t __ret;
315 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlaltq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
316 return __ret;
317}
318#else
319__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlaltq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
320 float32x4_t __ret;
321 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
322 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
323 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
324 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlaltq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
325 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
326 return __ret;
327}
328__ai __attribute__((target("bf16,neon"))) float32x4_t __noswap_vbfmlaltq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
329 float32x4_t __ret;
330 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlaltq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
331 return __ret;
332}
333#endif
334
335#ifdef __LITTLE_ENDIAN__
336__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmmlaq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
337 float32x4_t __ret;
338 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmmlaq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
339 return __ret;
340}
341#else
342__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmmlaq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
343 float32x4_t __ret;
344 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
345 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
346 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
347 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmmlaq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
348 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
349 return __ret;
350}
351#endif
352
353#ifdef __LITTLE_ENDIAN__
354__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcombine_bf16(bfloat16x4_t __p0, bfloat16x4_t __p1) {
355 bfloat16x8_t __ret;
356 __ret = __builtin_shufflevector(__p0, __p1, 0, 1, 2, 3, 4, 5, 6, 7);
357 return __ret;
358}
359#else
360__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcombine_bf16(bfloat16x4_t __p0, bfloat16x4_t __p1) {
361 bfloat16x8_t __ret;
362 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
363 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
364 __ret = __builtin_shufflevector(__rev0, __rev1, 0, 1, 2, 3, 4, 5, 6, 7);
365 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
366 return __ret;
367}
368__ai __attribute__((target("bf16,neon"))) bfloat16x8_t __noswap_vcombine_bf16(bfloat16x4_t __p0, bfloat16x4_t __p1) {
369 bfloat16x8_t __ret;
370 __ret = __builtin_shufflevector(__p0, __p1, 0, 1, 2, 3, 4, 5, 6, 7);
371 return __ret;
372}
373#endif
374
375#define vcreate_bf16(__p0) __extension__ ({ \
376 bfloat16x4_t __ret; \
377 uint64_t __promote = __p0; \
378 __ret = __builtin_bit_cast(bfloat16x4_t, __promote); \
379 __ret; \
380})
381__ai __attribute__((target("bf16,neon"))) float32_t vcvtah_f32_bf16(bfloat16_t __p0) {
382 float32_t __ret;
383 __ret = __builtin_bit_cast(float32_t, (uint32_t)(__builtin_bit_cast(uint16_t, __p0)) << 16);
384 return __ret;
385}
386__ai __attribute__((target("bf16,neon"))) bfloat16_t vcvth_bf16_f32(float32_t __p0) {
387 bfloat16_t __ret;
388 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vcvth_bf16_f32(__p0));
389 return __ret;
390}
391#ifdef __LITTLE_ENDIAN__
392#define vduph_lane_bf16(__p0, __p1) __extension__ ({ \
393 bfloat16_t __ret; \
394 bfloat16x4_t __s0 = __p0; \
395 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_lane_bf16(__s0, __p1)); \
396 __ret; \
397})
398#else
399#define vduph_lane_bf16(__p0, __p1) __extension__ ({ \
400 bfloat16_t __ret; \
401 bfloat16x4_t __s0 = __p0; \
402 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
403 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_lane_bf16(__rev0, __p1)); \
404 __ret; \
405})
406#endif
407
408#ifdef __LITTLE_ENDIAN__
409#define vdupq_lane_bf16(__p0_0, __p1_0) __extension__ ({ \
410 bfloat16x8_t __ret_0; \
411 bfloat16x4_t __s0_0 = __p0_0; \
412 __ret_0 = splatq_lane_bf16(__s0_0, __p1_0); \
413 __ret_0; \
414})
415#else
416#define vdupq_lane_bf16(__p0_1, __p1_1) __extension__ ({ \
417 bfloat16x8_t __ret_1; \
418 bfloat16x4_t __s0_1 = __p0_1; \
419 bfloat16x4_t __rev0_1; __rev0_1 = __builtin_shufflevector(__s0_1, __s0_1, __lane_reverse_64_16); \
420 __ret_1 = __noswap_splatq_lane_bf16(__rev0_1, __p1_1); \
421 __ret_1 = __builtin_shufflevector(__ret_1, __ret_1, __lane_reverse_128_16); \
422 __ret_1; \
423})
424#endif
425
426#ifdef __LITTLE_ENDIAN__
427#define vdup_lane_bf16(__p0_2, __p1_2) __extension__ ({ \
428 bfloat16x4_t __ret_2; \
429 bfloat16x4_t __s0_2 = __p0_2; \
430 __ret_2 = splat_lane_bf16(__s0_2, __p1_2); \
431 __ret_2; \
432})
433#else
434#define vdup_lane_bf16(__p0_3, __p1_3) __extension__ ({ \
435 bfloat16x4_t __ret_3; \
436 bfloat16x4_t __s0_3 = __p0_3; \
437 bfloat16x4_t __rev0_3; __rev0_3 = __builtin_shufflevector(__s0_3, __s0_3, __lane_reverse_64_16); \
438 __ret_3 = __noswap_splat_lane_bf16(__rev0_3, __p1_3); \
439 __ret_3 = __builtin_shufflevector(__ret_3, __ret_3, __lane_reverse_64_16); \
440 __ret_3; \
441})
442#endif
443
444#ifdef __LITTLE_ENDIAN__
445#define vduph_laneq_bf16(__p0, __p1) __extension__ ({ \
446 bfloat16_t __ret; \
447 bfloat16x8_t __s0 = __p0; \
448 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_laneq_bf16(__s0, __p1)); \
449 __ret; \
450})
451#else
452#define vduph_laneq_bf16(__p0, __p1) __extension__ ({ \
453 bfloat16_t __ret; \
454 bfloat16x8_t __s0 = __p0; \
455 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
456 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_laneq_bf16(__rev0, __p1)); \
457 __ret; \
458})
459#endif
460
461#ifdef __LITTLE_ENDIAN__
462#define vdupq_laneq_bf16(__p0_4, __p1_4) __extension__ ({ \
463 bfloat16x8_t __ret_4; \
464 bfloat16x8_t __s0_4 = __p0_4; \
465 __ret_4 = splatq_laneq_bf16(__s0_4, __p1_4); \
466 __ret_4; \
467})
468#else
469#define vdupq_laneq_bf16(__p0_5, __p1_5) __extension__ ({ \
470 bfloat16x8_t __ret_5; \
471 bfloat16x8_t __s0_5 = __p0_5; \
472 bfloat16x8_t __rev0_5; __rev0_5 = __builtin_shufflevector(__s0_5, __s0_5, __lane_reverse_128_16); \
473 __ret_5 = __noswap_splatq_laneq_bf16(__rev0_5, __p1_5); \
474 __ret_5 = __builtin_shufflevector(__ret_5, __ret_5, __lane_reverse_128_16); \
475 __ret_5; \
476})
477#endif
478
479#ifdef __LITTLE_ENDIAN__
480#define vdup_laneq_bf16(__p0_6, __p1_6) __extension__ ({ \
481 bfloat16x4_t __ret_6; \
482 bfloat16x8_t __s0_6 = __p0_6; \
483 __ret_6 = splat_laneq_bf16(__s0_6, __p1_6); \
484 __ret_6; \
485})
486#else
487#define vdup_laneq_bf16(__p0_7, __p1_7) __extension__ ({ \
488 bfloat16x4_t __ret_7; \
489 bfloat16x8_t __s0_7 = __p0_7; \
490 bfloat16x8_t __rev0_7; __rev0_7 = __builtin_shufflevector(__s0_7, __s0_7, __lane_reverse_128_16); \
491 __ret_7 = __noswap_splat_laneq_bf16(__rev0_7, __p1_7); \
492 __ret_7 = __builtin_shufflevector(__ret_7, __ret_7, __lane_reverse_64_16); \
493 __ret_7; \
494})
495#endif
496
497#ifdef __LITTLE_ENDIAN__
498__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vdupq_n_bf16(bfloat16_t __p0) {
499 bfloat16x8_t __ret;
500 __ret = (bfloat16x8_t) {__p0, __p0, __p0, __p0, __p0, __p0, __p0, __p0};
501 return __ret;
502}
503#else
504__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vdupq_n_bf16(bfloat16_t __p0) {
505 bfloat16x8_t __ret;
506 __ret = (bfloat16x8_t) {__p0, __p0, __p0, __p0, __p0, __p0, __p0, __p0};
507 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
508 return __ret;
509}
510#endif
511
512#ifdef __LITTLE_ENDIAN__
513__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vdup_n_bf16(bfloat16_t __p0) {
514 bfloat16x4_t __ret;
515 __ret = (bfloat16x4_t) {__p0, __p0, __p0, __p0};
516 return __ret;
517}
518#else
519__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vdup_n_bf16(bfloat16_t __p0) {
520 bfloat16x4_t __ret;
521 __ret = (bfloat16x4_t) {__p0, __p0, __p0, __p0};
522 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
523 return __ret;
524}
525#endif
526
527#ifdef __LITTLE_ENDIAN__
528__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vget_high_bf16(bfloat16x8_t __p0) {
529 bfloat16x4_t __ret;
530 __ret = __builtin_shufflevector(__p0, __p0, 4, 5, 6, 7);
531 return __ret;
532}
533#else
534__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vget_high_bf16(bfloat16x8_t __p0) {
535 bfloat16x4_t __ret;
536 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
537 __ret = __builtin_shufflevector(__rev0, __rev0, 4, 5, 6, 7);
538 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
539 return __ret;
540}
541__ai __attribute__((target("bf16,neon"))) bfloat16x4_t __noswap_vget_high_bf16(bfloat16x8_t __p0) {
542 bfloat16x4_t __ret;
543 __ret = __builtin_shufflevector(__p0, __p0, 4, 5, 6, 7);
544 return __ret;
545}
546#endif
547
548#ifdef __LITTLE_ENDIAN__
549#define vgetq_lane_bf16(__p0, __p1) __extension__ ({ \
550 bfloat16_t __ret; \
551 bfloat16x8_t __s0 = __p0; \
552 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vgetq_lane_bf16(__s0, __p1)); \
553 __ret; \
554})
555#else
556#define vgetq_lane_bf16(__p0, __p1) __extension__ ({ \
557 bfloat16_t __ret; \
558 bfloat16x8_t __s0 = __p0; \
559 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
560 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vgetq_lane_bf16(__rev0, __p1)); \
561 __ret; \
562})
563#define __noswap_vgetq_lane_bf16(__p0, __p1) __extension__ ({ \
564 bfloat16_t __ret; \
565 bfloat16x8_t __s0 = __p0; \
566 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vgetq_lane_bf16(__s0, __p1)); \
567 __ret; \
568})
569#endif
570
571#ifdef __LITTLE_ENDIAN__
572#define vget_lane_bf16(__p0, __p1) __extension__ ({ \
573 bfloat16_t __ret; \
574 bfloat16x4_t __s0 = __p0; \
575 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vget_lane_bf16(__s0, __p1)); \
576 __ret; \
577})
578#else
579#define vget_lane_bf16(__p0, __p1) __extension__ ({ \
580 bfloat16_t __ret; \
581 bfloat16x4_t __s0 = __p0; \
582 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
583 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vget_lane_bf16(__rev0, __p1)); \
584 __ret; \
585})
586#define __noswap_vget_lane_bf16(__p0, __p1) __extension__ ({ \
587 bfloat16_t __ret; \
588 bfloat16x4_t __s0 = __p0; \
589 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vget_lane_bf16(__s0, __p1)); \
590 __ret; \
591})
592#endif
593
594#ifdef __LITTLE_ENDIAN__
595__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vget_low_bf16(bfloat16x8_t __p0) {
596 bfloat16x4_t __ret;
597 __ret = __builtin_shufflevector(__p0, __p0, 0, 1, 2, 3);
598 return __ret;
599}
600#else
601__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vget_low_bf16(bfloat16x8_t __p0) {
602 bfloat16x4_t __ret;
603 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
604 __ret = __builtin_shufflevector(__rev0, __rev0, 0, 1, 2, 3);
605 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
606 return __ret;
607}
608__ai __attribute__((target("bf16,neon"))) bfloat16x4_t __noswap_vget_low_bf16(bfloat16x8_t __p0) {
609 bfloat16x4_t __ret;
610 __ret = __builtin_shufflevector(__p0, __p0, 0, 1, 2, 3);
611 return __ret;
612}
613#endif
614
615#ifdef __LITTLE_ENDIAN__
616#define vld1q_bf16(__p0) __extension__ ({ \
617 bfloat16x8_t __ret; \
618 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_bf16(__p0, 43)); \
619 __ret; \
620})
621#else
622#define vld1q_bf16(__p0) __extension__ ({ \
623 bfloat16x8_t __ret; \
624 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_bf16(__p0, 43)); \
625 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
626 __ret; \
627})
628#endif
629
630#ifdef __LITTLE_ENDIAN__
631#define vld1_bf16(__p0) __extension__ ({ \
632 bfloat16x4_t __ret; \
633 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_bf16(__p0, 11)); \
634 __ret; \
635})
636#else
637#define vld1_bf16(__p0) __extension__ ({ \
638 bfloat16x4_t __ret; \
639 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_bf16(__p0, 11)); \
640 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
641 __ret; \
642})
643#endif
644
645#ifdef __LITTLE_ENDIAN__
646#define vld1q_dup_bf16(__p0) __extension__ ({ \
647 bfloat16x8_t __ret; \
648 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_dup_bf16(__p0, 43)); \
649 __ret; \
650})
651#else
652#define vld1q_dup_bf16(__p0) __extension__ ({ \
653 bfloat16x8_t __ret; \
654 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_dup_bf16(__p0, 43)); \
655 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
656 __ret; \
657})
658#endif
659
660#ifdef __LITTLE_ENDIAN__
661#define vld1_dup_bf16(__p0) __extension__ ({ \
662 bfloat16x4_t __ret; \
663 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_dup_bf16(__p0, 11)); \
664 __ret; \
665})
666#else
667#define vld1_dup_bf16(__p0) __extension__ ({ \
668 bfloat16x4_t __ret; \
669 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_dup_bf16(__p0, 11)); \
670 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
671 __ret; \
672})
673#endif
674
675#ifdef __LITTLE_ENDIAN__
676#define vld1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
677 bfloat16x8_t __ret; \
678 bfloat16x8_t __s1 = __p1; \
679 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
680 __ret; \
681})
682#else
683#define vld1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
684 bfloat16x8_t __ret; \
685 bfloat16x8_t __s1 = __p1; \
686 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
687 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
688 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
689 __ret; \
690})
691#endif
692
693#ifdef __LITTLE_ENDIAN__
694#define vld1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
695 bfloat16x4_t __ret; \
696 bfloat16x4_t __s1 = __p1; \
697 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1), __p2, 11)); \
698 __ret; \
699})
700#else
701#define vld1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
702 bfloat16x4_t __ret; \
703 bfloat16x4_t __s1 = __p1; \
704 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
705 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1), __p2, 11)); \
706 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
707 __ret; \
708})
709#endif
710
711#ifdef __LITTLE_ENDIAN__
712#define vld1q_bf16_x2(__p0) __extension__ ({ \
713 bfloat16x8x2_t __ret; \
714 __builtin_neon_vld1q_bf16_x2(&__ret, __p0, 43); \
715 __ret; \
716})
717#else
718#define vld1q_bf16_x2(__p0) __extension__ ({ \
719 bfloat16x8x2_t __ret; \
720 __builtin_neon_vld1q_bf16_x2(&__ret, __p0, 43); \
721 \
722 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
723 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
724 __ret; \
725})
726#endif
727
728#ifdef __LITTLE_ENDIAN__
729#define vld1_bf16_x2(__p0) __extension__ ({ \
730 bfloat16x4x2_t __ret; \
731 __builtin_neon_vld1_bf16_x2(&__ret, __p0, 11); \
732 __ret; \
733})
734#else
735#define vld1_bf16_x2(__p0) __extension__ ({ \
736 bfloat16x4x2_t __ret; \
737 __builtin_neon_vld1_bf16_x2(&__ret, __p0, 11); \
738 \
739 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
740 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
741 __ret; \
742})
743#endif
744
745#ifdef __LITTLE_ENDIAN__
746#define vld1q_bf16_x3(__p0) __extension__ ({ \
747 bfloat16x8x3_t __ret; \
748 __builtin_neon_vld1q_bf16_x3(&__ret, __p0, 43); \
749 __ret; \
750})
751#else
752#define vld1q_bf16_x3(__p0) __extension__ ({ \
753 bfloat16x8x3_t __ret; \
754 __builtin_neon_vld1q_bf16_x3(&__ret, __p0, 43); \
755 \
756 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
757 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
758 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
759 __ret; \
760})
761#endif
762
763#ifdef __LITTLE_ENDIAN__
764#define vld1_bf16_x3(__p0) __extension__ ({ \
765 bfloat16x4x3_t __ret; \
766 __builtin_neon_vld1_bf16_x3(&__ret, __p0, 11); \
767 __ret; \
768})
769#else
770#define vld1_bf16_x3(__p0) __extension__ ({ \
771 bfloat16x4x3_t __ret; \
772 __builtin_neon_vld1_bf16_x3(&__ret, __p0, 11); \
773 \
774 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
775 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
776 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
777 __ret; \
778})
779#endif
780
781#ifdef __LITTLE_ENDIAN__
782#define vld1q_bf16_x4(__p0) __extension__ ({ \
783 bfloat16x8x4_t __ret; \
784 __builtin_neon_vld1q_bf16_x4(&__ret, __p0, 43); \
785 __ret; \
786})
787#else
788#define vld1q_bf16_x4(__p0) __extension__ ({ \
789 bfloat16x8x4_t __ret; \
790 __builtin_neon_vld1q_bf16_x4(&__ret, __p0, 43); \
791 \
792 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
793 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
794 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
795 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
796 __ret; \
797})
798#endif
799
800#ifdef __LITTLE_ENDIAN__
801#define vld1_bf16_x4(__p0) __extension__ ({ \
802 bfloat16x4x4_t __ret; \
803 __builtin_neon_vld1_bf16_x4(&__ret, __p0, 11); \
804 __ret; \
805})
806#else
807#define vld1_bf16_x4(__p0) __extension__ ({ \
808 bfloat16x4x4_t __ret; \
809 __builtin_neon_vld1_bf16_x4(&__ret, __p0, 11); \
810 \
811 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
812 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
813 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
814 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
815 __ret; \
816})
817#endif
818
819#ifdef __LITTLE_ENDIAN__
820#define vld2q_bf16(__p0) __extension__ ({ \
821 bfloat16x8x2_t __ret; \
822 __builtin_neon_vld2q_bf16(&__ret, __p0, 43); \
823 __ret; \
824})
825#else
826#define vld2q_bf16(__p0) __extension__ ({ \
827 bfloat16x8x2_t __ret; \
828 __builtin_neon_vld2q_bf16(&__ret, __p0, 43); \
829 \
830 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
831 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
832 __ret; \
833})
834#endif
835
836#ifdef __LITTLE_ENDIAN__
837#define vld2_bf16(__p0) __extension__ ({ \
838 bfloat16x4x2_t __ret; \
839 __builtin_neon_vld2_bf16(&__ret, __p0, 11); \
840 __ret; \
841})
842#else
843#define vld2_bf16(__p0) __extension__ ({ \
844 bfloat16x4x2_t __ret; \
845 __builtin_neon_vld2_bf16(&__ret, __p0, 11); \
846 \
847 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
848 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
849 __ret; \
850})
851#endif
852
853#ifdef __LITTLE_ENDIAN__
854#define vld2q_dup_bf16(__p0) __extension__ ({ \
855 bfloat16x8x2_t __ret; \
856 __builtin_neon_vld2q_dup_bf16(&__ret, __p0, 43); \
857 __ret; \
858})
859#else
860#define vld2q_dup_bf16(__p0) __extension__ ({ \
861 bfloat16x8x2_t __ret; \
862 __builtin_neon_vld2q_dup_bf16(&__ret, __p0, 43); \
863 \
864 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
865 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
866 __ret; \
867})
868#endif
869
870#ifdef __LITTLE_ENDIAN__
871#define vld2_dup_bf16(__p0) __extension__ ({ \
872 bfloat16x4x2_t __ret; \
873 __builtin_neon_vld2_dup_bf16(&__ret, __p0, 11); \
874 __ret; \
875})
876#else
877#define vld2_dup_bf16(__p0) __extension__ ({ \
878 bfloat16x4x2_t __ret; \
879 __builtin_neon_vld2_dup_bf16(&__ret, __p0, 11); \
880 \
881 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
882 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
883 __ret; \
884})
885#endif
886
887#ifdef __LITTLE_ENDIAN__
888#define vld2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
889 bfloat16x8x2_t __ret; \
890 bfloat16x8x2_t __s1 = __p1; \
891 __builtin_neon_vld2q_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __p2, 43); \
892 __ret; \
893})
894#else
895#define vld2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
896 bfloat16x8x2_t __ret; \
897 bfloat16x8x2_t __s1 = __p1; \
898 bfloat16x8x2_t __rev1; \
899 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
900 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
901 __builtin_neon_vld2q_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __p2, 43); \
902 \
903 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
904 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
905 __ret; \
906})
907#endif
908
909#ifdef __LITTLE_ENDIAN__
910#define vld2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
911 bfloat16x4x2_t __ret; \
912 bfloat16x4x2_t __s1 = __p1; \
913 __builtin_neon_vld2_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __p2, 11); \
914 __ret; \
915})
916#else
917#define vld2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
918 bfloat16x4x2_t __ret; \
919 bfloat16x4x2_t __s1 = __p1; \
920 bfloat16x4x2_t __rev1; \
921 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
922 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
923 __builtin_neon_vld2_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __p2, 11); \
924 \
925 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
926 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
927 __ret; \
928})
929#endif
930
931#ifdef __LITTLE_ENDIAN__
932#define vld3q_bf16(__p0) __extension__ ({ \
933 bfloat16x8x3_t __ret; \
934 __builtin_neon_vld3q_bf16(&__ret, __p0, 43); \
935 __ret; \
936})
937#else
938#define vld3q_bf16(__p0) __extension__ ({ \
939 bfloat16x8x3_t __ret; \
940 __builtin_neon_vld3q_bf16(&__ret, __p0, 43); \
941 \
942 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
943 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
944 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
945 __ret; \
946})
947#endif
948
949#ifdef __LITTLE_ENDIAN__
950#define vld3_bf16(__p0) __extension__ ({ \
951 bfloat16x4x3_t __ret; \
952 __builtin_neon_vld3_bf16(&__ret, __p0, 11); \
953 __ret; \
954})
955#else
956#define vld3_bf16(__p0) __extension__ ({ \
957 bfloat16x4x3_t __ret; \
958 __builtin_neon_vld3_bf16(&__ret, __p0, 11); \
959 \
960 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
961 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
962 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
963 __ret; \
964})
965#endif
966
967#ifdef __LITTLE_ENDIAN__
968#define vld3q_dup_bf16(__p0) __extension__ ({ \
969 bfloat16x8x3_t __ret; \
970 __builtin_neon_vld3q_dup_bf16(&__ret, __p0, 43); \
971 __ret; \
972})
973#else
974#define vld3q_dup_bf16(__p0) __extension__ ({ \
975 bfloat16x8x3_t __ret; \
976 __builtin_neon_vld3q_dup_bf16(&__ret, __p0, 43); \
977 \
978 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
979 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
980 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
981 __ret; \
982})
983#endif
984
985#ifdef __LITTLE_ENDIAN__
986#define vld3_dup_bf16(__p0) __extension__ ({ \
987 bfloat16x4x3_t __ret; \
988 __builtin_neon_vld3_dup_bf16(&__ret, __p0, 11); \
989 __ret; \
990})
991#else
992#define vld3_dup_bf16(__p0) __extension__ ({ \
993 bfloat16x4x3_t __ret; \
994 __builtin_neon_vld3_dup_bf16(&__ret, __p0, 11); \
995 \
996 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
997 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
998 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
999 __ret; \
1000})
1001#endif
1002
1003#ifdef __LITTLE_ENDIAN__
1004#define vld3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1005 bfloat16x8x3_t __ret; \
1006 bfloat16x8x3_t __s1 = __p1; \
1007 __builtin_neon_vld3q_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __p2, 43); \
1008 __ret; \
1009})
1010#else
1011#define vld3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1012 bfloat16x8x3_t __ret; \
1013 bfloat16x8x3_t __s1 = __p1; \
1014 bfloat16x8x3_t __rev1; \
1015 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1016 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1017 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
1018 __builtin_neon_vld3q_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __p2, 43); \
1019 \
1020 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
1021 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
1022 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
1023 __ret; \
1024})
1025#endif
1026
1027#ifdef __LITTLE_ENDIAN__
1028#define vld3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1029 bfloat16x4x3_t __ret; \
1030 bfloat16x4x3_t __s1 = __p1; \
1031 __builtin_neon_vld3_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __p2, 11); \
1032 __ret; \
1033})
1034#else
1035#define vld3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1036 bfloat16x4x3_t __ret; \
1037 bfloat16x4x3_t __s1 = __p1; \
1038 bfloat16x4x3_t __rev1; \
1039 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1040 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1041 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
1042 __builtin_neon_vld3_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __p2, 11); \
1043 \
1044 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
1045 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
1046 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
1047 __ret; \
1048})
1049#endif
1050
1051#ifdef __LITTLE_ENDIAN__
1052#define vld4q_bf16(__p0) __extension__ ({ \
1053 bfloat16x8x4_t __ret; \
1054 __builtin_neon_vld4q_bf16(&__ret, __p0, 43); \
1055 __ret; \
1056})
1057#else
1058#define vld4q_bf16(__p0) __extension__ ({ \
1059 bfloat16x8x4_t __ret; \
1060 __builtin_neon_vld4q_bf16(&__ret, __p0, 43); \
1061 \
1062 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
1063 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
1064 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
1065 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
1066 __ret; \
1067})
1068#endif
1069
1070#ifdef __LITTLE_ENDIAN__
1071#define vld4_bf16(__p0) __extension__ ({ \
1072 bfloat16x4x4_t __ret; \
1073 __builtin_neon_vld4_bf16(&__ret, __p0, 11); \
1074 __ret; \
1075})
1076#else
1077#define vld4_bf16(__p0) __extension__ ({ \
1078 bfloat16x4x4_t __ret; \
1079 __builtin_neon_vld4_bf16(&__ret, __p0, 11); \
1080 \
1081 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
1082 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
1083 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
1084 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
1085 __ret; \
1086})
1087#endif
1088
1089#ifdef __LITTLE_ENDIAN__
1090#define vld4q_dup_bf16(__p0) __extension__ ({ \
1091 bfloat16x8x4_t __ret; \
1092 __builtin_neon_vld4q_dup_bf16(&__ret, __p0, 43); \
1093 __ret; \
1094})
1095#else
1096#define vld4q_dup_bf16(__p0) __extension__ ({ \
1097 bfloat16x8x4_t __ret; \
1098 __builtin_neon_vld4q_dup_bf16(&__ret, __p0, 43); \
1099 \
1100 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
1101 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
1102 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
1103 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
1104 __ret; \
1105})
1106#endif
1107
1108#ifdef __LITTLE_ENDIAN__
1109#define vld4_dup_bf16(__p0) __extension__ ({ \
1110 bfloat16x4x4_t __ret; \
1111 __builtin_neon_vld4_dup_bf16(&__ret, __p0, 11); \
1112 __ret; \
1113})
1114#else
1115#define vld4_dup_bf16(__p0) __extension__ ({ \
1116 bfloat16x4x4_t __ret; \
1117 __builtin_neon_vld4_dup_bf16(&__ret, __p0, 11); \
1118 \
1119 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
1120 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
1121 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
1122 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
1123 __ret; \
1124})
1125#endif
1126
1127#ifdef __LITTLE_ENDIAN__
1128#define vld4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1129 bfloat16x8x4_t __ret; \
1130 bfloat16x8x4_t __s1 = __p1; \
1131 __builtin_neon_vld4q_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), __p2, 43); \
1132 __ret; \
1133})
1134#else
1135#define vld4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1136 bfloat16x8x4_t __ret; \
1137 bfloat16x8x4_t __s1 = __p1; \
1138 bfloat16x8x4_t __rev1; \
1139 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1140 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1141 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
1142 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \
1143 __builtin_neon_vld4q_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), __p2, 43); \
1144 \
1145 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
1146 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
1147 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
1148 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
1149 __ret; \
1150})
1151#endif
1152
1153#ifdef __LITTLE_ENDIAN__
1154#define vld4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1155 bfloat16x4x4_t __ret; \
1156 bfloat16x4x4_t __s1 = __p1; \
1157 __builtin_neon_vld4_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), __p2, 11); \
1158 __ret; \
1159})
1160#else
1161#define vld4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1162 bfloat16x4x4_t __ret; \
1163 bfloat16x4x4_t __s1 = __p1; \
1164 bfloat16x4x4_t __rev1; \
1165 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1166 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1167 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
1168 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \
1169 __builtin_neon_vld4_lane_bf16(&__ret, __p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), __p2, 11); \
1170 \
1171 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
1172 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
1173 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
1174 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
1175 __ret; \
1176})
1177#endif
1178
1179#ifdef __LITTLE_ENDIAN__
1180#define vsetq_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1181 bfloat16x8_t __ret; \
1182 bfloat16_t __s0 = __p0; \
1183 bfloat16x8_t __s1 = __p1; \
1184 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vsetq_lane_bf16(__s0, __s1, __p2)); \
1185 __ret; \
1186})
1187#else
1188#define vsetq_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1189 bfloat16x8_t __ret; \
1190 bfloat16_t __s0 = __p0; \
1191 bfloat16x8_t __s1 = __p1; \
1192 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
1193 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vsetq_lane_bf16(__s0, __rev1, __p2)); \
1194 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
1195 __ret; \
1196})
1197#define __noswap_vsetq_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1198 bfloat16x8_t __ret; \
1199 bfloat16_t __s0 = __p0; \
1200 bfloat16x8_t __s1 = __p1; \
1201 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vsetq_lane_bf16(__s0, __s1, __p2)); \
1202 __ret; \
1203})
1204#endif
1205
1206#ifdef __LITTLE_ENDIAN__
1207#define vset_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1208 bfloat16x4_t __ret; \
1209 bfloat16_t __s0 = __p0; \
1210 bfloat16x4_t __s1 = __p1; \
1211 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vset_lane_bf16(__s0, __s1, __p2)); \
1212 __ret; \
1213})
1214#else
1215#define vset_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1216 bfloat16x4_t __ret; \
1217 bfloat16_t __s0 = __p0; \
1218 bfloat16x4_t __s1 = __p1; \
1219 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
1220 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vset_lane_bf16(__s0, __rev1, __p2)); \
1221 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
1222 __ret; \
1223})
1224#define __noswap_vset_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1225 bfloat16x4_t __ret; \
1226 bfloat16_t __s0 = __p0; \
1227 bfloat16x4_t __s1 = __p1; \
1228 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vset_lane_bf16(__s0, __s1, __p2)); \
1229 __ret; \
1230})
1231#endif
1232
1233#ifdef __LITTLE_ENDIAN__
1234#define vst1q_bf16(__p0, __p1) __extension__ ({ \
1235 bfloat16x8_t __s1 = __p1; \
1236 __builtin_neon_vst1q_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1), 43); \
1237})
1238#else
1239#define vst1q_bf16(__p0, __p1) __extension__ ({ \
1240 bfloat16x8_t __s1 = __p1; \
1241 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
1242 __builtin_neon_vst1q_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1), 43); \
1243})
1244#endif
1245
1246#ifdef __LITTLE_ENDIAN__
1247#define vst1_bf16(__p0, __p1) __extension__ ({ \
1248 bfloat16x4_t __s1 = __p1; \
1249 __builtin_neon_vst1_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1), 11); \
1250})
1251#else
1252#define vst1_bf16(__p0, __p1) __extension__ ({ \
1253 bfloat16x4_t __s1 = __p1; \
1254 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
1255 __builtin_neon_vst1_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1), 11); \
1256})
1257#endif
1258
1259#ifdef __LITTLE_ENDIAN__
1260#define vst1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1261 bfloat16x8_t __s1 = __p1; \
1262 __builtin_neon_vst1q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1), __p2, 43); \
1263})
1264#else
1265#define vst1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1266 bfloat16x8_t __s1 = __p1; \
1267 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
1268 __builtin_neon_vst1q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1), __p2, 43); \
1269})
1270#endif
1271
1272#ifdef __LITTLE_ENDIAN__
1273#define vst1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1274 bfloat16x4_t __s1 = __p1; \
1275 __builtin_neon_vst1_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1), __p2, 11); \
1276})
1277#else
1278#define vst1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1279 bfloat16x4_t __s1 = __p1; \
1280 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
1281 __builtin_neon_vst1_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1), __p2, 11); \
1282})
1283#endif
1284
1285#ifdef __LITTLE_ENDIAN__
1286#define vst1q_bf16_x2(__p0, __p1) __extension__ ({ \
1287 bfloat16x8x2_t __s1 = __p1; \
1288 __builtin_neon_vst1q_bf16_x2(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), 43); \
1289})
1290#else
1291#define vst1q_bf16_x2(__p0, __p1) __extension__ ({ \
1292 bfloat16x8x2_t __s1 = __p1; \
1293 bfloat16x8x2_t __rev1; \
1294 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1295 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1296 __builtin_neon_vst1q_bf16_x2(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), 43); \
1297})
1298#endif
1299
1300#ifdef __LITTLE_ENDIAN__
1301#define vst1_bf16_x2(__p0, __p1) __extension__ ({ \
1302 bfloat16x4x2_t __s1 = __p1; \
1303 __builtin_neon_vst1_bf16_x2(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), 11); \
1304})
1305#else
1306#define vst1_bf16_x2(__p0, __p1) __extension__ ({ \
1307 bfloat16x4x2_t __s1 = __p1; \
1308 bfloat16x4x2_t __rev1; \
1309 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1310 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1311 __builtin_neon_vst1_bf16_x2(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), 11); \
1312})
1313#endif
1314
1315#ifdef __LITTLE_ENDIAN__
1316#define vst1q_bf16_x3(__p0, __p1) __extension__ ({ \
1317 bfloat16x8x3_t __s1 = __p1; \
1318 __builtin_neon_vst1q_bf16_x3(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), 43); \
1319})
1320#else
1321#define vst1q_bf16_x3(__p0, __p1) __extension__ ({ \
1322 bfloat16x8x3_t __s1 = __p1; \
1323 bfloat16x8x3_t __rev1; \
1324 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1325 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1326 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
1327 __builtin_neon_vst1q_bf16_x3(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), 43); \
1328})
1329#endif
1330
1331#ifdef __LITTLE_ENDIAN__
1332#define vst1_bf16_x3(__p0, __p1) __extension__ ({ \
1333 bfloat16x4x3_t __s1 = __p1; \
1334 __builtin_neon_vst1_bf16_x3(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), 11); \
1335})
1336#else
1337#define vst1_bf16_x3(__p0, __p1) __extension__ ({ \
1338 bfloat16x4x3_t __s1 = __p1; \
1339 bfloat16x4x3_t __rev1; \
1340 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1341 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1342 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
1343 __builtin_neon_vst1_bf16_x3(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), 11); \
1344})
1345#endif
1346
1347#ifdef __LITTLE_ENDIAN__
1348#define vst1q_bf16_x4(__p0, __p1) __extension__ ({ \
1349 bfloat16x8x4_t __s1 = __p1; \
1350 __builtin_neon_vst1q_bf16_x4(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), 43); \
1351})
1352#else
1353#define vst1q_bf16_x4(__p0, __p1) __extension__ ({ \
1354 bfloat16x8x4_t __s1 = __p1; \
1355 bfloat16x8x4_t __rev1; \
1356 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1357 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1358 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
1359 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \
1360 __builtin_neon_vst1q_bf16_x4(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), 43); \
1361})
1362#endif
1363
1364#ifdef __LITTLE_ENDIAN__
1365#define vst1_bf16_x4(__p0, __p1) __extension__ ({ \
1366 bfloat16x4x4_t __s1 = __p1; \
1367 __builtin_neon_vst1_bf16_x4(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), 11); \
1368})
1369#else
1370#define vst1_bf16_x4(__p0, __p1) __extension__ ({ \
1371 bfloat16x4x4_t __s1 = __p1; \
1372 bfloat16x4x4_t __rev1; \
1373 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1374 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1375 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
1376 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \
1377 __builtin_neon_vst1_bf16_x4(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), 11); \
1378})
1379#endif
1380
1381#ifdef __LITTLE_ENDIAN__
1382#define vst2q_bf16(__p0, __p1) __extension__ ({ \
1383 bfloat16x8x2_t __s1 = __p1; \
1384 __builtin_neon_vst2q_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), 43); \
1385})
1386#else
1387#define vst2q_bf16(__p0, __p1) __extension__ ({ \
1388 bfloat16x8x2_t __s1 = __p1; \
1389 bfloat16x8x2_t __rev1; \
1390 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1391 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1392 __builtin_neon_vst2q_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), 43); \
1393})
1394#endif
1395
1396#ifdef __LITTLE_ENDIAN__
1397#define vst2_bf16(__p0, __p1) __extension__ ({ \
1398 bfloat16x4x2_t __s1 = __p1; \
1399 __builtin_neon_vst2_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), 11); \
1400})
1401#else
1402#define vst2_bf16(__p0, __p1) __extension__ ({ \
1403 bfloat16x4x2_t __s1 = __p1; \
1404 bfloat16x4x2_t __rev1; \
1405 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1406 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1407 __builtin_neon_vst2_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), 11); \
1408})
1409#endif
1410
1411#ifdef __LITTLE_ENDIAN__
1412#define vst2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1413 bfloat16x8x2_t __s1 = __p1; \
1414 __builtin_neon_vst2q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __p2, 43); \
1415})
1416#else
1417#define vst2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1418 bfloat16x8x2_t __s1 = __p1; \
1419 bfloat16x8x2_t __rev1; \
1420 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1421 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1422 __builtin_neon_vst2q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __p2, 43); \
1423})
1424#endif
1425
1426#ifdef __LITTLE_ENDIAN__
1427#define vst2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1428 bfloat16x4x2_t __s1 = __p1; \
1429 __builtin_neon_vst2_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __p2, 11); \
1430})
1431#else
1432#define vst2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1433 bfloat16x4x2_t __s1 = __p1; \
1434 bfloat16x4x2_t __rev1; \
1435 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1436 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1437 __builtin_neon_vst2_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __p2, 11); \
1438})
1439#endif
1440
1441#ifdef __LITTLE_ENDIAN__
1442#define vst3q_bf16(__p0, __p1) __extension__ ({ \
1443 bfloat16x8x3_t __s1 = __p1; \
1444 __builtin_neon_vst3q_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), 43); \
1445})
1446#else
1447#define vst3q_bf16(__p0, __p1) __extension__ ({ \
1448 bfloat16x8x3_t __s1 = __p1; \
1449 bfloat16x8x3_t __rev1; \
1450 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1451 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1452 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
1453 __builtin_neon_vst3q_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), 43); \
1454})
1455#endif
1456
1457#ifdef __LITTLE_ENDIAN__
1458#define vst3_bf16(__p0, __p1) __extension__ ({ \
1459 bfloat16x4x3_t __s1 = __p1; \
1460 __builtin_neon_vst3_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), 11); \
1461})
1462#else
1463#define vst3_bf16(__p0, __p1) __extension__ ({ \
1464 bfloat16x4x3_t __s1 = __p1; \
1465 bfloat16x4x3_t __rev1; \
1466 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
1467 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
1468 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
1469 __builtin_neon_vst3_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), 11); \
1470})
1471#endif
1472
1473#ifdef __LITTLE_ENDIAN__
1474#define vst3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1475 bfloat16x8x3_t __s1 = __p1; \
1476 __builtin_neon_vst3q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __p2, 43); \
1477})
1478#else
1479#define vst3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1480 bfloat16x8x3_t __s1 = __p1; \
1481 bfloat16x8x3_t __rev1; \
1482 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
1483 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
1484 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
1485 __builtin_neon_vst3q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __p2, 43); \
1486})
1487#endif
1488
1489#ifdef __LITTLE_ENDIAN__
1490#define vst3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
1491 bfloat16x4x3_t __s1 = __p1; \
1492 __builtin_neon_vst3_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __p2, 11); \
1493})
1494#else153#else
1495#define vst3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \154__ai __attribute__((target("bf16,neon"))) float32x4_t vbfdotq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1496 bfloat16x4x3_t __s1 = __p1; \155 float32x4_t __ret;
1497 bfloat16x4x3_t __rev1; \156 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
1498 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \157 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
1499 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \158 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
1500 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \159 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfdotq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
1501 __builtin_neon_vst3_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __p2, 11); \160 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
1502})161 return __ret;
162}
163__ai __attribute__((target("bf16,neon"))) float32x4_t __noswap_vbfdotq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
164 float32x4_t __ret;
165 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfdotq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
166 return __ret;
167}
1503#endif168#endif
1504169
1505#ifdef __LITTLE_ENDIAN__170#ifdef __LITTLE_ENDIAN__
1506#define vst4q_bf16(__p0, __p1) __extension__ ({ \171__ai __attribute__((target("bf16,neon"))) float32x2_t vbfdot_f32(float32x2_t __p0, bfloat16x4_t __p1, bfloat16x4_t __p2) {
1507 bfloat16x8x4_t __s1 = __p1; \172 float32x2_t __ret;
1508 __builtin_neon_vst4q_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), 43); \173 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vbfdot_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), __builtin_bit_cast(int8x8_t, __p2), 9));
1509})174 return __ret;
175}
1510#else176#else
1511#define vst4q_bf16(__p0, __p1) __extension__ ({ \177__ai __attribute__((target("bf16,neon"))) float32x2_t vbfdot_f32(float32x2_t __p0, bfloat16x4_t __p1, bfloat16x4_t __p2) {
1512 bfloat16x8x4_t __s1 = __p1; \178 float32x2_t __ret;
1513 bfloat16x8x4_t __rev1; \179 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
1514 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \180 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
1515 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \181 bfloat16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_64_16);
1516 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \182 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vbfdot_f32(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __builtin_bit_cast(int8x8_t, __rev2), 9));
1517 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \183 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
1518 __builtin_neon_vst4q_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), 43); \184 return __ret;
1519})185}
186__ai __attribute__((target("bf16,neon"))) float32x2_t __noswap_vbfdot_f32(float32x2_t __p0, bfloat16x4_t __p1, bfloat16x4_t __p2) {
187 float32x2_t __ret;
188 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vbfdot_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), __builtin_bit_cast(int8x8_t, __p2), 9));
189 return __ret;
190}
1520#endif191#endif
1521192
1522#ifdef __LITTLE_ENDIAN__193#ifdef __LITTLE_ENDIAN__
1523#define vst4_bf16(__p0, __p1) __extension__ ({ \194__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlalbq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1524 bfloat16x4x4_t __s1 = __p1; \195 float32x4_t __ret;
1525 __builtin_neon_vst4_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), 11); \196 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlalbq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
1526})197 return __ret;
198}
1527#else199#else
1528#define vst4_bf16(__p0, __p1) __extension__ ({ \200__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlalbq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1529 bfloat16x4x4_t __s1 = __p1; \201 float32x4_t __ret;
1530 bfloat16x4x4_t __rev1; \202 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
1531 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \203 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
1532 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \204 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
1533 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \205 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlalbq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
1534 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \206 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
1535 __builtin_neon_vst4_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), 11); \207 return __ret;
1536})208}
209__ai __attribute__((target("bf16,neon"))) float32x4_t __noswap_vbfmlalbq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
210 float32x4_t __ret;
211 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlalbq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
212 return __ret;
213}
1537#endif214#endif
1538215
1539#ifdef __LITTLE_ENDIAN__216#ifdef __LITTLE_ENDIAN__
1540#define vst4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \217__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlaltq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1541 bfloat16x8x4_t __s1 = __p1; \218 float32x4_t __ret;
1542 __builtin_neon_vst4q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), __p2, 43); \219 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlaltq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
1543})220 return __ret;
221}
1544#else222#else
1545#define vst4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \223__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmlaltq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1546 bfloat16x8x4_t __s1 = __p1; \224 float32x4_t __ret;
1547 bfloat16x8x4_t __rev1; \225 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
1548 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \226 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
1549 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \227 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
1550 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \228 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlaltq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
1551 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \229 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
1552 __builtin_neon_vst4q_lane_bf16(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), __p2, 43); \230 return __ret;
1553})231}
232__ai __attribute__((target("bf16,neon"))) float32x4_t __noswap_vbfmlaltq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
233 float32x4_t __ret;
234 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmlaltq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
235 return __ret;
236}
1554#endif237#endif
1555238
1556#ifdef __LITTLE_ENDIAN__239#ifdef __LITTLE_ENDIAN__
1557#define vst4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \240__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmmlaq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1558 bfloat16x4x4_t __s1 = __p1; \241 float32x4_t __ret;
1559 __builtin_neon_vst4_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), __p2, 11); \242 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmmlaq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
1560})243 return __ret;
244}
1561#else245#else
1562#define vst4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \246__ai __attribute__((target("bf16,neon"))) float32x4_t vbfmmlaq_f32(float32x4_t __p0, bfloat16x8_t __p1, bfloat16x8_t __p2) {
1563 bfloat16x4x4_t __s1 = __p1; \247 float32x4_t __ret;
1564 bfloat16x4x4_t __rev1; \248 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
1565 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \249 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
1566 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \250 bfloat16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
1567 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \251 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vbfmmlaq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
1568 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \252 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
1569 __builtin_neon_vst4_lane_bf16(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), __p2, 11); \253 return __ret;
1570})254}
1571#endif255#endif
1572256
257__ai __attribute__((target("bf16,neon"))) float32_t vcvtah_f32_bf16(bfloat16_t __p0) {
258 float32_t __ret;
259 __ret = __builtin_bit_cast(float32_t, (uint32_t)(__builtin_bit_cast(uint16_t, __p0)) << 16);
260 return __ret;
261}
262__ai __attribute__((target("bf16,neon"))) bfloat16_t vcvth_bf16_f32(float32_t __p0) {
263 bfloat16_t __ret;
264 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vcvth_bf16_f32(__p0));
265 return __ret;
266}
1573#ifdef __LITTLE_ENDIAN__267#ifdef __LITTLE_ENDIAN__
1574__ai __attribute__((target("dotprod,neon"))) uint32x4_t vdotq_u32(uint32x4_t __p0, uint8x16_t __p1, uint8x16_t __p2) {268__ai __attribute__((target("dotprod,neon"))) uint32x4_t vdotq_u32(uint32x4_t __p0, uint8x16_t __p1, uint8x16_t __p2) {
1575 uint32x4_t __ret;269 uint32x4_t __ret;
...@@ -3925,6 +2619,54 @@ __ai __attribute__((target("i8mm,neon"))) int32x4_t vusmmlaq_s32(int32x4_t __p0,...@@ -3925,6 +2619,54 @@ __ai __attribute__((target("i8mm,neon"))) int32x4_t vusmmlaq_s32(int32x4_t __p0,
3925})2619})
3926#endif2620#endif
39272621
2622#ifdef __LITTLE_ENDIAN__
2623#define splatq_lane_bf16(__p0, __p1) __extension__ ({ \
2624 bfloat16x8_t __ret; \
2625 bfloat16x4_t __s0 = __p0; \
2626 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_lane_v(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
2627 __ret; \
2628})
2629#else
2630#define splatq_lane_bf16(__p0, __p1) __extension__ ({ \
2631 bfloat16x8_t __ret; \
2632 bfloat16x4_t __s0 = __p0; \
2633 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
2634 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_lane_v(__builtin_bit_cast(int8x8_t, __rev0), __p1, 11)); \
2635 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
2636 __ret; \
2637})
2638#define __noswap_splatq_lane_bf16(__p0, __p1) __extension__ ({ \
2639 bfloat16x8_t __ret; \
2640 bfloat16x4_t __s0 = __p0; \
2641 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_lane_v(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
2642 __ret; \
2643})
2644#endif
2645
2646#ifdef __LITTLE_ENDIAN__
2647#define splat_lane_bf16(__p0, __p1) __extension__ ({ \
2648 bfloat16x4_t __ret; \
2649 bfloat16x4_t __s0 = __p0; \
2650 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_lane_v(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
2651 __ret; \
2652})
2653#else
2654#define splat_lane_bf16(__p0, __p1) __extension__ ({ \
2655 bfloat16x4_t __ret; \
2656 bfloat16x4_t __s0 = __p0; \
2657 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
2658 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_lane_v(__builtin_bit_cast(int8x8_t, __rev0), __p1, 11)); \
2659 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
2660 __ret; \
2661})
2662#define __noswap_splat_lane_bf16(__p0, __p1) __extension__ ({ \
2663 bfloat16x4_t __ret; \
2664 bfloat16x4_t __s0 = __p0; \
2665 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_lane_v(__builtin_bit_cast(int8x8_t, __s0), __p1, 11)); \
2666 __ret; \
2667})
2668#endif
2669
3928#ifdef __LITTLE_ENDIAN__2670#ifdef __LITTLE_ENDIAN__
3929#define splat_laneq_p8(__p0, __p1) __extension__ ({ \2671#define splat_laneq_p8(__p0, __p1) __extension__ ({ \
3930 poly8x8_t __ret; \2672 poly8x8_t __ret; \
...@@ -4593,6 +3335,54 @@ __ai __attribute__((target("i8mm,neon"))) int32x4_t vusmmlaq_s32(int32x4_t __p0,...@@ -4593,6 +3335,54 @@ __ai __attribute__((target("i8mm,neon"))) int32x4_t vusmmlaq_s32(int32x4_t __p0,
4593})3335})
4594#endif3336#endif
45953337
3338#ifdef __LITTLE_ENDIAN__
3339#define splatq_laneq_bf16(__p0, __p1) __extension__ ({ \
3340 bfloat16x8_t __ret; \
3341 bfloat16x8_t __s0 = __p0; \
3342 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_laneq_v(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
3343 __ret; \
3344})
3345#else
3346#define splatq_laneq_bf16(__p0, __p1) __extension__ ({ \
3347 bfloat16x8_t __ret; \
3348 bfloat16x8_t __s0 = __p0; \
3349 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
3350 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_laneq_v(__builtin_bit_cast(int8x16_t, __rev0), __p1, 43)); \
3351 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
3352 __ret; \
3353})
3354#define __noswap_splatq_laneq_bf16(__p0, __p1) __extension__ ({ \
3355 bfloat16x8_t __ret; \
3356 bfloat16x8_t __s0 = __p0; \
3357 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_splatq_laneq_v(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
3358 __ret; \
3359})
3360#endif
3361
3362#ifdef __LITTLE_ENDIAN__
3363#define splat_laneq_bf16(__p0, __p1) __extension__ ({ \
3364 bfloat16x4_t __ret; \
3365 bfloat16x8_t __s0 = __p0; \
3366 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_laneq_v(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
3367 __ret; \
3368})
3369#else
3370#define splat_laneq_bf16(__p0, __p1) __extension__ ({ \
3371 bfloat16x4_t __ret; \
3372 bfloat16x8_t __s0 = __p0; \
3373 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
3374 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_laneq_v(__builtin_bit_cast(int8x16_t, __rev0), __p1, 43)); \
3375 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
3376 __ret; \
3377})
3378#define __noswap_splat_laneq_bf16(__p0, __p1) __extension__ ({ \
3379 bfloat16x4_t __ret; \
3380 bfloat16x8_t __s0 = __p0; \
3381 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_splat_laneq_v(__builtin_bit_cast(int8x16_t, __s0), __p1, 43)); \
3382 __ret; \
3383})
3384#endif
3385
4596#ifdef __LITTLE_ENDIAN__3386#ifdef __LITTLE_ENDIAN__
4597__ai __attribute__((target("neon"))) uint8x16_t vabdq_u8(uint8x16_t __p0, uint8x16_t __p1) {3387__ai __attribute__((target("neon"))) uint8x16_t vabdq_u8(uint8x16_t __p0, uint8x16_t __p1) {
4598 uint8x16_t __ret;3388 uint8x16_t __ret;
...@@ -8505,6 +7295,28 @@ __ai __attribute__((target("neon"))) int16x8_t __noswap_vcombine_s16(int16x4_t _...@@ -8505,6 +7295,28 @@ __ai __attribute__((target("neon"))) int16x8_t __noswap_vcombine_s16(int16x4_t _
8505}7295}
8506#endif7296#endif
85077297
7298#ifdef __LITTLE_ENDIAN__
7299__ai __attribute__((target("neon"))) bfloat16x8_t vcombine_bf16(bfloat16x4_t __p0, bfloat16x4_t __p1) {
7300 bfloat16x8_t __ret;
7301 __ret = __builtin_shufflevector(__p0, __p1, 0, 1, 2, 3, 4, 5, 6, 7);
7302 return __ret;
7303}
7304#else
7305__ai __attribute__((target("neon"))) bfloat16x8_t vcombine_bf16(bfloat16x4_t __p0, bfloat16x4_t __p1) {
7306 bfloat16x8_t __ret;
7307 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
7308 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
7309 __ret = __builtin_shufflevector(__rev0, __rev1, 0, 1, 2, 3, 4, 5, 6, 7);
7310 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
7311 return __ret;
7312}
7313__ai __attribute__((target("neon"))) bfloat16x8_t __noswap_vcombine_bf16(bfloat16x4_t __p0, bfloat16x4_t __p1) {
7314 bfloat16x8_t __ret;
7315 __ret = __builtin_shufflevector(__p0, __p1, 0, 1, 2, 3, 4, 5, 6, 7);
7316 return __ret;
7317}
7318#endif
7319
8508#define vcreate_p8(__p0) __extension__ ({ \7320#define vcreate_p8(__p0) __extension__ ({ \
8509 poly8x8_t __ret; \7321 poly8x8_t __ret; \
8510 uint64_t __promote = __p0; \7322 uint64_t __promote = __p0; \
...@@ -8577,6 +7389,12 @@ __ai __attribute__((target("neon"))) int16x8_t __noswap_vcombine_s16(int16x4_t _...@@ -8577,6 +7389,12 @@ __ai __attribute__((target("neon"))) int16x8_t __noswap_vcombine_s16(int16x4_t _
8577 __ret = __builtin_bit_cast(int16x4_t, __promote); \7389 __ret = __builtin_bit_cast(int16x4_t, __promote); \
8578 __ret; \7390 __ret; \
8579})7391})
7392#define vcreate_bf16(__p0) __extension__ ({ \
7393 bfloat16x4_t __ret; \
7394 uint64_t __promote = __p0; \
7395 __ret = __builtin_bit_cast(bfloat16x4_t, __promote); \
7396 __ret; \
7397})
8580#ifdef __LITTLE_ENDIAN__7398#ifdef __LITTLE_ENDIAN__
8581__ai __attribute__((target("neon"))) float32x4_t vcvtq_f32_u32(uint32x4_t __p0) {7399__ai __attribute__((target("neon"))) float32x4_t vcvtq_f32_u32(uint32x4_t __p0) {
8582 float32x4_t __ret;7400 float32x4_t __ret;
...@@ -8850,406 +7668,512 @@ __ai __attribute__((target("neon"))) uint32x2_t vcvt_u32_f32(float32x2_t __p0) {...@@ -8850,406 +7668,512 @@ __ai __attribute__((target("neon"))) uint32x2_t vcvt_u32_f32(float32x2_t __p0) {
8850#endif7668#endif
88517669
8852#ifdef __LITTLE_ENDIAN__7670#ifdef __LITTLE_ENDIAN__
8853#define vdup_lane_p8(__p0_8, __p1_8) __extension__ ({ \7671#define vduph_lane_bf16(__p0, __p1) __extension__ ({ \
8854 poly8x8_t __ret_8; \7672 bfloat16_t __ret; \
8855 poly8x8_t __s0_8 = __p0_8; \7673 bfloat16x4_t __s0 = __p0; \
8856 __ret_8 = splat_lane_p8(__s0_8, __p1_8); \7674 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_lane_bf16(__s0, __p1)); \
7675 __ret; \
7676})
7677#else
7678#define vduph_lane_bf16(__p0, __p1) __extension__ ({ \
7679 bfloat16_t __ret; \
7680 bfloat16x4_t __s0 = __p0; \
7681 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
7682 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_lane_bf16(__rev0, __p1)); \
7683 __ret; \
7684})
7685#endif
7686
7687#ifdef __LITTLE_ENDIAN__
7688#define vdup_lane_p8(__p0_0, __p1_0) __extension__ ({ \
7689 poly8x8_t __ret_0; \
7690 poly8x8_t __s0_0 = __p0_0; \
7691 __ret_0 = splat_lane_p8(__s0_0, __p1_0); \
7692 __ret_0; \
7693})
7694#else
7695#define vdup_lane_p8(__p0_1, __p1_1) __extension__ ({ \
7696 poly8x8_t __ret_1; \
7697 poly8x8_t __s0_1 = __p0_1; \
7698 poly8x8_t __rev0_1; __rev0_1 = __builtin_shufflevector(__s0_1, __s0_1, __lane_reverse_64_8); \
7699 __ret_1 = __noswap_splat_lane_p8(__rev0_1, __p1_1); \
7700 __ret_1 = __builtin_shufflevector(__ret_1, __ret_1, __lane_reverse_64_8); \
7701 __ret_1; \
7702})
7703#endif
7704
7705#ifdef __LITTLE_ENDIAN__
7706#define vdup_lane_p16(__p0_2, __p1_2) __extension__ ({ \
7707 poly16x4_t __ret_2; \
7708 poly16x4_t __s0_2 = __p0_2; \
7709 __ret_2 = splat_lane_p16(__s0_2, __p1_2); \
7710 __ret_2; \
7711})
7712#else
7713#define vdup_lane_p16(__p0_3, __p1_3) __extension__ ({ \
7714 poly16x4_t __ret_3; \
7715 poly16x4_t __s0_3 = __p0_3; \
7716 poly16x4_t __rev0_3; __rev0_3 = __builtin_shufflevector(__s0_3, __s0_3, __lane_reverse_64_16); \
7717 __ret_3 = __noswap_splat_lane_p16(__rev0_3, __p1_3); \
7718 __ret_3 = __builtin_shufflevector(__ret_3, __ret_3, __lane_reverse_64_16); \
7719 __ret_3; \
7720})
7721#endif
7722
7723#ifdef __LITTLE_ENDIAN__
7724#define vdupq_lane_p8(__p0_4, __p1_4) __extension__ ({ \
7725 poly8x16_t __ret_4; \
7726 poly8x8_t __s0_4 = __p0_4; \
7727 __ret_4 = splatq_lane_p8(__s0_4, __p1_4); \
7728 __ret_4; \
7729})
7730#else
7731#define vdupq_lane_p8(__p0_5, __p1_5) __extension__ ({ \
7732 poly8x16_t __ret_5; \
7733 poly8x8_t __s0_5 = __p0_5; \
7734 poly8x8_t __rev0_5; __rev0_5 = __builtin_shufflevector(__s0_5, __s0_5, __lane_reverse_64_8); \
7735 __ret_5 = __noswap_splatq_lane_p8(__rev0_5, __p1_5); \
7736 __ret_5 = __builtin_shufflevector(__ret_5, __ret_5, __lane_reverse_128_8); \
7737 __ret_5; \
7738})
7739#endif
7740
7741#ifdef __LITTLE_ENDIAN__
7742#define vdupq_lane_p16(__p0_6, __p1_6) __extension__ ({ \
7743 poly16x8_t __ret_6; \
7744 poly16x4_t __s0_6 = __p0_6; \
7745 __ret_6 = splatq_lane_p16(__s0_6, __p1_6); \
7746 __ret_6; \
7747})
7748#else
7749#define vdupq_lane_p16(__p0_7, __p1_7) __extension__ ({ \
7750 poly16x8_t __ret_7; \
7751 poly16x4_t __s0_7 = __p0_7; \
7752 poly16x4_t __rev0_7; __rev0_7 = __builtin_shufflevector(__s0_7, __s0_7, __lane_reverse_64_16); \
7753 __ret_7 = __noswap_splatq_lane_p16(__rev0_7, __p1_7); \
7754 __ret_7 = __builtin_shufflevector(__ret_7, __ret_7, __lane_reverse_128_16); \
7755 __ret_7; \
7756})
7757#endif
7758
7759#ifdef __LITTLE_ENDIAN__
7760#define vdupq_lane_u8(__p0_8, __p1_8) __extension__ ({ \
7761 uint8x16_t __ret_8; \
7762 uint8x8_t __s0_8 = __p0_8; \
7763 __ret_8 = splatq_lane_u8(__s0_8, __p1_8); \
8857 __ret_8; \7764 __ret_8; \
8858})7765})
8859#else7766#else
8860#define vdup_lane_p8(__p0_9, __p1_9) __extension__ ({ \7767#define vdupq_lane_u8(__p0_9, __p1_9) __extension__ ({ \
8861 poly8x8_t __ret_9; \7768 uint8x16_t __ret_9; \
8862 poly8x8_t __s0_9 = __p0_9; \7769 uint8x8_t __s0_9 = __p0_9; \
8863 poly8x8_t __rev0_9; __rev0_9 = __builtin_shufflevector(__s0_9, __s0_9, __lane_reverse_64_8); \7770 uint8x8_t __rev0_9; __rev0_9 = __builtin_shufflevector(__s0_9, __s0_9, __lane_reverse_64_8); \
8864 __ret_9 = __noswap_splat_lane_p8(__rev0_9, __p1_9); \7771 __ret_9 = __noswap_splatq_lane_u8(__rev0_9, __p1_9); \
8865 __ret_9 = __builtin_shufflevector(__ret_9, __ret_9, __lane_reverse_64_8); \7772 __ret_9 = __builtin_shufflevector(__ret_9, __ret_9, __lane_reverse_128_8); \
8866 __ret_9; \7773 __ret_9; \
8867})7774})
8868#endif7775#endif
88697776
8870#ifdef __LITTLE_ENDIAN__7777#ifdef __LITTLE_ENDIAN__
8871#define vdup_lane_p16(__p0_10, __p1_10) __extension__ ({ \7778#define vdupq_lane_u32(__p0_10, __p1_10) __extension__ ({ \
8872 poly16x4_t __ret_10; \7779 uint32x4_t __ret_10; \
8873 poly16x4_t __s0_10 = __p0_10; \7780 uint32x2_t __s0_10 = __p0_10; \
8874 __ret_10 = splat_lane_p16(__s0_10, __p1_10); \7781 __ret_10 = splatq_lane_u32(__s0_10, __p1_10); \
8875 __ret_10; \7782 __ret_10; \
8876})7783})
8877#else7784#else
8878#define vdup_lane_p16(__p0_11, __p1_11) __extension__ ({ \7785#define vdupq_lane_u32(__p0_11, __p1_11) __extension__ ({ \
8879 poly16x4_t __ret_11; \7786 uint32x4_t __ret_11; \
8880 poly16x4_t __s0_11 = __p0_11; \7787 uint32x2_t __s0_11 = __p0_11; \
8881 poly16x4_t __rev0_11; __rev0_11 = __builtin_shufflevector(__s0_11, __s0_11, __lane_reverse_64_16); \7788 uint32x2_t __rev0_11; __rev0_11 = __builtin_shufflevector(__s0_11, __s0_11, __lane_reverse_64_32); \
8882 __ret_11 = __noswap_splat_lane_p16(__rev0_11, __p1_11); \7789 __ret_11 = __noswap_splatq_lane_u32(__rev0_11, __p1_11); \
8883 __ret_11 = __builtin_shufflevector(__ret_11, __ret_11, __lane_reverse_64_16); \7790 __ret_11 = __builtin_shufflevector(__ret_11, __ret_11, __lane_reverse_128_32); \
8884 __ret_11; \7791 __ret_11; \
8885})7792})
8886#endif7793#endif
88877794
8888#ifdef __LITTLE_ENDIAN__7795#ifdef __LITTLE_ENDIAN__
8889#define vdupq_lane_p8(__p0_12, __p1_12) __extension__ ({ \7796#define vdupq_lane_u64(__p0_12, __p1_12) __extension__ ({ \
8890 poly8x16_t __ret_12; \7797 uint64x2_t __ret_12; \
8891 poly8x8_t __s0_12 = __p0_12; \7798 uint64x1_t __s0_12 = __p0_12; \
8892 __ret_12 = splatq_lane_p8(__s0_12, __p1_12); \7799 __ret_12 = splatq_lane_u64(__s0_12, __p1_12); \
8893 __ret_12; \7800 __ret_12; \
8894})7801})
8895#else7802#else
8896#define vdupq_lane_p8(__p0_13, __p1_13) __extension__ ({ \7803#define vdupq_lane_u64(__p0_13, __p1_13) __extension__ ({ \
8897 poly8x16_t __ret_13; \7804 uint64x2_t __ret_13; \
8898 poly8x8_t __s0_13 = __p0_13; \7805 uint64x1_t __s0_13 = __p0_13; \
8899 poly8x8_t __rev0_13; __rev0_13 = __builtin_shufflevector(__s0_13, __s0_13, __lane_reverse_64_8); \7806 __ret_13 = __noswap_splatq_lane_u64(__s0_13, __p1_13); \
8900 __ret_13 = __noswap_splatq_lane_p8(__rev0_13, __p1_13); \7807 __ret_13 = __builtin_shufflevector(__ret_13, __ret_13, __lane_reverse_128_64); \
8901 __ret_13 = __builtin_shufflevector(__ret_13, __ret_13, __lane_reverse_128_8); \
8902 __ret_13; \7808 __ret_13; \
8903})7809})
8904#endif7810#endif
89057811
8906#ifdef __LITTLE_ENDIAN__7812#ifdef __LITTLE_ENDIAN__
8907#define vdupq_lane_p16(__p0_14, __p1_14) __extension__ ({ \7813#define vdupq_lane_u16(__p0_14, __p1_14) __extension__ ({ \
8908 poly16x8_t __ret_14; \7814 uint16x8_t __ret_14; \
8909 poly16x4_t __s0_14 = __p0_14; \7815 uint16x4_t __s0_14 = __p0_14; \
8910 __ret_14 = splatq_lane_p16(__s0_14, __p1_14); \7816 __ret_14 = splatq_lane_u16(__s0_14, __p1_14); \
8911 __ret_14; \7817 __ret_14; \
8912})7818})
8913#else7819#else
8914#define vdupq_lane_p16(__p0_15, __p1_15) __extension__ ({ \7820#define vdupq_lane_u16(__p0_15, __p1_15) __extension__ ({ \
8915 poly16x8_t __ret_15; \7821 uint16x8_t __ret_15; \
8916 poly16x4_t __s0_15 = __p0_15; \7822 uint16x4_t __s0_15 = __p0_15; \
8917 poly16x4_t __rev0_15; __rev0_15 = __builtin_shufflevector(__s0_15, __s0_15, __lane_reverse_64_16); \7823 uint16x4_t __rev0_15; __rev0_15 = __builtin_shufflevector(__s0_15, __s0_15, __lane_reverse_64_16); \
8918 __ret_15 = __noswap_splatq_lane_p16(__rev0_15, __p1_15); \7824 __ret_15 = __noswap_splatq_lane_u16(__rev0_15, __p1_15); \
8919 __ret_15 = __builtin_shufflevector(__ret_15, __ret_15, __lane_reverse_128_16); \7825 __ret_15 = __builtin_shufflevector(__ret_15, __ret_15, __lane_reverse_128_16); \
8920 __ret_15; \7826 __ret_15; \
8921})7827})
8922#endif7828#endif
89237829
8924#ifdef __LITTLE_ENDIAN__7830#ifdef __LITTLE_ENDIAN__
8925#define vdupq_lane_u8(__p0_16, __p1_16) __extension__ ({ \7831#define vdupq_lane_s8(__p0_16, __p1_16) __extension__ ({ \
8926 uint8x16_t __ret_16; \7832 int8x16_t __ret_16; \
8927 uint8x8_t __s0_16 = __p0_16; \7833 int8x8_t __s0_16 = __p0_16; \
8928 __ret_16 = splatq_lane_u8(__s0_16, __p1_16); \7834 __ret_16 = splatq_lane_s8(__s0_16, __p1_16); \
8929 __ret_16; \7835 __ret_16; \
8930})7836})
8931#else7837#else
8932#define vdupq_lane_u8(__p0_17, __p1_17) __extension__ ({ \7838#define vdupq_lane_s8(__p0_17, __p1_17) __extension__ ({ \
8933 uint8x16_t __ret_17; \7839 int8x16_t __ret_17; \
8934 uint8x8_t __s0_17 = __p0_17; \7840 int8x8_t __s0_17 = __p0_17; \
8935 uint8x8_t __rev0_17; __rev0_17 = __builtin_shufflevector(__s0_17, __s0_17, __lane_reverse_64_8); \7841 int8x8_t __rev0_17; __rev0_17 = __builtin_shufflevector(__s0_17, __s0_17, __lane_reverse_64_8); \
8936 __ret_17 = __noswap_splatq_lane_u8(__rev0_17, __p1_17); \7842 __ret_17 = __noswap_splatq_lane_s8(__rev0_17, __p1_17); \
8937 __ret_17 = __builtin_shufflevector(__ret_17, __ret_17, __lane_reverse_128_8); \7843 __ret_17 = __builtin_shufflevector(__ret_17, __ret_17, __lane_reverse_128_8); \
8938 __ret_17; \7844 __ret_17; \
8939})7845})
8940#endif7846#endif
89417847
8942#ifdef __LITTLE_ENDIAN__7848#ifdef __LITTLE_ENDIAN__
8943#define vdupq_lane_u32(__p0_18, __p1_18) __extension__ ({ \7849#define vdupq_lane_f32(__p0_18, __p1_18) __extension__ ({ \
8944 uint32x4_t __ret_18; \7850 float32x4_t __ret_18; \
8945 uint32x2_t __s0_18 = __p0_18; \7851 float32x2_t __s0_18 = __p0_18; \
8946 __ret_18 = splatq_lane_u32(__s0_18, __p1_18); \7852 __ret_18 = splatq_lane_f32(__s0_18, __p1_18); \
8947 __ret_18; \7853 __ret_18; \
8948})7854})
8949#else7855#else
8950#define vdupq_lane_u32(__p0_19, __p1_19) __extension__ ({ \7856#define vdupq_lane_f32(__p0_19, __p1_19) __extension__ ({ \
8951 uint32x4_t __ret_19; \7857 float32x4_t __ret_19; \
8952 uint32x2_t __s0_19 = __p0_19; \7858 float32x2_t __s0_19 = __p0_19; \
8953 uint32x2_t __rev0_19; __rev0_19 = __builtin_shufflevector(__s0_19, __s0_19, __lane_reverse_64_32); \7859 float32x2_t __rev0_19; __rev0_19 = __builtin_shufflevector(__s0_19, __s0_19, __lane_reverse_64_32); \
8954 __ret_19 = __noswap_splatq_lane_u32(__rev0_19, __p1_19); \7860 __ret_19 = __noswap_splatq_lane_f32(__rev0_19, __p1_19); \
8955 __ret_19 = __builtin_shufflevector(__ret_19, __ret_19, __lane_reverse_128_32); \7861 __ret_19 = __builtin_shufflevector(__ret_19, __ret_19, __lane_reverse_128_32); \
8956 __ret_19; \7862 __ret_19; \
8957})7863})
8958#endif7864#endif
89597865
8960#ifdef __LITTLE_ENDIAN__7866#ifdef __LITTLE_ENDIAN__
8961#define vdupq_lane_u64(__p0_20, __p1_20) __extension__ ({ \7867#define vdupq_lane_f16(__p0_20, __p1_20) __extension__ ({ \
8962 uint64x2_t __ret_20; \7868 float16x8_t __ret_20; \
8963 uint64x1_t __s0_20 = __p0_20; \7869 float16x4_t __s0_20 = __p0_20; \
8964 __ret_20 = splatq_lane_u64(__s0_20, __p1_20); \7870 __ret_20 = splatq_lane_f16(__s0_20, __p1_20); \
8965 __ret_20; \7871 __ret_20; \
8966})7872})
8967#else7873#else
8968#define vdupq_lane_u64(__p0_21, __p1_21) __extension__ ({ \7874#define vdupq_lane_f16(__p0_21, __p1_21) __extension__ ({ \
8969 uint64x2_t __ret_21; \7875 float16x8_t __ret_21; \
8970 uint64x1_t __s0_21 = __p0_21; \7876 float16x4_t __s0_21 = __p0_21; \
8971 __ret_21 = __noswap_splatq_lane_u64(__s0_21, __p1_21); \7877 float16x4_t __rev0_21; __rev0_21 = __builtin_shufflevector(__s0_21, __s0_21, __lane_reverse_64_16); \
8972 __ret_21 = __builtin_shufflevector(__ret_21, __ret_21, __lane_reverse_128_64); \7878 __ret_21 = __noswap_splatq_lane_f16(__rev0_21, __p1_21); \
7879 __ret_21 = __builtin_shufflevector(__ret_21, __ret_21, __lane_reverse_128_16); \
8973 __ret_21; \7880 __ret_21; \
8974})7881})
8975#endif7882#endif
89767883
8977#ifdef __LITTLE_ENDIAN__7884#ifdef __LITTLE_ENDIAN__
8978#define vdupq_lane_u16(__p0_22, __p1_22) __extension__ ({ \7885#define vdupq_lane_s32(__p0_22, __p1_22) __extension__ ({ \
8979 uint16x8_t __ret_22; \7886 int32x4_t __ret_22; \
8980 uint16x4_t __s0_22 = __p0_22; \7887 int32x2_t __s0_22 = __p0_22; \
8981 __ret_22 = splatq_lane_u16(__s0_22, __p1_22); \7888 __ret_22 = splatq_lane_s32(__s0_22, __p1_22); \
8982 __ret_22; \7889 __ret_22; \
8983})7890})
8984#else7891#else
8985#define vdupq_lane_u16(__p0_23, __p1_23) __extension__ ({ \7892#define vdupq_lane_s32(__p0_23, __p1_23) __extension__ ({ \
8986 uint16x8_t __ret_23; \7893 int32x4_t __ret_23; \
8987 uint16x4_t __s0_23 = __p0_23; \7894 int32x2_t __s0_23 = __p0_23; \
8988 uint16x4_t __rev0_23; __rev0_23 = __builtin_shufflevector(__s0_23, __s0_23, __lane_reverse_64_16); \7895 int32x2_t __rev0_23; __rev0_23 = __builtin_shufflevector(__s0_23, __s0_23, __lane_reverse_64_32); \
8989 __ret_23 = __noswap_splatq_lane_u16(__rev0_23, __p1_23); \7896 __ret_23 = __noswap_splatq_lane_s32(__rev0_23, __p1_23); \
8990 __ret_23 = __builtin_shufflevector(__ret_23, __ret_23, __lane_reverse_128_16); \7897 __ret_23 = __builtin_shufflevector(__ret_23, __ret_23, __lane_reverse_128_32); \
8991 __ret_23; \7898 __ret_23; \
8992})7899})
8993#endif7900#endif
89947901
8995#ifdef __LITTLE_ENDIAN__7902#ifdef __LITTLE_ENDIAN__
8996#define vdupq_lane_s8(__p0_24, __p1_24) __extension__ ({ \7903#define vdupq_lane_s64(__p0_24, __p1_24) __extension__ ({ \
8997 int8x16_t __ret_24; \7904 int64x2_t __ret_24; \
8998 int8x8_t __s0_24 = __p0_24; \7905 int64x1_t __s0_24 = __p0_24; \
8999 __ret_24 = splatq_lane_s8(__s0_24, __p1_24); \7906 __ret_24 = splatq_lane_s64(__s0_24, __p1_24); \
9000 __ret_24; \7907 __ret_24; \
9001})7908})
9002#else7909#else
9003#define vdupq_lane_s8(__p0_25, __p1_25) __extension__ ({ \7910#define vdupq_lane_s64(__p0_25, __p1_25) __extension__ ({ \
9004 int8x16_t __ret_25; \7911 int64x2_t __ret_25; \
9005 int8x8_t __s0_25 = __p0_25; \7912 int64x1_t __s0_25 = __p0_25; \
9006 int8x8_t __rev0_25; __rev0_25 = __builtin_shufflevector(__s0_25, __s0_25, __lane_reverse_64_8); \7913 __ret_25 = __noswap_splatq_lane_s64(__s0_25, __p1_25); \
9007 __ret_25 = __noswap_splatq_lane_s8(__rev0_25, __p1_25); \7914 __ret_25 = __builtin_shufflevector(__ret_25, __ret_25, __lane_reverse_128_64); \
9008 __ret_25 = __builtin_shufflevector(__ret_25, __ret_25, __lane_reverse_128_8); \
9009 __ret_25; \7915 __ret_25; \
9010})7916})
9011#endif7917#endif
90127918
9013#ifdef __LITTLE_ENDIAN__7919#ifdef __LITTLE_ENDIAN__
9014#define vdupq_lane_f32(__p0_26, __p1_26) __extension__ ({ \7920#define vdupq_lane_s16(__p0_26, __p1_26) __extension__ ({ \
9015 float32x4_t __ret_26; \7921 int16x8_t __ret_26; \
9016 float32x2_t __s0_26 = __p0_26; \7922 int16x4_t __s0_26 = __p0_26; \
9017 __ret_26 = splatq_lane_f32(__s0_26, __p1_26); \7923 __ret_26 = splatq_lane_s16(__s0_26, __p1_26); \
9018 __ret_26; \7924 __ret_26; \
9019})7925})
9020#else7926#else
9021#define vdupq_lane_f32(__p0_27, __p1_27) __extension__ ({ \7927#define vdupq_lane_s16(__p0_27, __p1_27) __extension__ ({ \
9022 float32x4_t __ret_27; \7928 int16x8_t __ret_27; \
9023 float32x2_t __s0_27 = __p0_27; \7929 int16x4_t __s0_27 = __p0_27; \
9024 float32x2_t __rev0_27; __rev0_27 = __builtin_shufflevector(__s0_27, __s0_27, __lane_reverse_64_32); \7930 int16x4_t __rev0_27; __rev0_27 = __builtin_shufflevector(__s0_27, __s0_27, __lane_reverse_64_16); \
9025 __ret_27 = __noswap_splatq_lane_f32(__rev0_27, __p1_27); \7931 __ret_27 = __noswap_splatq_lane_s16(__rev0_27, __p1_27); \
9026 __ret_27 = __builtin_shufflevector(__ret_27, __ret_27, __lane_reverse_128_32); \7932 __ret_27 = __builtin_shufflevector(__ret_27, __ret_27, __lane_reverse_128_16); \
9027 __ret_27; \7933 __ret_27; \
9028})7934})
9029#endif7935#endif
90307936
9031#ifdef __LITTLE_ENDIAN__7937#ifdef __LITTLE_ENDIAN__
9032#define vdupq_lane_f16(__p0_28, __p1_28) __extension__ ({ \7938#define vdup_lane_u8(__p0_28, __p1_28) __extension__ ({ \
9033 float16x8_t __ret_28; \7939 uint8x8_t __ret_28; \
9034 float16x4_t __s0_28 = __p0_28; \7940 uint8x8_t __s0_28 = __p0_28; \
9035 __ret_28 = splatq_lane_f16(__s0_28, __p1_28); \7941 __ret_28 = splat_lane_u8(__s0_28, __p1_28); \
9036 __ret_28; \7942 __ret_28; \
9037})7943})
9038#else7944#else
9039#define vdupq_lane_f16(__p0_29, __p1_29) __extension__ ({ \7945#define vdup_lane_u8(__p0_29, __p1_29) __extension__ ({ \
9040 float16x8_t __ret_29; \7946 uint8x8_t __ret_29; \
9041 float16x4_t __s0_29 = __p0_29; \7947 uint8x8_t __s0_29 = __p0_29; \
9042 float16x4_t __rev0_29; __rev0_29 = __builtin_shufflevector(__s0_29, __s0_29, __lane_reverse_64_16); \7948 uint8x8_t __rev0_29; __rev0_29 = __builtin_shufflevector(__s0_29, __s0_29, __lane_reverse_64_8); \
9043 __ret_29 = __noswap_splatq_lane_f16(__rev0_29, __p1_29); \7949 __ret_29 = __noswap_splat_lane_u8(__rev0_29, __p1_29); \
9044 __ret_29 = __builtin_shufflevector(__ret_29, __ret_29, __lane_reverse_128_16); \7950 __ret_29 = __builtin_shufflevector(__ret_29, __ret_29, __lane_reverse_64_8); \
9045 __ret_29; \7951 __ret_29; \
9046})7952})
9047#endif7953#endif
90487954
9049#ifdef __LITTLE_ENDIAN__7955#ifdef __LITTLE_ENDIAN__
9050#define vdupq_lane_s32(__p0_30, __p1_30) __extension__ ({ \7956#define vdup_lane_u32(__p0_30, __p1_30) __extension__ ({ \
9051 int32x4_t __ret_30; \7957 uint32x2_t __ret_30; \
9052 int32x2_t __s0_30 = __p0_30; \7958 uint32x2_t __s0_30 = __p0_30; \
9053 __ret_30 = splatq_lane_s32(__s0_30, __p1_30); \7959 __ret_30 = splat_lane_u32(__s0_30, __p1_30); \
9054 __ret_30; \7960 __ret_30; \
9055})7961})
9056#else7962#else
9057#define vdupq_lane_s32(__p0_31, __p1_31) __extension__ ({ \7963#define vdup_lane_u32(__p0_31, __p1_31) __extension__ ({ \
9058 int32x4_t __ret_31; \7964 uint32x2_t __ret_31; \
9059 int32x2_t __s0_31 = __p0_31; \7965 uint32x2_t __s0_31 = __p0_31; \
9060 int32x2_t __rev0_31; __rev0_31 = __builtin_shufflevector(__s0_31, __s0_31, __lane_reverse_64_32); \7966 uint32x2_t __rev0_31; __rev0_31 = __builtin_shufflevector(__s0_31, __s0_31, __lane_reverse_64_32); \
9061 __ret_31 = __noswap_splatq_lane_s32(__rev0_31, __p1_31); \7967 __ret_31 = __noswap_splat_lane_u32(__rev0_31, __p1_31); \
9062 __ret_31 = __builtin_shufflevector(__ret_31, __ret_31, __lane_reverse_128_32); \7968 __ret_31 = __builtin_shufflevector(__ret_31, __ret_31, __lane_reverse_64_32); \
9063 __ret_31; \7969 __ret_31; \
9064})7970})
9065#endif7971#endif
90667972
9067#ifdef __LITTLE_ENDIAN__7973#define vdup_lane_u64(__p0_32, __p1_32) __extension__ ({ \
9068#define vdupq_lane_s64(__p0_32, __p1_32) __extension__ ({ \7974 uint64x1_t __ret_32; \
9069 int64x2_t __ret_32; \7975 uint64x1_t __s0_32 = __p0_32; \
9070 int64x1_t __s0_32 = __p0_32; \7976 __ret_32 = splat_lane_u64(__s0_32, __p1_32); \
9071 __ret_32 = splatq_lane_s64(__s0_32, __p1_32); \
9072 __ret_32; \7977 __ret_32; \
9073})7978})
9074#else7979#ifdef __LITTLE_ENDIAN__
9075#define vdupq_lane_s64(__p0_33, __p1_33) __extension__ ({ \7980#define vdup_lane_u16(__p0_33, __p1_33) __extension__ ({ \
9076 int64x2_t __ret_33; \7981 uint16x4_t __ret_33; \
9077 int64x1_t __s0_33 = __p0_33; \7982 uint16x4_t __s0_33 = __p0_33; \
9078 __ret_33 = __noswap_splatq_lane_s64(__s0_33, __p1_33); \7983 __ret_33 = splat_lane_u16(__s0_33, __p1_33); \
9079 __ret_33 = __builtin_shufflevector(__ret_33, __ret_33, __lane_reverse_128_64); \
9080 __ret_33; \7984 __ret_33; \
9081})7985})
7986#else
7987#define vdup_lane_u16(__p0_34, __p1_34) __extension__ ({ \
7988 uint16x4_t __ret_34; \
7989 uint16x4_t __s0_34 = __p0_34; \
7990 uint16x4_t __rev0_34; __rev0_34 = __builtin_shufflevector(__s0_34, __s0_34, __lane_reverse_64_16); \
7991 __ret_34 = __noswap_splat_lane_u16(__rev0_34, __p1_34); \
7992 __ret_34 = __builtin_shufflevector(__ret_34, __ret_34, __lane_reverse_64_16); \
7993 __ret_34; \
7994})
9082#endif7995#endif
90837996
9084#ifdef __LITTLE_ENDIAN__7997#ifdef __LITTLE_ENDIAN__
9085#define vdupq_lane_s16(__p0_34, __p1_34) __extension__ ({ \7998#define vdup_lane_s8(__p0_35, __p1_35) __extension__ ({ \
9086 int16x8_t __ret_34; \7999 int8x8_t __ret_35; \
9087 int16x4_t __s0_34 = __p0_34; \8000 int8x8_t __s0_35 = __p0_35; \
9088 __ret_34 = splatq_lane_s16(__s0_34, __p1_34); \8001 __ret_35 = splat_lane_s8(__s0_35, __p1_35); \
9089 __ret_34; \8002 __ret_35; \
9090})8003})
9091#else8004#else
9092#define vdupq_lane_s16(__p0_35, __p1_35) __extension__ ({ \8005#define vdup_lane_s8(__p0_36, __p1_36) __extension__ ({ \
9093 int16x8_t __ret_35; \8006 int8x8_t __ret_36; \
9094 int16x4_t __s0_35 = __p0_35; \8007 int8x8_t __s0_36 = __p0_36; \
9095 int16x4_t __rev0_35; __rev0_35 = __builtin_shufflevector(__s0_35, __s0_35, __lane_reverse_64_16); \8008 int8x8_t __rev0_36; __rev0_36 = __builtin_shufflevector(__s0_36, __s0_36, __lane_reverse_64_8); \
9096 __ret_35 = __noswap_splatq_lane_s16(__rev0_35, __p1_35); \8009 __ret_36 = __noswap_splat_lane_s8(__rev0_36, __p1_36); \
9097 __ret_35 = __builtin_shufflevector(__ret_35, __ret_35, __lane_reverse_128_16); \8010 __ret_36 = __builtin_shufflevector(__ret_36, __ret_36, __lane_reverse_64_8); \
9098 __ret_35; \8011 __ret_36; \
9099})8012})
9100#endif8013#endif
91018014
9102#ifdef __LITTLE_ENDIAN__8015#ifdef __LITTLE_ENDIAN__
9103#define vdup_lane_u8(__p0_36, __p1_36) __extension__ ({ \8016#define vdup_lane_f32(__p0_37, __p1_37) __extension__ ({ \
9104 uint8x8_t __ret_36; \8017 float32x2_t __ret_37; \
9105 uint8x8_t __s0_36 = __p0_36; \8018 float32x2_t __s0_37 = __p0_37; \
9106 __ret_36 = splat_lane_u8(__s0_36, __p1_36); \8019 __ret_37 = splat_lane_f32(__s0_37, __p1_37); \
9107 __ret_36; \8020 __ret_37; \
9108})8021})
9109#else8022#else
9110#define vdup_lane_u8(__p0_37, __p1_37) __extension__ ({ \8023#define vdup_lane_f32(__p0_38, __p1_38) __extension__ ({ \
9111 uint8x8_t __ret_37; \8024 float32x2_t __ret_38; \
9112 uint8x8_t __s0_37 = __p0_37; \8025 float32x2_t __s0_38 = __p0_38; \
9113 uint8x8_t __rev0_37; __rev0_37 = __builtin_shufflevector(__s0_37, __s0_37, __lane_reverse_64_8); \8026 float32x2_t __rev0_38; __rev0_38 = __builtin_shufflevector(__s0_38, __s0_38, __lane_reverse_64_32); \
9114 __ret_37 = __noswap_splat_lane_u8(__rev0_37, __p1_37); \8027 __ret_38 = __noswap_splat_lane_f32(__rev0_38, __p1_38); \
9115 __ret_37 = __builtin_shufflevector(__ret_37, __ret_37, __lane_reverse_64_8); \8028 __ret_38 = __builtin_shufflevector(__ret_38, __ret_38, __lane_reverse_64_32); \
9116 __ret_37; \8029 __ret_38; \
9117})8030})
9118#endif8031#endif
91198032
9120#ifdef __LITTLE_ENDIAN__8033#ifdef __LITTLE_ENDIAN__
9121#define vdup_lane_u32(__p0_38, __p1_38) __extension__ ({ \8034#define vdup_lane_f16(__p0_39, __p1_39) __extension__ ({ \
9122 uint32x2_t __ret_38; \8035 float16x4_t __ret_39; \
9123 uint32x2_t __s0_38 = __p0_38; \8036 float16x4_t __s0_39 = __p0_39; \
9124 __ret_38 = splat_lane_u32(__s0_38, __p1_38); \8037 __ret_39 = splat_lane_f16(__s0_39, __p1_39); \
9125 __ret_38; \8038 __ret_39; \
9126})8039})
9127#else8040#else
9128#define vdup_lane_u32(__p0_39, __p1_39) __extension__ ({ \8041#define vdup_lane_f16(__p0_40, __p1_40) __extension__ ({ \
9129 uint32x2_t __ret_39; \8042 float16x4_t __ret_40; \
9130 uint32x2_t __s0_39 = __p0_39; \8043 float16x4_t __s0_40 = __p0_40; \
9131 uint32x2_t __rev0_39; __rev0_39 = __builtin_shufflevector(__s0_39, __s0_39, __lane_reverse_64_32); \8044 float16x4_t __rev0_40; __rev0_40 = __builtin_shufflevector(__s0_40, __s0_40, __lane_reverse_64_16); \
9132 __ret_39 = __noswap_splat_lane_u32(__rev0_39, __p1_39); \8045 __ret_40 = __noswap_splat_lane_f16(__rev0_40, __p1_40); \
9133 __ret_39 = __builtin_shufflevector(__ret_39, __ret_39, __lane_reverse_64_32); \8046 __ret_40 = __builtin_shufflevector(__ret_40, __ret_40, __lane_reverse_64_16); \
9134 __ret_39; \8047 __ret_40; \
9135})8048})
9136#endif8049#endif
91378050
9138#define vdup_lane_u64(__p0_40, __p1_40) __extension__ ({ \
9139 uint64x1_t __ret_40; \
9140 uint64x1_t __s0_40 = __p0_40; \
9141 __ret_40 = splat_lane_u64(__s0_40, __p1_40); \
9142 __ret_40; \
9143})
9144#ifdef __LITTLE_ENDIAN__8051#ifdef __LITTLE_ENDIAN__
9145#define vdup_lane_u16(__p0_41, __p1_41) __extension__ ({ \8052#define vdup_lane_s32(__p0_41, __p1_41) __extension__ ({ \
9146 uint16x4_t __ret_41; \8053 int32x2_t __ret_41; \
9147 uint16x4_t __s0_41 = __p0_41; \8054 int32x2_t __s0_41 = __p0_41; \
9148 __ret_41 = splat_lane_u16(__s0_41, __p1_41); \8055 __ret_41 = splat_lane_s32(__s0_41, __p1_41); \
9149 __ret_41; \8056 __ret_41; \
9150})8057})
9151#else8058#else
9152#define vdup_lane_u16(__p0_42, __p1_42) __extension__ ({ \8059#define vdup_lane_s32(__p0_42, __p1_42) __extension__ ({ \
9153 uint16x4_t __ret_42; \8060 int32x2_t __ret_42; \
9154 uint16x4_t __s0_42 = __p0_42; \8061 int32x2_t __s0_42 = __p0_42; \
9155 uint16x4_t __rev0_42; __rev0_42 = __builtin_shufflevector(__s0_42, __s0_42, __lane_reverse_64_16); \8062 int32x2_t __rev0_42; __rev0_42 = __builtin_shufflevector(__s0_42, __s0_42, __lane_reverse_64_32); \
9156 __ret_42 = __noswap_splat_lane_u16(__rev0_42, __p1_42); \8063 __ret_42 = __noswap_splat_lane_s32(__rev0_42, __p1_42); \
9157 __ret_42 = __builtin_shufflevector(__ret_42, __ret_42, __lane_reverse_64_16); \8064 __ret_42 = __builtin_shufflevector(__ret_42, __ret_42, __lane_reverse_64_32); \
9158 __ret_42; \8065 __ret_42; \
9159})8066})
9160#endif8067#endif
91618068
9162#ifdef __LITTLE_ENDIAN__8069#define vdup_lane_s64(__p0_43, __p1_43) __extension__ ({ \
9163#define vdup_lane_s8(__p0_43, __p1_43) __extension__ ({ \8070 int64x1_t __ret_43; \
9164 int8x8_t __ret_43; \8071 int64x1_t __s0_43 = __p0_43; \
9165 int8x8_t __s0_43 = __p0_43; \8072 __ret_43 = splat_lane_s64(__s0_43, __p1_43); \
9166 __ret_43 = splat_lane_s8(__s0_43, __p1_43); \
9167 __ret_43; \8073 __ret_43; \
9168})8074})
9169#else8075#ifdef __LITTLE_ENDIAN__
9170#define vdup_lane_s8(__p0_44, __p1_44) __extension__ ({ \8076#define vdup_lane_s16(__p0_44, __p1_44) __extension__ ({ \
9171 int8x8_t __ret_44; \8077 int16x4_t __ret_44; \
9172 int8x8_t __s0_44 = __p0_44; \8078 int16x4_t __s0_44 = __p0_44; \
9173 int8x8_t __rev0_44; __rev0_44 = __builtin_shufflevector(__s0_44, __s0_44, __lane_reverse_64_8); \8079 __ret_44 = splat_lane_s16(__s0_44, __p1_44); \
9174 __ret_44 = __noswap_splat_lane_s8(__rev0_44, __p1_44); \
9175 __ret_44 = __builtin_shufflevector(__ret_44, __ret_44, __lane_reverse_64_8); \
9176 __ret_44; \8080 __ret_44; \
9177})8081})
8082#else
8083#define vdup_lane_s16(__p0_45, __p1_45) __extension__ ({ \
8084 int16x4_t __ret_45; \
8085 int16x4_t __s0_45 = __p0_45; \
8086 int16x4_t __rev0_45; __rev0_45 = __builtin_shufflevector(__s0_45, __s0_45, __lane_reverse_64_16); \
8087 __ret_45 = __noswap_splat_lane_s16(__rev0_45, __p1_45); \
8088 __ret_45 = __builtin_shufflevector(__ret_45, __ret_45, __lane_reverse_64_16); \
8089 __ret_45; \
8090})
9178#endif8091#endif
91798092
9180#ifdef __LITTLE_ENDIAN__8093#ifdef __LITTLE_ENDIAN__
9181#define vdup_lane_f32(__p0_45, __p1_45) __extension__ ({ \8094#define vdupq_lane_bf16(__p0_46, __p1_46) __extension__ ({ \
9182 float32x2_t __ret_45; \8095 bfloat16x8_t __ret_46; \
9183 float32x2_t __s0_45 = __p0_45; \8096 bfloat16x4_t __s0_46 = __p0_46; \
9184 __ret_45 = splat_lane_f32(__s0_45, __p1_45); \8097 __ret_46 = splatq_lane_bf16(__s0_46, __p1_46); \
9185 __ret_45; \8098 __ret_46; \
9186})8099})
9187#else8100#else
9188#define vdup_lane_f32(__p0_46, __p1_46) __extension__ ({ \8101#define vdupq_lane_bf16(__p0_47, __p1_47) __extension__ ({ \
9189 float32x2_t __ret_46; \8102 bfloat16x8_t __ret_47; \
9190 float32x2_t __s0_46 = __p0_46; \8103 bfloat16x4_t __s0_47 = __p0_47; \
9191 float32x2_t __rev0_46; __rev0_46 = __builtin_shufflevector(__s0_46, __s0_46, __lane_reverse_64_32); \8104 bfloat16x4_t __rev0_47; __rev0_47 = __builtin_shufflevector(__s0_47, __s0_47, __lane_reverse_64_16); \
9192 __ret_46 = __noswap_splat_lane_f32(__rev0_46, __p1_46); \8105 __ret_47 = __noswap_splatq_lane_bf16(__rev0_47, __p1_47); \
9193 __ret_46 = __builtin_shufflevector(__ret_46, __ret_46, __lane_reverse_64_32); \8106 __ret_47 = __builtin_shufflevector(__ret_47, __ret_47, __lane_reverse_128_16); \
9194 __ret_46; \8107 __ret_47; \
9195})8108})
9196#endif8109#endif
91978110
9198#ifdef __LITTLE_ENDIAN__8111#ifdef __LITTLE_ENDIAN__
9199#define vdup_lane_f16(__p0_47, __p1_47) __extension__ ({ \8112#define vdup_lane_bf16(__p0_48, __p1_48) __extension__ ({ \
9200 float16x4_t __ret_47; \8113 bfloat16x4_t __ret_48; \
9201 float16x4_t __s0_47 = __p0_47; \8114 bfloat16x4_t __s0_48 = __p0_48; \
9202 __ret_47 = splat_lane_f16(__s0_47, __p1_47); \8115 __ret_48 = splat_lane_bf16(__s0_48, __p1_48); \
9203 __ret_47; \8116 __ret_48; \
9204})8117})
9205#else8118#else
9206#define vdup_lane_f16(__p0_48, __p1_48) __extension__ ({ \8119#define vdup_lane_bf16(__p0_49, __p1_49) __extension__ ({ \
9207 float16x4_t __ret_48; \8120 bfloat16x4_t __ret_49; \
9208 float16x4_t __s0_48 = __p0_48; \8121 bfloat16x4_t __s0_49 = __p0_49; \
9209 float16x4_t __rev0_48; __rev0_48 = __builtin_shufflevector(__s0_48, __s0_48, __lane_reverse_64_16); \8122 bfloat16x4_t __rev0_49; __rev0_49 = __builtin_shufflevector(__s0_49, __s0_49, __lane_reverse_64_16); \
9210 __ret_48 = __noswap_splat_lane_f16(__rev0_48, __p1_48); \8123 __ret_49 = __noswap_splat_lane_bf16(__rev0_49, __p1_49); \
9211 __ret_48 = __builtin_shufflevector(__ret_48, __ret_48, __lane_reverse_64_16); \8124 __ret_49 = __builtin_shufflevector(__ret_49, __ret_49, __lane_reverse_64_16); \
9212 __ret_48; \8125 __ret_49; \
9213})8126})
9214#endif8127#endif
92158128
9216#ifdef __LITTLE_ENDIAN__8129#ifdef __LITTLE_ENDIAN__
9217#define vdup_lane_s32(__p0_49, __p1_49) __extension__ ({ \8130#define vduph_laneq_bf16(__p0, __p1) __extension__ ({ \
9218 int32x2_t __ret_49; \8131 bfloat16_t __ret; \
9219 int32x2_t __s0_49 = __p0_49; \8132 bfloat16x8_t __s0 = __p0; \
9220 __ret_49 = splat_lane_s32(__s0_49, __p1_49); \8133 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_laneq_bf16(__s0, __p1)); \
9221 __ret_49; \8134 __ret; \
9222})8135})
9223#else8136#else
9224#define vdup_lane_s32(__p0_50, __p1_50) __extension__ ({ \8137#define vduph_laneq_bf16(__p0, __p1) __extension__ ({ \
9225 int32x2_t __ret_50; \8138 bfloat16_t __ret; \
9226 int32x2_t __s0_50 = __p0_50; \8139 bfloat16x8_t __s0 = __p0; \
9227 int32x2_t __rev0_50; __rev0_50 = __builtin_shufflevector(__s0_50, __s0_50, __lane_reverse_64_32); \8140 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
9228 __ret_50 = __noswap_splat_lane_s32(__rev0_50, __p1_50); \8141 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vduph_laneq_bf16(__rev0, __p1)); \
9229 __ret_50 = __builtin_shufflevector(__ret_50, __ret_50, __lane_reverse_64_32); \8142 __ret; \
9230 __ret_50; \
9231})8143})
9232#endif8144#endif
92338145
9234#define vdup_lane_s64(__p0_51, __p1_51) __extension__ ({ \8146#ifdef __LITTLE_ENDIAN__
9235 int64x1_t __ret_51; \8147#define vdupq_laneq_bf16(__p0_50, __p1_50) __extension__ ({ \
9236 int64x1_t __s0_51 = __p0_51; \8148 bfloat16x8_t __ret_50; \
9237 __ret_51 = splat_lane_s64(__s0_51, __p1_51); \8149 bfloat16x8_t __s0_50 = __p0_50; \
8150 __ret_50 = splatq_laneq_bf16(__s0_50, __p1_50); \
8151 __ret_50; \
8152})
8153#else
8154#define vdupq_laneq_bf16(__p0_51, __p1_51) __extension__ ({ \
8155 bfloat16x8_t __ret_51; \
8156 bfloat16x8_t __s0_51 = __p0_51; \
8157 bfloat16x8_t __rev0_51; __rev0_51 = __builtin_shufflevector(__s0_51, __s0_51, __lane_reverse_128_16); \
8158 __ret_51 = __noswap_splatq_laneq_bf16(__rev0_51, __p1_51); \
8159 __ret_51 = __builtin_shufflevector(__ret_51, __ret_51, __lane_reverse_128_16); \
9238 __ret_51; \8160 __ret_51; \
9239})8161})
8162#endif
8163
9240#ifdef __LITTLE_ENDIAN__8164#ifdef __LITTLE_ENDIAN__
9241#define vdup_lane_s16(__p0_52, __p1_52) __extension__ ({ \8165#define vdup_laneq_bf16(__p0_52, __p1_52) __extension__ ({ \
9242 int16x4_t __ret_52; \8166 bfloat16x4_t __ret_52; \
9243 int16x4_t __s0_52 = __p0_52; \8167 bfloat16x8_t __s0_52 = __p0_52; \
9244 __ret_52 = splat_lane_s16(__s0_52, __p1_52); \8168 __ret_52 = splat_laneq_bf16(__s0_52, __p1_52); \
9245 __ret_52; \8169 __ret_52; \
9246})8170})
9247#else8171#else
9248#define vdup_lane_s16(__p0_53, __p1_53) __extension__ ({ \8172#define vdup_laneq_bf16(__p0_53, __p1_53) __extension__ ({ \
9249 int16x4_t __ret_53; \8173 bfloat16x4_t __ret_53; \
9250 int16x4_t __s0_53 = __p0_53; \8174 bfloat16x8_t __s0_53 = __p0_53; \
9251 int16x4_t __rev0_53; __rev0_53 = __builtin_shufflevector(__s0_53, __s0_53, __lane_reverse_64_16); \8175 bfloat16x8_t __rev0_53; __rev0_53 = __builtin_shufflevector(__s0_53, __s0_53, __lane_reverse_128_16); \
9252 __ret_53 = __noswap_splat_lane_s16(__rev0_53, __p1_53); \8176 __ret_53 = __noswap_splat_laneq_bf16(__rev0_53, __p1_53); \
9253 __ret_53 = __builtin_shufflevector(__ret_53, __ret_53, __lane_reverse_64_16); \8177 __ret_53 = __builtin_shufflevector(__ret_53, __ret_53, __lane_reverse_64_16); \
9254 __ret_53; \8178 __ret_53; \
9255})8179})
...@@ -9599,6 +8523,36 @@ __ai __attribute__((target("neon"))) int16x4_t vdup_n_s16(int16_t __p0) {...@@ -9599,6 +8523,36 @@ __ai __attribute__((target("neon"))) int16x4_t vdup_n_s16(int16_t __p0) {
9599}8523}
9600#endif8524#endif
96018525
8526#ifdef __LITTLE_ENDIAN__
8527__ai __attribute__((target("neon"))) bfloat16x8_t vdupq_n_bf16(bfloat16_t __p0) {
8528 bfloat16x8_t __ret;
8529 __ret = (bfloat16x8_t) {__p0, __p0, __p0, __p0, __p0, __p0, __p0, __p0};
8530 return __ret;
8531}
8532#else
8533__ai __attribute__((target("neon"))) bfloat16x8_t vdupq_n_bf16(bfloat16_t __p0) {
8534 bfloat16x8_t __ret;
8535 __ret = (bfloat16x8_t) {__p0, __p0, __p0, __p0, __p0, __p0, __p0, __p0};
8536 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
8537 return __ret;
8538}
8539#endif
8540
8541#ifdef __LITTLE_ENDIAN__
8542__ai __attribute__((target("neon"))) bfloat16x4_t vdup_n_bf16(bfloat16_t __p0) {
8543 bfloat16x4_t __ret;
8544 __ret = (bfloat16x4_t) {__p0, __p0, __p0, __p0};
8545 return __ret;
8546}
8547#else
8548__ai __attribute__((target("neon"))) bfloat16x4_t vdup_n_bf16(bfloat16_t __p0) {
8549 bfloat16x4_t __ret;
8550 __ret = (bfloat16x4_t) {__p0, __p0, __p0, __p0};
8551 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
8552 return __ret;
8553}
8554#endif
8555
9602#ifdef __LITTLE_ENDIAN__8556#ifdef __LITTLE_ENDIAN__
9603__ai __attribute__((target("neon"))) uint8x16_t veorq_u8(uint8x16_t __p0, uint8x16_t __p1) {8557__ai __attribute__((target("neon"))) uint8x16_t veorq_u8(uint8x16_t __p0, uint8x16_t __p1) {
9604 uint8x16_t __ret;8558 uint8x16_t __ret;
...@@ -10558,6 +9512,27 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -10558,6 +9512,27 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
10558}9512}
10559#endif9513#endif
105609514
9515#ifdef __LITTLE_ENDIAN__
9516__ai __attribute__((target("neon"))) bfloat16x4_t vget_high_bf16(bfloat16x8_t __p0) {
9517 bfloat16x4_t __ret;
9518 __ret = __builtin_shufflevector(__p0, __p0, 4, 5, 6, 7);
9519 return __ret;
9520}
9521#else
9522__ai __attribute__((target("neon"))) bfloat16x4_t vget_high_bf16(bfloat16x8_t __p0) {
9523 bfloat16x4_t __ret;
9524 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
9525 __ret = __builtin_shufflevector(__rev0, __rev0, 4, 5, 6, 7);
9526 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
9527 return __ret;
9528}
9529__ai __attribute__((target("neon"))) bfloat16x4_t __noswap_vget_high_bf16(bfloat16x8_t __p0) {
9530 bfloat16x4_t __ret;
9531 __ret = __builtin_shufflevector(__p0, __p0, 4, 5, 6, 7);
9532 return __ret;
9533}
9534#endif
9535
10561#ifdef __LITTLE_ENDIAN__9536#ifdef __LITTLE_ENDIAN__
10562#define vget_lane_p8(__p0, __p1) __extension__ ({ \9537#define vget_lane_p8(__p0, __p1) __extension__ ({ \
10563 poly8_t __ret; \9538 poly8_t __ret; \
...@@ -11030,6 +10005,52 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t...@@ -11030,6 +10005,52 @@ __ai __attribute__((target("neon"))) int16x4_t __noswap_vget_high_s16(int16x8_t
11030})10005})
11031#endif10006#endif
1103210007
10008#ifdef __LITTLE_ENDIAN__
10009#define vgetq_lane_bf16(__p0, __p1) __extension__ ({ \
10010 bfloat16_t __ret; \
10011 bfloat16x8_t __s0 = __p0; \
10012 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vgetq_lane_bf16(__s0, __p1)); \
10013 __ret; \
10014})
10015#else
10016#define vgetq_lane_bf16(__p0, __p1) __extension__ ({ \
10017 bfloat16_t __ret; \
10018 bfloat16x8_t __s0 = __p0; \
10019 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
10020 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vgetq_lane_bf16(__rev0, __p1)); \
10021 __ret; \
10022})
10023#define __noswap_vgetq_lane_bf16(__p0, __p1) __extension__ ({ \
10024 bfloat16_t __ret; \
10025 bfloat16x8_t __s0 = __p0; \
10026 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vgetq_lane_bf16(__s0, __p1)); \
10027 __ret; \
10028})
10029#endif
10030
10031#ifdef __LITTLE_ENDIAN__
10032#define vget_lane_bf16(__p0, __p1) __extension__ ({ \
10033 bfloat16_t __ret; \
10034 bfloat16x4_t __s0 = __p0; \
10035 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vget_lane_bf16(__s0, __p1)); \
10036 __ret; \
10037})
10038#else
10039#define vget_lane_bf16(__p0, __p1) __extension__ ({ \
10040 bfloat16_t __ret; \
10041 bfloat16x4_t __s0 = __p0; \
10042 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
10043 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vget_lane_bf16(__rev0, __p1)); \
10044 __ret; \
10045})
10046#define __noswap_vget_lane_bf16(__p0, __p1) __extension__ ({ \
10047 bfloat16_t __ret; \
10048 bfloat16x4_t __s0 = __p0; \
10049 __ret = __builtin_bit_cast(bfloat16_t, __builtin_neon_vget_lane_bf16(__s0, __p1)); \
10050 __ret; \
10051})
10052#endif
10053
11033#ifdef __LITTLE_ENDIAN__10054#ifdef __LITTLE_ENDIAN__
11034__ai __attribute__((target("neon"))) poly8x8_t vget_low_p8(poly8x16_t __p0) {10055__ai __attribute__((target("neon"))) poly8x8_t vget_low_p8(poly8x16_t __p0) {
11035 poly8x8_t __ret;10056 poly8x8_t __ret;
...@@ -11220,6 +10241,27 @@ __ai __attribute__((target("neon"))) int16x4_t vget_low_s16(int16x8_t __p0) {...@@ -11220,6 +10241,27 @@ __ai __attribute__((target("neon"))) int16x4_t vget_low_s16(int16x8_t __p0) {
11220}10241}
11221#endif10242#endif
1122210243
10244#ifdef __LITTLE_ENDIAN__
10245__ai __attribute__((target("neon"))) bfloat16x4_t vget_low_bf16(bfloat16x8_t __p0) {
10246 bfloat16x4_t __ret;
10247 __ret = __builtin_shufflevector(__p0, __p0, 0, 1, 2, 3);
10248 return __ret;
10249}
10250#else
10251__ai __attribute__((target("neon"))) bfloat16x4_t vget_low_bf16(bfloat16x8_t __p0) {
10252 bfloat16x4_t __ret;
10253 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
10254 __ret = __builtin_shufflevector(__rev0, __rev0, 0, 1, 2, 3);
10255 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
10256 return __ret;
10257}
10258__ai __attribute__((target("neon"))) bfloat16x4_t __noswap_vget_low_bf16(bfloat16x8_t __p0) {
10259 bfloat16x4_t __ret;
10260 __ret = __builtin_shufflevector(__p0, __p0, 0, 1, 2, 3);
10261 return __ret;
10262}
10263#endif
10264
11223#ifdef __LITTLE_ENDIAN__10265#ifdef __LITTLE_ENDIAN__
11224__ai __attribute__((target("neon"))) uint8x16_t vhaddq_u8(uint8x16_t __p0, uint8x16_t __p1) {10266__ai __attribute__((target("neon"))) uint8x16_t vhaddq_u8(uint8x16_t __p0, uint8x16_t __p1) {
11225 uint8x16_t __ret;10267 uint8x16_t __ret;
...@@ -11938,6 +10980,36 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -11938,6 +10980,36 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
11938})10980})
11939#endif10981#endif
1194010982
10983#ifdef __LITTLE_ENDIAN__
10984#define vld1q_bf16(__p0) __extension__ ({ \
10985 bfloat16x8_t __ret; \
10986 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_v(__p0, 43)); \
10987 __ret; \
10988})
10989#else
10990#define vld1q_bf16(__p0) __extension__ ({ \
10991 bfloat16x8_t __ret; \
10992 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_v(__p0, 43)); \
10993 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
10994 __ret; \
10995})
10996#endif
10997
10998#ifdef __LITTLE_ENDIAN__
10999#define vld1_bf16(__p0) __extension__ ({ \
11000 bfloat16x4_t __ret; \
11001 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_v(__p0, 11)); \
11002 __ret; \
11003})
11004#else
11005#define vld1_bf16(__p0) __extension__ ({ \
11006 bfloat16x4_t __ret; \
11007 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_v(__p0, 11)); \
11008 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
11009 __ret; \
11010})
11011#endif
11012
11941#ifdef __LITTLE_ENDIAN__11013#ifdef __LITTLE_ENDIAN__
11942#define vld1_dup_p8(__p0) __extension__ ({ \11014#define vld1_dup_p8(__p0) __extension__ ({ \
11943 poly8x8_t __ret; \11015 poly8x8_t __ret; \
...@@ -12248,6 +11320,36 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -12248,6 +11320,36 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
12248})11320})
12249#endif11321#endif
1225011322
11323#ifdef __LITTLE_ENDIAN__
11324#define vld1q_dup_bf16(__p0) __extension__ ({ \
11325 bfloat16x8_t __ret; \
11326 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_dup_v(__p0, 43)); \
11327 __ret; \
11328})
11329#else
11330#define vld1q_dup_bf16(__p0) __extension__ ({ \
11331 bfloat16x8_t __ret; \
11332 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_dup_v(__p0, 43)); \
11333 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
11334 __ret; \
11335})
11336#endif
11337
11338#ifdef __LITTLE_ENDIAN__
11339#define vld1_dup_bf16(__p0) __extension__ ({ \
11340 bfloat16x4_t __ret; \
11341 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_dup_v(__p0, 11)); \
11342 __ret; \
11343})
11344#else
11345#define vld1_dup_bf16(__p0) __extension__ ({ \
11346 bfloat16x4_t __ret; \
11347 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_dup_v(__p0, 11)); \
11348 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
11349 __ret; \
11350})
11351#endif
11352
12251#ifdef __LITTLE_ENDIAN__11353#ifdef __LITTLE_ENDIAN__
12252#define vld1_lane_p8(__p0, __p1, __p2) __extension__ ({ \11354#define vld1_lane_p8(__p0, __p1, __p2) __extension__ ({ \
12253 poly8x8_t __ret; \11355 poly8x8_t __ret; \
...@@ -12620,6 +11722,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -12620,6 +11722,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
12620})11722})
12621#endif11723#endif
1262211724
11725#ifdef __LITTLE_ENDIAN__
11726#define vld1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
11727 bfloat16x8_t __ret; \
11728 bfloat16x8_t __s1 = __p1; \
11729 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
11730 __ret; \
11731})
11732#else
11733#define vld1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
11734 bfloat16x8_t __ret; \
11735 bfloat16x8_t __s1 = __p1; \
11736 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
11737 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vld1q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
11738 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
11739 __ret; \
11740})
11741#endif
11742
11743#ifdef __LITTLE_ENDIAN__
11744#define vld1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
11745 bfloat16x4_t __ret; \
11746 bfloat16x4_t __s1 = __p1; \
11747 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_lane_v(__p0, __builtin_bit_cast(int8x8_t, __s1), __p2, 11)); \
11748 __ret; \
11749})
11750#else
11751#define vld1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
11752 bfloat16x4_t __ret; \
11753 bfloat16x4_t __s1 = __p1; \
11754 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
11755 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vld1_lane_v(__p0, __builtin_bit_cast(int8x8_t, __rev1), __p2, 11)); \
11756 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
11757 __ret; \
11758})
11759#endif
11760
12623#ifdef __LITTLE_ENDIAN__11761#ifdef __LITTLE_ENDIAN__
12624#define vld1_p8_x2(__p0) __extension__ ({ \11762#define vld1_p8_x2(__p0) __extension__ ({ \
12625 poly8x8x2_t __ret; \11763 poly8x8x2_t __ret; \
...@@ -12970,6 +12108,40 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -12970,6 +12108,40 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
12970})12108})
12971#endif12109#endif
1297212110
12111#ifdef __LITTLE_ENDIAN__
12112#define vld1q_bf16_x2(__p0) __extension__ ({ \
12113 bfloat16x8x2_t __ret; \
12114 __builtin_neon_vld1q_x2_v(&__ret, __p0, 43); \
12115 __ret; \
12116})
12117#else
12118#define vld1q_bf16_x2(__p0) __extension__ ({ \
12119 bfloat16x8x2_t __ret; \
12120 __builtin_neon_vld1q_x2_v(&__ret, __p0, 43); \
12121 \
12122 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
12123 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
12124 __ret; \
12125})
12126#endif
12127
12128#ifdef __LITTLE_ENDIAN__
12129#define vld1_bf16_x2(__p0) __extension__ ({ \
12130 bfloat16x4x2_t __ret; \
12131 __builtin_neon_vld1_x2_v(&__ret, __p0, 11); \
12132 __ret; \
12133})
12134#else
12135#define vld1_bf16_x2(__p0) __extension__ ({ \
12136 bfloat16x4x2_t __ret; \
12137 __builtin_neon_vld1_x2_v(&__ret, __p0, 11); \
12138 \
12139 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
12140 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
12141 __ret; \
12142})
12143#endif
12144
12973#ifdef __LITTLE_ENDIAN__12145#ifdef __LITTLE_ENDIAN__
12974#define vld1_p8_x3(__p0) __extension__ ({ \12146#define vld1_p8_x3(__p0) __extension__ ({ \
12975 poly8x8x3_t __ret; \12147 poly8x8x3_t __ret; \
...@@ -13340,6 +12512,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -13340,6 +12512,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
13340})12512})
13341#endif12513#endif
1334212514
12515#ifdef __LITTLE_ENDIAN__
12516#define vld1q_bf16_x3(__p0) __extension__ ({ \
12517 bfloat16x8x3_t __ret; \
12518 __builtin_neon_vld1q_x3_v(&__ret, __p0, 43); \
12519 __ret; \
12520})
12521#else
12522#define vld1q_bf16_x3(__p0) __extension__ ({ \
12523 bfloat16x8x3_t __ret; \
12524 __builtin_neon_vld1q_x3_v(&__ret, __p0, 43); \
12525 \
12526 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
12527 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
12528 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
12529 __ret; \
12530})
12531#endif
12532
12533#ifdef __LITTLE_ENDIAN__
12534#define vld1_bf16_x3(__p0) __extension__ ({ \
12535 bfloat16x4x3_t __ret; \
12536 __builtin_neon_vld1_x3_v(&__ret, __p0, 11); \
12537 __ret; \
12538})
12539#else
12540#define vld1_bf16_x3(__p0) __extension__ ({ \
12541 bfloat16x4x3_t __ret; \
12542 __builtin_neon_vld1_x3_v(&__ret, __p0, 11); \
12543 \
12544 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
12545 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
12546 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
12547 __ret; \
12548})
12549#endif
12550
13343#ifdef __LITTLE_ENDIAN__12551#ifdef __LITTLE_ENDIAN__
13344#define vld1_p8_x4(__p0) __extension__ ({ \12552#define vld1_p8_x4(__p0) __extension__ ({ \
13345 poly8x8x4_t __ret; \12553 poly8x8x4_t __ret; \
...@@ -13730,6 +12938,44 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -13730,6 +12938,44 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
13730})12938})
13731#endif12939#endif
1373212940
12941#ifdef __LITTLE_ENDIAN__
12942#define vld1q_bf16_x4(__p0) __extension__ ({ \
12943 bfloat16x8x4_t __ret; \
12944 __builtin_neon_vld1q_x4_v(&__ret, __p0, 43); \
12945 __ret; \
12946})
12947#else
12948#define vld1q_bf16_x4(__p0) __extension__ ({ \
12949 bfloat16x8x4_t __ret; \
12950 __builtin_neon_vld1q_x4_v(&__ret, __p0, 43); \
12951 \
12952 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
12953 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
12954 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
12955 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
12956 __ret; \
12957})
12958#endif
12959
12960#ifdef __LITTLE_ENDIAN__
12961#define vld1_bf16_x4(__p0) __extension__ ({ \
12962 bfloat16x4x4_t __ret; \
12963 __builtin_neon_vld1_x4_v(&__ret, __p0, 11); \
12964 __ret; \
12965})
12966#else
12967#define vld1_bf16_x4(__p0) __extension__ ({ \
12968 bfloat16x4x4_t __ret; \
12969 __builtin_neon_vld1_x4_v(&__ret, __p0, 11); \
12970 \
12971 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
12972 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
12973 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
12974 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
12975 __ret; \
12976})
12977#endif
12978
13733#ifdef __LITTLE_ENDIAN__12979#ifdef __LITTLE_ENDIAN__
13734#define vld2_p8(__p0) __extension__ ({ \12980#define vld2_p8(__p0) __extension__ ({ \
13735 poly8x8x2_t __ret; \12981 poly8x8x2_t __ret; \
...@@ -14046,6 +13292,40 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -14046,6 +13292,40 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
14046})13292})
14047#endif13293#endif
1404813294
13295#ifdef __LITTLE_ENDIAN__
13296#define vld2q_bf16(__p0) __extension__ ({ \
13297 bfloat16x8x2_t __ret; \
13298 __builtin_neon_vld2q_v(&__ret, __p0, 43); \
13299 __ret; \
13300})
13301#else
13302#define vld2q_bf16(__p0) __extension__ ({ \
13303 bfloat16x8x2_t __ret; \
13304 __builtin_neon_vld2q_v(&__ret, __p0, 43); \
13305 \
13306 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
13307 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
13308 __ret; \
13309})
13310#endif
13311
13312#ifdef __LITTLE_ENDIAN__
13313#define vld2_bf16(__p0) __extension__ ({ \
13314 bfloat16x4x2_t __ret; \
13315 __builtin_neon_vld2_v(&__ret, __p0, 11); \
13316 __ret; \
13317})
13318#else
13319#define vld2_bf16(__p0) __extension__ ({ \
13320 bfloat16x4x2_t __ret; \
13321 __builtin_neon_vld2_v(&__ret, __p0, 11); \
13322 \
13323 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
13324 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
13325 __ret; \
13326})
13327#endif
13328
14049#ifdef __LITTLE_ENDIAN__13329#ifdef __LITTLE_ENDIAN__
14050#define vld2_dup_p8(__p0) __extension__ ({ \13330#define vld2_dup_p8(__p0) __extension__ ({ \
14051 poly8x8x2_t __ret; \13331 poly8x8x2_t __ret; \
...@@ -14396,6 +13676,40 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -14396,6 +13676,40 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
14396})13676})
14397#endif13677#endif
1439813678
13679#ifdef __LITTLE_ENDIAN__
13680#define vld2q_dup_bf16(__p0) __extension__ ({ \
13681 bfloat16x8x2_t __ret; \
13682 __builtin_neon_vld2q_dup_v(&__ret, __p0, 43); \
13683 __ret; \
13684})
13685#else
13686#define vld2q_dup_bf16(__p0) __extension__ ({ \
13687 bfloat16x8x2_t __ret; \
13688 __builtin_neon_vld2q_dup_v(&__ret, __p0, 43); \
13689 \
13690 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
13691 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
13692 __ret; \
13693})
13694#endif
13695
13696#ifdef __LITTLE_ENDIAN__
13697#define vld2_dup_bf16(__p0) __extension__ ({ \
13698 bfloat16x4x2_t __ret; \
13699 __builtin_neon_vld2_dup_v(&__ret, __p0, 11); \
13700 __ret; \
13701})
13702#else
13703#define vld2_dup_bf16(__p0) __extension__ ({ \
13704 bfloat16x4x2_t __ret; \
13705 __builtin_neon_vld2_dup_v(&__ret, __p0, 11); \
13706 \
13707 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
13708 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
13709 __ret; \
13710})
13711#endif
13712
14399#ifdef __LITTLE_ENDIAN__13713#ifdef __LITTLE_ENDIAN__
14400#define vld2_lane_p8(__p0, __p1, __p2) __extension__ ({ \13714#define vld2_lane_p8(__p0, __p1, __p2) __extension__ ({ \
14401 poly8x8x2_t __ret; \13715 poly8x8x2_t __ret; \
...@@ -14726,6 +14040,50 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -14726,6 +14040,50 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
14726})14040})
14727#endif14041#endif
1472814042
14043#ifdef __LITTLE_ENDIAN__
14044#define vld2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
14045 bfloat16x8x2_t __ret; \
14046 bfloat16x8x2_t __s1 = __p1; \
14047 __builtin_neon_vld2q_lane_v(&__ret, __p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __p2, 43); \
14048 __ret; \
14049})
14050#else
14051#define vld2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
14052 bfloat16x8x2_t __ret; \
14053 bfloat16x8x2_t __s1 = __p1; \
14054 bfloat16x8x2_t __rev1; \
14055 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
14056 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
14057 __builtin_neon_vld2q_lane_v(&__ret, __p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __p2, 43); \
14058 \
14059 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
14060 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
14061 __ret; \
14062})
14063#endif
14064
14065#ifdef __LITTLE_ENDIAN__
14066#define vld2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
14067 bfloat16x4x2_t __ret; \
14068 bfloat16x4x2_t __s1 = __p1; \
14069 __builtin_neon_vld2_lane_v(&__ret, __p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __p2, 11); \
14070 __ret; \
14071})
14072#else
14073#define vld2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
14074 bfloat16x4x2_t __ret; \
14075 bfloat16x4x2_t __s1 = __p1; \
14076 bfloat16x4x2_t __rev1; \
14077 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
14078 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
14079 __builtin_neon_vld2_lane_v(&__ret, __p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __p2, 11); \
14080 \
14081 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
14082 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
14083 __ret; \
14084})
14085#endif
14086
14729#ifdef __LITTLE_ENDIAN__14087#ifdef __LITTLE_ENDIAN__
14730#define vld3_p8(__p0) __extension__ ({ \14088#define vld3_p8(__p0) __extension__ ({ \
14731 poly8x8x3_t __ret; \14089 poly8x8x3_t __ret; \
...@@ -15060,6 +14418,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -15060,6 +14418,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
15060})14418})
15061#endif14419#endif
1506214420
14421#ifdef __LITTLE_ENDIAN__
14422#define vld3q_bf16(__p0) __extension__ ({ \
14423 bfloat16x8x3_t __ret; \
14424 __builtin_neon_vld3q_v(&__ret, __p0, 43); \
14425 __ret; \
14426})
14427#else
14428#define vld3q_bf16(__p0) __extension__ ({ \
14429 bfloat16x8x3_t __ret; \
14430 __builtin_neon_vld3q_v(&__ret, __p0, 43); \
14431 \
14432 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
14433 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
14434 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
14435 __ret; \
14436})
14437#endif
14438
14439#ifdef __LITTLE_ENDIAN__
14440#define vld3_bf16(__p0) __extension__ ({ \
14441 bfloat16x4x3_t __ret; \
14442 __builtin_neon_vld3_v(&__ret, __p0, 11); \
14443 __ret; \
14444})
14445#else
14446#define vld3_bf16(__p0) __extension__ ({ \
14447 bfloat16x4x3_t __ret; \
14448 __builtin_neon_vld3_v(&__ret, __p0, 11); \
14449 \
14450 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
14451 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
14452 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
14453 __ret; \
14454})
14455#endif
14456
15063#ifdef __LITTLE_ENDIAN__14457#ifdef __LITTLE_ENDIAN__
15064#define vld3_dup_p8(__p0) __extension__ ({ \14458#define vld3_dup_p8(__p0) __extension__ ({ \
15065 poly8x8x3_t __ret; \14459 poly8x8x3_t __ret; \
...@@ -15430,6 +14824,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -15430,6 +14824,42 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
15430})14824})
15431#endif14825#endif
1543214826
14827#ifdef __LITTLE_ENDIAN__
14828#define vld3q_dup_bf16(__p0) __extension__ ({ \
14829 bfloat16x8x3_t __ret; \
14830 __builtin_neon_vld3q_dup_v(&__ret, __p0, 43); \
14831 __ret; \
14832})
14833#else
14834#define vld3q_dup_bf16(__p0) __extension__ ({ \
14835 bfloat16x8x3_t __ret; \
14836 __builtin_neon_vld3q_dup_v(&__ret, __p0, 43); \
14837 \
14838 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
14839 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
14840 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
14841 __ret; \
14842})
14843#endif
14844
14845#ifdef __LITTLE_ENDIAN__
14846#define vld3_dup_bf16(__p0) __extension__ ({ \
14847 bfloat16x4x3_t __ret; \
14848 __builtin_neon_vld3_dup_v(&__ret, __p0, 11); \
14849 __ret; \
14850})
14851#else
14852#define vld3_dup_bf16(__p0) __extension__ ({ \
14853 bfloat16x4x3_t __ret; \
14854 __builtin_neon_vld3_dup_v(&__ret, __p0, 11); \
14855 \
14856 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
14857 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
14858 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
14859 __ret; \
14860})
14861#endif
14862
15433#ifdef __LITTLE_ENDIAN__14863#ifdef __LITTLE_ENDIAN__
15434#define vld3_lane_p8(__p0, __p1, __p2) __extension__ ({ \14864#define vld3_lane_p8(__p0, __p1, __p2) __extension__ ({ \
15435 poly8x8x3_t __ret; \14865 poly8x8x3_t __ret; \
...@@ -15790,6 +15220,54 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -15790,6 +15220,54 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
15790})15220})
15791#endif15221#endif
1579215222
15223#ifdef __LITTLE_ENDIAN__
15224#define vld3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
15225 bfloat16x8x3_t __ret; \
15226 bfloat16x8x3_t __s1 = __p1; \
15227 __builtin_neon_vld3q_lane_v(&__ret, __p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __p2, 43); \
15228 __ret; \
15229})
15230#else
15231#define vld3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
15232 bfloat16x8x3_t __ret; \
15233 bfloat16x8x3_t __s1 = __p1; \
15234 bfloat16x8x3_t __rev1; \
15235 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
15236 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
15237 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
15238 __builtin_neon_vld3q_lane_v(&__ret, __p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __p2, 43); \
15239 \
15240 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
15241 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
15242 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
15243 __ret; \
15244})
15245#endif
15246
15247#ifdef __LITTLE_ENDIAN__
15248#define vld3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
15249 bfloat16x4x3_t __ret; \
15250 bfloat16x4x3_t __s1 = __p1; \
15251 __builtin_neon_vld3_lane_v(&__ret, __p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __p2, 11); \
15252 __ret; \
15253})
15254#else
15255#define vld3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
15256 bfloat16x4x3_t __ret; \
15257 bfloat16x4x3_t __s1 = __p1; \
15258 bfloat16x4x3_t __rev1; \
15259 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
15260 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
15261 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
15262 __builtin_neon_vld3_lane_v(&__ret, __p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __p2, 11); \
15263 \
15264 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
15265 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
15266 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
15267 __ret; \
15268})
15269#endif
15270
15793#ifdef __LITTLE_ENDIAN__15271#ifdef __LITTLE_ENDIAN__
15794#define vld4_p8(__p0) __extension__ ({ \15272#define vld4_p8(__p0) __extension__ ({ \
15795 poly8x8x4_t __ret; \15273 poly8x8x4_t __ret; \
...@@ -16142,6 +15620,44 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -16142,6 +15620,44 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
16142})15620})
16143#endif15621#endif
1614415622
15623#ifdef __LITTLE_ENDIAN__
15624#define vld4q_bf16(__p0) __extension__ ({ \
15625 bfloat16x8x4_t __ret; \
15626 __builtin_neon_vld4q_v(&__ret, __p0, 43); \
15627 __ret; \
15628})
15629#else
15630#define vld4q_bf16(__p0) __extension__ ({ \
15631 bfloat16x8x4_t __ret; \
15632 __builtin_neon_vld4q_v(&__ret, __p0, 43); \
15633 \
15634 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
15635 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
15636 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
15637 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
15638 __ret; \
15639})
15640#endif
15641
15642#ifdef __LITTLE_ENDIAN__
15643#define vld4_bf16(__p0) __extension__ ({ \
15644 bfloat16x4x4_t __ret; \
15645 __builtin_neon_vld4_v(&__ret, __p0, 11); \
15646 __ret; \
15647})
15648#else
15649#define vld4_bf16(__p0) __extension__ ({ \
15650 bfloat16x4x4_t __ret; \
15651 __builtin_neon_vld4_v(&__ret, __p0, 11); \
15652 \
15653 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
15654 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
15655 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
15656 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
15657 __ret; \
15658})
15659#endif
15660
16145#ifdef __LITTLE_ENDIAN__15661#ifdef __LITTLE_ENDIAN__
16146#define vld4_dup_p8(__p0) __extension__ ({ \15662#define vld4_dup_p8(__p0) __extension__ ({ \
16147 poly8x8x4_t __ret; \15663 poly8x8x4_t __ret; \
...@@ -16532,6 +16048,44 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -16532,6 +16048,44 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
16532})16048})
16533#endif16049#endif
1653416050
16051#ifdef __LITTLE_ENDIAN__
16052#define vld4q_dup_bf16(__p0) __extension__ ({ \
16053 bfloat16x8x4_t __ret; \
16054 __builtin_neon_vld4q_dup_v(&__ret, __p0, 43); \
16055 __ret; \
16056})
16057#else
16058#define vld4q_dup_bf16(__p0) __extension__ ({ \
16059 bfloat16x8x4_t __ret; \
16060 __builtin_neon_vld4q_dup_v(&__ret, __p0, 43); \
16061 \
16062 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
16063 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
16064 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
16065 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
16066 __ret; \
16067})
16068#endif
16069
16070#ifdef __LITTLE_ENDIAN__
16071#define vld4_dup_bf16(__p0) __extension__ ({ \
16072 bfloat16x4x4_t __ret; \
16073 __builtin_neon_vld4_dup_v(&__ret, __p0, 11); \
16074 __ret; \
16075})
16076#else
16077#define vld4_dup_bf16(__p0) __extension__ ({ \
16078 bfloat16x4x4_t __ret; \
16079 __builtin_neon_vld4_dup_v(&__ret, __p0, 11); \
16080 \
16081 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
16082 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
16083 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
16084 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
16085 __ret; \
16086})
16087#endif
16088
16535#ifdef __LITTLE_ENDIAN__16089#ifdef __LITTLE_ENDIAN__
16536#define vld4_lane_p8(__p0, __p1, __p2) __extension__ ({ \16090#define vld4_lane_p8(__p0, __p1, __p2) __extension__ ({ \
16537 poly8x8x4_t __ret; \16091 poly8x8x4_t __ret; \
...@@ -16922,6 +16476,58 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4...@@ -16922,6 +16476,58 @@ __ai __attribute__((target("neon"))) int16x4_t vhsub_s16(int16x4_t __p0, int16x4
16922})16476})
16923#endif16477#endif
1692416478
16479#ifdef __LITTLE_ENDIAN__
16480#define vld4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
16481 bfloat16x8x4_t __ret; \
16482 bfloat16x8x4_t __s1 = __p1; \
16483 __builtin_neon_vld4q_lane_v(&__ret, __p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), __p2, 43); \
16484 __ret; \
16485})
16486#else
16487#define vld4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
16488 bfloat16x8x4_t __ret; \
16489 bfloat16x8x4_t __s1 = __p1; \
16490 bfloat16x8x4_t __rev1; \
16491 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
16492 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
16493 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
16494 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \
16495 __builtin_neon_vld4q_lane_v(&__ret, __p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), __p2, 43); \
16496 \
16497 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_128_16); \
16498 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_128_16); \
16499 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_128_16); \
16500 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_128_16); \
16501 __ret; \
16502})
16503#endif
16504
16505#ifdef __LITTLE_ENDIAN__
16506#define vld4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
16507 bfloat16x4x4_t __ret; \
16508 bfloat16x4x4_t __s1 = __p1; \
16509 __builtin_neon_vld4_lane_v(&__ret, __p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), __p2, 11); \
16510 __ret; \
16511})
16512#else
16513#define vld4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
16514 bfloat16x4x4_t __ret; \
16515 bfloat16x4x4_t __s1 = __p1; \
16516 bfloat16x4x4_t __rev1; \
16517 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
16518 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
16519 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
16520 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \
16521 __builtin_neon_vld4_lane_v(&__ret, __p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), __p2, 11); \
16522 \
16523 __ret.val[0] = __builtin_shufflevector(__ret.val[0], __ret.val[0], __lane_reverse_64_16); \
16524 __ret.val[1] = __builtin_shufflevector(__ret.val[1], __ret.val[1], __lane_reverse_64_16); \
16525 __ret.val[2] = __builtin_shufflevector(__ret.val[2], __ret.val[2], __lane_reverse_64_16); \
16526 __ret.val[3] = __builtin_shufflevector(__ret.val[3], __ret.val[3], __lane_reverse_64_16); \
16527 __ret; \
16528})
16529#endif
16530
16925#ifdef __LITTLE_ENDIAN__16531#ifdef __LITTLE_ENDIAN__
16926__ai __attribute__((target("neon"))) uint8x16_t vmaxq_u8(uint8x16_t __p0, uint8x16_t __p1) {16532__ai __attribute__((target("neon"))) uint8x16_t vmaxq_u8(uint8x16_t __p0, uint8x16_t __p1) {
16927 uint8x16_t __ret;16533 uint8x16_t __ret;
...@@ -27576,6 +27182,60 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p...@@ -27576,6 +27182,60 @@ __ai __attribute__((target("neon"))) int8x8_t __noswap_vrsubhn_s16(int16x8_t __p
27576})27182})
27577#endif27183#endif
2757827184
27185#ifdef __LITTLE_ENDIAN__
27186#define vsetq_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
27187 bfloat16x8_t __ret; \
27188 bfloat16_t __s0 = __p0; \
27189 bfloat16x8_t __s1 = __p1; \
27190 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vsetq_lane_bf16(__s0, __s1, __p2)); \
27191 __ret; \
27192})
27193#else
27194#define vsetq_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
27195 bfloat16x8_t __ret; \
27196 bfloat16_t __s0 = __p0; \
27197 bfloat16x8_t __s1 = __p1; \
27198 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
27199 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vsetq_lane_bf16(__s0, __rev1, __p2)); \
27200 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
27201 __ret; \
27202})
27203#define __noswap_vsetq_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
27204 bfloat16x8_t __ret; \
27205 bfloat16_t __s0 = __p0; \
27206 bfloat16x8_t __s1 = __p1; \
27207 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vsetq_lane_bf16(__s0, __s1, __p2)); \
27208 __ret; \
27209})
27210#endif
27211
27212#ifdef __LITTLE_ENDIAN__
27213#define vset_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
27214 bfloat16x4_t __ret; \
27215 bfloat16_t __s0 = __p0; \
27216 bfloat16x4_t __s1 = __p1; \
27217 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vset_lane_bf16(__s0, __s1, __p2)); \
27218 __ret; \
27219})
27220#else
27221#define vset_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
27222 bfloat16x4_t __ret; \
27223 bfloat16_t __s0 = __p0; \
27224 bfloat16x4_t __s1 = __p1; \
27225 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
27226 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vset_lane_bf16(__s0, __rev1, __p2)); \
27227 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
27228 __ret; \
27229})
27230#define __noswap_vset_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
27231 bfloat16x4_t __ret; \
27232 bfloat16_t __s0 = __p0; \
27233 bfloat16x4_t __s1 = __p1; \
27234 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vset_lane_bf16(__s0, __s1, __p2)); \
27235 __ret; \
27236})
27237#endif
27238
27579#ifdef __LITTLE_ENDIAN__27239#ifdef __LITTLE_ENDIAN__
27580__ai __attribute__((target("neon"))) uint8x16_t vshlq_u8(uint8x16_t __p0, int8x16_t __p1) {27240__ai __attribute__((target("neon"))) uint8x16_t vshlq_u8(uint8x16_t __p0, int8x16_t __p1) {
27581 uint8x16_t __ret;27241 uint8x16_t __ret;
...@@ -30000,6 +29660,32 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -30000,6 +29660,32 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
30000})29660})
30001#endif29661#endif
3000229662
29663#ifdef __LITTLE_ENDIAN__
29664#define vst1q_bf16(__p0, __p1) __extension__ ({ \
29665 bfloat16x8_t __s1 = __p1; \
29666 __builtin_neon_vst1q_v(__p0, __builtin_bit_cast(int8x16_t, __s1), 43); \
29667})
29668#else
29669#define vst1q_bf16(__p0, __p1) __extension__ ({ \
29670 bfloat16x8_t __s1 = __p1; \
29671 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
29672 __builtin_neon_vst1q_v(__p0, __builtin_bit_cast(int8x16_t, __rev1), 43); \
29673})
29674#endif
29675
29676#ifdef __LITTLE_ENDIAN__
29677#define vst1_bf16(__p0, __p1) __extension__ ({ \
29678 bfloat16x4_t __s1 = __p1; \
29679 __builtin_neon_vst1_v(__p0, __builtin_bit_cast(int8x8_t, __s1), 11); \
29680})
29681#else
29682#define vst1_bf16(__p0, __p1) __extension__ ({ \
29683 bfloat16x4_t __s1 = __p1; \
29684 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
29685 __builtin_neon_vst1_v(__p0, __builtin_bit_cast(int8x8_t, __rev1), 11); \
29686})
29687#endif
29688
30003#ifdef __LITTLE_ENDIAN__29689#ifdef __LITTLE_ENDIAN__
30004#define vst1_lane_p8(__p0, __p1, __p2) __extension__ ({ \29690#define vst1_lane_p8(__p0, __p1, __p2) __extension__ ({ \
30005 poly8x8_t __s1 = __p1; \29691 poly8x8_t __s1 = __p1; \
...@@ -30268,6 +29954,32 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -30268,6 +29954,32 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
30268})29954})
30269#endif29955#endif
3027029956
29957#ifdef __LITTLE_ENDIAN__
29958#define vst1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
29959 bfloat16x8_t __s1 = __p1; \
29960 __builtin_neon_vst1q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __s1), __p2, 43); \
29961})
29962#else
29963#define vst1q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
29964 bfloat16x8_t __s1 = __p1; \
29965 bfloat16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
29966 __builtin_neon_vst1q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __rev1), __p2, 43); \
29967})
29968#endif
29969
29970#ifdef __LITTLE_ENDIAN__
29971#define vst1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
29972 bfloat16x4_t __s1 = __p1; \
29973 __builtin_neon_vst1_lane_v(__p0, __builtin_bit_cast(int8x8_t, __s1), __p2, 11); \
29974})
29975#else
29976#define vst1_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
29977 bfloat16x4_t __s1 = __p1; \
29978 bfloat16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
29979 __builtin_neon_vst1_lane_v(__p0, __builtin_bit_cast(int8x8_t, __rev1), __p2, 11); \
29980})
29981#endif
29982
30271#ifdef __LITTLE_ENDIAN__29983#ifdef __LITTLE_ENDIAN__
30272#define vst1_p8_x2(__p0, __p1) __extension__ ({ \29984#define vst1_p8_x2(__p0, __p1) __extension__ ({ \
30273 poly8x8x2_t __s1 = __p1; \29985 poly8x8x2_t __s1 = __p1; \
...@@ -30576,6 +30288,36 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -30576,6 +30288,36 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
30576})30288})
30577#endif30289#endif
3057830290
30291#ifdef __LITTLE_ENDIAN__
30292#define vst1q_bf16_x2(__p0, __p1) __extension__ ({ \
30293 bfloat16x8x2_t __s1 = __p1; \
30294 __builtin_neon_vst1q_x2_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), 43); \
30295})
30296#else
30297#define vst1q_bf16_x2(__p0, __p1) __extension__ ({ \
30298 bfloat16x8x2_t __s1 = __p1; \
30299 bfloat16x8x2_t __rev1; \
30300 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
30301 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
30302 __builtin_neon_vst1q_x2_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), 43); \
30303})
30304#endif
30305
30306#ifdef __LITTLE_ENDIAN__
30307#define vst1_bf16_x2(__p0, __p1) __extension__ ({ \
30308 bfloat16x4x2_t __s1 = __p1; \
30309 __builtin_neon_vst1_x2_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), 11); \
30310})
30311#else
30312#define vst1_bf16_x2(__p0, __p1) __extension__ ({ \
30313 bfloat16x4x2_t __s1 = __p1; \
30314 bfloat16x4x2_t __rev1; \
30315 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
30316 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
30317 __builtin_neon_vst1_x2_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), 11); \
30318})
30319#endif
30320
30579#ifdef __LITTLE_ENDIAN__30321#ifdef __LITTLE_ENDIAN__
30580#define vst1_p8_x3(__p0, __p1) __extension__ ({ \30322#define vst1_p8_x3(__p0, __p1) __extension__ ({ \
30581 poly8x8x3_t __s1 = __p1; \30323 poly8x8x3_t __s1 = __p1; \
...@@ -30904,6 +30646,38 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -30904,6 +30646,38 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
30904})30646})
30905#endif30647#endif
3090630648
30649#ifdef __LITTLE_ENDIAN__
30650#define vst1q_bf16_x3(__p0, __p1) __extension__ ({ \
30651 bfloat16x8x3_t __s1 = __p1; \
30652 __builtin_neon_vst1q_x3_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), 43); \
30653})
30654#else
30655#define vst1q_bf16_x3(__p0, __p1) __extension__ ({ \
30656 bfloat16x8x3_t __s1 = __p1; \
30657 bfloat16x8x3_t __rev1; \
30658 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
30659 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
30660 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
30661 __builtin_neon_vst1q_x3_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), 43); \
30662})
30663#endif
30664
30665#ifdef __LITTLE_ENDIAN__
30666#define vst1_bf16_x3(__p0, __p1) __extension__ ({ \
30667 bfloat16x4x3_t __s1 = __p1; \
30668 __builtin_neon_vst1_x3_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), 11); \
30669})
30670#else
30671#define vst1_bf16_x3(__p0, __p1) __extension__ ({ \
30672 bfloat16x4x3_t __s1 = __p1; \
30673 bfloat16x4x3_t __rev1; \
30674 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
30675 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
30676 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
30677 __builtin_neon_vst1_x3_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), 11); \
30678})
30679#endif
30680
30907#ifdef __LITTLE_ENDIAN__30681#ifdef __LITTLE_ENDIAN__
30908#define vst1_p8_x4(__p0, __p1) __extension__ ({ \30682#define vst1_p8_x4(__p0, __p1) __extension__ ({ \
30909 poly8x8x4_t __s1 = __p1; \30683 poly8x8x4_t __s1 = __p1; \
...@@ -31252,6 +31026,40 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -31252,6 +31026,40 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
31252})31026})
31253#endif31027#endif
3125431028
31029#ifdef __LITTLE_ENDIAN__
31030#define vst1q_bf16_x4(__p0, __p1) __extension__ ({ \
31031 bfloat16x8x4_t __s1 = __p1; \
31032 __builtin_neon_vst1q_x4_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), 43); \
31033})
31034#else
31035#define vst1q_bf16_x4(__p0, __p1) __extension__ ({ \
31036 bfloat16x8x4_t __s1 = __p1; \
31037 bfloat16x8x4_t __rev1; \
31038 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
31039 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
31040 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
31041 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \
31042 __builtin_neon_vst1q_x4_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), 43); \
31043})
31044#endif
31045
31046#ifdef __LITTLE_ENDIAN__
31047#define vst1_bf16_x4(__p0, __p1) __extension__ ({ \
31048 bfloat16x4x4_t __s1 = __p1; \
31049 __builtin_neon_vst1_x4_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), 11); \
31050})
31051#else
31052#define vst1_bf16_x4(__p0, __p1) __extension__ ({ \
31053 bfloat16x4x4_t __s1 = __p1; \
31054 bfloat16x4x4_t __rev1; \
31055 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
31056 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
31057 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
31058 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \
31059 __builtin_neon_vst1_x4_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), 11); \
31060})
31061#endif
31062
31255#ifdef __LITTLE_ENDIAN__31063#ifdef __LITTLE_ENDIAN__
31256#define vst2_p8(__p0, __p1) __extension__ ({ \31064#define vst2_p8(__p0, __p1) __extension__ ({ \
31257 poly8x8x2_t __s1 = __p1; \31065 poly8x8x2_t __s1 = __p1; \
...@@ -31530,6 +31338,36 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -31530,6 +31338,36 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
31530})31338})
31531#endif31339#endif
3153231340
31341#ifdef __LITTLE_ENDIAN__
31342#define vst2q_bf16(__p0, __p1) __extension__ ({ \
31343 bfloat16x8x2_t __s1 = __p1; \
31344 __builtin_neon_vst2q_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), 43); \
31345})
31346#else
31347#define vst2q_bf16(__p0, __p1) __extension__ ({ \
31348 bfloat16x8x2_t __s1 = __p1; \
31349 bfloat16x8x2_t __rev1; \
31350 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
31351 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
31352 __builtin_neon_vst2q_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), 43); \
31353})
31354#endif
31355
31356#ifdef __LITTLE_ENDIAN__
31357#define vst2_bf16(__p0, __p1) __extension__ ({ \
31358 bfloat16x4x2_t __s1 = __p1; \
31359 __builtin_neon_vst2_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), 11); \
31360})
31361#else
31362#define vst2_bf16(__p0, __p1) __extension__ ({ \
31363 bfloat16x4x2_t __s1 = __p1; \
31364 bfloat16x4x2_t __rev1; \
31365 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
31366 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
31367 __builtin_neon_vst2_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), 11); \
31368})
31369#endif
31370
31533#ifdef __LITTLE_ENDIAN__31371#ifdef __LITTLE_ENDIAN__
31534#define vst2_lane_p8(__p0, __p1, __p2) __extension__ ({ \31372#define vst2_lane_p8(__p0, __p1, __p2) __extension__ ({ \
31535 poly8x8x2_t __s1 = __p1; \31373 poly8x8x2_t __s1 = __p1; \
...@@ -31755,6 +31593,36 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -31755,6 +31593,36 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
31755})31593})
31756#endif31594#endif
3175731595
31596#ifdef __LITTLE_ENDIAN__
31597#define vst2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
31598 bfloat16x8x2_t __s1 = __p1; \
31599 __builtin_neon_vst2q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __p2, 43); \
31600})
31601#else
31602#define vst2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
31603 bfloat16x8x2_t __s1 = __p1; \
31604 bfloat16x8x2_t __rev1; \
31605 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
31606 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
31607 __builtin_neon_vst2q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __p2, 43); \
31608})
31609#endif
31610
31611#ifdef __LITTLE_ENDIAN__
31612#define vst2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
31613 bfloat16x4x2_t __s1 = __p1; \
31614 __builtin_neon_vst2_lane_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __p2, 11); \
31615})
31616#else
31617#define vst2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
31618 bfloat16x4x2_t __s1 = __p1; \
31619 bfloat16x4x2_t __rev1; \
31620 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
31621 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
31622 __builtin_neon_vst2_lane_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __p2, 11); \
31623})
31624#endif
31625
31758#ifdef __LITTLE_ENDIAN__31626#ifdef __LITTLE_ENDIAN__
31759#define vst3_p8(__p0, __p1) __extension__ ({ \31627#define vst3_p8(__p0, __p1) __extension__ ({ \
31760 poly8x8x3_t __s1 = __p1; \31628 poly8x8x3_t __s1 = __p1; \
...@@ -32051,6 +31919,38 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -32051,6 +31919,38 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
32051})31919})
32052#endif31920#endif
3205331921
31922#ifdef __LITTLE_ENDIAN__
31923#define vst3q_bf16(__p0, __p1) __extension__ ({ \
31924 bfloat16x8x3_t __s1 = __p1; \
31925 __builtin_neon_vst3q_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), 43); \
31926})
31927#else
31928#define vst3q_bf16(__p0, __p1) __extension__ ({ \
31929 bfloat16x8x3_t __s1 = __p1; \
31930 bfloat16x8x3_t __rev1; \
31931 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
31932 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
31933 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
31934 __builtin_neon_vst3q_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), 43); \
31935})
31936#endif
31937
31938#ifdef __LITTLE_ENDIAN__
31939#define vst3_bf16(__p0, __p1) __extension__ ({ \
31940 bfloat16x4x3_t __s1 = __p1; \
31941 __builtin_neon_vst3_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), 11); \
31942})
31943#else
31944#define vst3_bf16(__p0, __p1) __extension__ ({ \
31945 bfloat16x4x3_t __s1 = __p1; \
31946 bfloat16x4x3_t __rev1; \
31947 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
31948 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
31949 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
31950 __builtin_neon_vst3_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), 11); \
31951})
31952#endif
31953
32054#ifdef __LITTLE_ENDIAN__31954#ifdef __LITTLE_ENDIAN__
32055#define vst3_lane_p8(__p0, __p1, __p2) __extension__ ({ \31955#define vst3_lane_p8(__p0, __p1, __p2) __extension__ ({ \
32056 poly8x8x3_t __s1 = __p1; \31956 poly8x8x3_t __s1 = __p1; \
...@@ -32291,6 +32191,38 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -32291,6 +32191,38 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
32291})32191})
32292#endif32192#endif
3229332193
32194#ifdef __LITTLE_ENDIAN__
32195#define vst3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32196 bfloat16x8x3_t __s1 = __p1; \
32197 __builtin_neon_vst3q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __p2, 43); \
32198})
32199#else
32200#define vst3q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32201 bfloat16x8x3_t __s1 = __p1; \
32202 bfloat16x8x3_t __rev1; \
32203 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
32204 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
32205 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
32206 __builtin_neon_vst3q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __p2, 43); \
32207})
32208#endif
32209
32210#ifdef __LITTLE_ENDIAN__
32211#define vst3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32212 bfloat16x4x3_t __s1 = __p1; \
32213 __builtin_neon_vst3_lane_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __p2, 11); \
32214})
32215#else
32216#define vst3_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32217 bfloat16x4x3_t __s1 = __p1; \
32218 bfloat16x4x3_t __rev1; \
32219 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
32220 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
32221 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
32222 __builtin_neon_vst3_lane_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __p2, 11); \
32223})
32224#endif
32225
32294#ifdef __LITTLE_ENDIAN__32226#ifdef __LITTLE_ENDIAN__
32295#define vst4_p8(__p0, __p1) __extension__ ({ \32227#define vst4_p8(__p0, __p1) __extension__ ({ \
32296 poly8x8x4_t __s1 = __p1; \32228 poly8x8x4_t __s1 = __p1; \
...@@ -32605,6 +32537,40 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -32605,6 +32537,40 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
32605})32537})
32606#endif32538#endif
3260732539
32540#ifdef __LITTLE_ENDIAN__
32541#define vst4q_bf16(__p0, __p1) __extension__ ({ \
32542 bfloat16x8x4_t __s1 = __p1; \
32543 __builtin_neon_vst4q_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), 43); \
32544})
32545#else
32546#define vst4q_bf16(__p0, __p1) __extension__ ({ \
32547 bfloat16x8x4_t __s1 = __p1; \
32548 bfloat16x8x4_t __rev1; \
32549 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
32550 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
32551 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
32552 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \
32553 __builtin_neon_vst4q_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), 43); \
32554})
32555#endif
32556
32557#ifdef __LITTLE_ENDIAN__
32558#define vst4_bf16(__p0, __p1) __extension__ ({ \
32559 bfloat16x4x4_t __s1 = __p1; \
32560 __builtin_neon_vst4_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), 11); \
32561})
32562#else
32563#define vst4_bf16(__p0, __p1) __extension__ ({ \
32564 bfloat16x4x4_t __s1 = __p1; \
32565 bfloat16x4x4_t __rev1; \
32566 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
32567 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
32568 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
32569 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \
32570 __builtin_neon_vst4_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), 11); \
32571})
32572#endif
32573
32608#ifdef __LITTLE_ENDIAN__32574#ifdef __LITTLE_ENDIAN__
32609#define vst4_lane_p8(__p0, __p1, __p2) __extension__ ({ \32575#define vst4_lane_p8(__p0, __p1, __p2) __extension__ ({ \
32610 poly8x8x4_t __s1 = __p1; \32576 poly8x8x4_t __s1 = __p1; \
...@@ -32860,6 +32826,40 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_...@@ -32860,6 +32826,40 @@ __ai __attribute__((target("neon"))) int16x4_t vshl_s16(int16x4_t __p0, int16x4_
32860})32826})
32861#endif32827#endif
3286232828
32829#ifdef __LITTLE_ENDIAN__
32830#define vst4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32831 bfloat16x8x4_t __s1 = __p1; \
32832 __builtin_neon_vst4q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __s1.val[0]), __builtin_bit_cast(int8x16_t, __s1.val[1]), __builtin_bit_cast(int8x16_t, __s1.val[2]), __builtin_bit_cast(int8x16_t, __s1.val[3]), __p2, 43); \
32833})
32834#else
32835#define vst4q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32836 bfloat16x8x4_t __s1 = __p1; \
32837 bfloat16x8x4_t __rev1; \
32838 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_128_16); \
32839 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_128_16); \
32840 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_128_16); \
32841 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_128_16); \
32842 __builtin_neon_vst4q_lane_v(__p0, __builtin_bit_cast(int8x16_t, __rev1.val[0]), __builtin_bit_cast(int8x16_t, __rev1.val[1]), __builtin_bit_cast(int8x16_t, __rev1.val[2]), __builtin_bit_cast(int8x16_t, __rev1.val[3]), __p2, 43); \
32843})
32844#endif
32845
32846#ifdef __LITTLE_ENDIAN__
32847#define vst4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32848 bfloat16x4x4_t __s1 = __p1; \
32849 __builtin_neon_vst4_lane_v(__p0, __builtin_bit_cast(int8x8_t, __s1.val[0]), __builtin_bit_cast(int8x8_t, __s1.val[1]), __builtin_bit_cast(int8x8_t, __s1.val[2]), __builtin_bit_cast(int8x8_t, __s1.val[3]), __p2, 11); \
32850})
32851#else
32852#define vst4_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
32853 bfloat16x4x4_t __s1 = __p1; \
32854 bfloat16x4x4_t __rev1; \
32855 __rev1.val[0] = __builtin_shufflevector(__s1.val[0], __s1.val[0], __lane_reverse_64_16); \
32856 __rev1.val[1] = __builtin_shufflevector(__s1.val[1], __s1.val[1], __lane_reverse_64_16); \
32857 __rev1.val[2] = __builtin_shufflevector(__s1.val[2], __s1.val[2], __lane_reverse_64_16); \
32858 __rev1.val[3] = __builtin_shufflevector(__s1.val[3], __s1.val[3], __lane_reverse_64_16); \
32859 __builtin_neon_vst4_lane_v(__p0, __builtin_bit_cast(int8x8_t, __rev1.val[0]), __builtin_bit_cast(int8x8_t, __rev1.val[1]), __builtin_bit_cast(int8x8_t, __rev1.val[2]), __builtin_bit_cast(int8x8_t, __rev1.val[3]), __p2, 11); \
32860})
32861#endif
32862
32863#ifdef __LITTLE_ENDIAN__32863#ifdef __LITTLE_ENDIAN__
32864__ai __attribute__((target("neon"))) uint8x16_t vsubq_u8(uint8x16_t __p0, uint8x16_t __p1) {32864__ai __attribute__((target("neon"))) uint8x16_t vsubq_u8(uint8x16_t __p0, uint8x16_t __p1) {
32865 uint8x16_t __ret;32865 uint8x16_t __ret;
...@@ -37083,266 +37083,6 @@ __ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_low_bf16_f32(float3...@@ -37083,266 +37083,6 @@ __ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_low_bf16_f32(float3
37083}37083}
37084#endif37084#endif
3708537085
37086__ai __attribute__((target("bf16,neon"))) poly8x8_t vreinterpret_p8_bf16(bfloat16x4_t __p0) {
37087 poly8x8_t __ret;
37088 __ret = __builtin_bit_cast(poly8x8_t, __p0);
37089 return __ret;
37090}
37091__ai __attribute__((target("bf16,neon"))) poly64x1_t vreinterpret_p64_bf16(bfloat16x4_t __p0) {
37092 poly64x1_t __ret;
37093 __ret = __builtin_bit_cast(poly64x1_t, __p0);
37094 return __ret;
37095}
37096__ai __attribute__((target("bf16,neon"))) poly16x4_t vreinterpret_p16_bf16(bfloat16x4_t __p0) {
37097 poly16x4_t __ret;
37098 __ret = __builtin_bit_cast(poly16x4_t, __p0);
37099 return __ret;
37100}
37101__ai __attribute__((target("bf16,neon"))) poly8x16_t vreinterpretq_p8_bf16(bfloat16x8_t __p0) {
37102 poly8x16_t __ret;
37103 __ret = __builtin_bit_cast(poly8x16_t, __p0);
37104 return __ret;
37105}
37106__ai __attribute__((target("bf16,neon"))) poly64x2_t vreinterpretq_p64_bf16(bfloat16x8_t __p0) {
37107 poly64x2_t __ret;
37108 __ret = __builtin_bit_cast(poly64x2_t, __p0);
37109 return __ret;
37110}
37111__ai __attribute__((target("bf16,neon"))) poly16x8_t vreinterpretq_p16_bf16(bfloat16x8_t __p0) {
37112 poly16x8_t __ret;
37113 __ret = __builtin_bit_cast(poly16x8_t, __p0);
37114 return __ret;
37115}
37116__ai __attribute__((target("bf16,neon"))) uint8x16_t vreinterpretq_u8_bf16(bfloat16x8_t __p0) {
37117 uint8x16_t __ret;
37118 __ret = __builtin_bit_cast(uint8x16_t, __p0);
37119 return __ret;
37120}
37121__ai __attribute__((target("bf16,neon"))) uint32x4_t vreinterpretq_u32_bf16(bfloat16x8_t __p0) {
37122 uint32x4_t __ret;
37123 __ret = __builtin_bit_cast(uint32x4_t, __p0);
37124 return __ret;
37125}
37126__ai __attribute__((target("bf16,neon"))) uint64x2_t vreinterpretq_u64_bf16(bfloat16x8_t __p0) {
37127 uint64x2_t __ret;
37128 __ret = __builtin_bit_cast(uint64x2_t, __p0);
37129 return __ret;
37130}
37131__ai __attribute__((target("bf16,neon"))) uint16x8_t vreinterpretq_u16_bf16(bfloat16x8_t __p0) {
37132 uint16x8_t __ret;
37133 __ret = __builtin_bit_cast(uint16x8_t, __p0);
37134 return __ret;
37135}
37136__ai __attribute__((target("bf16,neon"))) int8x16_t vreinterpretq_s8_bf16(bfloat16x8_t __p0) {
37137 int8x16_t __ret;
37138 __ret = __builtin_bit_cast(int8x16_t, __p0);
37139 return __ret;
37140}
37141__ai __attribute__((target("bf16,neon"))) float32x4_t vreinterpretq_f32_bf16(bfloat16x8_t __p0) {
37142 float32x4_t __ret;
37143 __ret = __builtin_bit_cast(float32x4_t, __p0);
37144 return __ret;
37145}
37146__ai __attribute__((target("bf16,neon"))) float16x8_t vreinterpretq_f16_bf16(bfloat16x8_t __p0) {
37147 float16x8_t __ret;
37148 __ret = __builtin_bit_cast(float16x8_t, __p0);
37149 return __ret;
37150}
37151__ai __attribute__((target("bf16,neon"))) int32x4_t vreinterpretq_s32_bf16(bfloat16x8_t __p0) {
37152 int32x4_t __ret;
37153 __ret = __builtin_bit_cast(int32x4_t, __p0);
37154 return __ret;
37155}
37156__ai __attribute__((target("bf16,neon"))) int64x2_t vreinterpretq_s64_bf16(bfloat16x8_t __p0) {
37157 int64x2_t __ret;
37158 __ret = __builtin_bit_cast(int64x2_t, __p0);
37159 return __ret;
37160}
37161__ai __attribute__((target("bf16,neon"))) int16x8_t vreinterpretq_s16_bf16(bfloat16x8_t __p0) {
37162 int16x8_t __ret;
37163 __ret = __builtin_bit_cast(int16x8_t, __p0);
37164 return __ret;
37165}
37166__ai __attribute__((target("bf16,neon"))) uint8x8_t vreinterpret_u8_bf16(bfloat16x4_t __p0) {
37167 uint8x8_t __ret;
37168 __ret = __builtin_bit_cast(uint8x8_t, __p0);
37169 return __ret;
37170}
37171__ai __attribute__((target("bf16,neon"))) uint32x2_t vreinterpret_u32_bf16(bfloat16x4_t __p0) {
37172 uint32x2_t __ret;
37173 __ret = __builtin_bit_cast(uint32x2_t, __p0);
37174 return __ret;
37175}
37176__ai __attribute__((target("bf16,neon"))) uint64x1_t vreinterpret_u64_bf16(bfloat16x4_t __p0) {
37177 uint64x1_t __ret;
37178 __ret = __builtin_bit_cast(uint64x1_t, __p0);
37179 return __ret;
37180}
37181__ai __attribute__((target("bf16,neon"))) uint16x4_t vreinterpret_u16_bf16(bfloat16x4_t __p0) {
37182 uint16x4_t __ret;
37183 __ret = __builtin_bit_cast(uint16x4_t, __p0);
37184 return __ret;
37185}
37186__ai __attribute__((target("bf16,neon"))) int8x8_t vreinterpret_s8_bf16(bfloat16x4_t __p0) {
37187 int8x8_t __ret;
37188 __ret = __builtin_bit_cast(int8x8_t, __p0);
37189 return __ret;
37190}
37191__ai __attribute__((target("bf16,neon"))) float32x2_t vreinterpret_f32_bf16(bfloat16x4_t __p0) {
37192 float32x2_t __ret;
37193 __ret = __builtin_bit_cast(float32x2_t, __p0);
37194 return __ret;
37195}
37196__ai __attribute__((target("bf16,neon"))) float16x4_t vreinterpret_f16_bf16(bfloat16x4_t __p0) {
37197 float16x4_t __ret;
37198 __ret = __builtin_bit_cast(float16x4_t, __p0);
37199 return __ret;
37200}
37201__ai __attribute__((target("bf16,neon"))) int32x2_t vreinterpret_s32_bf16(bfloat16x4_t __p0) {
37202 int32x2_t __ret;
37203 __ret = __builtin_bit_cast(int32x2_t, __p0);
37204 return __ret;
37205}
37206__ai __attribute__((target("bf16,neon"))) int64x1_t vreinterpret_s64_bf16(bfloat16x4_t __p0) {
37207 int64x1_t __ret;
37208 __ret = __builtin_bit_cast(int64x1_t, __p0);
37209 return __ret;
37210}
37211__ai __attribute__((target("bf16,neon"))) int16x4_t vreinterpret_s16_bf16(bfloat16x4_t __p0) {
37212 int16x4_t __ret;
37213 __ret = __builtin_bit_cast(int16x4_t, __p0);
37214 return __ret;
37215}
37216__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p8(poly8x16_t __p0) {
37217 bfloat16x8_t __ret;
37218 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37219 return __ret;
37220}
37221__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p64(poly64x2_t __p0) {
37222 bfloat16x8_t __ret;
37223 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37224 return __ret;
37225}
37226__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p16(poly16x8_t __p0) {
37227 bfloat16x8_t __ret;
37228 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37229 return __ret;
37230}
37231__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u8(uint8x16_t __p0) {
37232 bfloat16x8_t __ret;
37233 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37234 return __ret;
37235}
37236__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u32(uint32x4_t __p0) {
37237 bfloat16x8_t __ret;
37238 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37239 return __ret;
37240}
37241__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u64(uint64x2_t __p0) {
37242 bfloat16x8_t __ret;
37243 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37244 return __ret;
37245}
37246__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u16(uint16x8_t __p0) {
37247 bfloat16x8_t __ret;
37248 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37249 return __ret;
37250}
37251__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s8(int8x16_t __p0) {
37252 bfloat16x8_t __ret;
37253 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37254 return __ret;
37255}
37256__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_f32(float32x4_t __p0) {
37257 bfloat16x8_t __ret;
37258 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37259 return __ret;
37260}
37261__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_f16(float16x8_t __p0) {
37262 bfloat16x8_t __ret;
37263 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37264 return __ret;
37265}
37266__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s32(int32x4_t __p0) {
37267 bfloat16x8_t __ret;
37268 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37269 return __ret;
37270}
37271__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s64(int64x2_t __p0) {
37272 bfloat16x8_t __ret;
37273 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37274 return __ret;
37275}
37276__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s16(int16x8_t __p0) {
37277 bfloat16x8_t __ret;
37278 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
37279 return __ret;
37280}
37281__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_p8(poly8x8_t __p0) {
37282 bfloat16x4_t __ret;
37283 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37284 return __ret;
37285}
37286__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_p64(poly64x1_t __p0) {
37287 bfloat16x4_t __ret;
37288 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37289 return __ret;
37290}
37291__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_p16(poly16x4_t __p0) {
37292 bfloat16x4_t __ret;
37293 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37294 return __ret;
37295}
37296__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u8(uint8x8_t __p0) {
37297 bfloat16x4_t __ret;
37298 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37299 return __ret;
37300}
37301__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u32(uint32x2_t __p0) {
37302 bfloat16x4_t __ret;
37303 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37304 return __ret;
37305}
37306__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u64(uint64x1_t __p0) {
37307 bfloat16x4_t __ret;
37308 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37309 return __ret;
37310}
37311__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u16(uint16x4_t __p0) {
37312 bfloat16x4_t __ret;
37313 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37314 return __ret;
37315}
37316__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s8(int8x8_t __p0) {
37317 bfloat16x4_t __ret;
37318 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37319 return __ret;
37320}
37321__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_f32(float32x2_t __p0) {
37322 bfloat16x4_t __ret;
37323 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37324 return __ret;
37325}
37326__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_f16(float16x4_t __p0) {
37327 bfloat16x4_t __ret;
37328 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37329 return __ret;
37330}
37331__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s32(int32x2_t __p0) {
37332 bfloat16x4_t __ret;
37333 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37334 return __ret;
37335}
37336__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s64(int64x1_t __p0) {
37337 bfloat16x4_t __ret;
37338 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37339 return __ret;
37340}
37341__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s16(int16x4_t __p0) {
37342 bfloat16x4_t __ret;
37343 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
37344 return __ret;
37345}
37346#ifdef __LITTLE_ENDIAN__37086#ifdef __LITTLE_ENDIAN__
37347#define vqdmulhq_lane_s32(__p0_214, __p1_214, __p2_214) __extension__ ({ \37087#define vqdmulhq_lane_s32(__p0_214, __p1_214, __p2_214) __extension__ ({ \
37348 int32x4_t __ret_214; \37088 int32x4_t __ret_214; \
...@@ -38831,6 +38571,266 @@ __ai __attribute__((target("neon"))) int16x4_t vreinterpret_s16_s64(int64x1_t __...@@ -38831,6 +38571,266 @@ __ai __attribute__((target("neon"))) int16x4_t vreinterpret_s16_s64(int64x1_t __
38831 __ret = __builtin_bit_cast(int16x4_t, __p0);38571 __ret = __builtin_bit_cast(int16x4_t, __p0);
38832 return __ret;38572 return __ret;
38833}38573}
38574__ai __attribute__((target("neon"))) poly8x8_t vreinterpret_p8_bf16(bfloat16x4_t __p0) {
38575 poly8x8_t __ret;
38576 __ret = __builtin_bit_cast(poly8x8_t, __p0);
38577 return __ret;
38578}
38579__ai __attribute__((target("neon"))) poly64x1_t vreinterpret_p64_bf16(bfloat16x4_t __p0) {
38580 poly64x1_t __ret;
38581 __ret = __builtin_bit_cast(poly64x1_t, __p0);
38582 return __ret;
38583}
38584__ai __attribute__((target("neon"))) poly16x4_t vreinterpret_p16_bf16(bfloat16x4_t __p0) {
38585 poly16x4_t __ret;
38586 __ret = __builtin_bit_cast(poly16x4_t, __p0);
38587 return __ret;
38588}
38589__ai __attribute__((target("neon"))) poly8x16_t vreinterpretq_p8_bf16(bfloat16x8_t __p0) {
38590 poly8x16_t __ret;
38591 __ret = __builtin_bit_cast(poly8x16_t, __p0);
38592 return __ret;
38593}
38594__ai __attribute__((target("neon"))) poly64x2_t vreinterpretq_p64_bf16(bfloat16x8_t __p0) {
38595 poly64x2_t __ret;
38596 __ret = __builtin_bit_cast(poly64x2_t, __p0);
38597 return __ret;
38598}
38599__ai __attribute__((target("neon"))) poly16x8_t vreinterpretq_p16_bf16(bfloat16x8_t __p0) {
38600 poly16x8_t __ret;
38601 __ret = __builtin_bit_cast(poly16x8_t, __p0);
38602 return __ret;
38603}
38604__ai __attribute__((target("neon"))) uint8x16_t vreinterpretq_u8_bf16(bfloat16x8_t __p0) {
38605 uint8x16_t __ret;
38606 __ret = __builtin_bit_cast(uint8x16_t, __p0);
38607 return __ret;
38608}
38609__ai __attribute__((target("neon"))) uint32x4_t vreinterpretq_u32_bf16(bfloat16x8_t __p0) {
38610 uint32x4_t __ret;
38611 __ret = __builtin_bit_cast(uint32x4_t, __p0);
38612 return __ret;
38613}
38614__ai __attribute__((target("neon"))) uint64x2_t vreinterpretq_u64_bf16(bfloat16x8_t __p0) {
38615 uint64x2_t __ret;
38616 __ret = __builtin_bit_cast(uint64x2_t, __p0);
38617 return __ret;
38618}
38619__ai __attribute__((target("neon"))) uint16x8_t vreinterpretq_u16_bf16(bfloat16x8_t __p0) {
38620 uint16x8_t __ret;
38621 __ret = __builtin_bit_cast(uint16x8_t, __p0);
38622 return __ret;
38623}
38624__ai __attribute__((target("neon"))) int8x16_t vreinterpretq_s8_bf16(bfloat16x8_t __p0) {
38625 int8x16_t __ret;
38626 __ret = __builtin_bit_cast(int8x16_t, __p0);
38627 return __ret;
38628}
38629__ai __attribute__((target("neon"))) float32x4_t vreinterpretq_f32_bf16(bfloat16x8_t __p0) {
38630 float32x4_t __ret;
38631 __ret = __builtin_bit_cast(float32x4_t, __p0);
38632 return __ret;
38633}
38634__ai __attribute__((target("neon"))) float16x8_t vreinterpretq_f16_bf16(bfloat16x8_t __p0) {
38635 float16x8_t __ret;
38636 __ret = __builtin_bit_cast(float16x8_t, __p0);
38637 return __ret;
38638}
38639__ai __attribute__((target("neon"))) int32x4_t vreinterpretq_s32_bf16(bfloat16x8_t __p0) {
38640 int32x4_t __ret;
38641 __ret = __builtin_bit_cast(int32x4_t, __p0);
38642 return __ret;
38643}
38644__ai __attribute__((target("neon"))) int64x2_t vreinterpretq_s64_bf16(bfloat16x8_t __p0) {
38645 int64x2_t __ret;
38646 __ret = __builtin_bit_cast(int64x2_t, __p0);
38647 return __ret;
38648}
38649__ai __attribute__((target("neon"))) int16x8_t vreinterpretq_s16_bf16(bfloat16x8_t __p0) {
38650 int16x8_t __ret;
38651 __ret = __builtin_bit_cast(int16x8_t, __p0);
38652 return __ret;
38653}
38654__ai __attribute__((target("neon"))) uint8x8_t vreinterpret_u8_bf16(bfloat16x4_t __p0) {
38655 uint8x8_t __ret;
38656 __ret = __builtin_bit_cast(uint8x8_t, __p0);
38657 return __ret;
38658}
38659__ai __attribute__((target("neon"))) uint32x2_t vreinterpret_u32_bf16(bfloat16x4_t __p0) {
38660 uint32x2_t __ret;
38661 __ret = __builtin_bit_cast(uint32x2_t, __p0);
38662 return __ret;
38663}
38664__ai __attribute__((target("neon"))) uint64x1_t vreinterpret_u64_bf16(bfloat16x4_t __p0) {
38665 uint64x1_t __ret;
38666 __ret = __builtin_bit_cast(uint64x1_t, __p0);
38667 return __ret;
38668}
38669__ai __attribute__((target("neon"))) uint16x4_t vreinterpret_u16_bf16(bfloat16x4_t __p0) {
38670 uint16x4_t __ret;
38671 __ret = __builtin_bit_cast(uint16x4_t, __p0);
38672 return __ret;
38673}
38674__ai __attribute__((target("neon"))) int8x8_t vreinterpret_s8_bf16(bfloat16x4_t __p0) {
38675 int8x8_t __ret;
38676 __ret = __builtin_bit_cast(int8x8_t, __p0);
38677 return __ret;
38678}
38679__ai __attribute__((target("neon"))) float32x2_t vreinterpret_f32_bf16(bfloat16x4_t __p0) {
38680 float32x2_t __ret;
38681 __ret = __builtin_bit_cast(float32x2_t, __p0);
38682 return __ret;
38683}
38684__ai __attribute__((target("neon"))) float16x4_t vreinterpret_f16_bf16(bfloat16x4_t __p0) {
38685 float16x4_t __ret;
38686 __ret = __builtin_bit_cast(float16x4_t, __p0);
38687 return __ret;
38688}
38689__ai __attribute__((target("neon"))) int32x2_t vreinterpret_s32_bf16(bfloat16x4_t __p0) {
38690 int32x2_t __ret;
38691 __ret = __builtin_bit_cast(int32x2_t, __p0);
38692 return __ret;
38693}
38694__ai __attribute__((target("neon"))) int64x1_t vreinterpret_s64_bf16(bfloat16x4_t __p0) {
38695 int64x1_t __ret;
38696 __ret = __builtin_bit_cast(int64x1_t, __p0);
38697 return __ret;
38698}
38699__ai __attribute__((target("neon"))) int16x4_t vreinterpret_s16_bf16(bfloat16x4_t __p0) {
38700 int16x4_t __ret;
38701 __ret = __builtin_bit_cast(int16x4_t, __p0);
38702 return __ret;
38703}
38704__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p8(poly8x16_t __p0) {
38705 bfloat16x8_t __ret;
38706 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38707 return __ret;
38708}
38709__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p64(poly64x2_t __p0) {
38710 bfloat16x8_t __ret;
38711 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38712 return __ret;
38713}
38714__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p16(poly16x8_t __p0) {
38715 bfloat16x8_t __ret;
38716 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38717 return __ret;
38718}
38719__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u8(uint8x16_t __p0) {
38720 bfloat16x8_t __ret;
38721 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38722 return __ret;
38723}
38724__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u32(uint32x4_t __p0) {
38725 bfloat16x8_t __ret;
38726 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38727 return __ret;
38728}
38729__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u64(uint64x2_t __p0) {
38730 bfloat16x8_t __ret;
38731 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38732 return __ret;
38733}
38734__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u16(uint16x8_t __p0) {
38735 bfloat16x8_t __ret;
38736 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38737 return __ret;
38738}
38739__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s8(int8x16_t __p0) {
38740 bfloat16x8_t __ret;
38741 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38742 return __ret;
38743}
38744__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_f32(float32x4_t __p0) {
38745 bfloat16x8_t __ret;
38746 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38747 return __ret;
38748}
38749__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_f16(float16x8_t __p0) {
38750 bfloat16x8_t __ret;
38751 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38752 return __ret;
38753}
38754__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s32(int32x4_t __p0) {
38755 bfloat16x8_t __ret;
38756 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38757 return __ret;
38758}
38759__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s64(int64x2_t __p0) {
38760 bfloat16x8_t __ret;
38761 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38762 return __ret;
38763}
38764__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s16(int16x8_t __p0) {
38765 bfloat16x8_t __ret;
38766 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
38767 return __ret;
38768}
38769__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_p8(poly8x8_t __p0) {
38770 bfloat16x4_t __ret;
38771 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38772 return __ret;
38773}
38774__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_p64(poly64x1_t __p0) {
38775 bfloat16x4_t __ret;
38776 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38777 return __ret;
38778}
38779__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_p16(poly16x4_t __p0) {
38780 bfloat16x4_t __ret;
38781 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38782 return __ret;
38783}
38784__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u8(uint8x8_t __p0) {
38785 bfloat16x4_t __ret;
38786 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38787 return __ret;
38788}
38789__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u32(uint32x2_t __p0) {
38790 bfloat16x4_t __ret;
38791 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38792 return __ret;
38793}
38794__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u64(uint64x1_t __p0) {
38795 bfloat16x4_t __ret;
38796 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38797 return __ret;
38798}
38799__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u16(uint16x4_t __p0) {
38800 bfloat16x4_t __ret;
38801 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38802 return __ret;
38803}
38804__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s8(int8x8_t __p0) {
38805 bfloat16x4_t __ret;
38806 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38807 return __ret;
38808}
38809__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_f32(float32x2_t __p0) {
38810 bfloat16x4_t __ret;
38811 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38812 return __ret;
38813}
38814__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_f16(float16x4_t __p0) {
38815 bfloat16x4_t __ret;
38816 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38817 return __ret;
38818}
38819__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s32(int32x2_t __p0) {
38820 bfloat16x4_t __ret;
38821 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38822 return __ret;
38823}
38824__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s64(int64x1_t __p0) {
38825 bfloat16x4_t __ret;
38826 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38827 return __ret;
38828}
38829__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s16(int16x4_t __p0) {
38830 bfloat16x4_t __ret;
38831 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
38832 return __ret;
38833}
38834#endif38834#endif
38835#if (__ARM_FP & 2)38835#if (__ARM_FP & 2)
38836#ifdef __LITTLE_ENDIAN__38836#ifdef __LITTLE_ENDIAN__
...@@ -41141,6 +41141,174 @@ __ai __attribute__((target("neon"))) float32x2_t vfms_f32(float32x2_t __p0, floa...@@ -41141,6 +41141,174 @@ __ai __attribute__((target("neon"))) float32x2_t vfms_f32(float32x2_t __p0, floa
4114141141
41142#endif41142#endif
41143#if defined(__aarch64__)41143#if defined(__aarch64__)
41144#ifdef __LITTLE_ENDIAN__
41145__ai __attribute__((target("f16f32dot,neon"))) float32x4_t vdotq_f32_f16(float32x4_t __p0, float16x8_t __p1, float16x8_t __p2) {
41146 float32x4_t __ret;
41147 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vdotq_f32_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
41148 return __ret;
41149}
41150#else
41151__ai __attribute__((target("f16f32dot,neon"))) float32x4_t vdotq_f32_f16(float32x4_t __p0, float16x8_t __p1, float16x8_t __p2) {
41152 float32x4_t __ret;
41153 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
41154 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
41155 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
41156 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vdotq_f32_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
41157 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
41158 return __ret;
41159}
41160#endif
41161
41162#ifdef __LITTLE_ENDIAN__
41163__ai __attribute__((target("f16f32dot,neon"))) float32x2_t vdot_f32_f16(float32x2_t __p0, float16x4_t __p1, float16x4_t __p2) {
41164 float32x2_t __ret;
41165 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vdot_f32_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), __builtin_bit_cast(int8x8_t, __p2), 9));
41166 return __ret;
41167}
41168#else
41169__ai __attribute__((target("f16f32dot,neon"))) float32x2_t vdot_f32_f16(float32x2_t __p0, float16x4_t __p1, float16x4_t __p2) {
41170 float32x2_t __ret;
41171 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
41172 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
41173 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_64_16);
41174 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vdot_f32_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __builtin_bit_cast(int8x8_t, __rev2), 9));
41175 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
41176 return __ret;
41177}
41178#endif
41179
41180#ifdef __LITTLE_ENDIAN__
41181#define vdotq_lane_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41182 float32x4_t __ret; \
41183 float32x4_t __s0 = __p0; \
41184 float16x8_t __s1 = __p1; \
41185 float16x4_t __s2 = __p2; \
41186 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vdotq_lane_f32_f16(__builtin_bit_cast(int8x16_t, __s0), __builtin_bit_cast(int8x16_t, __s1), __builtin_bit_cast(int8x8_t, __s2), __p3, 41)); \
41187 __ret; \
41188})
41189#else
41190#define vdotq_lane_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41191 float32x4_t __ret; \
41192 float32x4_t __s0 = __p0; \
41193 float16x8_t __s1 = __p1; \
41194 float16x4_t __s2 = __p2; \
41195 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_32); \
41196 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
41197 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__s2, __s2, __lane_reverse_64_16); \
41198 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vdotq_lane_f32_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x8_t, __rev2), __p3, 41)); \
41199 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32); \
41200 __ret; \
41201})
41202#endif
41203
41204#ifdef __LITTLE_ENDIAN__
41205#define vdot_lane_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41206 float32x2_t __ret; \
41207 float32x2_t __s0 = __p0; \
41208 float16x4_t __s1 = __p1; \
41209 float16x4_t __s2 = __p2; \
41210 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vdot_lane_f32_f16(__builtin_bit_cast(int8x8_t, __s0), __builtin_bit_cast(int8x8_t, __s1), __builtin_bit_cast(int8x8_t, __s2), __p3, 9)); \
41211 __ret; \
41212})
41213#else
41214#define vdot_lane_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41215 float32x2_t __ret; \
41216 float32x2_t __s0 = __p0; \
41217 float16x4_t __s1 = __p1; \
41218 float16x4_t __s2 = __p2; \
41219 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_32); \
41220 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
41221 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__s2, __s2, __lane_reverse_64_16); \
41222 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vdot_lane_f32_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __builtin_bit_cast(int8x8_t, __rev2), __p3, 9)); \
41223 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32); \
41224 __ret; \
41225})
41226#endif
41227
41228#ifdef __LITTLE_ENDIAN__
41229#define vdotq_laneq_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41230 float32x4_t __ret; \
41231 float32x4_t __s0 = __p0; \
41232 float16x8_t __s1 = __p1; \
41233 float16x8_t __s2 = __p2; \
41234 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vdotq_laneq_f32_f16(__builtin_bit_cast(int8x16_t, __s0), __builtin_bit_cast(int8x16_t, __s1), __builtin_bit_cast(int8x16_t, __s2), __p3, 41)); \
41235 __ret; \
41236})
41237#else
41238#define vdotq_laneq_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41239 float32x4_t __ret; \
41240 float32x4_t __s0 = __p0; \
41241 float16x8_t __s1 = __p1; \
41242 float16x8_t __s2 = __p2; \
41243 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_32); \
41244 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
41245 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__s2, __s2, __lane_reverse_128_16); \
41246 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vdotq_laneq_f32_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), __p3, 41)); \
41247 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32); \
41248 __ret; \
41249})
41250#endif
41251
41252#ifdef __LITTLE_ENDIAN__
41253#define vdot_laneq_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41254 float32x2_t __ret; \
41255 float32x2_t __s0 = __p0; \
41256 float16x4_t __s1 = __p1; \
41257 float16x8_t __s2 = __p2; \
41258 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vdot_laneq_f32_f16(__builtin_bit_cast(int8x8_t, __s0), __builtin_bit_cast(int8x8_t, __s1), __builtin_bit_cast(int8x16_t, __s2), __p3, 9)); \
41259 __ret; \
41260})
41261#else
41262#define vdot_laneq_f32_f16(__p0, __p1, __p2, __p3) __extension__ ({ \
41263 float32x2_t __ret; \
41264 float32x2_t __s0 = __p0; \
41265 float16x4_t __s1 = __p1; \
41266 float16x8_t __s2 = __p2; \
41267 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_32); \
41268 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
41269 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__s2, __s2, __lane_reverse_128_16); \
41270 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vdot_laneq_f32_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), __p3, 9)); \
41271 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32); \
41272 __ret; \
41273})
41274#endif
41275
41276#ifdef __LITTLE_ENDIAN__
41277__ai __attribute__((target("f16f32mm,neon"))) float32x4_t vmmlaq_f32_f16(float32x4_t __p0, float16x8_t __p1, float16x8_t __p2) {
41278 float32x4_t __ret;
41279 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vmmlaq_f32_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 41));
41280 return __ret;
41281}
41282#else
41283__ai __attribute__((target("f16f32mm,neon"))) float32x4_t vmmlaq_f32_f16(float32x4_t __p0, float16x8_t __p1, float16x8_t __p2) {
41284 float32x4_t __ret;
41285 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
41286 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
41287 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
41288 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vmmlaq_f32_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 41));
41289 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
41290 return __ret;
41291}
41292#endif
41293
41294#ifdef __LITTLE_ENDIAN__
41295__ai __attribute__((target("f16mm,neon"))) float16x8_t vmmlaq_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41296 float16x8_t __ret;
41297 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmmlaq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), __builtin_bit_cast(int8x16_t, __p2), 40));
41298 return __ret;
41299}
41300#else
41301__ai __attribute__((target("f16mm,neon"))) float16x8_t vmmlaq_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41302 float16x8_t __ret;
41303 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
41304 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
41305 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, __lane_reverse_128_16);
41306 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmmlaq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __builtin_bit_cast(int8x16_t, __rev2), 40));
41307 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
41308 return __ret;
41309}
41310#endif
41311
41144#ifdef __LITTLE_ENDIAN__41312#ifdef __LITTLE_ENDIAN__
41145__ai __attribute__((target("f8f16mm,neon"))) float16x8_t vmmlaq_f16_mf8_fpm(float16x8_t __p0, mfloat8x16_t __p1, mfloat8x16_t __p2, fpm_t __p3) {41313__ai __attribute__((target("f8f16mm,neon"))) float16x8_t vmmlaq_f16_mf8_fpm(float16x8_t __p0, mfloat8x16_t __p1, mfloat8x16_t __p2, fpm_t __p3) {
41146 float16x8_t __ret;41314 float16x8_t __ret;
...@@ -42391,6 +42559,48 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa...@@ -42391,6 +42559,48 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa
42391})42559})
42392#endif42560#endif
4239342561
42562#ifdef __LITTLE_ENDIAN__
42563#define vluti2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
42564 bfloat16x8_t __ret; \
42565 bfloat16x8_t __s0 = __p0; \
42566 uint8x8_t __s1 = __p1; \
42567 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_lane_bf16(__builtin_bit_cast(int8x16_t, __s0), __builtin_bit_cast(int8x8_t, __s1), __p2, 43)); \
42568 __ret; \
42569})
42570#else
42571#define vluti2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
42572 bfloat16x8_t __ret; \
42573 bfloat16x8_t __s0 = __p0; \
42574 uint8x8_t __s1 = __p1; \
42575 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
42576 uint8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
42577 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_lane_bf16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __p2, 43)); \
42578 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
42579 __ret; \
42580})
42581#endif
42582
42583#ifdef __LITTLE_ENDIAN__
42584#define vluti2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
42585 bfloat16x8_t __ret; \
42586 bfloat16x4_t __s0 = __p0; \
42587 uint8x8_t __s1 = __p1; \
42588 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_lane_bf16(__builtin_bit_cast(int8x8_t, __s0), __builtin_bit_cast(int8x8_t, __s1), __p2, 43)); \
42589 __ret; \
42590})
42591#else
42592#define vluti2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
42593 bfloat16x8_t __ret; \
42594 bfloat16x4_t __s0 = __p0; \
42595 uint8x8_t __s1 = __p1; \
42596 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
42597 uint8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
42598 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_lane_bf16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __p2, 43)); \
42599 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
42600 __ret; \
42601})
42602#endif
42603
42394#ifdef __LITTLE_ENDIAN__42604#ifdef __LITTLE_ENDIAN__
42395#define vluti2_lane_p16(__p0, __p1, __p2) __extension__ ({ \42605#define vluti2_lane_p16(__p0, __p1, __p2) __extension__ ({ \
42396 poly16x8_t __ret; \42606 poly16x8_t __ret; \
...@@ -42559,6 +42769,48 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa...@@ -42559,6 +42769,48 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa
42559})42769})
42560#endif42770#endif
4256142771
42772#ifdef __LITTLE_ENDIAN__
42773#define vluti2q_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
42774 bfloat16x8_t __ret; \
42775 bfloat16x8_t __s0 = __p0; \
42776 uint8x16_t __s1 = __p1; \
42777 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_laneq_bf16(__builtin_bit_cast(int8x16_t, __s0), __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
42778 __ret; \
42779})
42780#else
42781#define vluti2q_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
42782 bfloat16x8_t __ret; \
42783 bfloat16x8_t __s0 = __p0; \
42784 uint8x16_t __s1 = __p1; \
42785 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
42786 uint8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
42787 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_laneq_bf16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
42788 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
42789 __ret; \
42790})
42791#endif
42792
42793#ifdef __LITTLE_ENDIAN__
42794#define vluti2_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
42795 bfloat16x8_t __ret; \
42796 bfloat16x4_t __s0 = __p0; \
42797 uint8x16_t __s1 = __p1; \
42798 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_laneq_bf16(__builtin_bit_cast(int8x8_t, __s0), __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
42799 __ret; \
42800})
42801#else
42802#define vluti2_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
42803 bfloat16x8_t __ret; \
42804 bfloat16x4_t __s0 = __p0; \
42805 uint8x16_t __s1 = __p1; \
42806 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
42807 uint8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
42808 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_laneq_bf16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
42809 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
42810 __ret; \
42811})
42812#endif
42813
42562#ifdef __LITTLE_ENDIAN__42814#ifdef __LITTLE_ENDIAN__
42563#define vluti2_laneq_p8(__p0, __p1, __p2) __extension__ ({ \42815#define vluti2_laneq_p8(__p0, __p1, __p2) __extension__ ({ \
42564 poly8x16_t __ret; \42816 poly8x16_t __ret; \
...@@ -42979,6 +43231,29 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa...@@ -42979,6 +43231,29 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa
42979})43231})
42980#endif43232#endif
4298143233
43234#ifdef __LITTLE_ENDIAN__
43235#define vluti4q_lane_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43236 bfloat16x8_t __ret; \
43237 bfloat16x8x2_t __s0 = __p0; \
43238 uint8x8_t __s1 = __p1; \
43239 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_lane_bf16_x2(__builtin_bit_cast(int8x16_t, __s0.val[0]), __builtin_bit_cast(int8x16_t, __s0.val[1]), __builtin_bit_cast(int8x8_t, __s1), __p2, 43)); \
43240 __ret; \
43241})
43242#else
43243#define vluti4q_lane_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43244 bfloat16x8_t __ret; \
43245 bfloat16x8x2_t __s0 = __p0; \
43246 uint8x8_t __s1 = __p1; \
43247 bfloat16x8x2_t __rev0; \
43248 __rev0.val[0] = __builtin_shufflevector(__s0.val[0], __s0.val[0], __lane_reverse_128_16); \
43249 __rev0.val[1] = __builtin_shufflevector(__s0.val[1], __s0.val[1], __lane_reverse_128_16); \
43250 uint8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
43251 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_lane_bf16_x2(__builtin_bit_cast(int8x16_t, __rev0.val[0]), __builtin_bit_cast(int8x16_t, __rev0.val[1]), __builtin_bit_cast(int8x8_t, __rev1), __p2, 43)); \
43252 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43253 __ret; \
43254})
43255#endif
43256
42982#ifdef __LITTLE_ENDIAN__43257#ifdef __LITTLE_ENDIAN__
42983#define vluti4q_lane_p16_x2(__p0, __p1, __p2) __extension__ ({ \43258#define vluti4q_lane_p16_x2(__p0, __p1, __p2) __extension__ ({ \
42984 poly16x8_t __ret; \43259 poly16x8_t __ret; \
...@@ -43155,6 +43430,29 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa...@@ -43155,6 +43430,29 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa
43155})43430})
43156#endif43431#endif
4315743432
43433#ifdef __LITTLE_ENDIAN__
43434#define vluti4q_laneq_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43435 bfloat16x8_t __ret; \
43436 bfloat16x8x2_t __s0 = __p0; \
43437 uint8x16_t __s1 = __p1; \
43438 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_laneq_bf16_x2(__builtin_bit_cast(int8x16_t, __s0.val[0]), __builtin_bit_cast(int8x16_t, __s0.val[1]), __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
43439 __ret; \
43440})
43441#else
43442#define vluti4q_laneq_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43443 bfloat16x8_t __ret; \
43444 bfloat16x8x2_t __s0 = __p0; \
43445 uint8x16_t __s1 = __p1; \
43446 bfloat16x8x2_t __rev0; \
43447 __rev0.val[0] = __builtin_shufflevector(__s0.val[0], __s0.val[0], __lane_reverse_128_16); \
43448 __rev0.val[1] = __builtin_shufflevector(__s0.val[1], __s0.val[1], __lane_reverse_128_16); \
43449 uint8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
43450 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_laneq_bf16_x2(__builtin_bit_cast(int8x16_t, __rev0.val[0]), __builtin_bit_cast(int8x16_t, __rev0.val[1]), __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
43451 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43452 __ret; \
43453})
43454#endif
43455
43158#ifdef __LITTLE_ENDIAN__43456#ifdef __LITTLE_ENDIAN__
43159#define vluti4q_laneq_p16_x2(__p0, __p1, __p2) __extension__ ({ \43457#define vluti4q_laneq_p16_x2(__p0, __p1, __p2) __extension__ ({ \
43160 poly16x8_t __ret; \43458 poly16x8_t __ret; \
...@@ -43247,136 +43545,6 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa...@@ -43247,136 +43545,6 @@ __ai __attribute__((target("fp8fma,neon"))) float16x8_t vmlaltq_f16_mf8_fpm(floa
43247})43545})
43248#endif43546#endif
4324943547
43250#ifdef __LITTLE_ENDIAN__
43251#define vluti2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
43252 bfloat16x8_t __ret; \
43253 bfloat16x8_t __s0 = __p0; \
43254 uint8x8_t __s1 = __p1; \
43255 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_lane_bf16(__builtin_bit_cast(int8x16_t, __s0), __builtin_bit_cast(int8x8_t, __s1), __p2, 43)); \
43256 __ret; \
43257})
43258#else
43259#define vluti2q_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
43260 bfloat16x8_t __ret; \
43261 bfloat16x8_t __s0 = __p0; \
43262 uint8x8_t __s1 = __p1; \
43263 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
43264 uint8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
43265 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_lane_bf16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __p2, 43)); \
43266 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43267 __ret; \
43268})
43269#endif
43270
43271#ifdef __LITTLE_ENDIAN__
43272#define vluti2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
43273 bfloat16x8_t __ret; \
43274 bfloat16x4_t __s0 = __p0; \
43275 uint8x8_t __s1 = __p1; \
43276 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_lane_bf16(__builtin_bit_cast(int8x8_t, __s0), __builtin_bit_cast(int8x8_t, __s1), __p2, 43)); \
43277 __ret; \
43278})
43279#else
43280#define vluti2_lane_bf16(__p0, __p1, __p2) __extension__ ({ \
43281 bfloat16x8_t __ret; \
43282 bfloat16x4_t __s0 = __p0; \
43283 uint8x8_t __s1 = __p1; \
43284 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
43285 uint8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
43286 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_lane_bf16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), __p2, 43)); \
43287 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43288 __ret; \
43289})
43290#endif
43291
43292#ifdef __LITTLE_ENDIAN__
43293#define vluti2q_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
43294 bfloat16x8_t __ret; \
43295 bfloat16x8_t __s0 = __p0; \
43296 uint8x16_t __s1 = __p1; \
43297 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_laneq_bf16(__builtin_bit_cast(int8x16_t, __s0), __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
43298 __ret; \
43299})
43300#else
43301#define vluti2q_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
43302 bfloat16x8_t __ret; \
43303 bfloat16x8_t __s0 = __p0; \
43304 uint8x16_t __s1 = __p1; \
43305 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
43306 uint8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
43307 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2q_laneq_bf16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
43308 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43309 __ret; \
43310})
43311#endif
43312
43313#ifdef __LITTLE_ENDIAN__
43314#define vluti2_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
43315 bfloat16x8_t __ret; \
43316 bfloat16x4_t __s0 = __p0; \
43317 uint8x16_t __s1 = __p1; \
43318 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_laneq_bf16(__builtin_bit_cast(int8x8_t, __s0), __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
43319 __ret; \
43320})
43321#else
43322#define vluti2_laneq_bf16(__p0, __p1, __p2) __extension__ ({ \
43323 bfloat16x8_t __ret; \
43324 bfloat16x4_t __s0 = __p0; \
43325 uint8x16_t __s1 = __p1; \
43326 bfloat16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
43327 uint8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
43328 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti2_laneq_bf16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
43329 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43330 __ret; \
43331})
43332#endif
43333
43334#ifdef __LITTLE_ENDIAN__
43335#define vluti4q_lane_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43336 bfloat16x8_t __ret; \
43337 bfloat16x8x2_t __s0 = __p0; \
43338 uint8x8_t __s1 = __p1; \
43339 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_lane_bf16_x2(__builtin_bit_cast(int8x16_t, __s0.val[0]), __builtin_bit_cast(int8x16_t, __s0.val[1]), __builtin_bit_cast(int8x8_t, __s1), __p2, 43)); \
43340 __ret; \
43341})
43342#else
43343#define vluti4q_lane_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43344 bfloat16x8_t __ret; \
43345 bfloat16x8x2_t __s0 = __p0; \
43346 uint8x8_t __s1 = __p1; \
43347 bfloat16x8x2_t __rev0; \
43348 __rev0.val[0] = __builtin_shufflevector(__s0.val[0], __s0.val[0], __lane_reverse_128_16); \
43349 __rev0.val[1] = __builtin_shufflevector(__s0.val[1], __s0.val[1], __lane_reverse_128_16); \
43350 uint8x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_8); \
43351 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_lane_bf16_x2(__builtin_bit_cast(int8x16_t, __rev0.val[0]), __builtin_bit_cast(int8x16_t, __rev0.val[1]), __builtin_bit_cast(int8x8_t, __rev1), __p2, 43)); \
43352 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43353 __ret; \
43354})
43355#endif
43356
43357#ifdef __LITTLE_ENDIAN__
43358#define vluti4q_laneq_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43359 bfloat16x8_t __ret; \
43360 bfloat16x8x2_t __s0 = __p0; \
43361 uint8x16_t __s1 = __p1; \
43362 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_laneq_bf16_x2(__builtin_bit_cast(int8x16_t, __s0.val[0]), __builtin_bit_cast(int8x16_t, __s0.val[1]), __builtin_bit_cast(int8x16_t, __s1), __p2, 43)); \
43363 __ret; \
43364})
43365#else
43366#define vluti4q_laneq_bf16_x2(__p0, __p1, __p2) __extension__ ({ \
43367 bfloat16x8_t __ret; \
43368 bfloat16x8x2_t __s0 = __p0; \
43369 uint8x16_t __s1 = __p1; \
43370 bfloat16x8x2_t __rev0; \
43371 __rev0.val[0] = __builtin_shufflevector(__s0.val[0], __s0.val[0], __lane_reverse_128_16); \
43372 __rev0.val[1] = __builtin_shufflevector(__s0.val[1], __s0.val[1], __lane_reverse_128_16); \
43373 uint8x16_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_8); \
43374 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vluti4q_laneq_bf16_x2(__builtin_bit_cast(int8x16_t, __rev0.val[0]), __builtin_bit_cast(int8x16_t, __rev0.val[1]), __builtin_bit_cast(int8x16_t, __rev1), __p2, 43)); \
43375 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
43376 __ret; \
43377})
43378#endif
43379
43380#ifdef __LITTLE_ENDIAN__43548#ifdef __LITTLE_ENDIAN__
43381#define splatq_lane_mf8(__p0, __p1) __extension__ ({ \43549#define splatq_lane_mf8(__p0, __p1) __extension__ ({ \
43382 mfloat8x16_t __ret; \43550 mfloat8x16_t __ret; \
...@@ -44171,698 +44339,324 @@ __ai __attribute__((target("neon"))) mfloat8x8x2_t vzip_mf8(mfloat8x8_t __p0, mf...@@ -44171,698 +44339,324 @@ __ai __attribute__((target("neon"))) mfloat8x8x2_t vzip_mf8(mfloat8x8_t __p0, mf
44171#endif44339#endif
4417244340
44173#ifdef __LITTLE_ENDIAN__44341#ifdef __LITTLE_ENDIAN__
44174__ai __attribute__((target("neon,faminmax"))) float64x2_t vamaxq_f64(float64x2_t __p0, float64x2_t __p1) {44342__ai __attribute__((target("neon,faminmax"))) float64x2_t vamaxq_f64(float64x2_t __p0, float64x2_t __p1) {
44175 float64x2_t __ret;44343 float64x2_t __ret;
44176 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vamaxq_f64(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 42));44344 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vamaxq_f64(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 42));
44177 return __ret;
44178}
44179#else
44180__ai __attribute__((target("neon,faminmax"))) float64x2_t vamaxq_f64(float64x2_t __p0, float64x2_t __p1) {
44181 float64x2_t __ret;
44182 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_64);
44183 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_64);
44184 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vamaxq_f64(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 42));
44185 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_64);
44186 return __ret;
44187}
44188#endif
44189
44190#ifdef __LITTLE_ENDIAN__
44191__ai __attribute__((target("neon,faminmax"))) float32x4_t vamaxq_f32(float32x4_t __p0, float32x4_t __p1) {
44192 float32x4_t __ret;
44193 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vamaxq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 41));
44194 return __ret;
44195}
44196#else
44197__ai __attribute__((target("neon,faminmax"))) float32x4_t vamaxq_f32(float32x4_t __p0, float32x4_t __p1) {
44198 float32x4_t __ret;
44199 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44200 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_32);
44201 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vamaxq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 41));
44202 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
44203 return __ret;
44204}
44205#endif
44206
44207#ifdef __LITTLE_ENDIAN__
44208__ai __attribute__((target("neon,faminmax"))) float16x8_t vamaxq_f16(float16x8_t __p0, float16x8_t __p1) {
44209 float16x8_t __ret;
44210 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vamaxq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
44211 return __ret;
44212}
44213#else
44214__ai __attribute__((target("neon,faminmax"))) float16x8_t vamaxq_f16(float16x8_t __p0, float16x8_t __p1) {
44215 float16x8_t __ret;
44216 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
44217 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
44218 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vamaxq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 40));
44219 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44220 return __ret;
44221}
44222#endif
44223
44224#ifdef __LITTLE_ENDIAN__
44225__ai __attribute__((target("neon,faminmax"))) float32x2_t vamax_f32(float32x2_t __p0, float32x2_t __p1) {
44226 float32x2_t __ret;
44227 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamax_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 9));
44228 return __ret;
44229}
44230#else
44231__ai __attribute__((target("neon,faminmax"))) float32x2_t vamax_f32(float32x2_t __p0, float32x2_t __p1) {
44232 float32x2_t __ret;
44233 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
44234 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_32);
44235 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamax_f32(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 9));
44236 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
44237 return __ret;
44238}
44239#endif
44240
44241#ifdef __LITTLE_ENDIAN__
44242__ai __attribute__((target("neon,faminmax"))) float16x4_t vamax_f16(float16x4_t __p0, float16x4_t __p1) {
44243 float16x4_t __ret;
44244 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamax_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
44245 return __ret;
44246}
44247#else
44248__ai __attribute__((target("neon,faminmax"))) float16x4_t vamax_f16(float16x4_t __p0, float16x4_t __p1) {
44249 float16x4_t __ret;
44250 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
44251 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
44252 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamax_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 8));
44253 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
44254 return __ret;
44255}
44256#endif
44257
44258#ifdef __LITTLE_ENDIAN__
44259__ai __attribute__((target("neon,faminmax"))) float64x2_t vaminq_f64(float64x2_t __p0, float64x2_t __p1) {
44260 float64x2_t __ret;
44261 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vaminq_f64(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 42));
44262 return __ret;
44263}
44264#else
44265__ai __attribute__((target("neon,faminmax"))) float64x2_t vaminq_f64(float64x2_t __p0, float64x2_t __p1) {
44266 float64x2_t __ret;
44267 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_64);
44268 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_64);
44269 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vaminq_f64(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 42));
44270 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_64);
44271 return __ret;
44272}
44273#endif
44274
44275#ifdef __LITTLE_ENDIAN__
44276__ai __attribute__((target("neon,faminmax"))) float32x4_t vaminq_f32(float32x4_t __p0, float32x4_t __p1) {
44277 float32x4_t __ret;
44278 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vaminq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 41));
44279 return __ret;
44280}
44281#else
44282__ai __attribute__((target("neon,faminmax"))) float32x4_t vaminq_f32(float32x4_t __p0, float32x4_t __p1) {
44283 float32x4_t __ret;
44284 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44285 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_32);
44286 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vaminq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 41));
44287 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
44288 return __ret;
44289}
44290#endif
44291
44292#ifdef __LITTLE_ENDIAN__
44293__ai __attribute__((target("neon,faminmax"))) float16x8_t vaminq_f16(float16x8_t __p0, float16x8_t __p1) {
44294 float16x8_t __ret;
44295 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vaminq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
44296 return __ret;
44297}
44298#else
44299__ai __attribute__((target("neon,faminmax"))) float16x8_t vaminq_f16(float16x8_t __p0, float16x8_t __p1) {
44300 float16x8_t __ret;
44301 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
44302 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
44303 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vaminq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 40));
44304 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44305 return __ret;
44306}
44307#endif
44308
44309#ifdef __LITTLE_ENDIAN__
44310__ai __attribute__((target("neon,faminmax"))) float32x2_t vamin_f32(float32x2_t __p0, float32x2_t __p1) {
44311 float32x2_t __ret;
44312 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamin_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 9));
44313 return __ret;
44314}
44315#else
44316__ai __attribute__((target("neon,faminmax"))) float32x2_t vamin_f32(float32x2_t __p0, float32x2_t __p1) {
44317 float32x2_t __ret;
44318 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
44319 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_32);
44320 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamin_f32(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 9));
44321 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
44322 return __ret;
44323}
44324#endif
44325
44326#ifdef __LITTLE_ENDIAN__
44327__ai __attribute__((target("neon,faminmax"))) float16x4_t vamin_f16(float16x4_t __p0, float16x4_t __p1) {
44328 float16x4_t __ret;
44329 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamin_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
44330 return __ret;
44331}
44332#else
44333__ai __attribute__((target("neon,faminmax"))) float16x4_t vamin_f16(float16x4_t __p0, float16x4_t __p1) {
44334 float16x4_t __ret;
44335 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
44336 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
44337 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamin_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 8));
44338 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
44339 return __ret;
44340}
44341#endif
44342
44343#endif
44344#if defined(__aarch64__) || defined(__arm64ec__)
44345__ai __attribute__((target("aes,neon"))) poly128_t vmull_p64(poly64_t __p0, poly64_t __p1) {
44346 poly128_t __ret;
44347 __ret = __builtin_bit_cast(poly128_t, __builtin_neon_vmull_p64(__p0, __p1));
44348 return __ret;
44349}
44350#ifdef __LITTLE_ENDIAN__
44351#define vcopyq_lane_bf16(__p0_234, __p1_234, __p2_234, __p3_234) __extension__ ({ \
44352 bfloat16x8_t __ret_234; \
44353 bfloat16x8_t __s0_234 = __p0_234; \
44354 bfloat16x4_t __s2_234 = __p2_234; \
44355 __ret_234 = vsetq_lane_bf16(vget_lane_bf16(__s2_234, __p3_234), __s0_234, __p1_234); \
44356 __ret_234; \
44357})
44358#else
44359#define vcopyq_lane_bf16(__p0_235, __p1_235, __p2_235, __p3_235) __extension__ ({ \
44360 bfloat16x8_t __ret_235; \
44361 bfloat16x8_t __s0_235 = __p0_235; \
44362 bfloat16x4_t __s2_235 = __p2_235; \
44363 bfloat16x8_t __rev0_235; __rev0_235 = __builtin_shufflevector(__s0_235, __s0_235, __lane_reverse_128_16); \
44364 bfloat16x4_t __rev2_235; __rev2_235 = __builtin_shufflevector(__s2_235, __s2_235, __lane_reverse_64_16); \
44365 __ret_235 = __noswap_vsetq_lane_bf16(__noswap_vget_lane_bf16(__rev2_235, __p3_235), __rev0_235, __p1_235); \
44366 __ret_235 = __builtin_shufflevector(__ret_235, __ret_235, __lane_reverse_128_16); \
44367 __ret_235; \
44368})
44369#endif
44370
44371#ifdef __LITTLE_ENDIAN__
44372#define vcopy_lane_bf16(__p0_236, __p1_236, __p2_236, __p3_236) __extension__ ({ \
44373 bfloat16x4_t __ret_236; \
44374 bfloat16x4_t __s0_236 = __p0_236; \
44375 bfloat16x4_t __s2_236 = __p2_236; \
44376 __ret_236 = vset_lane_bf16(vget_lane_bf16(__s2_236, __p3_236), __s0_236, __p1_236); \
44377 __ret_236; \
44378})
44379#else
44380#define vcopy_lane_bf16(__p0_237, __p1_237, __p2_237, __p3_237) __extension__ ({ \
44381 bfloat16x4_t __ret_237; \
44382 bfloat16x4_t __s0_237 = __p0_237; \
44383 bfloat16x4_t __s2_237 = __p2_237; \
44384 bfloat16x4_t __rev0_237; __rev0_237 = __builtin_shufflevector(__s0_237, __s0_237, __lane_reverse_64_16); \
44385 bfloat16x4_t __rev2_237; __rev2_237 = __builtin_shufflevector(__s2_237, __s2_237, __lane_reverse_64_16); \
44386 __ret_237 = __noswap_vset_lane_bf16(__noswap_vget_lane_bf16(__rev2_237, __p3_237), __rev0_237, __p1_237); \
44387 __ret_237 = __builtin_shufflevector(__ret_237, __ret_237, __lane_reverse_64_16); \
44388 __ret_237; \
44389})
44390#endif
44391
44392#ifdef __LITTLE_ENDIAN__
44393#define vcopyq_laneq_bf16(__p0_238, __p1_238, __p2_238, __p3_238) __extension__ ({ \
44394 bfloat16x8_t __ret_238; \
44395 bfloat16x8_t __s0_238 = __p0_238; \
44396 bfloat16x8_t __s2_238 = __p2_238; \
44397 __ret_238 = vsetq_lane_bf16(vgetq_lane_bf16(__s2_238, __p3_238), __s0_238, __p1_238); \
44398 __ret_238; \
44399})
44400#else
44401#define vcopyq_laneq_bf16(__p0_239, __p1_239, __p2_239, __p3_239) __extension__ ({ \
44402 bfloat16x8_t __ret_239; \
44403 bfloat16x8_t __s0_239 = __p0_239; \
44404 bfloat16x8_t __s2_239 = __p2_239; \
44405 bfloat16x8_t __rev0_239; __rev0_239 = __builtin_shufflevector(__s0_239, __s0_239, __lane_reverse_128_16); \
44406 bfloat16x8_t __rev2_239; __rev2_239 = __builtin_shufflevector(__s2_239, __s2_239, __lane_reverse_128_16); \
44407 __ret_239 = __noswap_vsetq_lane_bf16(__noswap_vgetq_lane_bf16(__rev2_239, __p3_239), __rev0_239, __p1_239); \
44408 __ret_239 = __builtin_shufflevector(__ret_239, __ret_239, __lane_reverse_128_16); \
44409 __ret_239; \
44410})
44411#endif
44412
44413#ifdef __LITTLE_ENDIAN__
44414#define vcopy_laneq_bf16(__p0_240, __p1_240, __p2_240, __p3_240) __extension__ ({ \
44415 bfloat16x4_t __ret_240; \
44416 bfloat16x4_t __s0_240 = __p0_240; \
44417 bfloat16x8_t __s2_240 = __p2_240; \
44418 __ret_240 = vset_lane_bf16(vgetq_lane_bf16(__s2_240, __p3_240), __s0_240, __p1_240); \
44419 __ret_240; \
44420})
44421#else
44422#define vcopy_laneq_bf16(__p0_241, __p1_241, __p2_241, __p3_241) __extension__ ({ \
44423 bfloat16x4_t __ret_241; \
44424 bfloat16x4_t __s0_241 = __p0_241; \
44425 bfloat16x8_t __s2_241 = __p2_241; \
44426 bfloat16x4_t __rev0_241; __rev0_241 = __builtin_shufflevector(__s0_241, __s0_241, __lane_reverse_64_16); \
44427 bfloat16x8_t __rev2_241; __rev2_241 = __builtin_shufflevector(__s2_241, __s2_241, __lane_reverse_128_16); \
44428 __ret_241 = __noswap_vset_lane_bf16(__noswap_vgetq_lane_bf16(__rev2_241, __p3_241), __rev0_241, __p1_241); \
44429 __ret_241 = __builtin_shufflevector(__ret_241, __ret_241, __lane_reverse_64_16); \
44430 __ret_241; \
44431})
44432#endif
44433
44434#ifdef __LITTLE_ENDIAN__
44435__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vcvt_bf16_f32(float32x4_t __p0) {
44436 bfloat16x4_t __ret;
44437 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vcvt_bf16_f32(__builtin_bit_cast(int8x16_t, __p0), 11));
44438 return __ret;
44439}
44440#else
44441__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vcvt_bf16_f32(float32x4_t __p0) {
44442 bfloat16x4_t __ret;
44443 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44444 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vcvt_bf16_f32(__builtin_bit_cast(int8x16_t, __rev0), 11));
44445 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
44446 return __ret;
44447}
44448#endif
44449
44450#ifdef __LITTLE_ENDIAN__
44451__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_high_bf16_f32(bfloat16x8_t __p0, float32x4_t __p1) {
44452 bfloat16x8_t __ret;
44453 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_high_bf16_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 43));
44454 return __ret;
44455}
44456#else
44457__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_high_bf16_f32(bfloat16x8_t __p0, float32x4_t __p1) {
44458 bfloat16x8_t __ret;
44459 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
44460 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_32);
44461 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_high_bf16_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 43));
44462 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44463 return __ret;
44464}
44465#endif
44466
44467#ifdef __LITTLE_ENDIAN__
44468__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_low_bf16_f32(float32x4_t __p0) {
44469 bfloat16x8_t __ret;
44470 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_low_bf16_f32(__builtin_bit_cast(int8x16_t, __p0), 43));
44471 return __ret;
44472}
44473#else
44474__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_low_bf16_f32(float32x4_t __p0) {
44475 bfloat16x8_t __ret;
44476 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44477 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_low_bf16_f32(__builtin_bit_cast(int8x16_t, __rev0), 43));
44478 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44479 return __ret;
44480}
44481#endif
44482
44483__ai __attribute__((target("bf16,neon"))) poly8x8_t vreinterpret_p8_bf16(bfloat16x4_t __p0) {
44484 poly8x8_t __ret;
44485 __ret = __builtin_bit_cast(poly8x8_t, __p0);
44486 return __ret;
44487}
44488__ai __attribute__((target("bf16,neon"))) poly64x1_t vreinterpret_p64_bf16(bfloat16x4_t __p0) {
44489 poly64x1_t __ret;
44490 __ret = __builtin_bit_cast(poly64x1_t, __p0);
44491 return __ret;
44492}
44493__ai __attribute__((target("bf16,neon"))) poly16x4_t vreinterpret_p16_bf16(bfloat16x4_t __p0) {
44494 poly16x4_t __ret;
44495 __ret = __builtin_bit_cast(poly16x4_t, __p0);
44496 return __ret;
44497}
44498__ai __attribute__((target("bf16,neon"))) poly8x16_t vreinterpretq_p8_bf16(bfloat16x8_t __p0) {
44499 poly8x16_t __ret;
44500 __ret = __builtin_bit_cast(poly8x16_t, __p0);
44501 return __ret;
44502}
44503__ai __attribute__((target("bf16,neon"))) poly128_t vreinterpretq_p128_bf16(bfloat16x8_t __p0) {
44504 poly128_t __ret;
44505 __ret = __builtin_bit_cast(poly128_t, __p0);
44506 return __ret;
44507}
44508__ai __attribute__((target("bf16,neon"))) poly64x2_t vreinterpretq_p64_bf16(bfloat16x8_t __p0) {
44509 poly64x2_t __ret;
44510 __ret = __builtin_bit_cast(poly64x2_t, __p0);
44511 return __ret;
44512}
44513__ai __attribute__((target("bf16,neon"))) poly16x8_t vreinterpretq_p16_bf16(bfloat16x8_t __p0) {
44514 poly16x8_t __ret;
44515 __ret = __builtin_bit_cast(poly16x8_t, __p0);
44516 return __ret;
44517}
44518__ai __attribute__((target("bf16,neon"))) uint8x16_t vreinterpretq_u8_bf16(bfloat16x8_t __p0) {
44519 uint8x16_t __ret;
44520 __ret = __builtin_bit_cast(uint8x16_t, __p0);
44521 return __ret;
44522}
44523__ai __attribute__((target("bf16,neon"))) uint32x4_t vreinterpretq_u32_bf16(bfloat16x8_t __p0) {
44524 uint32x4_t __ret;
44525 __ret = __builtin_bit_cast(uint32x4_t, __p0);
44526 return __ret;
44527}
44528__ai __attribute__((target("bf16,neon"))) uint64x2_t vreinterpretq_u64_bf16(bfloat16x8_t __p0) {
44529 uint64x2_t __ret;
44530 __ret = __builtin_bit_cast(uint64x2_t, __p0);
44531 return __ret;
44532}
44533__ai __attribute__((target("bf16,neon"))) uint16x8_t vreinterpretq_u16_bf16(bfloat16x8_t __p0) {
44534 uint16x8_t __ret;
44535 __ret = __builtin_bit_cast(uint16x8_t, __p0);
44536 return __ret;
44537}
44538__ai __attribute__((target("bf16,neon"))) int8x16_t vreinterpretq_s8_bf16(bfloat16x8_t __p0) {
44539 int8x16_t __ret;
44540 __ret = __builtin_bit_cast(int8x16_t, __p0);
44541 return __ret;
44542}
44543__ai __attribute__((target("bf16,neon"))) float64x2_t vreinterpretq_f64_bf16(bfloat16x8_t __p0) {
44544 float64x2_t __ret;
44545 __ret = __builtin_bit_cast(float64x2_t, __p0);
44546 return __ret;
44547}
44548__ai __attribute__((target("bf16,neon"))) float32x4_t vreinterpretq_f32_bf16(bfloat16x8_t __p0) {
44549 float32x4_t __ret;
44550 __ret = __builtin_bit_cast(float32x4_t, __p0);
44551 return __ret;
44552}
44553__ai __attribute__((target("bf16,neon"))) float16x8_t vreinterpretq_f16_bf16(bfloat16x8_t __p0) {
44554 float16x8_t __ret;
44555 __ret = __builtin_bit_cast(float16x8_t, __p0);
44556 return __ret;
44557}
44558__ai __attribute__((target("bf16,neon"))) int32x4_t vreinterpretq_s32_bf16(bfloat16x8_t __p0) {
44559 int32x4_t __ret;
44560 __ret = __builtin_bit_cast(int32x4_t, __p0);
44561 return __ret;
44562}
44563__ai __attribute__((target("bf16,neon"))) int64x2_t vreinterpretq_s64_bf16(bfloat16x8_t __p0) {
44564 int64x2_t __ret;
44565 __ret = __builtin_bit_cast(int64x2_t, __p0);
44566 return __ret;
44567}
44568__ai __attribute__((target("bf16,neon"))) int16x8_t vreinterpretq_s16_bf16(bfloat16x8_t __p0) {
44569 int16x8_t __ret;
44570 __ret = __builtin_bit_cast(int16x8_t, __p0);
44571 return __ret;
44572}
44573__ai __attribute__((target("bf16,neon"))) uint8x8_t vreinterpret_u8_bf16(bfloat16x4_t __p0) {
44574 uint8x8_t __ret;
44575 __ret = __builtin_bit_cast(uint8x8_t, __p0);
44576 return __ret;
44577}
44578__ai __attribute__((target("bf16,neon"))) uint32x2_t vreinterpret_u32_bf16(bfloat16x4_t __p0) {
44579 uint32x2_t __ret;
44580 __ret = __builtin_bit_cast(uint32x2_t, __p0);
44581 return __ret;
44582}
44583__ai __attribute__((target("bf16,neon"))) uint64x1_t vreinterpret_u64_bf16(bfloat16x4_t __p0) {
44584 uint64x1_t __ret;
44585 __ret = __builtin_bit_cast(uint64x1_t, __p0);
44586 return __ret;
44587}
44588__ai __attribute__((target("bf16,neon"))) uint16x4_t vreinterpret_u16_bf16(bfloat16x4_t __p0) {
44589 uint16x4_t __ret;
44590 __ret = __builtin_bit_cast(uint16x4_t, __p0);
44591 return __ret;
44592}
44593__ai __attribute__((target("bf16,neon"))) int8x8_t vreinterpret_s8_bf16(bfloat16x4_t __p0) {
44594 int8x8_t __ret;
44595 __ret = __builtin_bit_cast(int8x8_t, __p0);
44596 return __ret;
44597}
44598__ai __attribute__((target("bf16,neon"))) float64x1_t vreinterpret_f64_bf16(bfloat16x4_t __p0) {
44599 float64x1_t __ret;
44600 __ret = __builtin_bit_cast(float64x1_t, __p0);
44601 return __ret;
44602}
44603__ai __attribute__((target("bf16,neon"))) float32x2_t vreinterpret_f32_bf16(bfloat16x4_t __p0) {
44604 float32x2_t __ret;
44605 __ret = __builtin_bit_cast(float32x2_t, __p0);
44606 return __ret;
44607}
44608__ai __attribute__((target("bf16,neon"))) float16x4_t vreinterpret_f16_bf16(bfloat16x4_t __p0) {
44609 float16x4_t __ret;
44610 __ret = __builtin_bit_cast(float16x4_t, __p0);
44611 return __ret;
44612}
44613__ai __attribute__((target("bf16,neon"))) int32x2_t vreinterpret_s32_bf16(bfloat16x4_t __p0) {
44614 int32x2_t __ret;
44615 __ret = __builtin_bit_cast(int32x2_t, __p0);
44616 return __ret;
44617}
44618__ai __attribute__((target("bf16,neon"))) int64x1_t vreinterpret_s64_bf16(bfloat16x4_t __p0) {
44619 int64x1_t __ret;
44620 __ret = __builtin_bit_cast(int64x1_t, __p0);
44621 return __ret;
44622}
44623__ai __attribute__((target("bf16,neon"))) int16x4_t vreinterpret_s16_bf16(bfloat16x4_t __p0) {
44624 int16x4_t __ret;
44625 __ret = __builtin_bit_cast(int16x4_t, __p0);
44626 return __ret;
44627}
44628__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p8(poly8x16_t __p0) {
44629 bfloat16x8_t __ret;
44630 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
44631 return __ret;
44632}
44633__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p128(poly128_t __p0) {
44634 bfloat16x8_t __ret;
44635 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
44636 return __ret;
44637}
44638__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p64(poly64x2_t __p0) {
44639 bfloat16x8_t __ret;
44640 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
44641 return __ret;44345 return __ret;
44642}44346}
44643__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_p16(poly16x8_t __p0) {44347#else
44644 bfloat16x8_t __ret;44348__ai __attribute__((target("neon,faminmax"))) float64x2_t vamaxq_f64(float64x2_t __p0, float64x2_t __p1) {
44645 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44349 float64x2_t __ret;
44350 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_64);
44351 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_64);
44352 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vamaxq_f64(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 42));
44353 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_64);
44646 return __ret;44354 return __ret;
44647}44355}
44648__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u8(uint8x16_t __p0) {44356#endif
44649 bfloat16x8_t __ret;44357
44650 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44358#ifdef __LITTLE_ENDIAN__
44359__ai __attribute__((target("neon,faminmax"))) float32x4_t vamaxq_f32(float32x4_t __p0, float32x4_t __p1) {
44360 float32x4_t __ret;
44361 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vamaxq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 41));
44651 return __ret;44362 return __ret;
44652}44363}
44653__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u32(uint32x4_t __p0) {44364#else
44654 bfloat16x8_t __ret;44365__ai __attribute__((target("neon,faminmax"))) float32x4_t vamaxq_f32(float32x4_t __p0, float32x4_t __p1) {
44655 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44366 float32x4_t __ret;
44367 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44368 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_32);
44369 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vamaxq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 41));
44370 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
44656 return __ret;44371 return __ret;
44657}44372}
44658__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u64(uint64x2_t __p0) {44373#endif
44659 bfloat16x8_t __ret;44374
44660 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44375#ifdef __LITTLE_ENDIAN__
44376__ai __attribute__((target("neon,faminmax"))) float16x8_t vamaxq_f16(float16x8_t __p0, float16x8_t __p1) {
44377 float16x8_t __ret;
44378 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vamaxq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
44661 return __ret;44379 return __ret;
44662}44380}
44663__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_u16(uint16x8_t __p0) {44381#else
44664 bfloat16x8_t __ret;44382__ai __attribute__((target("neon,faminmax"))) float16x8_t vamaxq_f16(float16x8_t __p0, float16x8_t __p1) {
44665 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44383 float16x8_t __ret;
44384 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
44385 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
44386 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vamaxq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 40));
44387 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44666 return __ret;44388 return __ret;
44667}44389}
44668__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s8(int8x16_t __p0) {44390#endif
44669 bfloat16x8_t __ret;44391
44670 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44392#ifdef __LITTLE_ENDIAN__
44393__ai __attribute__((target("neon,faminmax"))) float32x2_t vamax_f32(float32x2_t __p0, float32x2_t __p1) {
44394 float32x2_t __ret;
44395 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamax_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 9));
44671 return __ret;44396 return __ret;
44672}44397}
44673__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_f64(float64x2_t __p0) {44398#else
44674 bfloat16x8_t __ret;44399__ai __attribute__((target("neon,faminmax"))) float32x2_t vamax_f32(float32x2_t __p0, float32x2_t __p1) {
44675 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44400 float32x2_t __ret;
44401 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
44402 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_32);
44403 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamax_f32(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 9));
44404 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
44676 return __ret;44405 return __ret;
44677}44406}
44678__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_f32(float32x4_t __p0) {44407#endif
44679 bfloat16x8_t __ret;44408
44680 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44409#ifdef __LITTLE_ENDIAN__
44410__ai __attribute__((target("neon,faminmax"))) float16x4_t vamax_f16(float16x4_t __p0, float16x4_t __p1) {
44411 float16x4_t __ret;
44412 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamax_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
44681 return __ret;44413 return __ret;
44682}44414}
44683__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_f16(float16x8_t __p0) {44415#else
44684 bfloat16x8_t __ret;44416__ai __attribute__((target("neon,faminmax"))) float16x4_t vamax_f16(float16x4_t __p0, float16x4_t __p1) {
44685 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44417 float16x4_t __ret;
44418 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
44419 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
44420 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamax_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 8));
44421 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
44686 return __ret;44422 return __ret;
44687}44423}
44688__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s32(int32x4_t __p0) {44424#endif
44689 bfloat16x8_t __ret;44425
44690 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44426#ifdef __LITTLE_ENDIAN__
44427__ai __attribute__((target("neon,faminmax"))) float64x2_t vaminq_f64(float64x2_t __p0, float64x2_t __p1) {
44428 float64x2_t __ret;
44429 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vaminq_f64(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 42));
44691 return __ret;44430 return __ret;
44692}44431}
44693__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s64(int64x2_t __p0) {44432#else
44694 bfloat16x8_t __ret;44433__ai __attribute__((target("neon,faminmax"))) float64x2_t vaminq_f64(float64x2_t __p0, float64x2_t __p1) {
44695 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44434 float64x2_t __ret;
44435 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_64);
44436 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_64);
44437 __ret = __builtin_bit_cast(float64x2_t, __builtin_neon_vaminq_f64(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 42));
44438 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_64);
44696 return __ret;44439 return __ret;
44697}44440}
44698__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vreinterpretq_bf16_s16(int16x8_t __p0) {44441#endif
44699 bfloat16x8_t __ret;44442
44700 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);44443#ifdef __LITTLE_ENDIAN__
44444__ai __attribute__((target("neon,faminmax"))) float32x4_t vaminq_f32(float32x4_t __p0, float32x4_t __p1) {
44445 float32x4_t __ret;
44446 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vaminq_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 41));
44701 return __ret;44447 return __ret;
44702}44448}
44703__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_p8(poly8x8_t __p0) {44449#else
44704 bfloat16x4_t __ret;44450__ai __attribute__((target("neon,faminmax"))) float32x4_t vaminq_f32(float32x4_t __p0, float32x4_t __p1) {
44705 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44451 float32x4_t __ret;
44452 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44453 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_32);
44454 __ret = __builtin_bit_cast(float32x4_t, __builtin_neon_vaminq_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 41));
44455 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_32);
44706 return __ret;44456 return __ret;
44707}44457}
44708__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_p64(poly64x1_t __p0) {44458#endif
44709 bfloat16x4_t __ret;44459
44710 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44460#ifdef __LITTLE_ENDIAN__
44461__ai __attribute__((target("neon,faminmax"))) float16x8_t vaminq_f16(float16x8_t __p0, float16x8_t __p1) {
44462 float16x8_t __ret;
44463 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vaminq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
44711 return __ret;44464 return __ret;
44712}44465}
44713__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_p16(poly16x4_t __p0) {44466#else
44714 bfloat16x4_t __ret;44467__ai __attribute__((target("neon,faminmax"))) float16x8_t vaminq_f16(float16x8_t __p0, float16x8_t __p1) {
44715 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44468 float16x8_t __ret;
44469 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
44470 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
44471 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vaminq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 40));
44472 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44716 return __ret;44473 return __ret;
44717}44474}
44718__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u8(uint8x8_t __p0) {44475#endif
44719 bfloat16x4_t __ret;44476
44720 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44477#ifdef __LITTLE_ENDIAN__
44478__ai __attribute__((target("neon,faminmax"))) float32x2_t vamin_f32(float32x2_t __p0, float32x2_t __p1) {
44479 float32x2_t __ret;
44480 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamin_f32(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 9));
44721 return __ret;44481 return __ret;
44722}44482}
44723__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u32(uint32x2_t __p0) {44483#else
44724 bfloat16x4_t __ret;44484__ai __attribute__((target("neon,faminmax"))) float32x2_t vamin_f32(float32x2_t __p0, float32x2_t __p1) {
44725 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44485 float32x2_t __ret;
44486 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_32);
44487 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_32);
44488 __ret = __builtin_bit_cast(float32x2_t, __builtin_neon_vamin_f32(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 9));
44489 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_32);
44726 return __ret;44490 return __ret;
44727}44491}
44728__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u64(uint64x1_t __p0) {44492#endif
44729 bfloat16x4_t __ret;44493
44730 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44494#ifdef __LITTLE_ENDIAN__
44495__ai __attribute__((target("neon,faminmax"))) float16x4_t vamin_f16(float16x4_t __p0, float16x4_t __p1) {
44496 float16x4_t __ret;
44497 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamin_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
44731 return __ret;44498 return __ret;
44732}44499}
44733__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_u16(uint16x4_t __p0) {44500#else
44734 bfloat16x4_t __ret;44501__ai __attribute__((target("neon,faminmax"))) float16x4_t vamin_f16(float16x4_t __p0, float16x4_t __p1) {
44735 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44502 float16x4_t __ret;
44503 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
44504 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
44505 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vamin_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 8));
44506 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
44736 return __ret;44507 return __ret;
44737}44508}
44738__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s8(int8x8_t __p0) {44509#endif
44739 bfloat16x4_t __ret;44510
44740 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44511#endif
44512#if defined(__aarch64__) || defined(__arm64ec__)
44513__ai __attribute__((target("aes,neon"))) poly128_t vmull_p64(poly64_t __p0, poly64_t __p1) {
44514 poly128_t __ret;
44515 __ret = __builtin_bit_cast(poly128_t, __builtin_neon_vmull_p64(__p0, __p1));
44741 return __ret;44516 return __ret;
44742}44517}
44743__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_f64(float64x1_t __p0) {44518#ifdef __LITTLE_ENDIAN__
44519__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vcvt_bf16_f32(float32x4_t __p0) {
44744 bfloat16x4_t __ret;44520 bfloat16x4_t __ret;
44745 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44521 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vcvt_bf16_f32(__builtin_bit_cast(int8x16_t, __p0), 11));
44746 return __ret;44522 return __ret;
44747}44523}
44748__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_f32(float32x2_t __p0) {44524#else
44525__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vcvt_bf16_f32(float32x4_t __p0) {
44749 bfloat16x4_t __ret;44526 bfloat16x4_t __ret;
44750 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44527 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44528 __ret = __builtin_bit_cast(bfloat16x4_t, __builtin_neon_vcvt_bf16_f32(__builtin_bit_cast(int8x16_t, __rev0), 11));
44529 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
44751 return __ret;44530 return __ret;
44752}44531}
44753__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_f16(float16x4_t __p0) {44532#endif
44754 bfloat16x4_t __ret;44533
44755 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44534#ifdef __LITTLE_ENDIAN__
44535__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_high_bf16_f32(bfloat16x8_t __p0, float32x4_t __p1) {
44536 bfloat16x8_t __ret;
44537 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_high_bf16_f32(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 43));
44756 return __ret;44538 return __ret;
44757}44539}
44758__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s32(int32x2_t __p0) {44540#else
44759 bfloat16x4_t __ret;44541__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_high_bf16_f32(bfloat16x8_t __p0, float32x4_t __p1) {
44760 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44542 bfloat16x8_t __ret;
44543 bfloat16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
44544 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_32);
44545 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_high_bf16_f32(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 43));
44546 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44761 return __ret;44547 return __ret;
44762}44548}
44763__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s64(int64x1_t __p0) {44549#endif
44764 bfloat16x4_t __ret;44550
44765 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44551#ifdef __LITTLE_ENDIAN__
44552__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_low_bf16_f32(float32x4_t __p0) {
44553 bfloat16x8_t __ret;
44554 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_low_bf16_f32(__builtin_bit_cast(int8x16_t, __p0), 43));
44766 return __ret;44555 return __ret;
44767}44556}
44768__ai __attribute__((target("bf16,neon"))) bfloat16x4_t vreinterpret_bf16_s16(int16x4_t __p0) {44557#else
44769 bfloat16x4_t __ret;44558__ai __attribute__((target("bf16,neon"))) bfloat16x8_t vcvtq_low_bf16_f32(float32x4_t __p0) {
44770 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);44559 bfloat16x8_t __ret;
44560 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_32);
44561 __ret = __builtin_bit_cast(bfloat16x8_t, __builtin_neon_vcvtq_low_bf16_f32(__builtin_bit_cast(int8x16_t, __rev0), 43));
44562 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
44771 return __ret;44563 return __ret;
44772}44564}
44565#endif
44566
44773#ifdef __LITTLE_ENDIAN__44567#ifdef __LITTLE_ENDIAN__
44774#define vdotq_laneq_u32(__p0_242, __p1_242, __p2_242, __p3_242) __extension__ ({ \44568#define vdotq_laneq_u32(__p0_234, __p1_234, __p2_234, __p3_234) __extension__ ({ \
44775 uint32x4_t __ret_242; \44569 uint32x4_t __ret_234; \
44776 uint32x4_t __s0_242 = __p0_242; \44570 uint32x4_t __s0_234 = __p0_234; \
44777 uint8x16_t __s1_242 = __p1_242; \44571 uint8x16_t __s1_234 = __p1_234; \
44778 uint8x16_t __s2_242 = __p2_242; \44572 uint8x16_t __s2_234 = __p2_234; \
44779 __ret_242 = vdotq_u32(__s0_242, __s1_242, __builtin_bit_cast(uint8x16_t, splatq_laneq_u32(__builtin_bit_cast(uint32x4_t, __s2_242), __p3_242))); \44573 __ret_234 = vdotq_u32(__s0_234, __s1_234, __builtin_bit_cast(uint8x16_t, splatq_laneq_u32(__builtin_bit_cast(uint32x4_t, __s2_234), __p3_234))); \
44780 __ret_242; \44574 __ret_234; \
44781})44575})
44782#else44576#else
44783#define vdotq_laneq_u32(__p0_243, __p1_243, __p2_243, __p3_243) __extension__ ({ \44577#define vdotq_laneq_u32(__p0_235, __p1_235, __p2_235, __p3_235) __extension__ ({ \
44784 uint32x4_t __ret_243; \44578 uint32x4_t __ret_235; \
44785 uint32x4_t __s0_243 = __p0_243; \44579 uint32x4_t __s0_235 = __p0_235; \
44786 uint8x16_t __s1_243 = __p1_243; \44580 uint8x16_t __s1_235 = __p1_235; \
44787 uint8x16_t __s2_243 = __p2_243; \44581 uint8x16_t __s2_235 = __p2_235; \
44788 uint32x4_t __rev0_243; __rev0_243 = __builtin_shufflevector(__s0_243, __s0_243, __lane_reverse_128_32); \44582 uint32x4_t __rev0_235; __rev0_235 = __builtin_shufflevector(__s0_235, __s0_235, __lane_reverse_128_32); \
44789 uint8x16_t __rev1_243; __rev1_243 = __builtin_shufflevector(__s1_243, __s1_243, __lane_reverse_128_8); \44583 uint8x16_t __rev1_235; __rev1_235 = __builtin_shufflevector(__s1_235, __s1_235, __lane_reverse_128_8); \
44790 uint8x16_t __rev2_243; __rev2_243 = __builtin_shufflevector(__s2_243, __s2_243, __lane_reverse_128_8); \44584 uint8x16_t __rev2_235; __rev2_235 = __builtin_shufflevector(__s2_235, __s2_235, __lane_reverse_128_8); \
44791 __ret_243 = __noswap_vdotq_u32(__rev0_243, __rev1_243, __builtin_bit_cast(uint8x16_t, __noswap_splatq_laneq_u32(__builtin_bit_cast(uint32x4_t, __rev2_243), __p3_243))); \44585 __ret_235 = __noswap_vdotq_u32(__rev0_235, __rev1_235, __builtin_bit_cast(uint8x16_t, __noswap_splatq_laneq_u32(__builtin_bit_cast(uint32x4_t, __rev2_235), __p3_235))); \
44792 __ret_243 = __builtin_shufflevector(__ret_243, __ret_243, __lane_reverse_128_32); \44586 __ret_235 = __builtin_shufflevector(__ret_235, __ret_235, __lane_reverse_128_32); \
44793 __ret_243; \44587 __ret_235; \
44794})44588})
44795#endif44589#endif
4479644590
44797#ifdef __LITTLE_ENDIAN__44591#ifdef __LITTLE_ENDIAN__
44798#define vdotq_laneq_s32(__p0_244, __p1_244, __p2_244, __p3_244) __extension__ ({ \44592#define vdotq_laneq_s32(__p0_236, __p1_236, __p2_236, __p3_236) __extension__ ({ \
44799 int32x4_t __ret_244; \44593 int32x4_t __ret_236; \
44800 int32x4_t __s0_244 = __p0_244; \44594 int32x4_t __s0_236 = __p0_236; \
44801 int8x16_t __s1_244 = __p1_244; \44595 int8x16_t __s1_236 = __p1_236; \
44802 int8x16_t __s2_244 = __p2_244; \44596 int8x16_t __s2_236 = __p2_236; \
44803 __ret_244 = vdotq_s32(__s0_244, __s1_244, __builtin_bit_cast(int8x16_t, splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_244), __p3_244))); \44597 __ret_236 = vdotq_s32(__s0_236, __s1_236, __builtin_bit_cast(int8x16_t, splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_236), __p3_236))); \
44804 __ret_244; \44598 __ret_236; \
44805})44599})
44806#else44600#else
44807#define vdotq_laneq_s32(__p0_245, __p1_245, __p2_245, __p3_245) __extension__ ({ \44601#define vdotq_laneq_s32(__p0_237, __p1_237, __p2_237, __p3_237) __extension__ ({ \
44808 int32x4_t __ret_245; \44602 int32x4_t __ret_237; \
44809 int32x4_t __s0_245 = __p0_245; \44603 int32x4_t __s0_237 = __p0_237; \
44810 int8x16_t __s1_245 = __p1_245; \44604 int8x16_t __s1_237 = __p1_237; \
44811 int8x16_t __s2_245 = __p2_245; \44605 int8x16_t __s2_237 = __p2_237; \
44812 int32x4_t __rev0_245; __rev0_245 = __builtin_shufflevector(__s0_245, __s0_245, __lane_reverse_128_32); \44606 int32x4_t __rev0_237; __rev0_237 = __builtin_shufflevector(__s0_237, __s0_237, __lane_reverse_128_32); \
44813 int8x16_t __rev1_245; __rev1_245 = __builtin_shufflevector(__s1_245, __s1_245, __lane_reverse_128_8); \44607 int8x16_t __rev1_237; __rev1_237 = __builtin_shufflevector(__s1_237, __s1_237, __lane_reverse_128_8); \
44814 int8x16_t __rev2_245; __rev2_245 = __builtin_shufflevector(__s2_245, __s2_245, __lane_reverse_128_8); \44608 int8x16_t __rev2_237; __rev2_237 = __builtin_shufflevector(__s2_237, __s2_237, __lane_reverse_128_8); \
44815 __ret_245 = __noswap_vdotq_s32(__rev0_245, __rev1_245, __builtin_bit_cast(int8x16_t, __noswap_splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_245), __p3_245))); \44609 __ret_237 = __noswap_vdotq_s32(__rev0_237, __rev1_237, __builtin_bit_cast(int8x16_t, __noswap_splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_237), __p3_237))); \
44816 __ret_245 = __builtin_shufflevector(__ret_245, __ret_245, __lane_reverse_128_32); \44610 __ret_237 = __builtin_shufflevector(__ret_237, __ret_237, __lane_reverse_128_32); \
44817 __ret_245; \44611 __ret_237; \
44818})44612})
44819#endif44613#endif
4482044614
44821#ifdef __LITTLE_ENDIAN__44615#ifdef __LITTLE_ENDIAN__
44822#define vdot_laneq_u32(__p0_246, __p1_246, __p2_246, __p3_246) __extension__ ({ \44616#define vdot_laneq_u32(__p0_238, __p1_238, __p2_238, __p3_238) __extension__ ({ \
44823 uint32x2_t __ret_246; \44617 uint32x2_t __ret_238; \
44824 uint32x2_t __s0_246 = __p0_246; \44618 uint32x2_t __s0_238 = __p0_238; \
44825 uint8x8_t __s1_246 = __p1_246; \44619 uint8x8_t __s1_238 = __p1_238; \
44826 uint8x16_t __s2_246 = __p2_246; \44620 uint8x16_t __s2_238 = __p2_238; \
44827 __ret_246 = vdot_u32(__s0_246, __s1_246, __builtin_bit_cast(uint8x8_t, splat_laneq_u32(__builtin_bit_cast(uint32x4_t, __s2_246), __p3_246))); \44621 __ret_238 = vdot_u32(__s0_238, __s1_238, __builtin_bit_cast(uint8x8_t, splat_laneq_u32(__builtin_bit_cast(uint32x4_t, __s2_238), __p3_238))); \
44828 __ret_246; \44622 __ret_238; \
44829})44623})
44830#else44624#else
44831#define vdot_laneq_u32(__p0_247, __p1_247, __p2_247, __p3_247) __extension__ ({ \44625#define vdot_laneq_u32(__p0_239, __p1_239, __p2_239, __p3_239) __extension__ ({ \
44832 uint32x2_t __ret_247; \44626 uint32x2_t __ret_239; \
44833 uint32x2_t __s0_247 = __p0_247; \44627 uint32x2_t __s0_239 = __p0_239; \
44834 uint8x8_t __s1_247 = __p1_247; \44628 uint8x8_t __s1_239 = __p1_239; \
44835 uint8x16_t __s2_247 = __p2_247; \44629 uint8x16_t __s2_239 = __p2_239; \
44836 uint32x2_t __rev0_247; __rev0_247 = __builtin_shufflevector(__s0_247, __s0_247, __lane_reverse_64_32); \44630 uint32x2_t __rev0_239; __rev0_239 = __builtin_shufflevector(__s0_239, __s0_239, __lane_reverse_64_32); \
44837 uint8x8_t __rev1_247; __rev1_247 = __builtin_shufflevector(__s1_247, __s1_247, __lane_reverse_64_8); \44631 uint8x8_t __rev1_239; __rev1_239 = __builtin_shufflevector(__s1_239, __s1_239, __lane_reverse_64_8); \
44838 uint8x16_t __rev2_247; __rev2_247 = __builtin_shufflevector(__s2_247, __s2_247, __lane_reverse_128_8); \44632 uint8x16_t __rev2_239; __rev2_239 = __builtin_shufflevector(__s2_239, __s2_239, __lane_reverse_128_8); \
44839 __ret_247 = __noswap_vdot_u32(__rev0_247, __rev1_247, __builtin_bit_cast(uint8x8_t, __noswap_splat_laneq_u32(__builtin_bit_cast(uint32x4_t, __rev2_247), __p3_247))); \44633 __ret_239 = __noswap_vdot_u32(__rev0_239, __rev1_239, __builtin_bit_cast(uint8x8_t, __noswap_splat_laneq_u32(__builtin_bit_cast(uint32x4_t, __rev2_239), __p3_239))); \
44840 __ret_247 = __builtin_shufflevector(__ret_247, __ret_247, __lane_reverse_64_32); \44634 __ret_239 = __builtin_shufflevector(__ret_239, __ret_239, __lane_reverse_64_32); \
44841 __ret_247; \44635 __ret_239; \
44842})44636})
44843#endif44637#endif
4484444638
44845#ifdef __LITTLE_ENDIAN__44639#ifdef __LITTLE_ENDIAN__
44846#define vdot_laneq_s32(__p0_248, __p1_248, __p2_248, __p3_248) __extension__ ({ \44640#define vdot_laneq_s32(__p0_240, __p1_240, __p2_240, __p3_240) __extension__ ({ \
44847 int32x2_t __ret_248; \44641 int32x2_t __ret_240; \
44848 int32x2_t __s0_248 = __p0_248; \44642 int32x2_t __s0_240 = __p0_240; \
44849 int8x8_t __s1_248 = __p1_248; \44643 int8x8_t __s1_240 = __p1_240; \
44850 int8x16_t __s2_248 = __p2_248; \44644 int8x16_t __s2_240 = __p2_240; \
44851 __ret_248 = vdot_s32(__s0_248, __s1_248, __builtin_bit_cast(int8x8_t, splat_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_248), __p3_248))); \44645 __ret_240 = vdot_s32(__s0_240, __s1_240, __builtin_bit_cast(int8x8_t, splat_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_240), __p3_240))); \
44852 __ret_248; \44646 __ret_240; \
44853})44647})
44854#else44648#else
44855#define vdot_laneq_s32(__p0_249, __p1_249, __p2_249, __p3_249) __extension__ ({ \44649#define vdot_laneq_s32(__p0_241, __p1_241, __p2_241, __p3_241) __extension__ ({ \
44856 int32x2_t __ret_249; \44650 int32x2_t __ret_241; \
44857 int32x2_t __s0_249 = __p0_249; \44651 int32x2_t __s0_241 = __p0_241; \
44858 int8x8_t __s1_249 = __p1_249; \44652 int8x8_t __s1_241 = __p1_241; \
44859 int8x16_t __s2_249 = __p2_249; \44653 int8x16_t __s2_241 = __p2_241; \
44860 int32x2_t __rev0_249; __rev0_249 = __builtin_shufflevector(__s0_249, __s0_249, __lane_reverse_64_32); \44654 int32x2_t __rev0_241; __rev0_241 = __builtin_shufflevector(__s0_241, __s0_241, __lane_reverse_64_32); \
44861 int8x8_t __rev1_249; __rev1_249 = __builtin_shufflevector(__s1_249, __s1_249, __lane_reverse_64_8); \44655 int8x8_t __rev1_241; __rev1_241 = __builtin_shufflevector(__s1_241, __s1_241, __lane_reverse_64_8); \
44862 int8x16_t __rev2_249; __rev2_249 = __builtin_shufflevector(__s2_249, __s2_249, __lane_reverse_128_8); \44656 int8x16_t __rev2_241; __rev2_241 = __builtin_shufflevector(__s2_241, __s2_241, __lane_reverse_128_8); \
44863 __ret_249 = __noswap_vdot_s32(__rev0_249, __rev1_249, __builtin_bit_cast(int8x8_t, __noswap_splat_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_249), __p3_249))); \44657 __ret_241 = __noswap_vdot_s32(__rev0_241, __rev1_241, __builtin_bit_cast(int8x8_t, __noswap_splat_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_241), __p3_241))); \
44864 __ret_249 = __builtin_shufflevector(__ret_249, __ret_249, __lane_reverse_64_32); \44658 __ret_241 = __builtin_shufflevector(__ret_241, __ret_241, __lane_reverse_64_32); \
44865 __ret_249; \44659 __ret_241; \
44866})44660})
44867#endif44661#endif
4486844662
...@@ -45317,533 +45111,533 @@ __ai __attribute__((target("fullfp16,neon"))) float16x4_t vdiv_f16(float16x4_t _...@@ -45317,533 +45111,533 @@ __ai __attribute__((target("fullfp16,neon"))) float16x4_t vdiv_f16(float16x4_t _
45317#endif45111#endif
4531845112
45319#ifdef __LITTLE_ENDIAN__45113#ifdef __LITTLE_ENDIAN__
45320#define vfmsh_lane_f16(__p0_250, __p1_250, __p2_250, __p3_250) __extension__ ({ \45114#define vfmsh_lane_f16(__p0_242, __p1_242, __p2_242, __p3_242) __extension__ ({ \
45321 float16_t __ret_250; \45115 float16_t __ret_242; \
45322 float16_t __s0_250 = __p0_250; \45116 float16_t __s0_242 = __p0_242; \
45323 float16_t __s1_250 = __p1_250; \45117 float16_t __s1_242 = __p1_242; \
45324 float16x4_t __s2_250 = __p2_250; \45118 float16x4_t __s2_242 = __p2_242; \
45325 __ret_250 = vfmah_lane_f16(__s0_250, -__s1_250, __s2_250, __p3_250); \45119 __ret_242 = vfmah_lane_f16(__s0_242, -__s1_242, __s2_242, __p3_242); \
45120 __ret_242; \
45121})
45122#else
45123#define vfmsh_lane_f16(__p0_243, __p1_243, __p2_243, __p3_243) __extension__ ({ \
45124 float16_t __ret_243; \
45125 float16_t __s0_243 = __p0_243; \
45126 float16_t __s1_243 = __p1_243; \
45127 float16x4_t __s2_243 = __p2_243; \
45128 float16x4_t __rev2_243; __rev2_243 = __builtin_shufflevector(__s2_243, __s2_243, __lane_reverse_64_16); \
45129 __ret_243 = __noswap_vfmah_lane_f16(__s0_243, -__s1_243, __rev2_243, __p3_243); \
45130 __ret_243; \
45131})
45132#endif
45133
45134#ifdef __LITTLE_ENDIAN__
45135#define vfmsq_lane_f16(__p0_244, __p1_244, __p2_244, __p3_244) __extension__ ({ \
45136 float16x8_t __ret_244; \
45137 float16x8_t __s0_244 = __p0_244; \
45138 float16x8_t __s1_244 = __p1_244; \
45139 float16x4_t __s2_244 = __p2_244; \
45140 __ret_244 = vfmaq_lane_f16(__s0_244, -__s1_244, __s2_244, __p3_244); \
45141 __ret_244; \
45142})
45143#else
45144#define vfmsq_lane_f16(__p0_245, __p1_245, __p2_245, __p3_245) __extension__ ({ \
45145 float16x8_t __ret_245; \
45146 float16x8_t __s0_245 = __p0_245; \
45147 float16x8_t __s1_245 = __p1_245; \
45148 float16x4_t __s2_245 = __p2_245; \
45149 float16x8_t __rev0_245; __rev0_245 = __builtin_shufflevector(__s0_245, __s0_245, __lane_reverse_128_16); \
45150 float16x8_t __rev1_245; __rev1_245 = __builtin_shufflevector(__s1_245, __s1_245, __lane_reverse_128_16); \
45151 float16x4_t __rev2_245; __rev2_245 = __builtin_shufflevector(__s2_245, __s2_245, __lane_reverse_64_16); \
45152 __ret_245 = __noswap_vfmaq_lane_f16(__rev0_245, -__rev1_245, __rev2_245, __p3_245); \
45153 __ret_245 = __builtin_shufflevector(__ret_245, __ret_245, __lane_reverse_128_16); \
45154 __ret_245; \
45155})
45156#endif
45157
45158#ifdef __LITTLE_ENDIAN__
45159#define vfms_lane_f16(__p0_246, __p1_246, __p2_246, __p3_246) __extension__ ({ \
45160 float16x4_t __ret_246; \
45161 float16x4_t __s0_246 = __p0_246; \
45162 float16x4_t __s1_246 = __p1_246; \
45163 float16x4_t __s2_246 = __p2_246; \
45164 __ret_246 = vfma_lane_f16(__s0_246, -__s1_246, __s2_246, __p3_246); \
45165 __ret_246; \
45166})
45167#else
45168#define vfms_lane_f16(__p0_247, __p1_247, __p2_247, __p3_247) __extension__ ({ \
45169 float16x4_t __ret_247; \
45170 float16x4_t __s0_247 = __p0_247; \
45171 float16x4_t __s1_247 = __p1_247; \
45172 float16x4_t __s2_247 = __p2_247; \
45173 float16x4_t __rev0_247; __rev0_247 = __builtin_shufflevector(__s0_247, __s0_247, __lane_reverse_64_16); \
45174 float16x4_t __rev1_247; __rev1_247 = __builtin_shufflevector(__s1_247, __s1_247, __lane_reverse_64_16); \
45175 float16x4_t __rev2_247; __rev2_247 = __builtin_shufflevector(__s2_247, __s2_247, __lane_reverse_64_16); \
45176 __ret_247 = __noswap_vfma_lane_f16(__rev0_247, -__rev1_247, __rev2_247, __p3_247); \
45177 __ret_247 = __builtin_shufflevector(__ret_247, __ret_247, __lane_reverse_64_16); \
45178 __ret_247; \
45179})
45180#endif
45181
45182#ifdef __LITTLE_ENDIAN__
45183#define vfmsh_laneq_f16(__p0_248, __p1_248, __p2_248, __p3_248) __extension__ ({ \
45184 float16_t __ret_248; \
45185 float16_t __s0_248 = __p0_248; \
45186 float16_t __s1_248 = __p1_248; \
45187 float16x8_t __s2_248 = __p2_248; \
45188 __ret_248 = vfmah_laneq_f16(__s0_248, -__s1_248, __s2_248, __p3_248); \
45189 __ret_248; \
45190})
45191#else
45192#define vfmsh_laneq_f16(__p0_249, __p1_249, __p2_249, __p3_249) __extension__ ({ \
45193 float16_t __ret_249; \
45194 float16_t __s0_249 = __p0_249; \
45195 float16_t __s1_249 = __p1_249; \
45196 float16x8_t __s2_249 = __p2_249; \
45197 float16x8_t __rev2_249; __rev2_249 = __builtin_shufflevector(__s2_249, __s2_249, __lane_reverse_128_16); \
45198 __ret_249 = __noswap_vfmah_laneq_f16(__s0_249, -__s1_249, __rev2_249, __p3_249); \
45199 __ret_249; \
45200})
45201#endif
45202
45203#ifdef __LITTLE_ENDIAN__
45204#define vfmsq_laneq_f16(__p0_250, __p1_250, __p2_250, __p3_250) __extension__ ({ \
45205 float16x8_t __ret_250; \
45206 float16x8_t __s0_250 = __p0_250; \
45207 float16x8_t __s1_250 = __p1_250; \
45208 float16x8_t __s2_250 = __p2_250; \
45209 __ret_250 = vfmaq_laneq_f16(__s0_250, -__s1_250, __s2_250, __p3_250); \
45326 __ret_250; \45210 __ret_250; \
45327})45211})
45328#else45212#else
45329#define vfmsh_lane_f16(__p0_251, __p1_251, __p2_251, __p3_251) __extension__ ({ \45213#define vfmsq_laneq_f16(__p0_251, __p1_251, __p2_251, __p3_251) __extension__ ({ \
45330 float16_t __ret_251; \45214 float16x8_t __ret_251; \
45331 float16_t __s0_251 = __p0_251; \45215 float16x8_t __s0_251 = __p0_251; \
45332 float16_t __s1_251 = __p1_251; \45216 float16x8_t __s1_251 = __p1_251; \
45333 float16x4_t __s2_251 = __p2_251; \45217 float16x8_t __s2_251 = __p2_251; \
45334 float16x4_t __rev2_251; __rev2_251 = __builtin_shufflevector(__s2_251, __s2_251, __lane_reverse_64_16); \45218 float16x8_t __rev0_251; __rev0_251 = __builtin_shufflevector(__s0_251, __s0_251, __lane_reverse_128_16); \
45335 __ret_251 = __noswap_vfmah_lane_f16(__s0_251, -__s1_251, __rev2_251, __p3_251); \45219 float16x8_t __rev1_251; __rev1_251 = __builtin_shufflevector(__s1_251, __s1_251, __lane_reverse_128_16); \
45220 float16x8_t __rev2_251; __rev2_251 = __builtin_shufflevector(__s2_251, __s2_251, __lane_reverse_128_16); \
45221 __ret_251 = __noswap_vfmaq_laneq_f16(__rev0_251, -__rev1_251, __rev2_251, __p3_251); \
45222 __ret_251 = __builtin_shufflevector(__ret_251, __ret_251, __lane_reverse_128_16); \
45336 __ret_251; \45223 __ret_251; \
45337})45224})
45338#endif45225#endif
4533945226
45340#ifdef __LITTLE_ENDIAN__45227#ifdef __LITTLE_ENDIAN__
45341#define vfmsq_lane_f16(__p0_252, __p1_252, __p2_252, __p3_252) __extension__ ({ \45228#define vfms_laneq_f16(__p0_252, __p1_252, __p2_252, __p3_252) __extension__ ({ \
45342 float16x8_t __ret_252; \45229 float16x4_t __ret_252; \
45343 float16x8_t __s0_252 = __p0_252; \45230 float16x4_t __s0_252 = __p0_252; \
45344 float16x8_t __s1_252 = __p1_252; \45231 float16x4_t __s1_252 = __p1_252; \
45345 float16x4_t __s2_252 = __p2_252; \45232 float16x8_t __s2_252 = __p2_252; \
45346 __ret_252 = vfmaq_lane_f16(__s0_252, -__s1_252, __s2_252, __p3_252); \45233 __ret_252 = vfma_laneq_f16(__s0_252, -__s1_252, __s2_252, __p3_252); \
45347 __ret_252; \45234 __ret_252; \
45348})45235})
45349#else45236#else
45350#define vfmsq_lane_f16(__p0_253, __p1_253, __p2_253, __p3_253) __extension__ ({ \45237#define vfms_laneq_f16(__p0_253, __p1_253, __p2_253, __p3_253) __extension__ ({ \
45351 float16x8_t __ret_253; \45238 float16x4_t __ret_253; \
45352 float16x8_t __s0_253 = __p0_253; \45239 float16x4_t __s0_253 = __p0_253; \
45353 float16x8_t __s1_253 = __p1_253; \45240 float16x4_t __s1_253 = __p1_253; \
45354 float16x4_t __s2_253 = __p2_253; \45241 float16x8_t __s2_253 = __p2_253; \
45355 float16x8_t __rev0_253; __rev0_253 = __builtin_shufflevector(__s0_253, __s0_253, __lane_reverse_128_16); \45242 float16x4_t __rev0_253; __rev0_253 = __builtin_shufflevector(__s0_253, __s0_253, __lane_reverse_64_16); \
45356 float16x8_t __rev1_253; __rev1_253 = __builtin_shufflevector(__s1_253, __s1_253, __lane_reverse_128_16); \45243 float16x4_t __rev1_253; __rev1_253 = __builtin_shufflevector(__s1_253, __s1_253, __lane_reverse_64_16); \
45357 float16x4_t __rev2_253; __rev2_253 = __builtin_shufflevector(__s2_253, __s2_253, __lane_reverse_64_16); \45244 float16x8_t __rev2_253; __rev2_253 = __builtin_shufflevector(__s2_253, __s2_253, __lane_reverse_128_16); \
45358 __ret_253 = __noswap_vfmaq_lane_f16(__rev0_253, -__rev1_253, __rev2_253, __p3_253); \45245 __ret_253 = __noswap_vfma_laneq_f16(__rev0_253, -__rev1_253, __rev2_253, __p3_253); \
45359 __ret_253 = __builtin_shufflevector(__ret_253, __ret_253, __lane_reverse_128_16); \45246 __ret_253 = __builtin_shufflevector(__ret_253, __ret_253, __lane_reverse_64_16); \
45360 __ret_253; \45247 __ret_253; \
45361})45248})
45362#endif45249#endif
4536345250
45364#ifdef __LITTLE_ENDIAN__45251#ifdef __LITTLE_ENDIAN__
45365#define vfms_lane_f16(__p0_254, __p1_254, __p2_254, __p3_254) __extension__ ({ \45252#define vfmsq_n_f16(__p0, __p1, __p2) __extension__ ({ \
45366 float16x4_t __ret_254; \45253 float16x8_t __ret; \
45367 float16x4_t __s0_254 = __p0_254; \45254 float16x8_t __s0 = __p0; \
45368 float16x4_t __s1_254 = __p1_254; \45255 float16x8_t __s1 = __p1; \
45369 float16x4_t __s2_254 = __p2_254; \45256 float16_t __s2 = __p2; \
45370 __ret_254 = vfma_lane_f16(__s0_254, -__s1_254, __s2_254, __p3_254); \45257 __ret = vfmaq_f16(__s0, -__s1, (float16x8_t) {__s2, __s2, __s2, __s2, __s2, __s2, __s2, __s2}); \
45258 __ret; \
45259})
45260#else
45261#define vfmsq_n_f16(__p0, __p1, __p2) __extension__ ({ \
45262 float16x8_t __ret; \
45263 float16x8_t __s0 = __p0; \
45264 float16x8_t __s1 = __p1; \
45265 float16_t __s2 = __p2; \
45266 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45267 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
45268 __ret = __noswap_vfmaq_f16(__rev0, -__rev1, (float16x8_t) {__s2, __s2, __s2, __s2, __s2, __s2, __s2, __s2}); \
45269 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
45270 __ret; \
45271})
45272#endif
45273
45274#ifdef __LITTLE_ENDIAN__
45275#define vfms_n_f16(__p0, __p1, __p2) __extension__ ({ \
45276 float16x4_t __ret; \
45277 float16x4_t __s0 = __p0; \
45278 float16x4_t __s1 = __p1; \
45279 float16_t __s2 = __p2; \
45280 __ret = vfma_f16(__s0, -__s1, (float16x4_t) {__s2, __s2, __s2, __s2}); \
45281 __ret; \
45282})
45283#else
45284#define vfms_n_f16(__p0, __p1, __p2) __extension__ ({ \
45285 float16x4_t __ret; \
45286 float16x4_t __s0 = __p0; \
45287 float16x4_t __s1 = __p1; \
45288 float16_t __s2 = __p2; \
45289 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45290 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
45291 __ret = __noswap_vfma_f16(__rev0, -__rev1, (float16x4_t) {__s2, __s2, __s2, __s2}); \
45292 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
45293 __ret; \
45294})
45295#endif
45296
45297#ifdef __LITTLE_ENDIAN__
45298#define vmaxnmvq_f16(__p0) __extension__ ({ \
45299 float16_t __ret; \
45300 float16x8_t __s0 = __p0; \
45301 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45302 __ret; \
45303})
45304#else
45305#define vmaxnmvq_f16(__p0) __extension__ ({ \
45306 float16_t __ret; \
45307 float16x8_t __s0 = __p0; \
45308 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45309 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45310 __ret; \
45311})
45312#endif
45313
45314#ifdef __LITTLE_ENDIAN__
45315#define vmaxnmv_f16(__p0) __extension__ ({ \
45316 float16_t __ret; \
45317 float16x4_t __s0 = __p0; \
45318 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45319 __ret; \
45320})
45321#else
45322#define vmaxnmv_f16(__p0) __extension__ ({ \
45323 float16_t __ret; \
45324 float16x4_t __s0 = __p0; \
45325 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45326 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45327 __ret; \
45328})
45329#endif
45330
45331#ifdef __LITTLE_ENDIAN__
45332#define vmaxvq_f16(__p0) __extension__ ({ \
45333 float16_t __ret; \
45334 float16x8_t __s0 = __p0; \
45335 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45336 __ret; \
45337})
45338#else
45339#define vmaxvq_f16(__p0) __extension__ ({ \
45340 float16_t __ret; \
45341 float16x8_t __s0 = __p0; \
45342 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45343 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45344 __ret; \
45345})
45346#endif
45347
45348#ifdef __LITTLE_ENDIAN__
45349#define vmaxv_f16(__p0) __extension__ ({ \
45350 float16_t __ret; \
45351 float16x4_t __s0 = __p0; \
45352 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45353 __ret; \
45354})
45355#else
45356#define vmaxv_f16(__p0) __extension__ ({ \
45357 float16_t __ret; \
45358 float16x4_t __s0 = __p0; \
45359 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45360 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45361 __ret; \
45362})
45363#endif
45364
45365#ifdef __LITTLE_ENDIAN__
45366#define vminnmvq_f16(__p0) __extension__ ({ \
45367 float16_t __ret; \
45368 float16x8_t __s0 = __p0; \
45369 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45370 __ret; \
45371})
45372#else
45373#define vminnmvq_f16(__p0) __extension__ ({ \
45374 float16_t __ret; \
45375 float16x8_t __s0 = __p0; \
45376 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45377 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45378 __ret; \
45379})
45380#endif
45381
45382#ifdef __LITTLE_ENDIAN__
45383#define vminnmv_f16(__p0) __extension__ ({ \
45384 float16_t __ret; \
45385 float16x4_t __s0 = __p0; \
45386 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45387 __ret; \
45388})
45389#else
45390#define vminnmv_f16(__p0) __extension__ ({ \
45391 float16_t __ret; \
45392 float16x4_t __s0 = __p0; \
45393 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45394 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45395 __ret; \
45396})
45397#endif
45398
45399#ifdef __LITTLE_ENDIAN__
45400#define vminvq_f16(__p0) __extension__ ({ \
45401 float16_t __ret; \
45402 float16x8_t __s0 = __p0; \
45403 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45404 __ret; \
45405})
45406#else
45407#define vminvq_f16(__p0) __extension__ ({ \
45408 float16_t __ret; \
45409 float16x8_t __s0 = __p0; \
45410 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45411 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45412 __ret; \
45413})
45414#endif
45415
45416#ifdef __LITTLE_ENDIAN__
45417#define vminv_f16(__p0) __extension__ ({ \
45418 float16_t __ret; \
45419 float16x4_t __s0 = __p0; \
45420 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45421 __ret; \
45422})
45423#else
45424#define vminv_f16(__p0) __extension__ ({ \
45425 float16_t __ret; \
45426 float16x4_t __s0 = __p0; \
45427 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45428 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45429 __ret; \
45430})
45431#endif
45432
45433#ifdef __LITTLE_ENDIAN__
45434#define vmulq_laneq_f16(__p0_254, __p1_254, __p2_254) __extension__ ({ \
45435 float16x8_t __ret_254; \
45436 float16x8_t __s0_254 = __p0_254; \
45437 float16x8_t __s1_254 = __p1_254; \
45438 __ret_254 = __s0_254 * splatq_laneq_f16(__s1_254, __p2_254); \
45371 __ret_254; \45439 __ret_254; \
45372})45440})
45373#else45441#else
45374#define vfms_lane_f16(__p0_255, __p1_255, __p2_255, __p3_255) __extension__ ({ \45442#define vmulq_laneq_f16(__p0_255, __p1_255, __p2_255) __extension__ ({ \
45375 float16x4_t __ret_255; \45443 float16x8_t __ret_255; \
45376 float16x4_t __s0_255 = __p0_255; \45444 float16x8_t __s0_255 = __p0_255; \
45377 float16x4_t __s1_255 = __p1_255; \45445 float16x8_t __s1_255 = __p1_255; \
45378 float16x4_t __s2_255 = __p2_255; \45446 float16x8_t __rev0_255; __rev0_255 = __builtin_shufflevector(__s0_255, __s0_255, __lane_reverse_128_16); \
45379 float16x4_t __rev0_255; __rev0_255 = __builtin_shufflevector(__s0_255, __s0_255, __lane_reverse_64_16); \45447 float16x8_t __rev1_255; __rev1_255 = __builtin_shufflevector(__s1_255, __s1_255, __lane_reverse_128_16); \
45380 float16x4_t __rev1_255; __rev1_255 = __builtin_shufflevector(__s1_255, __s1_255, __lane_reverse_64_16); \45448 __ret_255 = __rev0_255 * __noswap_splatq_laneq_f16(__rev1_255, __p2_255); \
45381 float16x4_t __rev2_255; __rev2_255 = __builtin_shufflevector(__s2_255, __s2_255, __lane_reverse_64_16); \45449 __ret_255 = __builtin_shufflevector(__ret_255, __ret_255, __lane_reverse_128_16); \
45382 __ret_255 = __noswap_vfma_lane_f16(__rev0_255, -__rev1_255, __rev2_255, __p3_255); \
45383 __ret_255 = __builtin_shufflevector(__ret_255, __ret_255, __lane_reverse_64_16); \
45384 __ret_255; \45450 __ret_255; \
45385})45451})
45386#endif45452#endif
4538745453
45388#ifdef __LITTLE_ENDIAN__45454#ifdef __LITTLE_ENDIAN__
45389#define vfmsh_laneq_f16(__p0_256, __p1_256, __p2_256, __p3_256) __extension__ ({ \45455#define vmul_laneq_f16(__p0_256, __p1_256, __p2_256) __extension__ ({ \
45390 float16_t __ret_256; \45456 float16x4_t __ret_256; \
45391 float16_t __s0_256 = __p0_256; \45457 float16x4_t __s0_256 = __p0_256; \
45392 float16_t __s1_256 = __p1_256; \45458 float16x8_t __s1_256 = __p1_256; \
45393 float16x8_t __s2_256 = __p2_256; \45459 __ret_256 = __s0_256 * splat_laneq_f16(__s1_256, __p2_256); \
45394 __ret_256 = vfmah_laneq_f16(__s0_256, -__s1_256, __s2_256, __p3_256); \
45395 __ret_256; \45460 __ret_256; \
45396})45461})
45397#else45462#else
45398#define vfmsh_laneq_f16(__p0_257, __p1_257, __p2_257, __p3_257) __extension__ ({ \45463#define vmul_laneq_f16(__p0_257, __p1_257, __p2_257) __extension__ ({ \
45399 float16_t __ret_257; \45464 float16x4_t __ret_257; \
45400 float16_t __s0_257 = __p0_257; \45465 float16x4_t __s0_257 = __p0_257; \
45401 float16_t __s1_257 = __p1_257; \45466 float16x8_t __s1_257 = __p1_257; \
45402 float16x8_t __s2_257 = __p2_257; \45467 float16x4_t __rev0_257; __rev0_257 = __builtin_shufflevector(__s0_257, __s0_257, __lane_reverse_64_16); \
45403 float16x8_t __rev2_257; __rev2_257 = __builtin_shufflevector(__s2_257, __s2_257, __lane_reverse_128_16); \45468 float16x8_t __rev1_257; __rev1_257 = __builtin_shufflevector(__s1_257, __s1_257, __lane_reverse_128_16); \
45404 __ret_257 = __noswap_vfmah_laneq_f16(__s0_257, -__s1_257, __rev2_257, __p3_257); \45469 __ret_257 = __rev0_257 * __noswap_splat_laneq_f16(__rev1_257, __p2_257); \
45470 __ret_257 = __builtin_shufflevector(__ret_257, __ret_257, __lane_reverse_64_16); \
45405 __ret_257; \45471 __ret_257; \
45406})45472})
45407#endif45473#endif
4540845474
45409#ifdef __LITTLE_ENDIAN__45475#ifdef __LITTLE_ENDIAN__
45410#define vfmsq_laneq_f16(__p0_258, __p1_258, __p2_258, __p3_258) __extension__ ({ \45476__ai __attribute__((target("fullfp16,neon"))) float16x8_t vmulxq_f16(float16x8_t __p0, float16x8_t __p1) {
45477 float16x8_t __ret;
45478 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmulxq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
45479 return __ret;
45480}
45481#else
45482__ai __attribute__((target("fullfp16,neon"))) float16x8_t vmulxq_f16(float16x8_t __p0, float16x8_t __p1) {
45483 float16x8_t __ret;
45484 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
45485 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
45486 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmulxq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 40));
45487 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
45488 return __ret;
45489}
45490__ai __attribute__((target("fullfp16,neon"))) float16x8_t __noswap_vmulxq_f16(float16x8_t __p0, float16x8_t __p1) {
45491 float16x8_t __ret;
45492 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmulxq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
45493 return __ret;
45494}
45495#endif
45496
45497#ifdef __LITTLE_ENDIAN__
45498__ai __attribute__((target("fullfp16,neon"))) float16x4_t vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
45499 float16x4_t __ret;
45500 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vmulx_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
45501 return __ret;
45502}
45503#else
45504__ai __attribute__((target("fullfp16,neon"))) float16x4_t vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
45505 float16x4_t __ret;
45506 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
45507 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
45508 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vmulx_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 8));
45509 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
45510 return __ret;
45511}
45512__ai __attribute__((target("fullfp16,neon"))) float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
45513 float16x4_t __ret;
45514 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vmulx_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
45515 return __ret;
45516}
45517#endif
45518
45519#ifdef __LITTLE_ENDIAN__
45520#define vmulxh_lane_f16(__p0, __p1, __p2) __extension__ ({ \
45521 float16_t __ret; \
45522 float16_t __s0 = __p0; \
45523 float16x4_t __s1 = __p1; \
45524 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_lane_f16(__s0, __s1, __p2)); \
45525 __ret; \
45526})
45527#else
45528#define vmulxh_lane_f16(__p0, __p1, __p2) __extension__ ({ \
45529 float16_t __ret; \
45530 float16_t __s0 = __p0; \
45531 float16x4_t __s1 = __p1; \
45532 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
45533 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_lane_f16(__s0, __rev1, __p2)); \
45534 __ret; \
45535})
45536#endif
45537
45538#ifdef __LITTLE_ENDIAN__
45539#define vmulxq_lane_f16(__p0_258, __p1_258, __p2_258) __extension__ ({ \
45411 float16x8_t __ret_258; \45540 float16x8_t __ret_258; \
45412 float16x8_t __s0_258 = __p0_258; \45541 float16x8_t __s0_258 = __p0_258; \
45413 float16x8_t __s1_258 = __p1_258; \45542 float16x4_t __s1_258 = __p1_258; \
45414 float16x8_t __s2_258 = __p2_258; \45543 __ret_258 = vmulxq_f16(__s0_258, splatq_lane_f16(__s1_258, __p2_258)); \
45415 __ret_258 = vfmaq_laneq_f16(__s0_258, -__s1_258, __s2_258, __p3_258); \
45416 __ret_258; \45544 __ret_258; \
45417})45545})
45418#else45546#else
45419#define vfmsq_laneq_f16(__p0_259, __p1_259, __p2_259, __p3_259) __extension__ ({ \45547#define vmulxq_lane_f16(__p0_259, __p1_259, __p2_259) __extension__ ({ \
45420 float16x8_t __ret_259; \45548 float16x8_t __ret_259; \
45421 float16x8_t __s0_259 = __p0_259; \45549 float16x8_t __s0_259 = __p0_259; \
45422 float16x8_t __s1_259 = __p1_259; \45550 float16x4_t __s1_259 = __p1_259; \
45423 float16x8_t __s2_259 = __p2_259; \
45424 float16x8_t __rev0_259; __rev0_259 = __builtin_shufflevector(__s0_259, __s0_259, __lane_reverse_128_16); \45551 float16x8_t __rev0_259; __rev0_259 = __builtin_shufflevector(__s0_259, __s0_259, __lane_reverse_128_16); \
45425 float16x8_t __rev1_259; __rev1_259 = __builtin_shufflevector(__s1_259, __s1_259, __lane_reverse_128_16); \45552 float16x4_t __rev1_259; __rev1_259 = __builtin_shufflevector(__s1_259, __s1_259, __lane_reverse_64_16); \
45426 float16x8_t __rev2_259; __rev2_259 = __builtin_shufflevector(__s2_259, __s2_259, __lane_reverse_128_16); \45553 __ret_259 = __noswap_vmulxq_f16(__rev0_259, __noswap_splatq_lane_f16(__rev1_259, __p2_259)); \
45427 __ret_259 = __noswap_vfmaq_laneq_f16(__rev0_259, -__rev1_259, __rev2_259, __p3_259); \
45428 __ret_259 = __builtin_shufflevector(__ret_259, __ret_259, __lane_reverse_128_16); \45554 __ret_259 = __builtin_shufflevector(__ret_259, __ret_259, __lane_reverse_128_16); \
45429 __ret_259; \45555 __ret_259; \
45430})45556})
45431#endif45557#endif
4543245558
45433#ifdef __LITTLE_ENDIAN__45559#ifdef __LITTLE_ENDIAN__
45434#define vfms_laneq_f16(__p0_260, __p1_260, __p2_260, __p3_260) __extension__ ({ \45560#define vmulx_lane_f16(__p0_260, __p1_260, __p2_260) __extension__ ({ \
45435 float16x4_t __ret_260; \45561 float16x4_t __ret_260; \
45436 float16x4_t __s0_260 = __p0_260; \45562 float16x4_t __s0_260 = __p0_260; \
45437 float16x4_t __s1_260 = __p1_260; \45563 float16x4_t __s1_260 = __p1_260; \
45438 float16x8_t __s2_260 = __p2_260; \45564 __ret_260 = vmulx_f16(__s0_260, splat_lane_f16(__s1_260, __p2_260)); \
45439 __ret_260 = vfma_laneq_f16(__s0_260, -__s1_260, __s2_260, __p3_260); \
45440 __ret_260; \45565 __ret_260; \
45441})45566})
45442#else45567#else
45443#define vfms_laneq_f16(__p0_261, __p1_261, __p2_261, __p3_261) __extension__ ({ \45568#define vmulx_lane_f16(__p0_261, __p1_261, __p2_261) __extension__ ({ \
45444 float16x4_t __ret_261; \45569 float16x4_t __ret_261; \
45445 float16x4_t __s0_261 = __p0_261; \45570 float16x4_t __s0_261 = __p0_261; \
45446 float16x4_t __s1_261 = __p1_261; \45571 float16x4_t __s1_261 = __p1_261; \
45447 float16x8_t __s2_261 = __p2_261; \
45448 float16x4_t __rev0_261; __rev0_261 = __builtin_shufflevector(__s0_261, __s0_261, __lane_reverse_64_16); \45572 float16x4_t __rev0_261; __rev0_261 = __builtin_shufflevector(__s0_261, __s0_261, __lane_reverse_64_16); \
45449 float16x4_t __rev1_261; __rev1_261 = __builtin_shufflevector(__s1_261, __s1_261, __lane_reverse_64_16); \45573 float16x4_t __rev1_261; __rev1_261 = __builtin_shufflevector(__s1_261, __s1_261, __lane_reverse_64_16); \
45450 float16x8_t __rev2_261; __rev2_261 = __builtin_shufflevector(__s2_261, __s2_261, __lane_reverse_128_16); \45574 __ret_261 = __noswap_vmulx_f16(__rev0_261, __noswap_splat_lane_f16(__rev1_261, __p2_261)); \
45451 __ret_261 = __noswap_vfma_laneq_f16(__rev0_261, -__rev1_261, __rev2_261, __p3_261); \
45452 __ret_261 = __builtin_shufflevector(__ret_261, __ret_261, __lane_reverse_64_16); \45575 __ret_261 = __builtin_shufflevector(__ret_261, __ret_261, __lane_reverse_64_16); \
45453 __ret_261; \45576 __ret_261; \
45454})45577})
45455#endif45578#endif
4545645579
45457#ifdef __LITTLE_ENDIAN__45580#ifdef __LITTLE_ENDIAN__
45458#define vfmsq_n_f16(__p0, __p1, __p2) __extension__ ({ \45581#define vmulxh_laneq_f16(__p0, __p1, __p2) __extension__ ({ \
45459 float16x8_t __ret; \45582 float16_t __ret; \
45460 float16x8_t __s0 = __p0; \45583 float16_t __s0 = __p0; \
45461 float16x8_t __s1 = __p1; \45584 float16x8_t __s1 = __p1; \
45462 float16_t __s2 = __p2; \45585 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_laneq_f16(__s0, __s1, __p2)); \
45463 __ret = vfmaq_f16(__s0, -__s1, (float16x8_t) {__s2, __s2, __s2, __s2, __s2, __s2, __s2, __s2}); \
45464 __ret; \45586 __ret; \
45465})45587})
45466#else45588#else
45467#define vfmsq_n_f16(__p0, __p1, __p2) __extension__ ({ \45589#define vmulxh_laneq_f16(__p0, __p1, __p2) __extension__ ({ \
45468 float16x8_t __ret; \45590 float16_t __ret; \
45469 float16x8_t __s0 = __p0; \45591 float16_t __s0 = __p0; \
45470 float16x8_t __s1 = __p1; \45592 float16x8_t __s1 = __p1; \
45471 float16_t __s2 = __p2; \
45472 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45473 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \45593 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
45474 __ret = __noswap_vfmaq_f16(__rev0, -__rev1, (float16x8_t) {__s2, __s2, __s2, __s2, __s2, __s2, __s2, __s2}); \45594 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_laneq_f16(__s0, __rev1, __p2)); \
45475 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16); \
45476 __ret; \
45477})
45478#endif
45479
45480#ifdef __LITTLE_ENDIAN__
45481#define vfms_n_f16(__p0, __p1, __p2) __extension__ ({ \
45482 float16x4_t __ret; \
45483 float16x4_t __s0 = __p0; \
45484 float16x4_t __s1 = __p1; \
45485 float16_t __s2 = __p2; \
45486 __ret = vfma_f16(__s0, -__s1, (float16x4_t) {__s2, __s2, __s2, __s2}); \
45487 __ret; \
45488})
45489#else
45490#define vfms_n_f16(__p0, __p1, __p2) __extension__ ({ \
45491 float16x4_t __ret; \
45492 float16x4_t __s0 = __p0; \
45493 float16x4_t __s1 = __p1; \
45494 float16_t __s2 = __p2; \
45495 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45496 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
45497 __ret = __noswap_vfma_f16(__rev0, -__rev1, (float16x4_t) {__s2, __s2, __s2, __s2}); \
45498 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16); \
45499 __ret; \
45500})
45501#endif
45502
45503#ifdef __LITTLE_ENDIAN__
45504#define vmaxnmvq_f16(__p0) __extension__ ({ \
45505 float16_t __ret; \
45506 float16x8_t __s0 = __p0; \
45507 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45508 __ret; \
45509})
45510#else
45511#define vmaxnmvq_f16(__p0) __extension__ ({ \
45512 float16_t __ret; \
45513 float16x8_t __s0 = __p0; \
45514 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45515 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45516 __ret; \
45517})
45518#endif
45519
45520#ifdef __LITTLE_ENDIAN__
45521#define vmaxnmv_f16(__p0) __extension__ ({ \
45522 float16_t __ret; \
45523 float16x4_t __s0 = __p0; \
45524 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45525 __ret; \
45526})
45527#else
45528#define vmaxnmv_f16(__p0) __extension__ ({ \
45529 float16_t __ret; \
45530 float16x4_t __s0 = __p0; \
45531 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45532 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxnmv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45533 __ret; \
45534})
45535#endif
45536
45537#ifdef __LITTLE_ENDIAN__
45538#define vmaxvq_f16(__p0) __extension__ ({ \
45539 float16_t __ret; \
45540 float16x8_t __s0 = __p0; \
45541 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45542 __ret; \
45543})
45544#else
45545#define vmaxvq_f16(__p0) __extension__ ({ \
45546 float16_t __ret; \
45547 float16x8_t __s0 = __p0; \
45548 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45549 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45550 __ret; \
45551})
45552#endif
45553
45554#ifdef __LITTLE_ENDIAN__
45555#define vmaxv_f16(__p0) __extension__ ({ \
45556 float16_t __ret; \
45557 float16x4_t __s0 = __p0; \
45558 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45559 __ret; \
45560})
45561#else
45562#define vmaxv_f16(__p0) __extension__ ({ \
45563 float16_t __ret; \
45564 float16x4_t __s0 = __p0; \
45565 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45566 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmaxv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45567 __ret; \
45568})
45569#endif
45570
45571#ifdef __LITTLE_ENDIAN__
45572#define vminnmvq_f16(__p0) __extension__ ({ \
45573 float16_t __ret; \
45574 float16x8_t __s0 = __p0; \
45575 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45576 __ret; \
45577})
45578#else
45579#define vminnmvq_f16(__p0) __extension__ ({ \
45580 float16_t __ret; \
45581 float16x8_t __s0 = __p0; \
45582 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45583 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45584 __ret; \
45585})
45586#endif
45587
45588#ifdef __LITTLE_ENDIAN__
45589#define vminnmv_f16(__p0) __extension__ ({ \
45590 float16_t __ret; \
45591 float16x4_t __s0 = __p0; \
45592 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45593 __ret; \
45594})
45595#else
45596#define vminnmv_f16(__p0) __extension__ ({ \
45597 float16_t __ret; \
45598 float16x4_t __s0 = __p0; \
45599 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45600 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminnmv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45601 __ret; \
45602})
45603#endif
45604
45605#ifdef __LITTLE_ENDIAN__
45606#define vminvq_f16(__p0) __extension__ ({ \
45607 float16_t __ret; \
45608 float16x8_t __s0 = __p0; \
45609 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminvq_f16(__builtin_bit_cast(int8x16_t, __s0))); \
45610 __ret; \
45611})
45612#else
45613#define vminvq_f16(__p0) __extension__ ({ \
45614 float16_t __ret; \
45615 float16x8_t __s0 = __p0; \
45616 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_128_16); \
45617 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminvq_f16(__builtin_bit_cast(int8x16_t, __rev0))); \
45618 __ret; \
45619})
45620#endif
45621
45622#ifdef __LITTLE_ENDIAN__
45623#define vminv_f16(__p0) __extension__ ({ \
45624 float16_t __ret; \
45625 float16x4_t __s0 = __p0; \
45626 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminv_f16(__builtin_bit_cast(int8x8_t, __s0))); \
45627 __ret; \
45628})
45629#else
45630#define vminv_f16(__p0) __extension__ ({ \
45631 float16_t __ret; \
45632 float16x4_t __s0 = __p0; \
45633 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__s0, __s0, __lane_reverse_64_16); \
45634 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vminv_f16(__builtin_bit_cast(int8x8_t, __rev0))); \
45635 __ret; \45595 __ret; \
45636})45596})
45637#endif45597#endif
4563845598
45639#ifdef __LITTLE_ENDIAN__45599#ifdef __LITTLE_ENDIAN__
45640#define vmulq_laneq_f16(__p0_262, __p1_262, __p2_262) __extension__ ({ \45600#define vmulxq_laneq_f16(__p0_262, __p1_262, __p2_262) __extension__ ({ \
45641 float16x8_t __ret_262; \45601 float16x8_t __ret_262; \
45642 float16x8_t __s0_262 = __p0_262; \45602 float16x8_t __s0_262 = __p0_262; \
45643 float16x8_t __s1_262 = __p1_262; \45603 float16x8_t __s1_262 = __p1_262; \
45644 __ret_262 = __s0_262 * splatq_laneq_f16(__s1_262, __p2_262); \45604 __ret_262 = vmulxq_f16(__s0_262, splatq_laneq_f16(__s1_262, __p2_262)); \
45645 __ret_262; \45605 __ret_262; \
45646})45606})
45647#else45607#else
45648#define vmulq_laneq_f16(__p0_263, __p1_263, __p2_263) __extension__ ({ \45608#define vmulxq_laneq_f16(__p0_263, __p1_263, __p2_263) __extension__ ({ \
45649 float16x8_t __ret_263; \45609 float16x8_t __ret_263; \
45650 float16x8_t __s0_263 = __p0_263; \45610 float16x8_t __s0_263 = __p0_263; \
45651 float16x8_t __s1_263 = __p1_263; \45611 float16x8_t __s1_263 = __p1_263; \
45652 float16x8_t __rev0_263; __rev0_263 = __builtin_shufflevector(__s0_263, __s0_263, __lane_reverse_128_16); \45612 float16x8_t __rev0_263; __rev0_263 = __builtin_shufflevector(__s0_263, __s0_263, __lane_reverse_128_16); \
45653 float16x8_t __rev1_263; __rev1_263 = __builtin_shufflevector(__s1_263, __s1_263, __lane_reverse_128_16); \45613 float16x8_t __rev1_263; __rev1_263 = __builtin_shufflevector(__s1_263, __s1_263, __lane_reverse_128_16); \
45654 __ret_263 = __rev0_263 * __noswap_splatq_laneq_f16(__rev1_263, __p2_263); \45614 __ret_263 = __noswap_vmulxq_f16(__rev0_263, __noswap_splatq_laneq_f16(__rev1_263, __p2_263)); \
45655 __ret_263 = __builtin_shufflevector(__ret_263, __ret_263, __lane_reverse_128_16); \45615 __ret_263 = __builtin_shufflevector(__ret_263, __ret_263, __lane_reverse_128_16); \
45656 __ret_263; \45616 __ret_263; \
45657})45617})
45658#endif45618#endif
4565945619
45660#ifdef __LITTLE_ENDIAN__45620#ifdef __LITTLE_ENDIAN__
45661#define vmul_laneq_f16(__p0_264, __p1_264, __p2_264) __extension__ ({ \45621#define vmulx_laneq_f16(__p0_264, __p1_264, __p2_264) __extension__ ({ \
45662 float16x4_t __ret_264; \45622 float16x4_t __ret_264; \
45663 float16x4_t __s0_264 = __p0_264; \45623 float16x4_t __s0_264 = __p0_264; \
45664 float16x8_t __s1_264 = __p1_264; \45624 float16x8_t __s1_264 = __p1_264; \
45665 __ret_264 = __s0_264 * splat_laneq_f16(__s1_264, __p2_264); \45625 __ret_264 = vmulx_f16(__s0_264, splat_laneq_f16(__s1_264, __p2_264)); \
45666 __ret_264; \45626 __ret_264; \
45667})45627})
45668#else45628#else
45669#define vmul_laneq_f16(__p0_265, __p1_265, __p2_265) __extension__ ({ \45629#define vmulx_laneq_f16(__p0_265, __p1_265, __p2_265) __extension__ ({ \
45670 float16x4_t __ret_265; \45630 float16x4_t __ret_265; \
45671 float16x4_t __s0_265 = __p0_265; \45631 float16x4_t __s0_265 = __p0_265; \
45672 float16x8_t __s1_265 = __p1_265; \45632 float16x8_t __s1_265 = __p1_265; \
45673 float16x4_t __rev0_265; __rev0_265 = __builtin_shufflevector(__s0_265, __s0_265, __lane_reverse_64_16); \45633 float16x4_t __rev0_265; __rev0_265 = __builtin_shufflevector(__s0_265, __s0_265, __lane_reverse_64_16); \
45674 float16x8_t __rev1_265; __rev1_265 = __builtin_shufflevector(__s1_265, __s1_265, __lane_reverse_128_16); \45634 float16x8_t __rev1_265; __rev1_265 = __builtin_shufflevector(__s1_265, __s1_265, __lane_reverse_128_16); \
45675 __ret_265 = __rev0_265 * __noswap_splat_laneq_f16(__rev1_265, __p2_265); \45635 __ret_265 = __noswap_vmulx_f16(__rev0_265, __noswap_splat_laneq_f16(__rev1_265, __p2_265)); \
45676 __ret_265 = __builtin_shufflevector(__ret_265, __ret_265, __lane_reverse_64_16); \45636 __ret_265 = __builtin_shufflevector(__ret_265, __ret_265, __lane_reverse_64_16); \
45677 __ret_265; \45637 __ret_265; \
45678})45638})
45679#endif45639#endif
4568045640
45681#ifdef __LITTLE_ENDIAN__
45682__ai __attribute__((target("fullfp16,neon"))) float16x8_t vmulxq_f16(float16x8_t __p0, float16x8_t __p1) {
45683 float16x8_t __ret;
45684 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmulxq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
45685 return __ret;
45686}
45687#else
45688__ai __attribute__((target("fullfp16,neon"))) float16x8_t vmulxq_f16(float16x8_t __p0, float16x8_t __p1) {
45689 float16x8_t __ret;
45690 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_128_16);
45691 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_128_16);
45692 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmulxq_f16(__builtin_bit_cast(int8x16_t, __rev0), __builtin_bit_cast(int8x16_t, __rev1), 40));
45693 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_128_16);
45694 return __ret;
45695}
45696__ai __attribute__((target("fullfp16,neon"))) float16x8_t __noswap_vmulxq_f16(float16x8_t __p0, float16x8_t __p1) {
45697 float16x8_t __ret;
45698 __ret = __builtin_bit_cast(float16x8_t, __builtin_neon_vmulxq_f16(__builtin_bit_cast(int8x16_t, __p0), __builtin_bit_cast(int8x16_t, __p1), 40));
45699 return __ret;
45700}
45701#endif
45702
45703#ifdef __LITTLE_ENDIAN__
45704__ai __attribute__((target("fullfp16,neon"))) float16x4_t vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
45705 float16x4_t __ret;
45706 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vmulx_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
45707 return __ret;
45708}
45709#else
45710__ai __attribute__((target("fullfp16,neon"))) float16x4_t vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
45711 float16x4_t __ret;
45712 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, __lane_reverse_64_16);
45713 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, __lane_reverse_64_16);
45714 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vmulx_f16(__builtin_bit_cast(int8x8_t, __rev0), __builtin_bit_cast(int8x8_t, __rev1), 8));
45715 __ret = __builtin_shufflevector(__ret, __ret, __lane_reverse_64_16);
45716 return __ret;
45717}
45718__ai __attribute__((target("fullfp16,neon"))) float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
45719 float16x4_t __ret;
45720 __ret = __builtin_bit_cast(float16x4_t, __builtin_neon_vmulx_f16(__builtin_bit_cast(int8x8_t, __p0), __builtin_bit_cast(int8x8_t, __p1), 8));
45721 return __ret;
45722}
45723#endif
45724
45725#ifdef __LITTLE_ENDIAN__
45726#define vmulxh_lane_f16(__p0, __p1, __p2) __extension__ ({ \
45727 float16_t __ret; \
45728 float16_t __s0 = __p0; \
45729 float16x4_t __s1 = __p1; \
45730 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_lane_f16(__s0, __s1, __p2)); \
45731 __ret; \
45732})
45733#else
45734#define vmulxh_lane_f16(__p0, __p1, __p2) __extension__ ({ \
45735 float16_t __ret; \
45736 float16_t __s0 = __p0; \
45737 float16x4_t __s1 = __p1; \
45738 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_64_16); \
45739 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_lane_f16(__s0, __rev1, __p2)); \
45740 __ret; \
45741})
45742#endif
45743
45744#ifdef __LITTLE_ENDIAN__
45745#define vmulxq_lane_f16(__p0_266, __p1_266, __p2_266) __extension__ ({ \
45746 float16x8_t __ret_266; \
45747 float16x8_t __s0_266 = __p0_266; \
45748 float16x4_t __s1_266 = __p1_266; \
45749 __ret_266 = vmulxq_f16(__s0_266, splatq_lane_f16(__s1_266, __p2_266)); \
45750 __ret_266; \
45751})
45752#else
45753#define vmulxq_lane_f16(__p0_267, __p1_267, __p2_267) __extension__ ({ \
45754 float16x8_t __ret_267; \
45755 float16x8_t __s0_267 = __p0_267; \
45756 float16x4_t __s1_267 = __p1_267; \
45757 float16x8_t __rev0_267; __rev0_267 = __builtin_shufflevector(__s0_267, __s0_267, __lane_reverse_128_16); \
45758 float16x4_t __rev1_267; __rev1_267 = __builtin_shufflevector(__s1_267, __s1_267, __lane_reverse_64_16); \
45759 __ret_267 = __noswap_vmulxq_f16(__rev0_267, __noswap_splatq_lane_f16(__rev1_267, __p2_267)); \
45760 __ret_267 = __builtin_shufflevector(__ret_267, __ret_267, __lane_reverse_128_16); \
45761 __ret_267; \
45762})
45763#endif
45764
45765#ifdef __LITTLE_ENDIAN__
45766#define vmulx_lane_f16(__p0_268, __p1_268, __p2_268) __extension__ ({ \
45767 float16x4_t __ret_268; \
45768 float16x4_t __s0_268 = __p0_268; \
45769 float16x4_t __s1_268 = __p1_268; \
45770 __ret_268 = vmulx_f16(__s0_268, splat_lane_f16(__s1_268, __p2_268)); \
45771 __ret_268; \
45772})
45773#else
45774#define vmulx_lane_f16(__p0_269, __p1_269, __p2_269) __extension__ ({ \
45775 float16x4_t __ret_269; \
45776 float16x4_t __s0_269 = __p0_269; \
45777 float16x4_t __s1_269 = __p1_269; \
45778 float16x4_t __rev0_269; __rev0_269 = __builtin_shufflevector(__s0_269, __s0_269, __lane_reverse_64_16); \
45779 float16x4_t __rev1_269; __rev1_269 = __builtin_shufflevector(__s1_269, __s1_269, __lane_reverse_64_16); \
45780 __ret_269 = __noswap_vmulx_f16(__rev0_269, __noswap_splat_lane_f16(__rev1_269, __p2_269)); \
45781 __ret_269 = __builtin_shufflevector(__ret_269, __ret_269, __lane_reverse_64_16); \
45782 __ret_269; \
45783})
45784#endif
45785
45786#ifdef __LITTLE_ENDIAN__
45787#define vmulxh_laneq_f16(__p0, __p1, __p2) __extension__ ({ \
45788 float16_t __ret; \
45789 float16_t __s0 = __p0; \
45790 float16x8_t __s1 = __p1; \
45791 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_laneq_f16(__s0, __s1, __p2)); \
45792 __ret; \
45793})
45794#else
45795#define vmulxh_laneq_f16(__p0, __p1, __p2) __extension__ ({ \
45796 float16_t __ret; \
45797 float16_t __s0 = __p0; \
45798 float16x8_t __s1 = __p1; \
45799 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__s1, __s1, __lane_reverse_128_16); \
45800 __ret = __builtin_bit_cast(float16_t, __builtin_neon_vmulxh_laneq_f16(__s0, __rev1, __p2)); \
45801 __ret; \
45802})
45803#endif
45804
45805#ifdef __LITTLE_ENDIAN__
45806#define vmulxq_laneq_f16(__p0_270, __p1_270, __p2_270) __extension__ ({ \
45807 float16x8_t __ret_270; \
45808 float16x8_t __s0_270 = __p0_270; \
45809 float16x8_t __s1_270 = __p1_270; \
45810 __ret_270 = vmulxq_f16(__s0_270, splatq_laneq_f16(__s1_270, __p2_270)); \
45811 __ret_270; \
45812})
45813#else
45814#define vmulxq_laneq_f16(__p0_271, __p1_271, __p2_271) __extension__ ({ \
45815 float16x8_t __ret_271; \
45816 float16x8_t __s0_271 = __p0_271; \
45817 float16x8_t __s1_271 = __p1_271; \
45818 float16x8_t __rev0_271; __rev0_271 = __builtin_shufflevector(__s0_271, __s0_271, __lane_reverse_128_16); \
45819 float16x8_t __rev1_271; __rev1_271 = __builtin_shufflevector(__s1_271, __s1_271, __lane_reverse_128_16); \
45820 __ret_271 = __noswap_vmulxq_f16(__rev0_271, __noswap_splatq_laneq_f16(__rev1_271, __p2_271)); \
45821 __ret_271 = __builtin_shufflevector(__ret_271, __ret_271, __lane_reverse_128_16); \
45822 __ret_271; \
45823})
45824#endif
45825
45826#ifdef __LITTLE_ENDIAN__
45827#define vmulx_laneq_f16(__p0_272, __p1_272, __p2_272) __extension__ ({ \
45828 float16x4_t __ret_272; \
45829 float16x4_t __s0_272 = __p0_272; \
45830 float16x8_t __s1_272 = __p1_272; \
45831 __ret_272 = vmulx_f16(__s0_272, splat_laneq_f16(__s1_272, __p2_272)); \
45832 __ret_272; \
45833})
45834#else
45835#define vmulx_laneq_f16(__p0_273, __p1_273, __p2_273) __extension__ ({ \
45836 float16x4_t __ret_273; \
45837 float16x4_t __s0_273 = __p0_273; \
45838 float16x8_t __s1_273 = __p1_273; \
45839 float16x4_t __rev0_273; __rev0_273 = __builtin_shufflevector(__s0_273, __s0_273, __lane_reverse_64_16); \
45840 float16x8_t __rev1_273; __rev1_273 = __builtin_shufflevector(__s1_273, __s1_273, __lane_reverse_128_16); \
45841 __ret_273 = __noswap_vmulx_f16(__rev0_273, __noswap_splat_laneq_f16(__rev1_273, __p2_273)); \
45842 __ret_273 = __builtin_shufflevector(__ret_273, __ret_273, __lane_reverse_64_16); \
45843 __ret_273; \
45844})
45845#endif
45846
45847#ifdef __LITTLE_ENDIAN__45641#ifdef __LITTLE_ENDIAN__
45848#define vmulxq_n_f16(__p0, __p1) __extension__ ({ \45642#define vmulxq_n_f16(__p0, __p1) __extension__ ({ \
45849 float16x8_t __ret; \45643 float16x8_t __ret; \
...@@ -46068,98 +45862,98 @@ __ai __attribute__((target("fullfp16,neon"))) float16x4_t vsqrt_f16(float16x4_t...@@ -46068,98 +45862,98 @@ __ai __attribute__((target("fullfp16,neon"))) float16x4_t vsqrt_f16(float16x4_t
46068#endif45862#endif
4606945863
46070#ifdef __LITTLE_ENDIAN__45864#ifdef __LITTLE_ENDIAN__
46071#define vsudotq_laneq_s32(__p0_274, __p1_274, __p2_274, __p3_274) __extension__ ({ \45865#define vsudotq_laneq_s32(__p0_266, __p1_266, __p2_266, __p3_266) __extension__ ({ \
46072 int32x4_t __ret_274; \45866 int32x4_t __ret_266; \
46073 int32x4_t __s0_274 = __p0_274; \45867 int32x4_t __s0_266 = __p0_266; \
46074 int8x16_t __s1_274 = __p1_274; \45868 int8x16_t __s1_266 = __p1_266; \
46075 uint8x16_t __s2_274 = __p2_274; \45869 uint8x16_t __s2_266 = __p2_266; \
46076 __ret_274 = vusdotq_s32(__s0_274, __builtin_bit_cast(uint8x16_t, splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_274), __p3_274)), __s1_274); \45870 __ret_266 = vusdotq_s32(__s0_266, __builtin_bit_cast(uint8x16_t, splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_266), __p3_266)), __s1_266); \
46077 __ret_274; \45871 __ret_266; \
46078})45872})
46079#else45873#else
46080#define vsudotq_laneq_s32(__p0_275, __p1_275, __p2_275, __p3_275) __extension__ ({ \45874#define vsudotq_laneq_s32(__p0_267, __p1_267, __p2_267, __p3_267) __extension__ ({ \
46081 int32x4_t __ret_275; \45875 int32x4_t __ret_267; \
46082 int32x4_t __s0_275 = __p0_275; \45876 int32x4_t __s0_267 = __p0_267; \
46083 int8x16_t __s1_275 = __p1_275; \45877 int8x16_t __s1_267 = __p1_267; \
46084 uint8x16_t __s2_275 = __p2_275; \45878 uint8x16_t __s2_267 = __p2_267; \
46085 int32x4_t __rev0_275; __rev0_275 = __builtin_shufflevector(__s0_275, __s0_275, __lane_reverse_128_32); \45879 int32x4_t __rev0_267; __rev0_267 = __builtin_shufflevector(__s0_267, __s0_267, __lane_reverse_128_32); \
46086 int8x16_t __rev1_275; __rev1_275 = __builtin_shufflevector(__s1_275, __s1_275, __lane_reverse_128_8); \45880 int8x16_t __rev1_267; __rev1_267 = __builtin_shufflevector(__s1_267, __s1_267, __lane_reverse_128_8); \
46087 uint8x16_t __rev2_275; __rev2_275 = __builtin_shufflevector(__s2_275, __s2_275, __lane_reverse_128_8); \45881 uint8x16_t __rev2_267; __rev2_267 = __builtin_shufflevector(__s2_267, __s2_267, __lane_reverse_128_8); \
46088 __ret_275 = __noswap_vusdotq_s32(__rev0_275, __builtin_bit_cast(uint8x16_t, __noswap_splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_275), __p3_275)), __rev1_275); \45882 __ret_267 = __noswap_vusdotq_s32(__rev0_267, __builtin_bit_cast(uint8x16_t, __noswap_splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_267), __p3_267)), __rev1_267); \
46089 __ret_275 = __builtin_shufflevector(__ret_275, __ret_275, __lane_reverse_128_32); \45883 __ret_267 = __builtin_shufflevector(__ret_267, __ret_267, __lane_reverse_128_32); \
46090 __ret_275; \45884 __ret_267; \
46091})45885})
46092#endif45886#endif
4609345887
46094#ifdef __LITTLE_ENDIAN__45888#ifdef __LITTLE_ENDIAN__
46095#define vsudot_laneq_s32(__p0_276, __p1_276, __p2_276, __p3_276) __extension__ ({ \45889#define vsudot_laneq_s32(__p0_268, __p1_268, __p2_268, __p3_268) __extension__ ({ \
46096 int32x2_t __ret_276; \45890 int32x2_t __ret_268; \
46097 int32x2_t __s0_276 = __p0_276; \45891 int32x2_t __s0_268 = __p0_268; \
46098 int8x8_t __s1_276 = __p1_276; \45892 int8x8_t __s1_268 = __p1_268; \
46099 uint8x16_t __s2_276 = __p2_276; \45893 uint8x16_t __s2_268 = __p2_268; \
46100 __ret_276 = vusdot_s32(__s0_276, __builtin_bit_cast(uint8x8_t, splat_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_276), __p3_276)), __s1_276); \45894 __ret_268 = vusdot_s32(__s0_268, __builtin_bit_cast(uint8x8_t, splat_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_268), __p3_268)), __s1_268); \
46101 __ret_276; \45895 __ret_268; \
46102})45896})
46103#else45897#else
46104#define vsudot_laneq_s32(__p0_277, __p1_277, __p2_277, __p3_277) __extension__ ({ \45898#define vsudot_laneq_s32(__p0_269, __p1_269, __p2_269, __p3_269) __extension__ ({ \
46105 int32x2_t __ret_277; \45899 int32x2_t __ret_269; \
46106 int32x2_t __s0_277 = __p0_277; \45900 int32x2_t __s0_269 = __p0_269; \
46107 int8x8_t __s1_277 = __p1_277; \45901 int8x8_t __s1_269 = __p1_269; \
46108 uint8x16_t __s2_277 = __p2_277; \45902 uint8x16_t __s2_269 = __p2_269; \
46109 int32x2_t __rev0_277; __rev0_277 = __builtin_shufflevector(__s0_277, __s0_277, __lane_reverse_64_32); \45903 int32x2_t __rev0_269; __rev0_269 = __builtin_shufflevector(__s0_269, __s0_269, __lane_reverse_64_32); \
46110 int8x8_t __rev1_277; __rev1_277 = __builtin_shufflevector(__s1_277, __s1_277, __lane_reverse_64_8); \45904 int8x8_t __rev1_269; __rev1_269 = __builtin_shufflevector(__s1_269, __s1_269, __lane_reverse_64_8); \
46111 uint8x16_t __rev2_277; __rev2_277 = __builtin_shufflevector(__s2_277, __s2_277, __lane_reverse_128_8); \45905 uint8x16_t __rev2_269; __rev2_269 = __builtin_shufflevector(__s2_269, __s2_269, __lane_reverse_128_8); \
46112 __ret_277 = __noswap_vusdot_s32(__rev0_277, __builtin_bit_cast(uint8x8_t, __noswap_splat_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_277), __p3_277)), __rev1_277); \45906 __ret_269 = __noswap_vusdot_s32(__rev0_269, __builtin_bit_cast(uint8x8_t, __noswap_splat_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_269), __p3_269)), __rev1_269); \
46113 __ret_277 = __builtin_shufflevector(__ret_277, __ret_277, __lane_reverse_64_32); \45907 __ret_269 = __builtin_shufflevector(__ret_269, __ret_269, __lane_reverse_64_32); \
46114 __ret_277; \45908 __ret_269; \
46115})45909})
46116#endif45910#endif
4611745911
46118#ifdef __LITTLE_ENDIAN__45912#ifdef __LITTLE_ENDIAN__
46119#define vusdotq_laneq_s32(__p0_278, __p1_278, __p2_278, __p3_278) __extension__ ({ \45913#define vusdotq_laneq_s32(__p0_270, __p1_270, __p2_270, __p3_270) __extension__ ({ \
46120 int32x4_t __ret_278; \45914 int32x4_t __ret_270; \
46121 int32x4_t __s0_278 = __p0_278; \45915 int32x4_t __s0_270 = __p0_270; \
46122 uint8x16_t __s1_278 = __p1_278; \45916 uint8x16_t __s1_270 = __p1_270; \
46123 int8x16_t __s2_278 = __p2_278; \45917 int8x16_t __s2_270 = __p2_270; \
46124 __ret_278 = vusdotq_s32(__s0_278, __s1_278, __builtin_bit_cast(int8x16_t, splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_278), __p3_278))); \45918 __ret_270 = vusdotq_s32(__s0_270, __s1_270, __builtin_bit_cast(int8x16_t, splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_270), __p3_270))); \
46125 __ret_278; \45919 __ret_270; \
46126})45920})
46127#else45921#else
46128#define vusdotq_laneq_s32(__p0_279, __p1_279, __p2_279, __p3_279) __extension__ ({ \45922#define vusdotq_laneq_s32(__p0_271, __p1_271, __p2_271, __p3_271) __extension__ ({ \
46129 int32x4_t __ret_279; \45923 int32x4_t __ret_271; \
46130 int32x4_t __s0_279 = __p0_279; \45924 int32x4_t __s0_271 = __p0_271; \
46131 uint8x16_t __s1_279 = __p1_279; \45925 uint8x16_t __s1_271 = __p1_271; \
46132 int8x16_t __s2_279 = __p2_279; \45926 int8x16_t __s2_271 = __p2_271; \
46133 int32x4_t __rev0_279; __rev0_279 = __builtin_shufflevector(__s0_279, __s0_279, __lane_reverse_128_32); \45927 int32x4_t __rev0_271; __rev0_271 = __builtin_shufflevector(__s0_271, __s0_271, __lane_reverse_128_32); \
46134 uint8x16_t __rev1_279; __rev1_279 = __builtin_shufflevector(__s1_279, __s1_279, __lane_reverse_128_8); \45928 uint8x16_t __rev1_271; __rev1_271 = __builtin_shufflevector(__s1_271, __s1_271, __lane_reverse_128_8); \
46135 int8x16_t __rev2_279; __rev2_279 = __builtin_shufflevector(__s2_279, __s2_279, __lane_reverse_128_8); \45929 int8x16_t __rev2_271; __rev2_271 = __builtin_shufflevector(__s2_271, __s2_271, __lane_reverse_128_8); \
46136 __ret_279 = __noswap_vusdotq_s32(__rev0_279, __rev1_279, __builtin_bit_cast(int8x16_t, __noswap_splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_279), __p3_279))); \45930 __ret_271 = __noswap_vusdotq_s32(__rev0_271, __rev1_271, __builtin_bit_cast(int8x16_t, __noswap_splatq_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_271), __p3_271))); \
46137 __ret_279 = __builtin_shufflevector(__ret_279, __ret_279, __lane_reverse_128_32); \45931 __ret_271 = __builtin_shufflevector(__ret_271, __ret_271, __lane_reverse_128_32); \
46138 __ret_279; \45932 __ret_271; \
46139})45933})
46140#endif45934#endif
4614145935
46142#ifdef __LITTLE_ENDIAN__45936#ifdef __LITTLE_ENDIAN__
46143#define vusdot_laneq_s32(__p0_280, __p1_280, __p2_280, __p3_280) __extension__ ({ \45937#define vusdot_laneq_s32(__p0_272, __p1_272, __p2_272, __p3_272) __extension__ ({ \
46144 int32x2_t __ret_280; \45938 int32x2_t __ret_272; \
46145 int32x2_t __s0_280 = __p0_280; \45939 int32x2_t __s0_272 = __p0_272; \
46146 uint8x8_t __s1_280 = __p1_280; \45940 uint8x8_t __s1_272 = __p1_272; \
46147 int8x16_t __s2_280 = __p2_280; \45941 int8x16_t __s2_272 = __p2_272; \
46148 __ret_280 = vusdot_s32(__s0_280, __s1_280, __builtin_bit_cast(int8x8_t, splat_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_280), __p3_280))); \45942 __ret_272 = vusdot_s32(__s0_272, __s1_272, __builtin_bit_cast(int8x8_t, splat_laneq_s32(__builtin_bit_cast(int32x4_t, __s2_272), __p3_272))); \
46149 __ret_280; \45943 __ret_272; \
46150})45944})
46151#else45945#else
46152#define vusdot_laneq_s32(__p0_281, __p1_281, __p2_281, __p3_281) __extension__ ({ \45946#define vusdot_laneq_s32(__p0_273, __p1_273, __p2_273, __p3_273) __extension__ ({ \
46153 int32x2_t __ret_281; \45947 int32x2_t __ret_273; \
46154 int32x2_t __s0_281 = __p0_281; \45948 int32x2_t __s0_273 = __p0_273; \
46155 uint8x8_t __s1_281 = __p1_281; \45949 uint8x8_t __s1_273 = __p1_273; \
46156 int8x16_t __s2_281 = __p2_281; \45950 int8x16_t __s2_273 = __p2_273; \
46157 int32x2_t __rev0_281; __rev0_281 = __builtin_shufflevector(__s0_281, __s0_281, __lane_reverse_64_32); \45951 int32x2_t __rev0_273; __rev0_273 = __builtin_shufflevector(__s0_273, __s0_273, __lane_reverse_64_32); \
46158 uint8x8_t __rev1_281; __rev1_281 = __builtin_shufflevector(__s1_281, __s1_281, __lane_reverse_64_8); \45952 uint8x8_t __rev1_273; __rev1_273 = __builtin_shufflevector(__s1_273, __s1_273, __lane_reverse_64_8); \
46159 int8x16_t __rev2_281; __rev2_281 = __builtin_shufflevector(__s2_281, __s2_281, __lane_reverse_128_8); \45953 int8x16_t __rev2_273; __rev2_273 = __builtin_shufflevector(__s2_273, __s2_273, __lane_reverse_128_8); \
46160 __ret_281 = __noswap_vusdot_s32(__rev0_281, __rev1_281, __builtin_bit_cast(int8x8_t, __noswap_splat_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_281), __p3_281))); \45954 __ret_273 = __noswap_vusdot_s32(__rev0_273, __rev1_273, __builtin_bit_cast(int8x8_t, __noswap_splat_laneq_s32(__builtin_bit_cast(int32x4_t, __rev2_273), __p3_273))); \
46161 __ret_281 = __builtin_shufflevector(__ret_281, __ret_281, __lane_reverse_64_32); \45955 __ret_273 = __builtin_shufflevector(__ret_273, __ret_273, __lane_reverse_64_32); \
46162 __ret_281; \45956 __ret_273; \
46163})45957})
46164#endif45958#endif
4616545959
...@@ -48579,974 +48373,1058 @@ __ai __attribute__((target("neon"))) float64x2_t vcombine_f64(float64x1_t __p0,...@@ -48579,974 +48373,1058 @@ __ai __attribute__((target("neon"))) float64x2_t vcombine_f64(float64x1_t __p0,
48579#endif48373#endif
4858048374
48581#ifdef __LITTLE_ENDIAN__48375#ifdef __LITTLE_ENDIAN__
48582#define vcopyq_lane_p8(__p0_282, __p1_282, __p2_282, __p3_282) __extension__ ({ \48376#define vcopyq_lane_p8(__p0_274, __p1_274, __p2_274, __p3_274) __extension__ ({ \
48583 poly8x16_t __ret_282; \48377 poly8x16_t __ret_274; \
48584 poly8x16_t __s0_282 = __p0_282; \48378 poly8x16_t __s0_274 = __p0_274; \
48585 poly8x8_t __s2_282 = __p2_282; \48379 poly8x8_t __s2_274 = __p2_274; \
48586 __ret_282 = vsetq_lane_p8(vget_lane_p8(__s2_282, __p3_282), __s0_282, __p1_282); \48380 __ret_274 = vsetq_lane_p8(vget_lane_p8(__s2_274, __p3_274), __s0_274, __p1_274); \
48381 __ret_274; \
48382})
48383#else
48384#define vcopyq_lane_p8(__p0_275, __p1_275, __p2_275, __p3_275) __extension__ ({ \
48385 poly8x16_t __ret_275; \
48386 poly8x16_t __s0_275 = __p0_275; \
48387 poly8x8_t __s2_275 = __p2_275; \
48388 poly8x16_t __rev0_275; __rev0_275 = __builtin_shufflevector(__s0_275, __s0_275, __lane_reverse_128_8); \
48389 poly8x8_t __rev2_275; __rev2_275 = __builtin_shufflevector(__s2_275, __s2_275, __lane_reverse_64_8); \
48390 __ret_275 = __noswap_vsetq_lane_p8(__noswap_vget_lane_p8(__rev2_275, __p3_275), __rev0_275, __p1_275); \
48391 __ret_275 = __builtin_shufflevector(__ret_275, __ret_275, __lane_reverse_128_8); \
48392 __ret_275; \
48393})
48394#endif
48395
48396#ifdef __LITTLE_ENDIAN__
48397#define vcopyq_lane_p16(__p0_276, __p1_276, __p2_276, __p3_276) __extension__ ({ \
48398 poly16x8_t __ret_276; \
48399 poly16x8_t __s0_276 = __p0_276; \
48400 poly16x4_t __s2_276 = __p2_276; \
48401 __ret_276 = vsetq_lane_p16(vget_lane_p16(__s2_276, __p3_276), __s0_276, __p1_276); \
48402 __ret_276; \
48403})
48404#else
48405#define vcopyq_lane_p16(__p0_277, __p1_277, __p2_277, __p3_277) __extension__ ({ \
48406 poly16x8_t __ret_277; \
48407 poly16x8_t __s0_277 = __p0_277; \
48408 poly16x4_t __s2_277 = __p2_277; \
48409 poly16x8_t __rev0_277; __rev0_277 = __builtin_shufflevector(__s0_277, __s0_277, __lane_reverse_128_16); \
48410 poly16x4_t __rev2_277; __rev2_277 = __builtin_shufflevector(__s2_277, __s2_277, __lane_reverse_64_16); \
48411 __ret_277 = __noswap_vsetq_lane_p16(__noswap_vget_lane_p16(__rev2_277, __p3_277), __rev0_277, __p1_277); \
48412 __ret_277 = __builtin_shufflevector(__ret_277, __ret_277, __lane_reverse_128_16); \
48413 __ret_277; \
48414})
48415#endif
48416
48417#ifdef __LITTLE_ENDIAN__
48418#define vcopyq_lane_u8(__p0_278, __p1_278, __p2_278, __p3_278) __extension__ ({ \
48419 uint8x16_t __ret_278; \
48420 uint8x16_t __s0_278 = __p0_278; \
48421 uint8x8_t __s2_278 = __p2_278; \
48422 __ret_278 = vsetq_lane_u8(vget_lane_u8(__s2_278, __p3_278), __s0_278, __p1_278); \
48423 __ret_278; \
48424})
48425#else
48426#define vcopyq_lane_u8(__p0_279, __p1_279, __p2_279, __p3_279) __extension__ ({ \
48427 uint8x16_t __ret_279; \
48428 uint8x16_t __s0_279 = __p0_279; \
48429 uint8x8_t __s2_279 = __p2_279; \
48430 uint8x16_t __rev0_279; __rev0_279 = __builtin_shufflevector(__s0_279, __s0_279, __lane_reverse_128_8); \
48431 uint8x8_t __rev2_279; __rev2_279 = __builtin_shufflevector(__s2_279, __s2_279, __lane_reverse_64_8); \
48432 __ret_279 = __noswap_vsetq_lane_u8(__noswap_vget_lane_u8(__rev2_279, __p3_279), __rev0_279, __p1_279); \
48433 __ret_279 = __builtin_shufflevector(__ret_279, __ret_279, __lane_reverse_128_8); \
48434 __ret_279; \
48435})
48436#endif
48437
48438#ifdef __LITTLE_ENDIAN__
48439#define vcopyq_lane_u32(__p0_280, __p1_280, __p2_280, __p3_280) __extension__ ({ \
48440 uint32x4_t __ret_280; \
48441 uint32x4_t __s0_280 = __p0_280; \
48442 uint32x2_t __s2_280 = __p2_280; \
48443 __ret_280 = vsetq_lane_u32(vget_lane_u32(__s2_280, __p3_280), __s0_280, __p1_280); \
48444 __ret_280; \
48445})
48446#else
48447#define vcopyq_lane_u32(__p0_281, __p1_281, __p2_281, __p3_281) __extension__ ({ \
48448 uint32x4_t __ret_281; \
48449 uint32x4_t __s0_281 = __p0_281; \
48450 uint32x2_t __s2_281 = __p2_281; \
48451 uint32x4_t __rev0_281; __rev0_281 = __builtin_shufflevector(__s0_281, __s0_281, __lane_reverse_128_32); \
48452 uint32x2_t __rev2_281; __rev2_281 = __builtin_shufflevector(__s2_281, __s2_281, __lane_reverse_64_32); \
48453 __ret_281 = __noswap_vsetq_lane_u32(__noswap_vget_lane_u32(__rev2_281, __p3_281), __rev0_281, __p1_281); \
48454 __ret_281 = __builtin_shufflevector(__ret_281, __ret_281, __lane_reverse_128_32); \
48455 __ret_281; \
48456})
48457#endif
48458
48459#ifdef __LITTLE_ENDIAN__
48460#define vcopyq_lane_u64(__p0_282, __p1_282, __p2_282, __p3_282) __extension__ ({ \
48461 uint64x2_t __ret_282; \
48462 uint64x2_t __s0_282 = __p0_282; \
48463 uint64x1_t __s2_282 = __p2_282; \
48464 __ret_282 = vsetq_lane_u64(vget_lane_u64(__s2_282, __p3_282), __s0_282, __p1_282); \
48587 __ret_282; \48465 __ret_282; \
48588})48466})
48589#else48467#else
48590#define vcopyq_lane_p8(__p0_283, __p1_283, __p2_283, __p3_283) __extension__ ({ \48468#define vcopyq_lane_u64(__p0_283, __p1_283, __p2_283, __p3_283) __extension__ ({ \
48591 poly8x16_t __ret_283; \48469 uint64x2_t __ret_283; \
48592 poly8x16_t __s0_283 = __p0_283; \48470 uint64x2_t __s0_283 = __p0_283; \
48593 poly8x8_t __s2_283 = __p2_283; \48471 uint64x1_t __s2_283 = __p2_283; \
48594 poly8x16_t __rev0_283; __rev0_283 = __builtin_shufflevector(__s0_283, __s0_283, __lane_reverse_128_8); \48472 uint64x2_t __rev0_283; __rev0_283 = __builtin_shufflevector(__s0_283, __s0_283, __lane_reverse_128_64); \
48595 poly8x8_t __rev2_283; __rev2_283 = __builtin_shufflevector(__s2_283, __s2_283, __lane_reverse_64_8); \48473 __ret_283 = __noswap_vsetq_lane_u64(vget_lane_u64(__s2_283, __p3_283), __rev0_283, __p1_283); \
48596 __ret_283 = __noswap_vsetq_lane_p8(__noswap_vget_lane_p8(__rev2_283, __p3_283), __rev0_283, __p1_283); \48474 __ret_283 = __builtin_shufflevector(__ret_283, __ret_283, __lane_reverse_128_64); \
48597 __ret_283 = __builtin_shufflevector(__ret_283, __ret_283, __lane_reverse_128_8); \
48598 __ret_283; \48475 __ret_283; \
48599})48476})
48600#endif48477#endif
4860148478
48602#ifdef __LITTLE_ENDIAN__48479#ifdef __LITTLE_ENDIAN__
48603#define vcopyq_lane_p16(__p0_284, __p1_284, __p2_284, __p3_284) __extension__ ({ \48480#define vcopyq_lane_u16(__p0_284, __p1_284, __p2_284, __p3_284) __extension__ ({ \
48604 poly16x8_t __ret_284; \48481 uint16x8_t __ret_284; \
48605 poly16x8_t __s0_284 = __p0_284; \48482 uint16x8_t __s0_284 = __p0_284; \
48606 poly16x4_t __s2_284 = __p2_284; \48483 uint16x4_t __s2_284 = __p2_284; \
48607 __ret_284 = vsetq_lane_p16(vget_lane_p16(__s2_284, __p3_284), __s0_284, __p1_284); \48484 __ret_284 = vsetq_lane_u16(vget_lane_u16(__s2_284, __p3_284), __s0_284, __p1_284); \
48608 __ret_284; \48485 __ret_284; \
48609})48486})
48610#else48487#else
48611#define vcopyq_lane_p16(__p0_285, __p1_285, __p2_285, __p3_285) __extension__ ({ \48488#define vcopyq_lane_u16(__p0_285, __p1_285, __p2_285, __p3_285) __extension__ ({ \
48612 poly16x8_t __ret_285; \48489 uint16x8_t __ret_285; \
48613 poly16x8_t __s0_285 = __p0_285; \48490 uint16x8_t __s0_285 = __p0_285; \
48614 poly16x4_t __s2_285 = __p2_285; \48491 uint16x4_t __s2_285 = __p2_285; \
48615 poly16x8_t __rev0_285; __rev0_285 = __builtin_shufflevector(__s0_285, __s0_285, __lane_reverse_128_16); \48492 uint16x8_t __rev0_285; __rev0_285 = __builtin_shufflevector(__s0_285, __s0_285, __lane_reverse_128_16); \
48616 poly16x4_t __rev2_285; __rev2_285 = __builtin_shufflevector(__s2_285, __s2_285, __lane_reverse_64_16); \48493 uint16x4_t __rev2_285; __rev2_285 = __builtin_shufflevector(__s2_285, __s2_285, __lane_reverse_64_16); \
48617 __ret_285 = __noswap_vsetq_lane_p16(__noswap_vget_lane_p16(__rev2_285, __p3_285), __rev0_285, __p1_285); \48494 __ret_285 = __noswap_vsetq_lane_u16(__noswap_vget_lane_u16(__rev2_285, __p3_285), __rev0_285, __p1_285); \
48618 __ret_285 = __builtin_shufflevector(__ret_285, __ret_285, __lane_reverse_128_16); \48495 __ret_285 = __builtin_shufflevector(__ret_285, __ret_285, __lane_reverse_128_16); \
48619 __ret_285; \48496 __ret_285; \
48620})48497})
48621#endif48498#endif
4862248499
48623#ifdef __LITTLE_ENDIAN__48500#ifdef __LITTLE_ENDIAN__
48624#define vcopyq_lane_u8(__p0_286, __p1_286, __p2_286, __p3_286) __extension__ ({ \48501#define vcopyq_lane_s8(__p0_286, __p1_286, __p2_286, __p3_286) __extension__ ({ \
48625 uint8x16_t __ret_286; \48502 int8x16_t __ret_286; \
48626 uint8x16_t __s0_286 = __p0_286; \48503 int8x16_t __s0_286 = __p0_286; \
48627 uint8x8_t __s2_286 = __p2_286; \48504 int8x8_t __s2_286 = __p2_286; \
48628 __ret_286 = vsetq_lane_u8(vget_lane_u8(__s2_286, __p3_286), __s0_286, __p1_286); \48505 __ret_286 = vsetq_lane_s8(vget_lane_s8(__s2_286, __p3_286), __s0_286, __p1_286); \
48629 __ret_286; \48506 __ret_286; \
48630})48507})
48631#else48508#else
48632#define vcopyq_lane_u8(__p0_287, __p1_287, __p2_287, __p3_287) __extension__ ({ \48509#define vcopyq_lane_s8(__p0_287, __p1_287, __p2_287, __p3_287) __extension__ ({ \
48633 uint8x16_t __ret_287; \48510 int8x16_t __ret_287; \
48634 uint8x16_t __s0_287 = __p0_287; \48511 int8x16_t __s0_287 = __p0_287; \
48635 uint8x8_t __s2_287 = __p2_287; \48512 int8x8_t __s2_287 = __p2_287; \
48636 uint8x16_t __rev0_287; __rev0_287 = __builtin_shufflevector(__s0_287, __s0_287, __lane_reverse_128_8); \48513 int8x16_t __rev0_287; __rev0_287 = __builtin_shufflevector(__s0_287, __s0_287, __lane_reverse_128_8); \
48637 uint8x8_t __rev2_287; __rev2_287 = __builtin_shufflevector(__s2_287, __s2_287, __lane_reverse_64_8); \48514 int8x8_t __rev2_287; __rev2_287 = __builtin_shufflevector(__s2_287, __s2_287, __lane_reverse_64_8); \
48638 __ret_287 = __noswap_vsetq_lane_u8(__noswap_vget_lane_u8(__rev2_287, __p3_287), __rev0_287, __p1_287); \48515 __ret_287 = __noswap_vsetq_lane_s8(__noswap_vget_lane_s8(__rev2_287, __p3_287), __rev0_287, __p1_287); \
48639 __ret_287 = __builtin_shufflevector(__ret_287, __ret_287, __lane_reverse_128_8); \48516 __ret_287 = __builtin_shufflevector(__ret_287, __ret_287, __lane_reverse_128_8); \
48640 __ret_287; \48517 __ret_287; \
48641})48518})
48642#endif48519#endif
4864348520
48644#ifdef __LITTLE_ENDIAN__48521#ifdef __LITTLE_ENDIAN__
48645#define vcopyq_lane_u32(__p0_288, __p1_288, __p2_288, __p3_288) __extension__ ({ \48522#define vcopyq_lane_f32(__p0_288, __p1_288, __p2_288, __p3_288) __extension__ ({ \
48646 uint32x4_t __ret_288; \48523 float32x4_t __ret_288; \
48647 uint32x4_t __s0_288 = __p0_288; \48524 float32x4_t __s0_288 = __p0_288; \
48648 uint32x2_t __s2_288 = __p2_288; \48525 float32x2_t __s2_288 = __p2_288; \
48649 __ret_288 = vsetq_lane_u32(vget_lane_u32(__s2_288, __p3_288), __s0_288, __p1_288); \48526 __ret_288 = vsetq_lane_f32(vget_lane_f32(__s2_288, __p3_288), __s0_288, __p1_288); \
48650 __ret_288; \48527 __ret_288; \
48651})48528})
48652#else48529#else
48653#define vcopyq_lane_u32(__p0_289, __p1_289, __p2_289, __p3_289) __extension__ ({ \48530#define vcopyq_lane_f32(__p0_289, __p1_289, __p2_289, __p3_289) __extension__ ({ \
48654 uint32x4_t __ret_289; \48531 float32x4_t __ret_289; \
48655 uint32x4_t __s0_289 = __p0_289; \48532 float32x4_t __s0_289 = __p0_289; \
48656 uint32x2_t __s2_289 = __p2_289; \48533 float32x2_t __s2_289 = __p2_289; \
48657 uint32x4_t __rev0_289; __rev0_289 = __builtin_shufflevector(__s0_289, __s0_289, __lane_reverse_128_32); \48534 float32x4_t __rev0_289; __rev0_289 = __builtin_shufflevector(__s0_289, __s0_289, __lane_reverse_128_32); \
48658 uint32x2_t __rev2_289; __rev2_289 = __builtin_shufflevector(__s2_289, __s2_289, __lane_reverse_64_32); \48535 float32x2_t __rev2_289; __rev2_289 = __builtin_shufflevector(__s2_289, __s2_289, __lane_reverse_64_32); \
48659 __ret_289 = __noswap_vsetq_lane_u32(__noswap_vget_lane_u32(__rev2_289, __p3_289), __rev0_289, __p1_289); \48536 __ret_289 = __noswap_vsetq_lane_f32(__noswap_vget_lane_f32(__rev2_289, __p3_289), __rev0_289, __p1_289); \
48660 __ret_289 = __builtin_shufflevector(__ret_289, __ret_289, __lane_reverse_128_32); \48537 __ret_289 = __builtin_shufflevector(__ret_289, __ret_289, __lane_reverse_128_32); \
48661 __ret_289; \48538 __ret_289; \
48662})48539})
48663#endif48540#endif
4866448541
48665#ifdef __LITTLE_ENDIAN__48542#ifdef __LITTLE_ENDIAN__
48666#define vcopyq_lane_u64(__p0_290, __p1_290, __p2_290, __p3_290) __extension__ ({ \48543#define vcopyq_lane_s32(__p0_290, __p1_290, __p2_290, __p3_290) __extension__ ({ \
48667 uint64x2_t __ret_290; \48544 int32x4_t __ret_290; \
48668 uint64x2_t __s0_290 = __p0_290; \48545 int32x4_t __s0_290 = __p0_290; \
48669 uint64x1_t __s2_290 = __p2_290; \48546 int32x2_t __s2_290 = __p2_290; \
48670 __ret_290 = vsetq_lane_u64(vget_lane_u64(__s2_290, __p3_290), __s0_290, __p1_290); \48547 __ret_290 = vsetq_lane_s32(vget_lane_s32(__s2_290, __p3_290), __s0_290, __p1_290); \
48671 __ret_290; \48548 __ret_290; \
48672})48549})
48673#else48550#else
48674#define vcopyq_lane_u64(__p0_291, __p1_291, __p2_291, __p3_291) __extension__ ({ \48551#define vcopyq_lane_s32(__p0_291, __p1_291, __p2_291, __p3_291) __extension__ ({ \
48675 uint64x2_t __ret_291; \48552 int32x4_t __ret_291; \
48676 uint64x2_t __s0_291 = __p0_291; \48553 int32x4_t __s0_291 = __p0_291; \
48677 uint64x1_t __s2_291 = __p2_291; \48554 int32x2_t __s2_291 = __p2_291; \
48678 uint64x2_t __rev0_291; __rev0_291 = __builtin_shufflevector(__s0_291, __s0_291, __lane_reverse_128_64); \48555 int32x4_t __rev0_291; __rev0_291 = __builtin_shufflevector(__s0_291, __s0_291, __lane_reverse_128_32); \
48679 __ret_291 = __noswap_vsetq_lane_u64(vget_lane_u64(__s2_291, __p3_291), __rev0_291, __p1_291); \48556 int32x2_t __rev2_291; __rev2_291 = __builtin_shufflevector(__s2_291, __s2_291, __lane_reverse_64_32); \
48680 __ret_291 = __builtin_shufflevector(__ret_291, __ret_291, __lane_reverse_128_64); \48557 __ret_291 = __noswap_vsetq_lane_s32(__noswap_vget_lane_s32(__rev2_291, __p3_291), __rev0_291, __p1_291); \
48558 __ret_291 = __builtin_shufflevector(__ret_291, __ret_291, __lane_reverse_128_32); \
48681 __ret_291; \48559 __ret_291; \
48682})48560})
48683#endif48561#endif
4868448562
48685#ifdef __LITTLE_ENDIAN__48563#ifdef __LITTLE_ENDIAN__
48686#define vcopyq_lane_u16(__p0_292, __p1_292, __p2_292, __p3_292) __extension__ ({ \48564#define vcopyq_lane_s64(__p0_292, __p1_292, __p2_292, __p3_292) __extension__ ({ \
48687 uint16x8_t __ret_292; \48565 int64x2_t __ret_292; \
48688 uint16x8_t __s0_292 = __p0_292; \48566 int64x2_t __s0_292 = __p0_292; \
48689 uint16x4_t __s2_292 = __p2_292; \48567 int64x1_t __s2_292 = __p2_292; \
48690 __ret_292 = vsetq_lane_u16(vget_lane_u16(__s2_292, __p3_292), __s0_292, __p1_292); \48568 __ret_292 = vsetq_lane_s64(vget_lane_s64(__s2_292, __p3_292), __s0_292, __p1_292); \
48691 __ret_292; \48569 __ret_292; \
48692})48570})
48693#else48571#else
48694#define vcopyq_lane_u16(__p0_293, __p1_293, __p2_293, __p3_293) __extension__ ({ \48572#define vcopyq_lane_s64(__p0_293, __p1_293, __p2_293, __p3_293) __extension__ ({ \
48695 uint16x8_t __ret_293; \48573 int64x2_t __ret_293; \
48696 uint16x8_t __s0_293 = __p0_293; \48574 int64x2_t __s0_293 = __p0_293; \
48697 uint16x4_t __s2_293 = __p2_293; \48575 int64x1_t __s2_293 = __p2_293; \
48698 uint16x8_t __rev0_293; __rev0_293 = __builtin_shufflevector(__s0_293, __s0_293, __lane_reverse_128_16); \48576 int64x2_t __rev0_293; __rev0_293 = __builtin_shufflevector(__s0_293, __s0_293, __lane_reverse_128_64); \
48699 uint16x4_t __rev2_293; __rev2_293 = __builtin_shufflevector(__s2_293, __s2_293, __lane_reverse_64_16); \48577 __ret_293 = __noswap_vsetq_lane_s64(vget_lane_s64(__s2_293, __p3_293), __rev0_293, __p1_293); \
48700 __ret_293 = __noswap_vsetq_lane_u16(__noswap_vget_lane_u16(__rev2_293, __p3_293), __rev0_293, __p1_293); \48578 __ret_293 = __builtin_shufflevector(__ret_293, __ret_293, __lane_reverse_128_64); \
48701 __ret_293 = __builtin_shufflevector(__ret_293, __ret_293, __lane_reverse_128_16); \
48702 __ret_293; \48579 __ret_293; \
48703})48580})
48704#endif48581#endif
4870548582
48706#ifdef __LITTLE_ENDIAN__48583#ifdef __LITTLE_ENDIAN__
48707#define vcopyq_lane_s8(__p0_294, __p1_294, __p2_294, __p3_294) __extension__ ({ \48584#define vcopyq_lane_mf8(__p0_294, __p1_294, __p2_294, __p3_294) __extension__ ({ \
48708 int8x16_t __ret_294; \48585 mfloat8x16_t __ret_294; \
48709 int8x16_t __s0_294 = __p0_294; \48586 mfloat8x16_t __s0_294 = __p0_294; \
48710 int8x8_t __s2_294 = __p2_294; \48587 mfloat8x8_t __s2_294 = __p2_294; \
48711 __ret_294 = vsetq_lane_s8(vget_lane_s8(__s2_294, __p3_294), __s0_294, __p1_294); \48588 __ret_294 = vsetq_lane_mf8(vget_lane_mf8(__s2_294, __p3_294), __s0_294, __p1_294); \
48712 __ret_294; \48589 __ret_294; \
48713})48590})
48714#else48591#else
48715#define vcopyq_lane_s8(__p0_295, __p1_295, __p2_295, __p3_295) __extension__ ({ \48592#define vcopyq_lane_mf8(__p0_295, __p1_295, __p2_295, __p3_295) __extension__ ({ \
48716 int8x16_t __ret_295; \48593 mfloat8x16_t __ret_295; \
48717 int8x16_t __s0_295 = __p0_295; \48594 mfloat8x16_t __s0_295 = __p0_295; \
48718 int8x8_t __s2_295 = __p2_295; \48595 mfloat8x8_t __s2_295 = __p2_295; \
48719 int8x16_t __rev0_295; __rev0_295 = __builtin_shufflevector(__s0_295, __s0_295, __lane_reverse_128_8); \48596 mfloat8x16_t __rev0_295; __rev0_295 = __builtin_shufflevector(__s0_295, __s0_295, __lane_reverse_128_8); \
48720 int8x8_t __rev2_295; __rev2_295 = __builtin_shufflevector(__s2_295, __s2_295, __lane_reverse_64_8); \48597 mfloat8x8_t __rev2_295; __rev2_295 = __builtin_shufflevector(__s2_295, __s2_295, __lane_reverse_64_8); \
48721 __ret_295 = __noswap_vsetq_lane_s8(__noswap_vget_lane_s8(__rev2_295, __p3_295), __rev0_295, __p1_295); \48598 __ret_295 = __noswap_vsetq_lane_mf8(__noswap_vget_lane_mf8(__rev2_295, __p3_295), __rev0_295, __p1_295); \
48722 __ret_295 = __builtin_shufflevector(__ret_295, __ret_295, __lane_reverse_128_8); \48599 __ret_295 = __builtin_shufflevector(__ret_295, __ret_295, __lane_reverse_128_8); \
48723 __ret_295; \48600 __ret_295; \
48724})48601})
48725#endif48602#endif
4872648603
48727#ifdef __LITTLE_ENDIAN__48604#ifdef __LITTLE_ENDIAN__
48728#define vcopyq_lane_f32(__p0_296, __p1_296, __p2_296, __p3_296) __extension__ ({ \48605#define vcopyq_lane_s16(__p0_296, __p1_296, __p2_296, __p3_296) __extension__ ({ \
48729 float32x4_t __ret_296; \48606 int16x8_t __ret_296; \
48730 float32x4_t __s0_296 = __p0_296; \48607 int16x8_t __s0_296 = __p0_296; \
48731 float32x2_t __s2_296 = __p2_296; \48608 int16x4_t __s2_296 = __p2_296; \
48732 __ret_296 = vsetq_lane_f32(vget_lane_f32(__s2_296, __p3_296), __s0_296, __p1_296); \48609 __ret_296 = vsetq_lane_s16(vget_lane_s16(__s2_296, __p3_296), __s0_296, __p1_296); \
48733 __ret_296; \48610 __ret_296; \
48734})48611})
48735#else48612#else
48736#define vcopyq_lane_f32(__p0_297, __p1_297, __p2_297, __p3_297) __extension__ ({ \48613#define vcopyq_lane_s16(__p0_297, __p1_297, __p2_297, __p3_297) __extension__ ({ \
48737 float32x4_t __ret_297; \48614 int16x8_t __ret_297; \
48738 float32x4_t __s0_297 = __p0_297; \48615 int16x8_t __s0_297 = __p0_297; \
48739 float32x2_t __s2_297 = __p2_297; \48616 int16x4_t __s2_297 = __p2_297; \
48740 float32x4_t __rev0_297; __rev0_297 = __builtin_shufflevector(__s0_297, __s0_297, __lane_reverse_128_32); \48617 int16x8_t __rev0_297; __rev0_297 = __builtin_shufflevector(__s0_297, __s0_297, __lane_reverse_128_16); \
48741 float32x2_t __rev2_297; __rev2_297 = __builtin_shufflevector(__s2_297, __s2_297, __lane_reverse_64_32); \48618 int16x4_t __rev2_297; __rev2_297 = __builtin_shufflevector(__s2_297, __s2_297, __lane_reverse_64_16); \
48742 __ret_297 = __noswap_vsetq_lane_f32(__noswap_vget_lane_f32(__rev2_297, __p3_297), __rev0_297, __p1_297); \48619 __ret_297 = __noswap_vsetq_lane_s16(__noswap_vget_lane_s16(__rev2_297, __p3_297), __rev0_297, __p1_297); \
48743 __ret_297 = __builtin_shufflevector(__ret_297, __ret_297, __lane_reverse_128_32); \48620 __ret_297 = __builtin_shufflevector(__ret_297, __ret_297, __lane_reverse_128_16); \
48744 __ret_297; \48621 __ret_297; \
48745})48622})
48746#endif48623#endif
4874748624
48748#ifdef __LITTLE_ENDIAN__48625#ifdef __LITTLE_ENDIAN__
48749#define vcopyq_lane_s32(__p0_298, __p1_298, __p2_298, __p3_298) __extension__ ({ \48626#define vcopyq_lane_bf16(__p0_298, __p1_298, __p2_298, __p3_298) __extension__ ({ \
48750 int32x4_t __ret_298; \48627 bfloat16x8_t __ret_298; \
48751 int32x4_t __s0_298 = __p0_298; \48628 bfloat16x8_t __s0_298 = __p0_298; \
48752 int32x2_t __s2_298 = __p2_298; \48629 bfloat16x4_t __s2_298 = __p2_298; \
48753 __ret_298 = vsetq_lane_s32(vget_lane_s32(__s2_298, __p3_298), __s0_298, __p1_298); \48630 __ret_298 = vsetq_lane_bf16(vget_lane_bf16(__s2_298, __p3_298), __s0_298, __p1_298); \
48754 __ret_298; \48631 __ret_298; \
48755})48632})
48756#else48633#else
48757#define vcopyq_lane_s32(__p0_299, __p1_299, __p2_299, __p3_299) __extension__ ({ \48634#define vcopyq_lane_bf16(__p0_299, __p1_299, __p2_299, __p3_299) __extension__ ({ \
48758 int32x4_t __ret_299; \48635 bfloat16x8_t __ret_299; \
48759 int32x4_t __s0_299 = __p0_299; \48636 bfloat16x8_t __s0_299 = __p0_299; \
48760 int32x2_t __s2_299 = __p2_299; \48637 bfloat16x4_t __s2_299 = __p2_299; \
48761 int32x4_t __rev0_299; __rev0_299 = __builtin_shufflevector(__s0_299, __s0_299, __lane_reverse_128_32); \48638 bfloat16x8_t __rev0_299; __rev0_299 = __builtin_shufflevector(__s0_299, __s0_299, __lane_reverse_128_16); \
48762 int32x2_t __rev2_299; __rev2_299 = __builtin_shufflevector(__s2_299, __s2_299, __lane_reverse_64_32); \48639 bfloat16x4_t __rev2_299; __rev2_299 = __builtin_shufflevector(__s2_299, __s2_299, __lane_reverse_64_16); \
48763 __ret_299 = __noswap_vsetq_lane_s32(__noswap_vget_lane_s32(__rev2_299, __p3_299), __rev0_299, __p1_299); \48640 __ret_299 = __noswap_vsetq_lane_bf16(__noswap_vget_lane_bf16(__rev2_299, __p3_299), __rev0_299, __p1_299); \
48764 __ret_299 = __builtin_shufflevector(__ret_299, __ret_299, __lane_reverse_128_32); \48641 __ret_299 = __builtin_shufflevector(__ret_299, __ret_299, __lane_reverse_128_16); \
48765 __ret_299; \48642 __ret_299; \
48766})48643})
48767#endif48644#endif
4876848645
48769#ifdef __LITTLE_ENDIAN__48646#ifdef __LITTLE_ENDIAN__
48770#define vcopyq_lane_s64(__p0_300, __p1_300, __p2_300, __p3_300) __extension__ ({ \48647#define vcopy_lane_p8(__p0_300, __p1_300, __p2_300, __p3_300) __extension__ ({ \
48771 int64x2_t __ret_300; \48648 poly8x8_t __ret_300; \
48772 int64x2_t __s0_300 = __p0_300; \48649 poly8x8_t __s0_300 = __p0_300; \
48773 int64x1_t __s2_300 = __p2_300; \48650 poly8x8_t __s2_300 = __p2_300; \
48774 __ret_300 = vsetq_lane_s64(vget_lane_s64(__s2_300, __p3_300), __s0_300, __p1_300); \48651 __ret_300 = vset_lane_p8(vget_lane_p8(__s2_300, __p3_300), __s0_300, __p1_300); \
48775 __ret_300; \48652 __ret_300; \
48776})48653})
48777#else48654#else
48778#define vcopyq_lane_s64(__p0_301, __p1_301, __p2_301, __p3_301) __extension__ ({ \48655#define vcopy_lane_p8(__p0_301, __p1_301, __p2_301, __p3_301) __extension__ ({ \
48779 int64x2_t __ret_301; \48656 poly8x8_t __ret_301; \
48780 int64x2_t __s0_301 = __p0_301; \48657 poly8x8_t __s0_301 = __p0_301; \
48781 int64x1_t __s2_301 = __p2_301; \48658 poly8x8_t __s2_301 = __p2_301; \
48782 int64x2_t __rev0_301; __rev0_301 = __builtin_shufflevector(__s0_301, __s0_301, __lane_reverse_128_64); \48659 poly8x8_t __rev0_301; __rev0_301 = __builtin_shufflevector(__s0_301, __s0_301, __lane_reverse_64_8); \
48783 __ret_301 = __noswap_vsetq_lane_s64(vget_lane_s64(__s2_301, __p3_301), __rev0_301, __p1_301); \48660 poly8x8_t __rev2_301; __rev2_301 = __builtin_shufflevector(__s2_301, __s2_301, __lane_reverse_64_8); \
48784 __ret_301 = __builtin_shufflevector(__ret_301, __ret_301, __lane_reverse_128_64); \48661 __ret_301 = __noswap_vset_lane_p8(__noswap_vget_lane_p8(__rev2_301, __p3_301), __rev0_301, __p1_301); \
48662 __ret_301 = __builtin_shufflevector(__ret_301, __ret_301, __lane_reverse_64_8); \
48785 __ret_301; \48663 __ret_301; \
48786})48664})
48787#endif48665#endif
4878848666
48789#ifdef __LITTLE_ENDIAN__48667#ifdef __LITTLE_ENDIAN__
48790#define vcopyq_lane_mf8(__p0_302, __p1_302, __p2_302, __p3_302) __extension__ ({ \48668#define vcopy_lane_p16(__p0_302, __p1_302, __p2_302, __p3_302) __extension__ ({ \
48791 mfloat8x16_t __ret_302; \48669 poly16x4_t __ret_302; \
48792 mfloat8x16_t __s0_302 = __p0_302; \48670 poly16x4_t __s0_302 = __p0_302; \
48793 mfloat8x8_t __s2_302 = __p2_302; \48671 poly16x4_t __s2_302 = __p2_302; \
48794 __ret_302 = vsetq_lane_mf8(vget_lane_mf8(__s2_302, __p3_302), __s0_302, __p1_302); \48672 __ret_302 = vset_lane_p16(vget_lane_p16(__s2_302, __p3_302), __s0_302, __p1_302); \
48795 __ret_302; \48673 __ret_302; \
48796})48674})
48797#else48675#else
48798#define vcopyq_lane_mf8(__p0_303, __p1_303, __p2_303, __p3_303) __extension__ ({ \48676#define vcopy_lane_p16(__p0_303, __p1_303, __p2_303, __p3_303) __extension__ ({ \
48799 mfloat8x16_t __ret_303; \48677 poly16x4_t __ret_303; \
48800 mfloat8x16_t __s0_303 = __p0_303; \48678 poly16x4_t __s0_303 = __p0_303; \
48801 mfloat8x8_t __s2_303 = __p2_303; \48679 poly16x4_t __s2_303 = __p2_303; \
48802 mfloat8x16_t __rev0_303; __rev0_303 = __builtin_shufflevector(__s0_303, __s0_303, __lane_reverse_128_8); \48680 poly16x4_t __rev0_303; __rev0_303 = __builtin_shufflevector(__s0_303, __s0_303, __lane_reverse_64_16); \
48803 mfloat8x8_t __rev2_303; __rev2_303 = __builtin_shufflevector(__s2_303, __s2_303, __lane_reverse_64_8); \48681 poly16x4_t __rev2_303; __rev2_303 = __builtin_shufflevector(__s2_303, __s2_303, __lane_reverse_64_16); \
48804 __ret_303 = __noswap_vsetq_lane_mf8(__noswap_vget_lane_mf8(__rev2_303, __p3_303), __rev0_303, __p1_303); \48682 __ret_303 = __noswap_vset_lane_p16(__noswap_vget_lane_p16(__rev2_303, __p3_303), __rev0_303, __p1_303); \
48805 __ret_303 = __builtin_shufflevector(__ret_303, __ret_303, __lane_reverse_128_8); \48683 __ret_303 = __builtin_shufflevector(__ret_303, __ret_303, __lane_reverse_64_16); \
48806 __ret_303; \48684 __ret_303; \
48807})48685})
48808#endif48686#endif
4880948687
48810#ifdef __LITTLE_ENDIAN__48688#ifdef __LITTLE_ENDIAN__
48811#define vcopyq_lane_s16(__p0_304, __p1_304, __p2_304, __p3_304) __extension__ ({ \48689#define vcopy_lane_u8(__p0_304, __p1_304, __p2_304, __p3_304) __extension__ ({ \
48812 int16x8_t __ret_304; \48690 uint8x8_t __ret_304; \
48813 int16x8_t __s0_304 = __p0_304; \48691 uint8x8_t __s0_304 = __p0_304; \
48814 int16x4_t __s2_304 = __p2_304; \48692 uint8x8_t __s2_304 = __p2_304; \
48815 __ret_304 = vsetq_lane_s16(vget_lane_s16(__s2_304, __p3_304), __s0_304, __p1_304); \48693 __ret_304 = vset_lane_u8(vget_lane_u8(__s2_304, __p3_304), __s0_304, __p1_304); \
48816 __ret_304; \48694 __ret_304; \
48817})48695})
48818#else48696#else
48819#define vcopyq_lane_s16(__p0_305, __p1_305, __p2_305, __p3_305) __extension__ ({ \48697#define vcopy_lane_u8(__p0_305, __p1_305, __p2_305, __p3_305) __extension__ ({ \
48820 int16x8_t __ret_305; \48698 uint8x8_t __ret_305; \
48821 int16x8_t __s0_305 = __p0_305; \48699 uint8x8_t __s0_305 = __p0_305; \
48822 int16x4_t __s2_305 = __p2_305; \48700 uint8x8_t __s2_305 = __p2_305; \
48823 int16x8_t __rev0_305; __rev0_305 = __builtin_shufflevector(__s0_305, __s0_305, __lane_reverse_128_16); \48701 uint8x8_t __rev0_305; __rev0_305 = __builtin_shufflevector(__s0_305, __s0_305, __lane_reverse_64_8); \
48824 int16x4_t __rev2_305; __rev2_305 = __builtin_shufflevector(__s2_305, __s2_305, __lane_reverse_64_16); \48702 uint8x8_t __rev2_305; __rev2_305 = __builtin_shufflevector(__s2_305, __s2_305, __lane_reverse_64_8); \
48825 __ret_305 = __noswap_vsetq_lane_s16(__noswap_vget_lane_s16(__rev2_305, __p3_305), __rev0_305, __p1_305); \48703 __ret_305 = __noswap_vset_lane_u8(__noswap_vget_lane_u8(__rev2_305, __p3_305), __rev0_305, __p1_305); \
48826 __ret_305 = __builtin_shufflevector(__ret_305, __ret_305, __lane_reverse_128_16); \48704 __ret_305 = __builtin_shufflevector(__ret_305, __ret_305, __lane_reverse_64_8); \
48827 __ret_305; \48705 __ret_305; \
48828})48706})
48829#endif48707#endif
4883048708
48831#ifdef __LITTLE_ENDIAN__48709#ifdef __LITTLE_ENDIAN__
48832#define vcopy_lane_p8(__p0_306, __p1_306, __p2_306, __p3_306) __extension__ ({ \48710#define vcopy_lane_u32(__p0_306, __p1_306, __p2_306, __p3_306) __extension__ ({ \
48833 poly8x8_t __ret_306; \48711 uint32x2_t __ret_306; \
48834 poly8x8_t __s0_306 = __p0_306; \48712 uint32x2_t __s0_306 = __p0_306; \
48835 poly8x8_t __s2_306 = __p2_306; \48713 uint32x2_t __s2_306 = __p2_306; \
48836 __ret_306 = vset_lane_p8(vget_lane_p8(__s2_306, __p3_306), __s0_306, __p1_306); \48714 __ret_306 = vset_lane_u32(vget_lane_u32(__s2_306, __p3_306), __s0_306, __p1_306); \
48837 __ret_306; \48715 __ret_306; \
48838})48716})
48839#else48717#else
48840#define vcopy_lane_p8(__p0_307, __p1_307, __p2_307, __p3_307) __extension__ ({ \48718#define vcopy_lane_u32(__p0_307, __p1_307, __p2_307, __p3_307) __extension__ ({ \
48841 poly8x8_t __ret_307; \48719 uint32x2_t __ret_307; \
48842 poly8x8_t __s0_307 = __p0_307; \48720 uint32x2_t __s0_307 = __p0_307; \
48843 poly8x8_t __s2_307 = __p2_307; \48721 uint32x2_t __s2_307 = __p2_307; \
48844 poly8x8_t __rev0_307; __rev0_307 = __builtin_shufflevector(__s0_307, __s0_307, __lane_reverse_64_8); \48722 uint32x2_t __rev0_307; __rev0_307 = __builtin_shufflevector(__s0_307, __s0_307, __lane_reverse_64_32); \
48845 poly8x8_t __rev2_307; __rev2_307 = __builtin_shufflevector(__s2_307, __s2_307, __lane_reverse_64_8); \48723 uint32x2_t __rev2_307; __rev2_307 = __builtin_shufflevector(__s2_307, __s2_307, __lane_reverse_64_32); \
48846 __ret_307 = __noswap_vset_lane_p8(__noswap_vget_lane_p8(__rev2_307, __p3_307), __rev0_307, __p1_307); \48724 __ret_307 = __noswap_vset_lane_u32(__noswap_vget_lane_u32(__rev2_307, __p3_307), __rev0_307, __p1_307); \
48847 __ret_307 = __builtin_shufflevector(__ret_307, __ret_307, __lane_reverse_64_8); \48725 __ret_307 = __builtin_shufflevector(__ret_307, __ret_307, __lane_reverse_64_32); \
48848 __ret_307; \48726 __ret_307; \
48849})48727})
48850#endif48728#endif
4885148729
48852#ifdef __LITTLE_ENDIAN__48730#define vcopy_lane_u64(__p0_308, __p1_308, __p2_308, __p3_308) __extension__ ({ \
48853#define vcopy_lane_p16(__p0_308, __p1_308, __p2_308, __p3_308) __extension__ ({ \48731 uint64x1_t __ret_308; \
48854 poly16x4_t __ret_308; \48732 uint64x1_t __s0_308 = __p0_308; \
48855 poly16x4_t __s0_308 = __p0_308; \48733 uint64x1_t __s2_308 = __p2_308; \
48856 poly16x4_t __s2_308 = __p2_308; \48734 __ret_308 = vset_lane_u64(vget_lane_u64(__s2_308, __p3_308), __s0_308, __p1_308); \
48857 __ret_308 = vset_lane_p16(vget_lane_p16(__s2_308, __p3_308), __s0_308, __p1_308); \
48858 __ret_308; \48735 __ret_308; \
48859})48736})
48860#else48737#ifdef __LITTLE_ENDIAN__
48861#define vcopy_lane_p16(__p0_309, __p1_309, __p2_309, __p3_309) __extension__ ({ \48738#define vcopy_lane_u16(__p0_309, __p1_309, __p2_309, __p3_309) __extension__ ({ \
48862 poly16x4_t __ret_309; \48739 uint16x4_t __ret_309; \
48863 poly16x4_t __s0_309 = __p0_309; \48740 uint16x4_t __s0_309 = __p0_309; \
48864 poly16x4_t __s2_309 = __p2_309; \48741 uint16x4_t __s2_309 = __p2_309; \
48865 poly16x4_t __rev0_309; __rev0_309 = __builtin_shufflevector(__s0_309, __s0_309, __lane_reverse_64_16); \48742 __ret_309 = vset_lane_u16(vget_lane_u16(__s2_309, __p3_309), __s0_309, __p1_309); \
48866 poly16x4_t __rev2_309; __rev2_309 = __builtin_shufflevector(__s2_309, __s2_309, __lane_reverse_64_16); \
48867 __ret_309 = __noswap_vset_lane_p16(__noswap_vget_lane_p16(__rev2_309, __p3_309), __rev0_309, __p1_309); \
48868 __ret_309 = __builtin_shufflevector(__ret_309, __ret_309, __lane_reverse_64_16); \
48869 __ret_309; \48743 __ret_309; \
48870})48744})
48745#else
48746#define vcopy_lane_u16(__p0_310, __p1_310, __p2_310, __p3_310) __extension__ ({ \
48747 uint16x4_t __ret_310; \
48748 uint16x4_t __s0_310 = __p0_310; \
48749 uint16x4_t __s2_310 = __p2_310; \
48750 uint16x4_t __rev0_310; __rev0_310 = __builtin_shufflevector(__s0_310, __s0_310, __lane_reverse_64_16); \
48751 uint16x4_t __rev2_310; __rev2_310 = __builtin_shufflevector(__s2_310, __s2_310, __lane_reverse_64_16); \
48752 __ret_310 = __noswap_vset_lane_u16(__noswap_vget_lane_u16(__rev2_310, __p3_310), __rev0_310, __p1_310); \
48753 __ret_310 = __builtin_shufflevector(__ret_310, __ret_310, __lane_reverse_64_16); \
48754 __ret_310; \
48755})
48871#endif48756#endif
4887248757
48873#ifdef __LITTLE_ENDIAN__48758#ifdef __LITTLE_ENDIAN__
48874#define vcopy_lane_u8(__p0_310, __p1_310, __p2_310, __p3_310) __extension__ ({ \48759#define vcopy_lane_s8(__p0_311, __p1_311, __p2_311, __p3_311) __extension__ ({ \
48875 uint8x8_t __ret_310; \48760 int8x8_t __ret_311; \
48876 uint8x8_t __s0_310 = __p0_310; \48761 int8x8_t __s0_311 = __p0_311; \
48877 uint8x8_t __s2_310 = __p2_310; \48762 int8x8_t __s2_311 = __p2_311; \
48878 __ret_310 = vset_lane_u8(vget_lane_u8(__s2_310, __p3_310), __s0_310, __p1_310); \48763 __ret_311 = vset_lane_s8(vget_lane_s8(__s2_311, __p3_311), __s0_311, __p1_311); \
48879 __ret_310; \48764 __ret_311; \
48880})48765})
48881#else48766#else
48882#define vcopy_lane_u8(__p0_311, __p1_311, __p2_311, __p3_311) __extension__ ({ \48767#define vcopy_lane_s8(__p0_312, __p1_312, __p2_312, __p3_312) __extension__ ({ \
48883 uint8x8_t __ret_311; \48768 int8x8_t __ret_312; \
48884 uint8x8_t __s0_311 = __p0_311; \48769 int8x8_t __s0_312 = __p0_312; \
48885 uint8x8_t __s2_311 = __p2_311; \48770 int8x8_t __s2_312 = __p2_312; \
48886 uint8x8_t __rev0_311; __rev0_311 = __builtin_shufflevector(__s0_311, __s0_311, __lane_reverse_64_8); \48771 int8x8_t __rev0_312; __rev0_312 = __builtin_shufflevector(__s0_312, __s0_312, __lane_reverse_64_8); \
48887 uint8x8_t __rev2_311; __rev2_311 = __builtin_shufflevector(__s2_311, __s2_311, __lane_reverse_64_8); \48772 int8x8_t __rev2_312; __rev2_312 = __builtin_shufflevector(__s2_312, __s2_312, __lane_reverse_64_8); \
48888 __ret_311 = __noswap_vset_lane_u8(__noswap_vget_lane_u8(__rev2_311, __p3_311), __rev0_311, __p1_311); \48773 __ret_312 = __noswap_vset_lane_s8(__noswap_vget_lane_s8(__rev2_312, __p3_312), __rev0_312, __p1_312); \
48889 __ret_311 = __builtin_shufflevector(__ret_311, __ret_311, __lane_reverse_64_8); \48774 __ret_312 = __builtin_shufflevector(__ret_312, __ret_312, __lane_reverse_64_8); \
48890 __ret_311; \48775 __ret_312; \
48891})48776})
48892#endif48777#endif
4889348778
48894#ifdef __LITTLE_ENDIAN__48779#ifdef __LITTLE_ENDIAN__
48895#define vcopy_lane_u32(__p0_312, __p1_312, __p2_312, __p3_312) __extension__ ({ \48780#define vcopy_lane_f32(__p0_313, __p1_313, __p2_313, __p3_313) __extension__ ({ \
48896 uint32x2_t __ret_312; \48781 float32x2_t __ret_313; \
48897 uint32x2_t __s0_312 = __p0_312; \48782 float32x2_t __s0_313 = __p0_313; \
48898 uint32x2_t __s2_312 = __p2_312; \48783 float32x2_t __s2_313 = __p2_313; \
48899 __ret_312 = vset_lane_u32(vget_lane_u32(__s2_312, __p3_312), __s0_312, __p1_312); \48784 __ret_313 = vset_lane_f32(vget_lane_f32(__s2_313, __p3_313), __s0_313, __p1_313); \
48900 __ret_312; \48785 __ret_313; \
48901})48786})
48902#else48787#else
48903#define vcopy_lane_u32(__p0_313, __p1_313, __p2_313, __p3_313) __extension__ ({ \48788#define vcopy_lane_f32(__p0_314, __p1_314, __p2_314, __p3_314) __extension__ ({ \
48904 uint32x2_t __ret_313; \48789 float32x2_t __ret_314; \
48905 uint32x2_t __s0_313 = __p0_313; \48790 float32x2_t __s0_314 = __p0_314; \
48906 uint32x2_t __s2_313 = __p2_313; \48791 float32x2_t __s2_314 = __p2_314; \
48907 uint32x2_t __rev0_313; __rev0_313 = __builtin_shufflevector(__s0_313, __s0_313, __lane_reverse_64_32); \48792 float32x2_t __rev0_314; __rev0_314 = __builtin_shufflevector(__s0_314, __s0_314, __lane_reverse_64_32); \
48908 uint32x2_t __rev2_313; __rev2_313 = __builtin_shufflevector(__s2_313, __s2_313, __lane_reverse_64_32); \48793 float32x2_t __rev2_314; __rev2_314 = __builtin_shufflevector(__s2_314, __s2_314, __lane_reverse_64_32); \
48909 __ret_313 = __noswap_vset_lane_u32(__noswap_vget_lane_u32(__rev2_313, __p3_313), __rev0_313, __p1_313); \48794 __ret_314 = __noswap_vset_lane_f32(__noswap_vget_lane_f32(__rev2_314, __p3_314), __rev0_314, __p1_314); \
48910 __ret_313 = __builtin_shufflevector(__ret_313, __ret_313, __lane_reverse_64_32); \48795 __ret_314 = __builtin_shufflevector(__ret_314, __ret_314, __lane_reverse_64_32); \
48911 __ret_313; \48796 __ret_314; \
48912})48797})
48913#endif48798#endif
4891448799
48915#define vcopy_lane_u64(__p0_314, __p1_314, __p2_314, __p3_314) __extension__ ({ \
48916 uint64x1_t __ret_314; \
48917 uint64x1_t __s0_314 = __p0_314; \
48918 uint64x1_t __s2_314 = __p2_314; \
48919 __ret_314 = vset_lane_u64(vget_lane_u64(__s2_314, __p3_314), __s0_314, __p1_314); \
48920 __ret_314; \
48921})
48922#ifdef __LITTLE_ENDIAN__48800#ifdef __LITTLE_ENDIAN__
48923#define vcopy_lane_u16(__p0_315, __p1_315, __p2_315, __p3_315) __extension__ ({ \48801#define vcopy_lane_s32(__p0_315, __p1_315, __p2_315, __p3_315) __extension__ ({ \
48924 uint16x4_t __ret_315; \48802 int32x2_t __ret_315; \
48925 uint16x4_t __s0_315 = __p0_315; \48803 int32x2_t __s0_315 = __p0_315; \
48926 uint16x4_t __s2_315 = __p2_315; \48804 int32x2_t __s2_315 = __p2_315; \
48927 __ret_315 = vset_lane_u16(vget_lane_u16(__s2_315, __p3_315), __s0_315, __p1_315); \48805 __ret_315 = vset_lane_s32(vget_lane_s32(__s2_315, __p3_315), __s0_315, __p1_315); \
48928 __ret_315; \48806 __ret_315; \
48929})48807})
48930#else48808#else
48931#define vcopy_lane_u16(__p0_316, __p1_316, __p2_316, __p3_316) __extension__ ({ \48809#define vcopy_lane_s32(__p0_316, __p1_316, __p2_316, __p3_316) __extension__ ({ \
48932 uint16x4_t __ret_316; \48810 int32x2_t __ret_316; \
48933 uint16x4_t __s0_316 = __p0_316; \48811 int32x2_t __s0_316 = __p0_316; \
48934 uint16x4_t __s2_316 = __p2_316; \48812 int32x2_t __s2_316 = __p2_316; \
48935 uint16x4_t __rev0_316; __rev0_316 = __builtin_shufflevector(__s0_316, __s0_316, __lane_reverse_64_16); \48813 int32x2_t __rev0_316; __rev0_316 = __builtin_shufflevector(__s0_316, __s0_316, __lane_reverse_64_32); \
48936 uint16x4_t __rev2_316; __rev2_316 = __builtin_shufflevector(__s2_316, __s2_316, __lane_reverse_64_16); \48814 int32x2_t __rev2_316; __rev2_316 = __builtin_shufflevector(__s2_316, __s2_316, __lane_reverse_64_32); \
48937 __ret_316 = __noswap_vset_lane_u16(__noswap_vget_lane_u16(__rev2_316, __p3_316), __rev0_316, __p1_316); \48815 __ret_316 = __noswap_vset_lane_s32(__noswap_vget_lane_s32(__rev2_316, __p3_316), __rev0_316, __p1_316); \
48938 __ret_316 = __builtin_shufflevector(__ret_316, __ret_316, __lane_reverse_64_16); \48816 __ret_316 = __builtin_shufflevector(__ret_316, __ret_316, __lane_reverse_64_32); \
48939 __ret_316; \48817 __ret_316; \
48940})48818})
48941#endif48819#endif
4894248820
48943#ifdef __LITTLE_ENDIAN__48821#define vcopy_lane_s64(__p0_317, __p1_317, __p2_317, __p3_317) __extension__ ({ \
48944#define vcopy_lane_s8(__p0_317, __p1_317, __p2_317, __p3_317) __extension__ ({ \48822 int64x1_t __ret_317; \
48945 int8x8_t __ret_317; \48823 int64x1_t __s0_317 = __p0_317; \
48946 int8x8_t __s0_317 = __p0_317; \48824 int64x1_t __s2_317 = __p2_317; \
48947 int8x8_t __s2_317 = __p2_317; \48825 __ret_317 = vset_lane_s64(vget_lane_s64(__s2_317, __p3_317), __s0_317, __p1_317); \
48948 __ret_317 = vset_lane_s8(vget_lane_s8(__s2_317, __p3_317), __s0_317, __p1_317); \
48949 __ret_317; \48826 __ret_317; \
48950})48827})
48951#else48828#ifdef __LITTLE_ENDIAN__
48952#define vcopy_lane_s8(__p0_318, __p1_318, __p2_318, __p3_318) __extension__ ({ \48829#define vcopy_lane_mf8(__p0_318, __p1_318, __p2_318, __p3_318) __extension__ ({ \
48953 int8x8_t __ret_318; \48830 mfloat8x8_t __ret_318; \
48954 int8x8_t __s0_318 = __p0_318; \48831 mfloat8x8_t __s0_318 = __p0_318; \
48955 int8x8_t __s2_318 = __p2_318; \48832 mfloat8x8_t __s2_318 = __p2_318; \
48956 int8x8_t __rev0_318; __rev0_318 = __builtin_shufflevector(__s0_318, __s0_318, __lane_reverse_64_8); \48833 __ret_318 = vset_lane_mf8(vget_lane_mf8(__s2_318, __p3_318), __s0_318, __p1_318); \
48957 int8x8_t __rev2_318; __rev2_318 = __builtin_shufflevector(__s2_318, __s2_318, __lane_reverse_64_8); \
48958 __ret_318 = __noswap_vset_lane_s8(__noswap_vget_lane_s8(__rev2_318, __p3_318), __rev0_318, __p1_318); \
48959 __ret_318 = __builtin_shufflevector(__ret_318, __ret_318, __lane_reverse_64_8); \
48960 __ret_318; \48834 __ret_318; \
48961})48835})
48836#else
48837#define vcopy_lane_mf8(__p0_319, __p1_319, __p2_319, __p3_319) __extension__ ({ \
48838 mfloat8x8_t __ret_319; \
48839 mfloat8x8_t __s0_319 = __p0_319; \
48840 mfloat8x8_t __s2_319 = __p2_319; \
48841 mfloat8x8_t __rev0_319; __rev0_319 = __builtin_shufflevector(__s0_319, __s0_319, __lane_reverse_64_8); \
48842 mfloat8x8_t __rev2_319; __rev2_319 = __builtin_shufflevector(__s2_319, __s2_319, __lane_reverse_64_8); \
48843 __ret_319 = __noswap_vset_lane_mf8(__noswap_vget_lane_mf8(__rev2_319, __p3_319), __rev0_319, __p1_319); \
48844 __ret_319 = __builtin_shufflevector(__ret_319, __ret_319, __lane_reverse_64_8); \
48845 __ret_319; \
48846})
48962#endif48847#endif
4896348848
48964#ifdef __LITTLE_ENDIAN__48849#ifdef __LITTLE_ENDIAN__
48965#define vcopy_lane_f32(__p0_319, __p1_319, __p2_319, __p3_319) __extension__ ({ \48850#define vcopy_lane_s16(__p0_320, __p1_320, __p2_320, __p3_320) __extension__ ({ \
48966 float32x2_t __ret_319; \48851 int16x4_t __ret_320; \
48967 float32x2_t __s0_319 = __p0_319; \48852 int16x4_t __s0_320 = __p0_320; \
48968 float32x2_t __s2_319 = __p2_319; \48853 int16x4_t __s2_320 = __p2_320; \
48969 __ret_319 = vset_lane_f32(vget_lane_f32(__s2_319, __p3_319), __s0_319, __p1_319); \48854 __ret_320 = vset_lane_s16(vget_lane_s16(__s2_320, __p3_320), __s0_320, __p1_320); \
48970 __ret_319; \48855 __ret_320; \
48971})48856})
48972#else48857#else
48973#define vcopy_lane_f32(__p0_320, __p1_320, __p2_320, __p3_320) __extension__ ({ \48858#define vcopy_lane_s16(__p0_321, __p1_321, __p2_321, __p3_321) __extension__ ({ \
48974 float32x2_t __ret_320; \48859 int16x4_t __ret_321; \
48975 float32x2_t __s0_320 = __p0_320; \48860 int16x4_t __s0_321 = __p0_321; \
48976 float32x2_t __s2_320 = __p2_320; \48861 int16x4_t __s2_321 = __p2_321; \
48977 float32x2_t __rev0_320; __rev0_320 = __builtin_shufflevector(__s0_320, __s0_320, __lane_reverse_64_32); \48862 int16x4_t __rev0_321; __rev0_321 = __builtin_shufflevector(__s0_321, __s0_321, __lane_reverse_64_16); \
48978 float32x2_t __rev2_320; __rev2_320 = __builtin_shufflevector(__s2_320, __s2_320, __lane_reverse_64_32); \48863 int16x4_t __rev2_321; __rev2_321 = __builtin_shufflevector(__s2_321, __s2_321, __lane_reverse_64_16); \
48979 __ret_320 = __noswap_vset_lane_f32(__noswap_vget_lane_f32(__rev2_320, __p3_320), __rev0_320, __p1_320); \48864 __ret_321 = __noswap_vset_lane_s16(__noswap_vget_lane_s16(__rev2_321, __p3_321), __rev0_321, __p1_321); \
48980 __ret_320 = __builtin_shufflevector(__ret_320, __ret_320, __lane_reverse_64_32); \48865 __ret_321 = __builtin_shufflevector(__ret_321, __ret_321, __lane_reverse_64_16); \
48981 __ret_320; \48866 __ret_321; \
48982})48867})
48983#endif48868#endif
4898448869
48985#ifdef __LITTLE_ENDIAN__48870#ifdef __LITTLE_ENDIAN__
48986#define vcopy_lane_s32(__p0_321, __p1_321, __p2_321, __p3_321) __extension__ ({ \48871#define vcopy_lane_bf16(__p0_322, __p1_322, __p2_322, __p3_322) __extension__ ({ \
48987 int32x2_t __ret_321; \48872 bfloat16x4_t __ret_322; \
48988 int32x2_t __s0_321 = __p0_321; \48873 bfloat16x4_t __s0_322 = __p0_322; \
48989 int32x2_t __s2_321 = __p2_321; \48874 bfloat16x4_t __s2_322 = __p2_322; \
48990 __ret_321 = vset_lane_s32(vget_lane_s32(__s2_321, __p3_321), __s0_321, __p1_321); \48875 __ret_322 = vset_lane_bf16(vget_lane_bf16(__s2_322, __p3_322), __s0_322, __p1_322); \
48991 __ret_321; \48876 __ret_322; \
48992})48877})
48993#else48878#else
48994#define vcopy_lane_s32(__p0_322, __p1_322, __p2_322, __p3_322) __extension__ ({ \48879#define vcopy_lane_bf16(__p0_323, __p1_323, __p2_323, __p3_323) __extension__ ({ \
48995 int32x2_t __ret_322; \48880 bfloat16x4_t __ret_323; \
48996 int32x2_t __s0_322 = __p0_322; \48881 bfloat16x4_t __s0_323 = __p0_323; \
48997 int32x2_t __s2_322 = __p2_322; \48882 bfloat16x4_t __s2_323 = __p2_323; \
48998 int32x2_t __rev0_322; __rev0_322 = __builtin_shufflevector(__s0_322, __s0_322, __lane_reverse_64_32); \48883 bfloat16x4_t __rev0_323; __rev0_323 = __builtin_shufflevector(__s0_323, __s0_323, __lane_reverse_64_16); \
48999 int32x2_t __rev2_322; __rev2_322 = __builtin_shufflevector(__s2_322, __s2_322, __lane_reverse_64_32); \48884 bfloat16x4_t __rev2_323; __rev2_323 = __builtin_shufflevector(__s2_323, __s2_323, __lane_reverse_64_16); \
49000 __ret_322 = __noswap_vset_lane_s32(__noswap_vget_lane_s32(__rev2_322, __p3_322), __rev0_322, __p1_322); \48885 __ret_323 = __noswap_vset_lane_bf16(__noswap_vget_lane_bf16(__rev2_323, __p3_323), __rev0_323, __p1_323); \
49001 __ret_322 = __builtin_shufflevector(__ret_322, __ret_322, __lane_reverse_64_32); \48886 __ret_323 = __builtin_shufflevector(__ret_323, __ret_323, __lane_reverse_64_16); \
49002 __ret_322; \48887 __ret_323; \
49003})48888})
49004#endif48889#endif
4900548890
49006#define vcopy_lane_s64(__p0_323, __p1_323, __p2_323, __p3_323) __extension__ ({ \
49007 int64x1_t __ret_323; \
49008 int64x1_t __s0_323 = __p0_323; \
49009 int64x1_t __s2_323 = __p2_323; \
49010 __ret_323 = vset_lane_s64(vget_lane_s64(__s2_323, __p3_323), __s0_323, __p1_323); \
49011 __ret_323; \
49012})
49013#ifdef __LITTLE_ENDIAN__48891#ifdef __LITTLE_ENDIAN__
49014#define vcopy_lane_mf8(__p0_324, __p1_324, __p2_324, __p3_324) __extension__ ({ \48892#define vcopyq_laneq_p8(__p0_324, __p1_324, __p2_324, __p3_324) __extension__ ({ \
49015 mfloat8x8_t __ret_324; \48893 poly8x16_t __ret_324; \
49016 mfloat8x8_t __s0_324 = __p0_324; \48894 poly8x16_t __s0_324 = __p0_324; \
49017 mfloat8x8_t __s2_324 = __p2_324; \48895 poly8x16_t __s2_324 = __p2_324; \
49018 __ret_324 = vset_lane_mf8(vget_lane_mf8(__s2_324, __p3_324), __s0_324, __p1_324); \48896 __ret_324 = vsetq_lane_p8(vgetq_lane_p8(__s2_324, __p3_324), __s0_324, __p1_324); \
49019 __ret_324; \48897 __ret_324; \
49020})48898})
49021#else48899#else
49022#define vcopy_lane_mf8(__p0_325, __p1_325, __p2_325, __p3_325) __extension__ ({ \48900#define vcopyq_laneq_p8(__p0_325, __p1_325, __p2_325, __p3_325) __extension__ ({ \
49023 mfloat8x8_t __ret_325; \48901 poly8x16_t __ret_325; \
49024 mfloat8x8_t __s0_325 = __p0_325; \48902 poly8x16_t __s0_325 = __p0_325; \
49025 mfloat8x8_t __s2_325 = __p2_325; \48903 poly8x16_t __s2_325 = __p2_325; \
49026 mfloat8x8_t __rev0_325; __rev0_325 = __builtin_shufflevector(__s0_325, __s0_325, __lane_reverse_64_8); \48904 poly8x16_t __rev0_325; __rev0_325 = __builtin_shufflevector(__s0_325, __s0_325, __lane_reverse_128_8); \
49027 mfloat8x8_t __rev2_325; __rev2_325 = __builtin_shufflevector(__s2_325, __s2_325, __lane_reverse_64_8); \48905 poly8x16_t __rev2_325; __rev2_325 = __builtin_shufflevector(__s2_325, __s2_325, __lane_reverse_128_8); \
49028 __ret_325 = __noswap_vset_lane_mf8(__noswap_vget_lane_mf8(__rev2_325, __p3_325), __rev0_325, __p1_325); \48906 __ret_325 = __noswap_vsetq_lane_p8(__noswap_vgetq_lane_p8(__rev2_325, __p3_325), __rev0_325, __p1_325); \
49029 __ret_325 = __builtin_shufflevector(__ret_325, __ret_325, __lane_reverse_64_8); \48907 __ret_325 = __builtin_shufflevector(__ret_325, __ret_325, __lane_reverse_128_8); \
49030 __ret_325; \48908 __ret_325; \
49031})48909})
49032#endif48910#endif
4903348911
49034#ifdef __LITTLE_ENDIAN__48912#ifdef __LITTLE_ENDIAN__
49035#define vcopy_lane_s16(__p0_326, __p1_326, __p2_326, __p3_326) __extension__ ({ \48913#define vcopyq_laneq_p16(__p0_326, __p1_326, __p2_326, __p3_326) __extension__ ({ \
49036 int16x4_t __ret_326; \48914 poly16x8_t __ret_326; \
49037 int16x4_t __s0_326 = __p0_326; \48915 poly16x8_t __s0_326 = __p0_326; \
49038 int16x4_t __s2_326 = __p2_326; \48916 poly16x8_t __s2_326 = __p2_326; \
49039 __ret_326 = vset_lane_s16(vget_lane_s16(__s2_326, __p3_326), __s0_326, __p1_326); \48917 __ret_326 = vsetq_lane_p16(vgetq_lane_p16(__s2_326, __p3_326), __s0_326, __p1_326); \
49040 __ret_326; \48918 __ret_326; \
49041})48919})
49042#else48920#else
49043#define vcopy_lane_s16(__p0_327, __p1_327, __p2_327, __p3_327) __extension__ ({ \48921#define vcopyq_laneq_p16(__p0_327, __p1_327, __p2_327, __p3_327) __extension__ ({ \
49044 int16x4_t __ret_327; \48922 poly16x8_t __ret_327; \
49045 int16x4_t __s0_327 = __p0_327; \48923 poly16x8_t __s0_327 = __p0_327; \
49046 int16x4_t __s2_327 = __p2_327; \48924 poly16x8_t __s2_327 = __p2_327; \
49047 int16x4_t __rev0_327; __rev0_327 = __builtin_shufflevector(__s0_327, __s0_327, __lane_reverse_64_16); \48925 poly16x8_t __rev0_327; __rev0_327 = __builtin_shufflevector(__s0_327, __s0_327, __lane_reverse_128_16); \
49048 int16x4_t __rev2_327; __rev2_327 = __builtin_shufflevector(__s2_327, __s2_327, __lane_reverse_64_16); \48926 poly16x8_t __rev2_327; __rev2_327 = __builtin_shufflevector(__s2_327, __s2_327, __lane_reverse_128_16); \
49049 __ret_327 = __noswap_vset_lane_s16(__noswap_vget_lane_s16(__rev2_327, __p3_327), __rev0_327, __p1_327); \48927 __ret_327 = __noswap_vsetq_lane_p16(__noswap_vgetq_lane_p16(__rev2_327, __p3_327), __rev0_327, __p1_327); \
49050 __ret_327 = __builtin_shufflevector(__ret_327, __ret_327, __lane_reverse_64_16); \48928 __ret_327 = __builtin_shufflevector(__ret_327, __ret_327, __lane_reverse_128_16); \
49051 __ret_327; \48929 __ret_327; \
49052})48930})
49053#endif48931#endif
4905448932
49055#ifdef __LITTLE_ENDIAN__48933#ifdef __LITTLE_ENDIAN__
49056#define vcopyq_laneq_p8(__p0_328, __p1_328, __p2_328, __p3_328) __extension__ ({ \48934#define vcopyq_laneq_u8(__p0_328, __p1_328, __p2_328, __p3_328) __extension__ ({ \
49057 poly8x16_t __ret_328; \48935 uint8x16_t __ret_328; \
49058 poly8x16_t __s0_328 = __p0_328; \48936 uint8x16_t __s0_328 = __p0_328; \
49059 poly8x16_t __s2_328 = __p2_328; \48937 uint8x16_t __s2_328 = __p2_328; \
49060 __ret_328 = vsetq_lane_p8(vgetq_lane_p8(__s2_328, __p3_328), __s0_328, __p1_328); \48938 __ret_328 = vsetq_lane_u8(vgetq_lane_u8(__s2_328, __p3_328), __s0_328, __p1_328); \
49061 __ret_328; \48939 __ret_328; \
49062})48940})
49063#else48941#else
49064#define vcopyq_laneq_p8(__p0_329, __p1_329, __p2_329, __p3_329) __extension__ ({ \48942#define vcopyq_laneq_u8(__p0_329, __p1_329, __p2_329, __p3_329) __extension__ ({ \
49065 poly8x16_t __ret_329; \48943 uint8x16_t __ret_329; \
49066 poly8x16_t __s0_329 = __p0_329; \48944 uint8x16_t __s0_329 = __p0_329; \
49067 poly8x16_t __s2_329 = __p2_329; \48945 uint8x16_t __s2_329 = __p2_329; \
49068 poly8x16_t __rev0_329; __rev0_329 = __builtin_shufflevector(__s0_329, __s0_329, __lane_reverse_128_8); \48946 uint8x16_t __rev0_329; __rev0_329 = __builtin_shufflevector(__s0_329, __s0_329, __lane_reverse_128_8); \
49069 poly8x16_t __rev2_329; __rev2_329 = __builtin_shufflevector(__s2_329, __s2_329, __lane_reverse_128_8); \48947 uint8x16_t __rev2_329; __rev2_329 = __builtin_shufflevector(__s2_329, __s2_329, __lane_reverse_128_8); \
49070 __ret_329 = __noswap_vsetq_lane_p8(__noswap_vgetq_lane_p8(__rev2_329, __p3_329), __rev0_329, __p1_329); \48948 __ret_329 = __noswap_vsetq_lane_u8(__noswap_vgetq_lane_u8(__rev2_329, __p3_329), __rev0_329, __p1_329); \
49071 __ret_329 = __builtin_shufflevector(__ret_329, __ret_329, __lane_reverse_128_8); \48949 __ret_329 = __builtin_shufflevector(__ret_329, __ret_329, __lane_reverse_128_8); \
49072 __ret_329; \48950 __ret_329; \
49073})48951})
49074#endif48952#endif
4907548953
49076#ifdef __LITTLE_ENDIAN__48954#ifdef __LITTLE_ENDIAN__
49077#define vcopyq_laneq_p16(__p0_330, __p1_330, __p2_330, __p3_330) __extension__ ({ \48955#define vcopyq_laneq_u32(__p0_330, __p1_330, __p2_330, __p3_330) __extension__ ({ \
49078 poly16x8_t __ret_330; \48956 uint32x4_t __ret_330; \
49079 poly16x8_t __s0_330 = __p0_330; \48957 uint32x4_t __s0_330 = __p0_330; \
49080 poly16x8_t __s2_330 = __p2_330; \48958 uint32x4_t __s2_330 = __p2_330; \
49081 __ret_330 = vsetq_lane_p16(vgetq_lane_p16(__s2_330, __p3_330), __s0_330, __p1_330); \48959 __ret_330 = vsetq_lane_u32(vgetq_lane_u32(__s2_330, __p3_330), __s0_330, __p1_330); \
49082 __ret_330; \48960 __ret_330; \
49083})48961})
49084#else48962#else
49085#define vcopyq_laneq_p16(__p0_331, __p1_331, __p2_331, __p3_331) __extension__ ({ \48963#define vcopyq_laneq_u32(__p0_331, __p1_331, __p2_331, __p3_331) __extension__ ({ \
49086 poly16x8_t __ret_331; \48964 uint32x4_t __ret_331; \
49087 poly16x8_t __s0_331 = __p0_331; \48965 uint32x4_t __s0_331 = __p0_331; \
49088 poly16x8_t __s2_331 = __p2_331; \48966 uint32x4_t __s2_331 = __p2_331; \
49089 poly16x8_t __rev0_331; __rev0_331 = __builtin_shufflevector(__s0_331, __s0_331, __lane_reverse_128_16); \48967 uint32x4_t __rev0_331; __rev0_331 = __builtin_shufflevector(__s0_331, __s0_331, __lane_reverse_128_32); \
49090 poly16x8_t __rev2_331; __rev2_331 = __builtin_shufflevector(__s2_331, __s2_331, __lane_reverse_128_16); \48968 uint32x4_t __rev2_331; __rev2_331 = __builtin_shufflevector(__s2_331, __s2_331, __lane_reverse_128_32); \
49091 __ret_331 = __noswap_vsetq_lane_p16(__noswap_vgetq_lane_p16(__rev2_331, __p3_331), __rev0_331, __p1_331); \48969 __ret_331 = __noswap_vsetq_lane_u32(__noswap_vgetq_lane_u32(__rev2_331, __p3_331), __rev0_331, __p1_331); \
49092 __ret_331 = __builtin_shufflevector(__ret_331, __ret_331, __lane_reverse_128_16); \48970 __ret_331 = __builtin_shufflevector(__ret_331, __ret_331, __lane_reverse_128_32); \
49093 __ret_331; \48971 __ret_331; \
49094})48972})
49095#endif48973#endif
4909648974
49097#ifdef __LITTLE_ENDIAN__48975#ifdef __LITTLE_ENDIAN__
49098#define vcopyq_laneq_u8(__p0_332, __p1_332, __p2_332, __p3_332) __extension__ ({ \48976#define vcopyq_laneq_u64(__p0_332, __p1_332, __p2_332, __p3_332) __extension__ ({ \
49099 uint8x16_t __ret_332; \48977 uint64x2_t __ret_332; \
49100 uint8x16_t __s0_332 = __p0_332; \48978 uint64x2_t __s0_332 = __p0_332; \
49101 uint8x16_t __s2_332 = __p2_332; \48979 uint64x2_t __s2_332 = __p2_332; \
49102 __ret_332 = vsetq_lane_u8(vgetq_lane_u8(__s2_332, __p3_332), __s0_332, __p1_332); \48980 __ret_332 = vsetq_lane_u64(vgetq_lane_u64(__s2_332, __p3_332), __s0_332, __p1_332); \
49103 __ret_332; \48981 __ret_332; \
49104})48982})
49105#else48983#else
49106#define vcopyq_laneq_u8(__p0_333, __p1_333, __p2_333, __p3_333) __extension__ ({ \48984#define vcopyq_laneq_u64(__p0_333, __p1_333, __p2_333, __p3_333) __extension__ ({ \
49107 uint8x16_t __ret_333; \48985 uint64x2_t __ret_333; \
49108 uint8x16_t __s0_333 = __p0_333; \48986 uint64x2_t __s0_333 = __p0_333; \
49109 uint8x16_t __s2_333 = __p2_333; \48987 uint64x2_t __s2_333 = __p2_333; \
49110 uint8x16_t __rev0_333; __rev0_333 = __builtin_shufflevector(__s0_333, __s0_333, __lane_reverse_128_8); \48988 uint64x2_t __rev0_333; __rev0_333 = __builtin_shufflevector(__s0_333, __s0_333, __lane_reverse_128_64); \
49111 uint8x16_t __rev2_333; __rev2_333 = __builtin_shufflevector(__s2_333, __s2_333, __lane_reverse_128_8); \48989 uint64x2_t __rev2_333; __rev2_333 = __builtin_shufflevector(__s2_333, __s2_333, __lane_reverse_128_64); \
49112 __ret_333 = __noswap_vsetq_lane_u8(__noswap_vgetq_lane_u8(__rev2_333, __p3_333), __rev0_333, __p1_333); \48990 __ret_333 = __noswap_vsetq_lane_u64(__noswap_vgetq_lane_u64(__rev2_333, __p3_333), __rev0_333, __p1_333); \
49113 __ret_333 = __builtin_shufflevector(__ret_333, __ret_333, __lane_reverse_128_8); \48991 __ret_333 = __builtin_shufflevector(__ret_333, __ret_333, __lane_reverse_128_64); \
49114 __ret_333; \48992 __ret_333; \
49115})48993})
49116#endif48994#endif
4911748995
49118#ifdef __LITTLE_ENDIAN__48996#ifdef __LITTLE_ENDIAN__
49119#define vcopyq_laneq_u32(__p0_334, __p1_334, __p2_334, __p3_334) __extension__ ({ \48997#define vcopyq_laneq_u16(__p0_334, __p1_334, __p2_334, __p3_334) __extension__ ({ \
49120 uint32x4_t __ret_334; \48998 uint16x8_t __ret_334; \
49121 uint32x4_t __s0_334 = __p0_334; \48999 uint16x8_t __s0_334 = __p0_334; \
49122 uint32x4_t __s2_334 = __p2_334; \49000 uint16x8_t __s2_334 = __p2_334; \
49123 __ret_334 = vsetq_lane_u32(vgetq_lane_u32(__s2_334, __p3_334), __s0_334, __p1_334); \49001 __ret_334 = vsetq_lane_u16(vgetq_lane_u16(__s2_334, __p3_334), __s0_334, __p1_334); \
49124 __ret_334; \49002 __ret_334; \
49125})49003})
49126#else49004#else
49127#define vcopyq_laneq_u32(__p0_335, __p1_335, __p2_335, __p3_335) __extension__ ({ \49005#define vcopyq_laneq_u16(__p0_335, __p1_335, __p2_335, __p3_335) __extension__ ({ \
49128 uint32x4_t __ret_335; \49006 uint16x8_t __ret_335; \
49129 uint32x4_t __s0_335 = __p0_335; \49007 uint16x8_t __s0_335 = __p0_335; \
49130 uint32x4_t __s2_335 = __p2_335; \49008 uint16x8_t __s2_335 = __p2_335; \
49131 uint32x4_t __rev0_335; __rev0_335 = __builtin_shufflevector(__s0_335, __s0_335, __lane_reverse_128_32); \49009 uint16x8_t __rev0_335; __rev0_335 = __builtin_shufflevector(__s0_335, __s0_335, __lane_reverse_128_16); \
49132 uint32x4_t __rev2_335; __rev2_335 = __builtin_shufflevector(__s2_335, __s2_335, __lane_reverse_128_32); \49010 uint16x8_t __rev2_335; __rev2_335 = __builtin_shufflevector(__s2_335, __s2_335, __lane_reverse_128_16); \
49133 __ret_335 = __noswap_vsetq_lane_u32(__noswap_vgetq_lane_u32(__rev2_335, __p3_335), __rev0_335, __p1_335); \49011 __ret_335 = __noswap_vsetq_lane_u16(__noswap_vgetq_lane_u16(__rev2_335, __p3_335), __rev0_335, __p1_335); \
49134 __ret_335 = __builtin_shufflevector(__ret_335, __ret_335, __lane_reverse_128_32); \49012 __ret_335 = __builtin_shufflevector(__ret_335, __ret_335, __lane_reverse_128_16); \
49135 __ret_335; \49013 __ret_335; \
49136})49014})
49137#endif49015#endif
4913849016
49139#ifdef __LITTLE_ENDIAN__49017#ifdef __LITTLE_ENDIAN__
49140#define vcopyq_laneq_u64(__p0_336, __p1_336, __p2_336, __p3_336) __extension__ ({ \49018#define vcopyq_laneq_s8(__p0_336, __p1_336, __p2_336, __p3_336) __extension__ ({ \
49141 uint64x2_t __ret_336; \49019 int8x16_t __ret_336; \
49142 uint64x2_t __s0_336 = __p0_336; \49020 int8x16_t __s0_336 = __p0_336; \
49143 uint64x2_t __s2_336 = __p2_336; \49021 int8x16_t __s2_336 = __p2_336; \
49144 __ret_336 = vsetq_lane_u64(vgetq_lane_u64(__s2_336, __p3_336), __s0_336, __p1_336); \49022 __ret_336 = vsetq_lane_s8(vgetq_lane_s8(__s2_336, __p3_336), __s0_336, __p1_336); \
49145 __ret_336; \49023 __ret_336; \
49146})49024})
49147#else49025#else
49148#define vcopyq_laneq_u64(__p0_337, __p1_337, __p2_337, __p3_337) __extension__ ({ \49026#define vcopyq_laneq_s8(__p0_337, __p1_337, __p2_337, __p3_337) __extension__ ({ \
49149 uint64x2_t __ret_337; \49027 int8x16_t __ret_337; \
49150 uint64x2_t __s0_337 = __p0_337; \49028 int8x16_t __s0_337 = __p0_337; \
49151 uint64x2_t __s2_337 = __p2_337; \49029 int8x16_t __s2_337 = __p2_337; \
49152 uint64x2_t __rev0_337; __rev0_337 = __builtin_shufflevector(__s0_337, __s0_337, __lane_reverse_128_64); \49030 int8x16_t __rev0_337; __rev0_337 = __builtin_shufflevector(__s0_337, __s0_337, __lane_reverse_128_8); \
49153 uint64x2_t __rev2_337; __rev2_337 = __builtin_shufflevector(__s2_337, __s2_337, __lane_reverse_128_64); \49031 int8x16_t __rev2_337; __rev2_337 = __builtin_shufflevector(__s2_337, __s2_337, __lane_reverse_128_8); \
49154 __ret_337 = __noswap_vsetq_lane_u64(__noswap_vgetq_lane_u64(__rev2_337, __p3_337), __rev0_337, __p1_337); \49032 __ret_337 = __noswap_vsetq_lane_s8(__noswap_vgetq_lane_s8(__rev2_337, __p3_337), __rev0_337, __p1_337); \
49155 __ret_337 = __builtin_shufflevector(__ret_337, __ret_337, __lane_reverse_128_64); \49033 __ret_337 = __builtin_shufflevector(__ret_337, __ret_337, __lane_reverse_128_8); \
49156 __ret_337; \49034 __ret_337; \
49157})49035})
49158#endif49036#endif
4915949037
49160#ifdef __LITTLE_ENDIAN__49038#ifdef __LITTLE_ENDIAN__
49161#define vcopyq_laneq_u16(__p0_338, __p1_338, __p2_338, __p3_338) __extension__ ({ \49039#define vcopyq_laneq_f32(__p0_338, __p1_338, __p2_338, __p3_338) __extension__ ({ \
49162 uint16x8_t __ret_338; \49040 float32x4_t __ret_338; \
49163 uint16x8_t __s0_338 = __p0_338; \49041 float32x4_t __s0_338 = __p0_338; \
49164 uint16x8_t __s2_338 = __p2_338; \49042 float32x4_t __s2_338 = __p2_338; \
49165 __ret_338 = vsetq_lane_u16(vgetq_lane_u16(__s2_338, __p3_338), __s0_338, __p1_338); \49043 __ret_338 = vsetq_lane_f32(vgetq_lane_f32(__s2_338, __p3_338), __s0_338, __p1_338); \
49166 __ret_338; \49044 __ret_338; \
49167})49045})
49168#else49046#else
49169#define vcopyq_laneq_u16(__p0_339, __p1_339, __p2_339, __p3_339) __extension__ ({ \49047#define vcopyq_laneq_f32(__p0_339, __p1_339, __p2_339, __p3_339) __extension__ ({ \
49170 uint16x8_t __ret_339; \49048 float32x4_t __ret_339; \
49171 uint16x8_t __s0_339 = __p0_339; \49049 float32x4_t __s0_339 = __p0_339; \
49172 uint16x8_t __s2_339 = __p2_339; \49050 float32x4_t __s2_339 = __p2_339; \
49173 uint16x8_t __rev0_339; __rev0_339 = __builtin_shufflevector(__s0_339, __s0_339, __lane_reverse_128_16); \49051 float32x4_t __rev0_339; __rev0_339 = __builtin_shufflevector(__s0_339, __s0_339, __lane_reverse_128_32); \
49174 uint16x8_t __rev2_339; __rev2_339 = __builtin_shufflevector(__s2_339, __s2_339, __lane_reverse_128_16); \49052 float32x4_t __rev2_339; __rev2_339 = __builtin_shufflevector(__s2_339, __s2_339, __lane_reverse_128_32); \
49175 __ret_339 = __noswap_vsetq_lane_u16(__noswap_vgetq_lane_u16(__rev2_339, __p3_339), __rev0_339, __p1_339); \49053 __ret_339 = __noswap_vsetq_lane_f32(__noswap_vgetq_lane_f32(__rev2_339, __p3_339), __rev0_339, __p1_339); \
49176 __ret_339 = __builtin_shufflevector(__ret_339, __ret_339, __lane_reverse_128_16); \49054 __ret_339 = __builtin_shufflevector(__ret_339, __ret_339, __lane_reverse_128_32); \
49177 __ret_339; \49055 __ret_339; \
49178})49056})
49179#endif49057#endif
4918049058
49181#ifdef __LITTLE_ENDIAN__49059#ifdef __LITTLE_ENDIAN__
49182#define vcopyq_laneq_s8(__p0_340, __p1_340, __p2_340, __p3_340) __extension__ ({ \49060#define vcopyq_laneq_s32(__p0_340, __p1_340, __p2_340, __p3_340) __extension__ ({ \
49183 int8x16_t __ret_340; \49061 int32x4_t __ret_340; \
49184 int8x16_t __s0_340 = __p0_340; \49062 int32x4_t __s0_340 = __p0_340; \
49185 int8x16_t __s2_340 = __p2_340; \49063 int32x4_t __s2_340 = __p2_340; \
49186 __ret_340 = vsetq_lane_s8(vgetq_lane_s8(__s2_340, __p3_340), __s0_340, __p1_340); \49064 __ret_340 = vsetq_lane_s32(vgetq_lane_s32(__s2_340, __p3_340), __s0_340, __p1_340); \
49187 __ret_340; \49065 __ret_340; \
49188})49066})
49189#else49067#else
49190#define vcopyq_laneq_s8(__p0_341, __p1_341, __p2_341, __p3_341) __extension__ ({ \49068#define vcopyq_laneq_s32(__p0_341, __p1_341, __p2_341, __p3_341) __extension__ ({ \
49191 int8x16_t __ret_341; \49069 int32x4_t __ret_341; \
49192 int8x16_t __s0_341 = __p0_341; \49070 int32x4_t __s0_341 = __p0_341; \
49193 int8x16_t __s2_341 = __p2_341; \49071 int32x4_t __s2_341 = __p2_341; \
49194 int8x16_t __rev0_341; __rev0_341 = __builtin_shufflevector(__s0_341, __s0_341, __lane_reverse_128_8); \49072 int32x4_t __rev0_341; __rev0_341 = __builtin_shufflevector(__s0_341, __s0_341, __lane_reverse_128_32); \
49195 int8x16_t __rev2_341; __rev2_341 = __builtin_shufflevector(__s2_341, __s2_341, __lane_reverse_128_8); \49073 int32x4_t __rev2_341; __rev2_341 = __builtin_shufflevector(__s2_341, __s2_341, __lane_reverse_128_32); \
49196 __ret_341 = __noswap_vsetq_lane_s8(__noswap_vgetq_lane_s8(__rev2_341, __p3_341), __rev0_341, __p1_341); \49074 __ret_341 = __noswap_vsetq_lane_s32(__noswap_vgetq_lane_s32(__rev2_341, __p3_341), __rev0_341, __p1_341); \
49197 __ret_341 = __builtin_shufflevector(__ret_341, __ret_341, __lane_reverse_128_8); \49075 __ret_341 = __builtin_shufflevector(__ret_341, __ret_341, __lane_reverse_128_32); \
49198 __ret_341; \49076 __ret_341; \
49199})49077})
49200#endif49078#endif
4920149079
49202#ifdef __LITTLE_ENDIAN__49080#ifdef __LITTLE_ENDIAN__
49203#define vcopyq_laneq_f32(__p0_342, __p1_342, __p2_342, __p3_342) __extension__ ({ \49081#define vcopyq_laneq_s64(__p0_342, __p1_342, __p2_342, __p3_342) __extension__ ({ \
49204 float32x4_t __ret_342; \49082 int64x2_t __ret_342; \
49205 float32x4_t __s0_342 = __p0_342; \49083 int64x2_t __s0_342 = __p0_342; \
49206 float32x4_t __s2_342 = __p2_342; \49084 int64x2_t __s2_342 = __p2_342; \
49207 __ret_342 = vsetq_lane_f32(vgetq_lane_f32(__s2_342, __p3_342), __s0_342, __p1_342); \49085 __ret_342 = vsetq_lane_s64(vgetq_lane_s64(__s2_342, __p3_342), __s0_342, __p1_342); \
49208 __ret_342; \49086 __ret_342; \
49209})49087})
49210#else49088#else
49211#define vcopyq_laneq_f32(__p0_343, __p1_343, __p2_343, __p3_343) __extension__ ({ \49089#define vcopyq_laneq_s64(__p0_343, __p1_343, __p2_343, __p3_343) __extension__ ({ \
49212 float32x4_t __ret_343; \49090 int64x2_t __ret_343; \
49213 float32x4_t __s0_343 = __p0_343; \49091 int64x2_t __s0_343 = __p0_343; \
49214 float32x4_t __s2_343 = __p2_343; \49092 int64x2_t __s2_343 = __p2_343; \
49215 float32x4_t __rev0_343; __rev0_343 = __builtin_shufflevector(__s0_343, __s0_343, __lane_reverse_128_32); \49093 int64x2_t __rev0_343; __rev0_343 = __builtin_shufflevector(__s0_343, __s0_343, __lane_reverse_128_64); \
49216 float32x4_t __rev2_343; __rev2_343 = __builtin_shufflevector(__s2_343, __s2_343, __lane_reverse_128_32); \49094 int64x2_t __rev2_343; __rev2_343 = __builtin_shufflevector(__s2_343, __s2_343, __lane_reverse_128_64); \
49217 __ret_343 = __noswap_vsetq_lane_f32(__noswap_vgetq_lane_f32(__rev2_343, __p3_343), __rev0_343, __p1_343); \49095 __ret_343 = __noswap_vsetq_lane_s64(__noswap_vgetq_lane_s64(__rev2_343, __p3_343), __rev0_343, __p1_343); \
49218 __ret_343 = __builtin_shufflevector(__ret_343, __ret_343, __lane_reverse_128_32); \49096 __ret_343 = __builtin_shufflevector(__ret_343, __ret_343, __lane_reverse_128_64); \
49219 __ret_343; \49097 __ret_343; \
49220})49098})
49221#endif49099#endif
4922249100
49223#ifdef __LITTLE_ENDIAN__49101#ifdef __LITTLE_ENDIAN__
49224#define vcopyq_laneq_s32(__p0_344, __p1_344, __p2_344, __p3_344) __extension__ ({ \49102#define vcopyq_laneq_mf8(__p0_344, __p1_344, __p2_344, __p3_344) __extension__ ({ \
49225 int32x4_t __ret_344; \49103 mfloat8x16_t __ret_344; \
49226 int32x4_t __s0_344 = __p0_344; \49104 mfloat8x16_t __s0_344 = __p0_344; \
49227 int32x4_t __s2_344 = __p2_344; \49105 mfloat8x16_t __s2_344 = __p2_344; \
49228 __ret_344 = vsetq_lane_s32(vgetq_lane_s32(__s2_344, __p3_344), __s0_344, __p1_344); \49106 __ret_344 = vsetq_lane_mf8(vgetq_lane_mf8(__s2_344, __p3_344), __s0_344, __p1_344); \
49229 __ret_344; \49107 __ret_344; \
49230})49108})
49231#else49109#else
49232#define vcopyq_laneq_s32(__p0_345, __p1_345, __p2_345, __p3_345) __extension__ ({ \49110#define vcopyq_laneq_mf8(__p0_345, __p1_345, __p2_345, __p3_345) __extension__ ({ \
49233 int32x4_t __ret_345; \49111 mfloat8x16_t __ret_345; \
49234 int32x4_t __s0_345 = __p0_345; \49112 mfloat8x16_t __s0_345 = __p0_345; \
49235 int32x4_t __s2_345 = __p2_345; \49113 mfloat8x16_t __s2_345 = __p2_345; \
49236 int32x4_t __rev0_345; __rev0_345 = __builtin_shufflevector(__s0_345, __s0_345, __lane_reverse_128_32); \49114 mfloat8x16_t __rev0_345; __rev0_345 = __builtin_shufflevector(__s0_345, __s0_345, __lane_reverse_128_8); \
49237 int32x4_t __rev2_345; __rev2_345 = __builtin_shufflevector(__s2_345, __s2_345, __lane_reverse_128_32); \49115 mfloat8x16_t __rev2_345; __rev2_345 = __builtin_shufflevector(__s2_345, __s2_345, __lane_reverse_128_8); \
49238 __ret_345 = __noswap_vsetq_lane_s32(__noswap_vgetq_lane_s32(__rev2_345, __p3_345), __rev0_345, __p1_345); \49116 __ret_345 = __noswap_vsetq_lane_mf8(__noswap_vgetq_lane_mf8(__rev2_345, __p3_345), __rev0_345, __p1_345); \
49239 __ret_345 = __builtin_shufflevector(__ret_345, __ret_345, __lane_reverse_128_32); \49117 __ret_345 = __builtin_shufflevector(__ret_345, __ret_345, __lane_reverse_128_8); \
49240 __ret_345; \49118 __ret_345; \
49241})49119})
49242#endif49120#endif
4924349121
49244#ifdef __LITTLE_ENDIAN__49122#ifdef __LITTLE_ENDIAN__
49245#define vcopyq_laneq_s64(__p0_346, __p1_346, __p2_346, __p3_346) __extension__ ({ \49123#define vcopyq_laneq_s16(__p0_346, __p1_346, __p2_346, __p3_346) __extension__ ({ \
49246 int64x2_t __ret_346; \49124 int16x8_t __ret_346; \
49247 int64x2_t __s0_346 = __p0_346; \49125 int16x8_t __s0_346 = __p0_346; \
49248 int64x2_t __s2_346 = __p2_346; \49126 int16x8_t __s2_346 = __p2_346; \
49249 __ret_346 = vsetq_lane_s64(vgetq_lane_s64(__s2_346, __p3_346), __s0_346, __p1_346); \49127 __ret_346 = vsetq_lane_s16(vgetq_lane_s16(__s2_346, __p3_346), __s0_346, __p1_346); \
49250 __ret_346; \49128 __ret_346; \
49251})49129})
49252#else49130#else
49253#define vcopyq_laneq_s64(__p0_347, __p1_347, __p2_347, __p3_347) __extension__ ({ \49131#define vcopyq_laneq_s16(__p0_347, __p1_347, __p2_347, __p3_347) __extension__ ({ \
49254 int64x2_t __ret_347; \49132 int16x8_t __ret_347; \
49255 int64x2_t __s0_347 = __p0_347; \49133 int16x8_t __s0_347 = __p0_347; \
49256 int64x2_t __s2_347 = __p2_347; \49134 int16x8_t __s2_347 = __p2_347; \
49257 int64x2_t __rev0_347; __rev0_347 = __builtin_shufflevector(__s0_347, __s0_347, __lane_reverse_128_64); \49135 int16x8_t __rev0_347; __rev0_347 = __builtin_shufflevector(__s0_347, __s0_347, __lane_reverse_128_16); \
49258 int64x2_t __rev2_347; __rev2_347 = __builtin_shufflevector(__s2_347, __s2_347, __lane_reverse_128_64); \49136 int16x8_t __rev2_347; __rev2_347 = __builtin_shufflevector(__s2_347, __s2_347, __lane_reverse_128_16); \
49259 __ret_347 = __noswap_vsetq_lane_s64(__noswap_vgetq_lane_s64(__rev2_347, __p3_347), __rev0_347, __p1_347); \49137 __ret_347 = __noswap_vsetq_lane_s16(__noswap_vgetq_lane_s16(__rev2_347, __p3_347), __rev0_347, __p1_347); \
49260 __ret_347 = __builtin_shufflevector(__ret_347, __ret_347, __lane_reverse_128_64); \49138 __ret_347 = __builtin_shufflevector(__ret_347, __ret_347, __lane_reverse_128_16); \
49261 __ret_347; \49139 __ret_347; \
49262})49140})
49263#endif49141#endif
4926449142
49265#ifdef __LITTLE_ENDIAN__49143#ifdef __LITTLE_ENDIAN__
49266#define vcopyq_laneq_mf8(__p0_348, __p1_348, __p2_348, __p3_348) __extension__ ({ \49144#define vcopyq_laneq_bf16(__p0_348, __p1_348, __p2_348, __p3_348) __extension__ ({ \
49267 mfloat8x16_t __ret_348; \49145 bfloat16x8_t __ret_348; \
49268 mfloat8x16_t __s0_348 = __p0_348; \49146 bfloat16x8_t __s0_348 = __p0_348; \
49269 mfloat8x16_t __s2_348 = __p2_348; \49147 bfloat16x8_t __s2_348 = __p2_348; \
49270 __ret_348 = vsetq_lane_mf8(vgetq_lane_mf8(__s2_348, __p3_348), __s0_348, __p1_348); \49148 __ret_348 = vsetq_lane_bf16(vgetq_lane_bf16(__s2_348, __p3_348), __s0_348, __p1_348); \
49271 __ret_348; \49149 __ret_348; \
49272})49150})
49273#else49151#else
49274#define vcopyq_laneq_mf8(__p0_349, __p1_349, __p2_349, __p3_349) __extension__ ({ \49152#define vcopyq_laneq_bf16(__p0_349, __p1_349, __p2_349, __p3_349) __extension__ ({ \
49275 mfloat8x16_t __ret_349; \49153 bfloat16x8_t __ret_349; \
49276 mfloat8x16_t __s0_349 = __p0_349; \49154 bfloat16x8_t __s0_349 = __p0_349; \
49277 mfloat8x16_t __s2_349 = __p2_349; \49155 bfloat16x8_t __s2_349 = __p2_349; \
49278 mfloat8x16_t __rev0_349; __rev0_349 = __builtin_shufflevector(__s0_349, __s0_349, __lane_reverse_128_8); \49156 bfloat16x8_t __rev0_349; __rev0_349 = __builtin_shufflevector(__s0_349, __s0_349, __lane_reverse_128_16); \
49279 mfloat8x16_t __rev2_349; __rev2_349 = __builtin_shufflevector(__s2_349, __s2_349, __lane_reverse_128_8); \49157 bfloat16x8_t __rev2_349; __rev2_349 = __builtin_shufflevector(__s2_349, __s2_349, __lane_reverse_128_16); \
49280 __ret_349 = __noswap_vsetq_lane_mf8(__noswap_vgetq_lane_mf8(__rev2_349, __p3_349), __rev0_349, __p1_349); \49158 __ret_349 = __noswap_vsetq_lane_bf16(__noswap_vgetq_lane_bf16(__rev2_349, __p3_349), __rev0_349, __p1_349); \
49281 __ret_349 = __builtin_shufflevector(__ret_349, __ret_349, __lane_reverse_128_8); \49159 __ret_349 = __builtin_shufflevector(__ret_349, __ret_349, __lane_reverse_128_16); \
49282 __ret_349; \49160 __ret_349; \
49283})49161})
49284#endif49162#endif
4928549163
49286#ifdef __LITTLE_ENDIAN__49164#ifdef __LITTLE_ENDIAN__
49287#define vcopyq_laneq_s16(__p0_350, __p1_350, __p2_350, __p3_350) __extension__ ({ \49165#define vcopy_laneq_p8(__p0_350, __p1_350, __p2_350, __p3_350) __extension__ ({ \
49288 int16x8_t __ret_350; \49166 poly8x8_t __ret_350; \
49289 int16x8_t __s0_350 = __p0_350; \49167 poly8x8_t __s0_350 = __p0_350; \
49290 int16x8_t __s2_350 = __p2_350; \49168 poly8x16_t __s2_350 = __p2_350; \
49291 __ret_350 = vsetq_lane_s16(vgetq_lane_s16(__s2_350, __p3_350), __s0_350, __p1_350); \49169 __ret_350 = vset_lane_p8(vgetq_lane_p8(__s2_350, __p3_350), __s0_350, __p1_350); \
49292 __ret_350; \49170 __ret_350; \
49293})49171})
49294#else49172#else
49295#define vcopyq_laneq_s16(__p0_351, __p1_351, __p2_351, __p3_351) __extension__ ({ \49173#define vcopy_laneq_p8(__p0_351, __p1_351, __p2_351, __p3_351) __extension__ ({ \
49296 int16x8_t __ret_351; \49174 poly8x8_t __ret_351; \
49297 int16x8_t __s0_351 = __p0_351; \49175 poly8x8_t __s0_351 = __p0_351; \
49298 int16x8_t __s2_351 = __p2_351; \49176 poly8x16_t __s2_351 = __p2_351; \
49299 int16x8_t __rev0_351; __rev0_351 = __builtin_shufflevector(__s0_351, __s0_351, __lane_reverse_128_16); \49177 poly8x8_t __rev0_351; __rev0_351 = __builtin_shufflevector(__s0_351, __s0_351, __lane_reverse_64_8); \
49300 int16x8_t __rev2_351; __rev2_351 = __builtin_shufflevector(__s2_351, __s2_351, __lane_reverse_128_16); \49178 poly8x16_t __rev2_351; __rev2_351 = __builtin_shufflevector(__s2_351, __s2_351, __lane_reverse_128_8); \
49301 __ret_351 = __noswap_vsetq_lane_s16(__noswap_vgetq_lane_s16(__rev2_351, __p3_351), __rev0_351, __p1_351); \49179 __ret_351 = __noswap_vset_lane_p8(__noswap_vgetq_lane_p8(__rev2_351, __p3_351), __rev0_351, __p1_351); \
49302 __ret_351 = __builtin_shufflevector(__ret_351, __ret_351, __lane_reverse_128_16); \49180 __ret_351 = __builtin_shufflevector(__ret_351, __ret_351, __lane_reverse_64_8); \
49303 __ret_351; \49181 __ret_351; \
49304})49182})
49305#endif49183#endif
4930649184
49307#ifdef __LITTLE_ENDIAN__49185#ifdef __LITTLE_ENDIAN__
49308#define vcopy_laneq_p8(__p0_352, __p1_352, __p2_352, __p3_352) __extension__ ({ \49186#define vcopy_laneq_p16(__p0_352, __p1_352, __p2_352, __p3_352) __extension__ ({ \
49309 poly8x8_t __ret_352; \49187 poly16x4_t __ret_352; \
49310 poly8x8_t __s0_352 = __p0_352; \49188 poly16x4_t __s0_352 = __p0_352; \
49311 poly8x16_t __s2_352 = __p2_352; \49189 poly16x8_t __s2_352 = __p2_352; \
49312 __ret_352 = vset_lane_p8(vgetq_lane_p8(__s2_352, __p3_352), __s0_352, __p1_352); \49190 __ret_352 = vset_lane_p16(vgetq_lane_p16(__s2_352, __p3_352), __s0_352, __p1_352); \
49313 __ret_352; \49191 __ret_352; \
49314})49192})
49315#else49193#else
49316#define vcopy_laneq_p8(__p0_353, __p1_353, __p2_353, __p3_353) __extension__ ({ \49194#define vcopy_laneq_p16(__p0_353, __p1_353, __p2_353, __p3_353) __extension__ ({ \
49317 poly8x8_t __ret_353; \49195 poly16x4_t __ret_353; \
49318 poly8x8_t __s0_353 = __p0_353; \49196 poly16x4_t __s0_353 = __p0_353; \
49319 poly8x16_t __s2_353 = __p2_353; \49197 poly16x8_t __s2_353 = __p2_353; \
49320 poly8x8_t __rev0_353; __rev0_353 = __builtin_shufflevector(__s0_353, __s0_353, __lane_reverse_64_8); \49198 poly16x4_t __rev0_353; __rev0_353 = __builtin_shufflevector(__s0_353, __s0_353, __lane_reverse_64_16); \
49321 poly8x16_t __rev2_353; __rev2_353 = __builtin_shufflevector(__s2_353, __s2_353, __lane_reverse_128_8); \49199 poly16x8_t __rev2_353; __rev2_353 = __builtin_shufflevector(__s2_353, __s2_353, __lane_reverse_128_16); \
49322 __ret_353 = __noswap_vset_lane_p8(__noswap_vgetq_lane_p8(__rev2_353, __p3_353), __rev0_353, __p1_353); \49200 __ret_353 = __noswap_vset_lane_p16(__noswap_vgetq_lane_p16(__rev2_353, __p3_353), __rev0_353, __p1_353); \
49323 __ret_353 = __builtin_shufflevector(__ret_353, __ret_353, __lane_reverse_64_8); \49201 __ret_353 = __builtin_shufflevector(__ret_353, __ret_353, __lane_reverse_64_16); \
49324 __ret_353; \49202 __ret_353; \
49325})49203})
49326#endif49204#endif
4932749205
49328#ifdef __LITTLE_ENDIAN__49206#ifdef __LITTLE_ENDIAN__
49329#define vcopy_laneq_p16(__p0_354, __p1_354, __p2_354, __p3_354) __extension__ ({ \49207#define vcopy_laneq_u8(__p0_354, __p1_354, __p2_354, __p3_354) __extension__ ({ \
49330 poly16x4_t __ret_354; \49208 uint8x8_t __ret_354; \
49331 poly16x4_t __s0_354 = __p0_354; \49209 uint8x8_t __s0_354 = __p0_354; \
49332 poly16x8_t __s2_354 = __p2_354; \49210 uint8x16_t __s2_354 = __p2_354; \
49333 __ret_354 = vset_lane_p16(vgetq_lane_p16(__s2_354, __p3_354), __s0_354, __p1_354); \49211 __ret_354 = vset_lane_u8(vgetq_lane_u8(__s2_354, __p3_354), __s0_354, __p1_354); \
49334 __ret_354; \49212 __ret_354; \
49335})49213})
49336#else49214#else
49337#define vcopy_laneq_p16(__p0_355, __p1_355, __p2_355, __p3_355) __extension__ ({ \49215#define vcopy_laneq_u8(__p0_355, __p1_355, __p2_355, __p3_355) __extension__ ({ \
49338 poly16x4_t __ret_355; \49216 uint8x8_t __ret_355; \
49339 poly16x4_t __s0_355 = __p0_355; \49217 uint8x8_t __s0_355 = __p0_355; \
49340 poly16x8_t __s2_355 = __p2_355; \49218 uint8x16_t __s2_355 = __p2_355; \
49341 poly16x4_t __rev0_355; __rev0_355 = __builtin_shufflevector(__s0_355, __s0_355, __lane_reverse_64_16); \49219 uint8x8_t __rev0_355; __rev0_355 = __builtin_shufflevector(__s0_355, __s0_355, __lane_reverse_64_8); \
49342 poly16x8_t __rev2_355; __rev2_355 = __builtin_shufflevector(__s2_355, __s2_355, __lane_reverse_128_16); \49220 uint8x16_t __rev2_355; __rev2_355 = __builtin_shufflevector(__s2_355, __s2_355, __lane_reverse_128_8); \
49343 __ret_355 = __noswap_vset_lane_p16(__noswap_vgetq_lane_p16(__rev2_355, __p3_355), __rev0_355, __p1_355); \49221 __ret_355 = __noswap_vset_lane_u8(__noswap_vgetq_lane_u8(__rev2_355, __p3_355), __rev0_355, __p1_355); \
49344 __ret_355 = __builtin_shufflevector(__ret_355, __ret_355, __lane_reverse_64_16); \49222 __ret_355 = __builtin_shufflevector(__ret_355, __ret_355, __lane_reverse_64_8); \
49345 __ret_355; \49223 __ret_355; \
49346})49224})
49347#endif49225#endif
4934849226
49349#ifdef __LITTLE_ENDIAN__49227#ifdef __LITTLE_ENDIAN__
49350#define vcopy_laneq_u8(__p0_356, __p1_356, __p2_356, __p3_356) __extension__ ({ \49228#define vcopy_laneq_u32(__p0_356, __p1_356, __p2_356, __p3_356) __extension__ ({ \
49351 uint8x8_t __ret_356; \49229 uint32x2_t __ret_356; \
49352 uint8x8_t __s0_356 = __p0_356; \49230 uint32x2_t __s0_356 = __p0_356; \
49353 uint8x16_t __s2_356 = __p2_356; \49231 uint32x4_t __s2_356 = __p2_356; \
49354 __ret_356 = vset_lane_u8(vgetq_lane_u8(__s2_356, __p3_356), __s0_356, __p1_356); \49232 __ret_356 = vset_lane_u32(vgetq_lane_u32(__s2_356, __p3_356), __s0_356, __p1_356); \
49355 __ret_356; \49233 __ret_356; \
49356})49234})
49357#else49235#else
49358#define vcopy_laneq_u8(__p0_357, __p1_357, __p2_357, __p3_357) __extension__ ({ \49236#define vcopy_laneq_u32(__p0_357, __p1_357, __p2_357, __p3_357) __extension__ ({ \
49359 uint8x8_t __ret_357; \49237 uint32x2_t __ret_357; \
49360 uint8x8_t __s0_357 = __p0_357; \49238 uint32x2_t __s0_357 = __p0_357; \
49361 uint8x16_t __s2_357 = __p2_357; \49239 uint32x4_t __s2_357 = __p2_357; \
49362 uint8x8_t __rev0_357; __rev0_357 = __builtin_shufflevector(__s0_357, __s0_357, __lane_reverse_64_8); \49240 uint32x2_t __rev0_357; __rev0_357 = __builtin_shufflevector(__s0_357, __s0_357, __lane_reverse_64_32); \
49363 uint8x16_t __rev2_357; __rev2_357 = __builtin_shufflevector(__s2_357, __s2_357, __lane_reverse_128_8); \49241 uint32x4_t __rev2_357; __rev2_357 = __builtin_shufflevector(__s2_357, __s2_357, __lane_reverse_128_32); \
49364 __ret_357 = __noswap_vset_lane_u8(__noswap_vgetq_lane_u8(__rev2_357, __p3_357), __rev0_357, __p1_357); \49242 __ret_357 = __noswap_vset_lane_u32(__noswap_vgetq_lane_u32(__rev2_357, __p3_357), __rev0_357, __p1_357); \
49365 __ret_357 = __builtin_shufflevector(__ret_357, __ret_357, __lane_reverse_64_8); \49243 __ret_357 = __builtin_shufflevector(__ret_357, __ret_357, __lane_reverse_64_32); \
49366 __ret_357; \49244 __ret_357; \
49367})49245})
49368#endif49246#endif
4936949247
49370#ifdef __LITTLE_ENDIAN__49248#ifdef __LITTLE_ENDIAN__
49371#define vcopy_laneq_u32(__p0_358, __p1_358, __p2_358, __p3_358) __extension__ ({ \49249#define vcopy_laneq_u64(__p0_358, __p1_358, __p2_358, __p3_358) __extension__ ({ \
49372 uint32x2_t __ret_358; \49250 uint64x1_t __ret_358; \
49373 uint32x2_t __s0_358 = __p0_358; \49251 uint64x1_t __s0_358 = __p0_358; \
49374 uint32x4_t __s2_358 = __p2_358; \49252 uint64x2_t __s2_358 = __p2_358; \
49375 __ret_358 = vset_lane_u32(vgetq_lane_u32(__s2_358, __p3_358), __s0_358, __p1_358); \49253 __ret_358 = vset_lane_u64(vgetq_lane_u64(__s2_358, __p3_358), __s0_358, __p1_358); \
49376 __ret_358; \49254 __ret_358; \
49377})49255})
49378#else49256#else
49379#define vcopy_laneq_u32(__p0_359, __p1_359, __p2_359, __p3_359) __extension__ ({ \49257#define vcopy_laneq_u64(__p0_359, __p1_359, __p2_359, __p3_359) __extension__ ({ \
49380 uint32x2_t __ret_359; \49258 uint64x1_t __ret_359; \
49381 uint32x2_t __s0_359 = __p0_359; \49259 uint64x1_t __s0_359 = __p0_359; \
49382 uint32x4_t __s2_359 = __p2_359; \49260 uint64x2_t __s2_359 = __p2_359; \
49383 uint32x2_t __rev0_359; __rev0_359 = __builtin_shufflevector(__s0_359, __s0_359, __lane_reverse_64_32); \49261 uint64x2_t __rev2_359; __rev2_359 = __builtin_shufflevector(__s2_359, __s2_359, __lane_reverse_128_64); \
49384 uint32x4_t __rev2_359; __rev2_359 = __builtin_shufflevector(__s2_359, __s2_359, __lane_reverse_128_32); \49262 __ret_359 = vset_lane_u64(__noswap_vgetq_lane_u64(__rev2_359, __p3_359), __s0_359, __p1_359); \
49385 __ret_359 = __noswap_vset_lane_u32(__noswap_vgetq_lane_u32(__rev2_359, __p3_359), __rev0_359, __p1_359); \
49386 __ret_359 = __builtin_shufflevector(__ret_359, __ret_359, __lane_reverse_64_32); \
49387 __ret_359; \49263 __ret_359; \
49388})49264})
49389#endif49265#endif
4939049266
49391#ifdef __LITTLE_ENDIAN__49267#ifdef __LITTLE_ENDIAN__
49392#define vcopy_laneq_u64(__p0_360, __p1_360, __p2_360, __p3_360) __extension__ ({ \49268#define vcopy_laneq_u16(__p0_360, __p1_360, __p2_360, __p3_360) __extension__ ({ \
49393 uint64x1_t __ret_360; \49269 uint16x4_t __ret_360; \
49394 uint64x1_t __s0_360 = __p0_360; \49270 uint16x4_t __s0_360 = __p0_360; \
49395 uint64x2_t __s2_360 = __p2_360; \49271 uint16x8_t __s2_360 = __p2_360; \
49396 __ret_360 = vset_lane_u64(vgetq_lane_u64(__s2_360, __p3_360), __s0_360, __p1_360); \49272 __ret_360 = vset_lane_u16(vgetq_lane_u16(__s2_360, __p3_360), __s0_360, __p1_360); \
49397 __ret_360; \49273 __ret_360; \
49398})49274})
49399#else49275#else
49400#define vcopy_laneq_u64(__p0_361, __p1_361, __p2_361, __p3_361) __extension__ ({ \49276#define vcopy_laneq_u16(__p0_361, __p1_361, __p2_361, __p3_361) __extension__ ({ \
49401 uint64x1_t __ret_361; \49277 uint16x4_t __ret_361; \
49402 uint64x1_t __s0_361 = __p0_361; \49278 uint16x4_t __s0_361 = __p0_361; \
49403 uint64x2_t __s2_361 = __p2_361; \49279 uint16x8_t __s2_361 = __p2_361; \
49404 uint64x2_t __rev2_361; __rev2_361 = __builtin_shufflevector(__s2_361, __s2_361, __lane_reverse_128_64); \49280 uint16x4_t __rev0_361; __rev0_361 = __builtin_shufflevector(__s0_361, __s0_361, __lane_reverse_64_16); \
49405 __ret_361 = vset_lane_u64(__noswap_vgetq_lane_u64(__rev2_361, __p3_361), __s0_361, __p1_361); \49281 uint16x8_t __rev2_361; __rev2_361 = __builtin_shufflevector(__s2_361, __s2_361, __lane_reverse_128_16); \
49282 __ret_361 = __noswap_vset_lane_u16(__noswap_vgetq_lane_u16(__rev2_361, __p3_361), __rev0_361, __p1_361); \
49283 __ret_361 = __builtin_shufflevector(__ret_361, __ret_361, __lane_reverse_64_16); \
49406 __ret_361; \49284 __ret_361; \
49407})49285})
49408#endif49286#endif
4940949287
49410#ifdef __LITTLE_ENDIAN__49288#ifdef __LITTLE_ENDIAN__
49411#define vcopy_laneq_u16(__p0_362, __p1_362, __p2_362, __p3_362) __extension__ ({ \49289#define vcopy_laneq_s8(__p0_362, __p1_362, __p2_362, __p3_362) __extension__ ({ \
49412 uint16x4_t __ret_362; \49290 int8x8_t __ret_362; \
49413 uint16x4_t __s0_362 = __p0_362; \49291 int8x8_t __s0_362 = __p0_362; \
49414 uint16x8_t __s2_362 = __p2_362; \49292 int8x16_t __s2_362 = __p2_362; \
49415 __ret_362 = vset_lane_u16(vgetq_lane_u16(__s2_362, __p3_362), __s0_362, __p1_362); \49293 __ret_362 = vset_lane_s8(vgetq_lane_s8(__s2_362, __p3_362), __s0_362, __p1_362); \
49416 __ret_362; \49294 __ret_362; \
49417})49295})
49418#else49296#else
49419#define vcopy_laneq_u16(__p0_363, __p1_363, __p2_363, __p3_363) __extension__ ({ \49297#define vcopy_laneq_s8(__p0_363, __p1_363, __p2_363, __p3_363) __extension__ ({ \
49420 uint16x4_t __ret_363; \49298 int8x8_t __ret_363; \
49421 uint16x4_t __s0_363 = __p0_363; \49299 int8x8_t __s0_363 = __p0_363; \
49422 uint16x8_t __s2_363 = __p2_363; \49300 int8x16_t __s2_363 = __p2_363; \
49423 uint16x4_t __rev0_363; __rev0_363 = __builtin_shufflevector(__s0_363, __s0_363, __lane_reverse_64_16); \49301 int8x8_t __rev0_363; __rev0_363 = __builtin_shufflevector(__s0_363, __s0_363, __lane_reverse_64_8); \
49424 uint16x8_t __rev2_363; __rev2_363 = __builtin_shufflevector(__s2_363, __s2_363, __lane_reverse_128_16); \49302 int8x16_t __rev2_363; __rev2_363 = __builtin_shufflevector(__s2_363, __s2_363, __lane_reverse_128_8); \
49425 __ret_363 = __noswap_vset_lane_u16(__noswap_vgetq_lane_u16(__rev2_363, __p3_363), __rev0_363, __p1_363); \49303 __ret_363 = __noswap_vset_lane_s8(__noswap_vgetq_lane_s8(__rev2_363, __p3_363), __rev0_363, __p1_363); \
49426 __ret_363 = __builtin_shufflevector(__ret_363, __ret_363, __lane_reverse_64_16); \49304 __ret_363 = __builtin_shufflevector(__ret_363, __ret_363, __lane_reverse_64_8); \
49427 __ret_363; \49305 __ret_363; \
49428})49306})
49429#endif49307#endif
4943049308
49431#ifdef __LITTLE_ENDIAN__49309#ifdef __LITTLE_ENDIAN__
49432#define vcopy_laneq_s8(__p0_364, __p1_364, __p2_364, __p3_364) __extension__ ({ \49310#define vcopy_laneq_f32(__p0_364, __p1_364, __p2_364, __p3_364) __extension__ ({ \
49433 int8x8_t __ret_364; \49311 float32x2_t __ret_364; \
49434 int8x8_t __s0_364 = __p0_364; \49312 float32x2_t __s0_364 = __p0_364; \
49435 int8x16_t __s2_364 = __p2_364; \49313 float32x4_t __s2_364 = __p2_364; \
49436 __ret_364 = vset_lane_s8(vgetq_lane_s8(__s2_364, __p3_364), __s0_364, __p1_364); \49314 __ret_364 = vset_lane_f32(vgetq_lane_f32(__s2_364, __p3_364), __s0_364, __p1_364); \
49437 __ret_364; \49315 __ret_364; \
49438})49316})
49439#else49317#else
49440#define vcopy_laneq_s8(__p0_365, __p1_365, __p2_365, __p3_365) __extension__ ({ \49318#define vcopy_laneq_f32(__p0_365, __p1_365, __p2_365, __p3_365) __extension__ ({ \
49441 int8x8_t __ret_365; \49319 float32x2_t __ret_365; \
49442 int8x8_t __s0_365 = __p0_365; \49320 float32x2_t __s0_365 = __p0_365; \
49443 int8x16_t __s2_365 = __p2_365; \49321 float32x4_t __s2_365 = __p2_365; \
49444 int8x8_t __rev0_365; __rev0_365 = __builtin_shufflevector(__s0_365, __s0_365, __lane_reverse_64_8); \49322 float32x2_t __rev0_365; __rev0_365 = __builtin_shufflevector(__s0_365, __s0_365, __lane_reverse_64_32); \
49445 int8x16_t __rev2_365; __rev2_365 = __builtin_shufflevector(__s2_365, __s2_365, __lane_reverse_128_8); \49323 float32x4_t __rev2_365; __rev2_365 = __builtin_shufflevector(__s2_365, __s2_365, __lane_reverse_128_32); \
49446 __ret_365 = __noswap_vset_lane_s8(__noswap_vgetq_lane_s8(__rev2_365, __p3_365), __rev0_365, __p1_365); \49324 __ret_365 = __noswap_vset_lane_f32(__noswap_vgetq_lane_f32(__rev2_365, __p3_365), __rev0_365, __p1_365); \
49447 __ret_365 = __builtin_shufflevector(__ret_365, __ret_365, __lane_reverse_64_8); \49325 __ret_365 = __builtin_shufflevector(__ret_365, __ret_365, __lane_reverse_64_32); \
49448 __ret_365; \49326 __ret_365; \
49449})49327})
49450#endif49328#endif
4945149329
49452#ifdef __LITTLE_ENDIAN__49330#ifdef __LITTLE_ENDIAN__
49453#define vcopy_laneq_f32(__p0_366, __p1_366, __p2_366, __p3_366) __extension__ ({ \49331#define vcopy_laneq_s32(__p0_366, __p1_366, __p2_366, __p3_366) __extension__ ({ \
49454 float32x2_t __ret_366; \49332 int32x2_t __ret_366; \
49455 float32x2_t __s0_366 = __p0_366; \49333 int32x2_t __s0_366 = __p0_366; \
49456 float32x4_t __s2_366 = __p2_366; \49334 int32x4_t __s2_366 = __p2_366; \
49457 __ret_366 = vset_lane_f32(vgetq_lane_f32(__s2_366, __p3_366), __s0_366, __p1_366); \49335 __ret_366 = vset_lane_s32(vgetq_lane_s32(__s2_366, __p3_366), __s0_366, __p1_366); \
49458 __ret_366; \49336 __ret_366; \
49459})49337})
49460#else49338#else
49461#define vcopy_laneq_f32(__p0_367, __p1_367, __p2_367, __p3_367) __extension__ ({ \49339#define vcopy_laneq_s32(__p0_367, __p1_367, __p2_367, __p3_367) __extension__ ({ \
49462 float32x2_t __ret_367; \49340 int32x2_t __ret_367; \
49463 float32x2_t __s0_367 = __p0_367; \49341 int32x2_t __s0_367 = __p0_367; \
49464 float32x4_t __s2_367 = __p2_367; \49342 int32x4_t __s2_367 = __p2_367; \
49465 float32x2_t __rev0_367; __rev0_367 = __builtin_shufflevector(__s0_367, __s0_367, __lane_reverse_64_32); \49343 int32x2_t __rev0_367; __rev0_367 = __builtin_shufflevector(__s0_367, __s0_367, __lane_reverse_64_32); \
49466 float32x4_t __rev2_367; __rev2_367 = __builtin_shufflevector(__s2_367, __s2_367, __lane_reverse_128_32); \49344 int32x4_t __rev2_367; __rev2_367 = __builtin_shufflevector(__s2_367, __s2_367, __lane_reverse_128_32); \
49467 __ret_367 = __noswap_vset_lane_f32(__noswap_vgetq_lane_f32(__rev2_367, __p3_367), __rev0_367, __p1_367); \49345 __ret_367 = __noswap_vset_lane_s32(__noswap_vgetq_lane_s32(__rev2_367, __p3_367), __rev0_367, __p1_367); \
49468 __ret_367 = __builtin_shufflevector(__ret_367, __ret_367, __lane_reverse_64_32); \49346 __ret_367 = __builtin_shufflevector(__ret_367, __ret_367, __lane_reverse_64_32); \
49469 __ret_367; \49347 __ret_367; \
49470})49348})
49471#endif49349#endif
4947249350
49473#ifdef __LITTLE_ENDIAN__49351#ifdef __LITTLE_ENDIAN__
49474#define vcopy_laneq_s32(__p0_368, __p1_368, __p2_368, __p3_368) __extension__ ({ \49352#define vcopy_laneq_s64(__p0_368, __p1_368, __p2_368, __p3_368) __extension__ ({ \
49475 int32x2_t __ret_368; \49353 int64x1_t __ret_368; \
49476 int32x2_t __s0_368 = __p0_368; \49354 int64x1_t __s0_368 = __p0_368; \
49477 int32x4_t __s2_368 = __p2_368; \49355 int64x2_t __s2_368 = __p2_368; \
49478 __ret_368 = vset_lane_s32(vgetq_lane_s32(__s2_368, __p3_368), __s0_368, __p1_368); \49356 __ret_368 = vset_lane_s64(vgetq_lane_s64(__s2_368, __p3_368), __s0_368, __p1_368); \
49479 __ret_368; \49357 __ret_368; \
49480})49358})
49481#else49359#else
49482#define vcopy_laneq_s32(__p0_369, __p1_369, __p2_369, __p3_369) __extension__ ({ \49360#define vcopy_laneq_s64(__p0_369, __p1_369, __p2_369, __p3_369) __extension__ ({ \
49483 int32x2_t __ret_369; \49361 int64x1_t __ret_369; \
49484 int32x2_t __s0_369 = __p0_369; \49362 int64x1_t __s0_369 = __p0_369; \
49485 int32x4_t __s2_369 = __p2_369; \49363 int64x2_t __s2_369 = __p2_369; \
49486 int32x2_t __rev0_369; __rev0_369 = __builtin_shufflevector(__s0_369, __s0_369, __lane_reverse_64_32); \49364 int64x2_t __rev2_369; __rev2_369 = __builtin_shufflevector(__s2_369, __s2_369, __lane_reverse_128_64); \
49487 int32x4_t __rev2_369; __rev2_369 = __builtin_shufflevector(__s2_369, __s2_369, __lane_reverse_128_32); \49365 __ret_369 = vset_lane_s64(__noswap_vgetq_lane_s64(__rev2_369, __p3_369), __s0_369, __p1_369); \
49488 __ret_369 = __noswap_vset_lane_s32(__noswap_vgetq_lane_s32(__rev2_369, __p3_369), __rev0_369, __p1_369); \
49489 __ret_369 = __builtin_shufflevector(__ret_369, __ret_369, __lane_reverse_64_32); \
49490 __ret_369; \49366 __ret_369; \
49491})49367})
49492#endif49368#endif
4949349369
49494#ifdef __LITTLE_ENDIAN__49370#ifdef __LITTLE_ENDIAN__
49495#define vcopy_laneq_s64(__p0_370, __p1_370, __p2_370, __p3_370) __extension__ ({ \49371#define vcopy_laneq_mf8(__p0_370, __p1_370, __p2_370, __p3_370) __extension__ ({ \
49496 int64x1_t __ret_370; \49372 mfloat8x8_t __ret_370; \
49497 int64x1_t __s0_370 = __p0_370; \49373 mfloat8x8_t __s0_370 = __p0_370; \
49498 int64x2_t __s2_370 = __p2_370; \49374 mfloat8x16_t __s2_370 = __p2_370; \
49499 __ret_370 = vset_lane_s64(vgetq_lane_s64(__s2_370, __p3_370), __s0_370, __p1_370); \49375 __ret_370 = vset_lane_mf8(vgetq_lane_mf8(__s2_370, __p3_370), __s0_370, __p1_370); \
49500 __ret_370; \49376 __ret_370; \
49501})49377})
49502#else49378#else
49503#define vcopy_laneq_s64(__p0_371, __p1_371, __p2_371, __p3_371) __extension__ ({ \49379#define vcopy_laneq_mf8(__p0_371, __p1_371, __p2_371, __p3_371) __extension__ ({ \
49504 int64x1_t __ret_371; \49380 mfloat8x8_t __ret_371; \
49505 int64x1_t __s0_371 = __p0_371; \49381 mfloat8x8_t __s0_371 = __p0_371; \
49506 int64x2_t __s2_371 = __p2_371; \49382 mfloat8x16_t __s2_371 = __p2_371; \
49507 int64x2_t __rev2_371; __rev2_371 = __builtin_shufflevector(__s2_371, __s2_371, __lane_reverse_128_64); \49383 mfloat8x8_t __rev0_371; __rev0_371 = __builtin_shufflevector(__s0_371, __s0_371, __lane_reverse_64_8); \
49508 __ret_371 = vset_lane_s64(__noswap_vgetq_lane_s64(__rev2_371, __p3_371), __s0_371, __p1_371); \49384 mfloat8x16_t __rev2_371; __rev2_371 = __builtin_shufflevector(__s2_371, __s2_371, __lane_reverse_128_8); \
49385 __ret_371 = __noswap_vset_lane_mf8(__noswap_vgetq_lane_mf8(__rev2_371, __p3_371), __rev0_371, __p1_371); \
49386 __ret_371 = __builtin_shufflevector(__ret_371, __ret_371, __lane_reverse_64_8); \
49509 __ret_371; \49387 __ret_371; \
49510})49388})
49511#endif49389#endif
4951249390
49513#ifdef __LITTLE_ENDIAN__49391#ifdef __LITTLE_ENDIAN__
49514#define vcopy_laneq_mf8(__p0_372, __p1_372, __p2_372, __p3_372) __extension__ ({ \49392#define vcopy_laneq_s16(__p0_372, __p1_372, __p2_372, __p3_372) __extension__ ({ \
49515 mfloat8x8_t __ret_372; \49393 int16x4_t __ret_372; \
49516 mfloat8x8_t __s0_372 = __p0_372; \49394 int16x4_t __s0_372 = __p0_372; \
49517 mfloat8x16_t __s2_372 = __p2_372; \49395 int16x8_t __s2_372 = __p2_372; \
49518 __ret_372 = vset_lane_mf8(vgetq_lane_mf8(__s2_372, __p3_372), __s0_372, __p1_372); \49396 __ret_372 = vset_lane_s16(vgetq_lane_s16(__s2_372, __p3_372), __s0_372, __p1_372); \
49519 __ret_372; \49397 __ret_372; \
49520})49398})
49521#else49399#else
49522#define vcopy_laneq_mf8(__p0_373, __p1_373, __p2_373, __p3_373) __extension__ ({ \49400#define vcopy_laneq_s16(__p0_373, __p1_373, __p2_373, __p3_373) __extension__ ({ \
49523 mfloat8x8_t __ret_373; \49401 int16x4_t __ret_373; \
49524 mfloat8x8_t __s0_373 = __p0_373; \49402 int16x4_t __s0_373 = __p0_373; \
49525 mfloat8x16_t __s2_373 = __p2_373; \49403 int16x8_t __s2_373 = __p2_373; \
49526 mfloat8x8_t __rev0_373; __rev0_373 = __builtin_shufflevector(__s0_373, __s0_373, __lane_reverse_64_8); \49404 int16x4_t __rev0_373; __rev0_373 = __builtin_shufflevector(__s0_373, __s0_373, __lane_reverse_64_16); \
49527 mfloat8x16_t __rev2_373; __rev2_373 = __builtin_shufflevector(__s2_373, __s2_373, __lane_reverse_128_8); \49405 int16x8_t __rev2_373; __rev2_373 = __builtin_shufflevector(__s2_373, __s2_373, __lane_reverse_128_16); \
49528 __ret_373 = __noswap_vset_lane_mf8(__noswap_vgetq_lane_mf8(__rev2_373, __p3_373), __rev0_373, __p1_373); \49406 __ret_373 = __noswap_vset_lane_s16(__noswap_vgetq_lane_s16(__rev2_373, __p3_373), __rev0_373, __p1_373); \
49529 __ret_373 = __builtin_shufflevector(__ret_373, __ret_373, __lane_reverse_64_8); \49407 __ret_373 = __builtin_shufflevector(__ret_373, __ret_373, __lane_reverse_64_16); \
49530 __ret_373; \49408 __ret_373; \
49531})49409})
49532#endif49410#endif
4953349411
49534#ifdef __LITTLE_ENDIAN__49412#ifdef __LITTLE_ENDIAN__
49535#define vcopy_laneq_s16(__p0_374, __p1_374, __p2_374, __p3_374) __extension__ ({ \49413#define vcopy_laneq_bf16(__p0_374, __p1_374, __p2_374, __p3_374) __extension__ ({ \
49536 int16x4_t __ret_374; \49414 bfloat16x4_t __ret_374; \
49537 int16x4_t __s0_374 = __p0_374; \49415 bfloat16x4_t __s0_374 = __p0_374; \
49538 int16x8_t __s2_374 = __p2_374; \49416 bfloat16x8_t __s2_374 = __p2_374; \
49539 __ret_374 = vset_lane_s16(vgetq_lane_s16(__s2_374, __p3_374), __s0_374, __p1_374); \49417 __ret_374 = vset_lane_bf16(vgetq_lane_bf16(__s2_374, __p3_374), __s0_374, __p1_374); \
49540 __ret_374; \49418 __ret_374; \
49541})49419})
49542#else49420#else
49543#define vcopy_laneq_s16(__p0_375, __p1_375, __p2_375, __p3_375) __extension__ ({ \49421#define vcopy_laneq_bf16(__p0_375, __p1_375, __p2_375, __p3_375) __extension__ ({ \
49544 int16x4_t __ret_375; \49422 bfloat16x4_t __ret_375; \
49545 int16x4_t __s0_375 = __p0_375; \49423 bfloat16x4_t __s0_375 = __p0_375; \
49546 int16x8_t __s2_375 = __p2_375; \49424 bfloat16x8_t __s2_375 = __p2_375; \
49547 int16x4_t __rev0_375; __rev0_375 = __builtin_shufflevector(__s0_375, __s0_375, __lane_reverse_64_16); \49425 bfloat16x4_t __rev0_375; __rev0_375 = __builtin_shufflevector(__s0_375, __s0_375, __lane_reverse_64_16); \
49548 int16x8_t __rev2_375; __rev2_375 = __builtin_shufflevector(__s2_375, __s2_375, __lane_reverse_128_16); \49426 bfloat16x8_t __rev2_375; __rev2_375 = __builtin_shufflevector(__s2_375, __s2_375, __lane_reverse_128_16); \
49549 __ret_375 = __noswap_vset_lane_s16(__noswap_vgetq_lane_s16(__rev2_375, __p3_375), __rev0_375, __p1_375); \49427 __ret_375 = __noswap_vset_lane_bf16(__noswap_vgetq_lane_bf16(__rev2_375, __p3_375), __rev0_375, __p1_375); \
49550 __ret_375 = __builtin_shufflevector(__ret_375, __ret_375, __lane_reverse_64_16); \49428 __ret_375 = __builtin_shufflevector(__ret_375, __ret_375, __lane_reverse_64_16); \
49551 __ret_375; \49429 __ret_375; \
49552})49430})
...@@ -64144,6 +64022,296 @@ __ai __attribute__((target("neon"))) int16x4_t vreinterpret_s16_mf8(mfloat8x8_t...@@ -64144,6 +64022,296 @@ __ai __attribute__((target("neon"))) int16x4_t vreinterpret_s16_mf8(mfloat8x8_t
64144 __ret = __builtin_bit_cast(int16x4_t, __p0);64022 __ret = __builtin_bit_cast(int16x4_t, __p0);
64145 return __ret;64023 return __ret;
64146}64024}
64025__ai __attribute__((target("neon"))) poly8x8_t vreinterpret_p8_bf16(bfloat16x4_t __p0) {
64026 poly8x8_t __ret;
64027 __ret = __builtin_bit_cast(poly8x8_t, __p0);
64028 return __ret;
64029}
64030__ai __attribute__((target("neon"))) poly64x1_t vreinterpret_p64_bf16(bfloat16x4_t __p0) {
64031 poly64x1_t __ret;
64032 __ret = __builtin_bit_cast(poly64x1_t, __p0);
64033 return __ret;
64034}
64035__ai __attribute__((target("neon"))) poly16x4_t vreinterpret_p16_bf16(bfloat16x4_t __p0) {
64036 poly16x4_t __ret;
64037 __ret = __builtin_bit_cast(poly16x4_t, __p0);
64038 return __ret;
64039}
64040__ai __attribute__((target("neon"))) poly8x16_t vreinterpretq_p8_bf16(bfloat16x8_t __p0) {
64041 poly8x16_t __ret;
64042 __ret = __builtin_bit_cast(poly8x16_t, __p0);
64043 return __ret;
64044}
64045__ai __attribute__((target("neon"))) poly128_t vreinterpretq_p128_bf16(bfloat16x8_t __p0) {
64046 poly128_t __ret;
64047 __ret = __builtin_bit_cast(poly128_t, __p0);
64048 return __ret;
64049}
64050__ai __attribute__((target("neon"))) poly64x2_t vreinterpretq_p64_bf16(bfloat16x8_t __p0) {
64051 poly64x2_t __ret;
64052 __ret = __builtin_bit_cast(poly64x2_t, __p0);
64053 return __ret;
64054}
64055__ai __attribute__((target("neon"))) poly16x8_t vreinterpretq_p16_bf16(bfloat16x8_t __p0) {
64056 poly16x8_t __ret;
64057 __ret = __builtin_bit_cast(poly16x8_t, __p0);
64058 return __ret;
64059}
64060__ai __attribute__((target("neon"))) uint8x16_t vreinterpretq_u8_bf16(bfloat16x8_t __p0) {
64061 uint8x16_t __ret;
64062 __ret = __builtin_bit_cast(uint8x16_t, __p0);
64063 return __ret;
64064}
64065__ai __attribute__((target("neon"))) uint32x4_t vreinterpretq_u32_bf16(bfloat16x8_t __p0) {
64066 uint32x4_t __ret;
64067 __ret = __builtin_bit_cast(uint32x4_t, __p0);
64068 return __ret;
64069}
64070__ai __attribute__((target("neon"))) uint64x2_t vreinterpretq_u64_bf16(bfloat16x8_t __p0) {
64071 uint64x2_t __ret;
64072 __ret = __builtin_bit_cast(uint64x2_t, __p0);
64073 return __ret;
64074}
64075__ai __attribute__((target("neon"))) uint16x8_t vreinterpretq_u16_bf16(bfloat16x8_t __p0) {
64076 uint16x8_t __ret;
64077 __ret = __builtin_bit_cast(uint16x8_t, __p0);
64078 return __ret;
64079}
64080__ai __attribute__((target("neon"))) int8x16_t vreinterpretq_s8_bf16(bfloat16x8_t __p0) {
64081 int8x16_t __ret;
64082 __ret = __builtin_bit_cast(int8x16_t, __p0);
64083 return __ret;
64084}
64085__ai __attribute__((target("neon"))) float64x2_t vreinterpretq_f64_bf16(bfloat16x8_t __p0) {
64086 float64x2_t __ret;
64087 __ret = __builtin_bit_cast(float64x2_t, __p0);
64088 return __ret;
64089}
64090__ai __attribute__((target("neon"))) float32x4_t vreinterpretq_f32_bf16(bfloat16x8_t __p0) {
64091 float32x4_t __ret;
64092 __ret = __builtin_bit_cast(float32x4_t, __p0);
64093 return __ret;
64094}
64095__ai __attribute__((target("neon"))) float16x8_t vreinterpretq_f16_bf16(bfloat16x8_t __p0) {
64096 float16x8_t __ret;
64097 __ret = __builtin_bit_cast(float16x8_t, __p0);
64098 return __ret;
64099}
64100__ai __attribute__((target("neon"))) int32x4_t vreinterpretq_s32_bf16(bfloat16x8_t __p0) {
64101 int32x4_t __ret;
64102 __ret = __builtin_bit_cast(int32x4_t, __p0);
64103 return __ret;
64104}
64105__ai __attribute__((target("neon"))) int64x2_t vreinterpretq_s64_bf16(bfloat16x8_t __p0) {
64106 int64x2_t __ret;
64107 __ret = __builtin_bit_cast(int64x2_t, __p0);
64108 return __ret;
64109}
64110__ai __attribute__((target("neon"))) int16x8_t vreinterpretq_s16_bf16(bfloat16x8_t __p0) {
64111 int16x8_t __ret;
64112 __ret = __builtin_bit_cast(int16x8_t, __p0);
64113 return __ret;
64114}
64115__ai __attribute__((target("neon"))) uint8x8_t vreinterpret_u8_bf16(bfloat16x4_t __p0) {
64116 uint8x8_t __ret;
64117 __ret = __builtin_bit_cast(uint8x8_t, __p0);
64118 return __ret;
64119}
64120__ai __attribute__((target("neon"))) uint32x2_t vreinterpret_u32_bf16(bfloat16x4_t __p0) {
64121 uint32x2_t __ret;
64122 __ret = __builtin_bit_cast(uint32x2_t, __p0);
64123 return __ret;
64124}
64125__ai __attribute__((target("neon"))) uint64x1_t vreinterpret_u64_bf16(bfloat16x4_t __p0) {
64126 uint64x1_t __ret;
64127 __ret = __builtin_bit_cast(uint64x1_t, __p0);
64128 return __ret;
64129}
64130__ai __attribute__((target("neon"))) uint16x4_t vreinterpret_u16_bf16(bfloat16x4_t __p0) {
64131 uint16x4_t __ret;
64132 __ret = __builtin_bit_cast(uint16x4_t, __p0);
64133 return __ret;
64134}
64135__ai __attribute__((target("neon"))) int8x8_t vreinterpret_s8_bf16(bfloat16x4_t __p0) {
64136 int8x8_t __ret;
64137 __ret = __builtin_bit_cast(int8x8_t, __p0);
64138 return __ret;
64139}
64140__ai __attribute__((target("neon"))) float64x1_t vreinterpret_f64_bf16(bfloat16x4_t __p0) {
64141 float64x1_t __ret;
64142 __ret = __builtin_bit_cast(float64x1_t, __p0);
64143 return __ret;
64144}
64145__ai __attribute__((target("neon"))) float32x2_t vreinterpret_f32_bf16(bfloat16x4_t __p0) {
64146 float32x2_t __ret;
64147 __ret = __builtin_bit_cast(float32x2_t, __p0);
64148 return __ret;
64149}
64150__ai __attribute__((target("neon"))) float16x4_t vreinterpret_f16_bf16(bfloat16x4_t __p0) {
64151 float16x4_t __ret;
64152 __ret = __builtin_bit_cast(float16x4_t, __p0);
64153 return __ret;
64154}
64155__ai __attribute__((target("neon"))) int32x2_t vreinterpret_s32_bf16(bfloat16x4_t __p0) {
64156 int32x2_t __ret;
64157 __ret = __builtin_bit_cast(int32x2_t, __p0);
64158 return __ret;
64159}
64160__ai __attribute__((target("neon"))) int64x1_t vreinterpret_s64_bf16(bfloat16x4_t __p0) {
64161 int64x1_t __ret;
64162 __ret = __builtin_bit_cast(int64x1_t, __p0);
64163 return __ret;
64164}
64165__ai __attribute__((target("neon"))) int16x4_t vreinterpret_s16_bf16(bfloat16x4_t __p0) {
64166 int16x4_t __ret;
64167 __ret = __builtin_bit_cast(int16x4_t, __p0);
64168 return __ret;
64169}
64170__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p8(poly8x16_t __p0) {
64171 bfloat16x8_t __ret;
64172 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64173 return __ret;
64174}
64175__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p128(poly128_t __p0) {
64176 bfloat16x8_t __ret;
64177 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64178 return __ret;
64179}
64180__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p64(poly64x2_t __p0) {
64181 bfloat16x8_t __ret;
64182 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64183 return __ret;
64184}
64185__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_p16(poly16x8_t __p0) {
64186 bfloat16x8_t __ret;
64187 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64188 return __ret;
64189}
64190__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u8(uint8x16_t __p0) {
64191 bfloat16x8_t __ret;
64192 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64193 return __ret;
64194}
64195__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u32(uint32x4_t __p0) {
64196 bfloat16x8_t __ret;
64197 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64198 return __ret;
64199}
64200__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u64(uint64x2_t __p0) {
64201 bfloat16x8_t __ret;
64202 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64203 return __ret;
64204}
64205__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_u16(uint16x8_t __p0) {
64206 bfloat16x8_t __ret;
64207 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64208 return __ret;
64209}
64210__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s8(int8x16_t __p0) {
64211 bfloat16x8_t __ret;
64212 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64213 return __ret;
64214}
64215__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_f64(float64x2_t __p0) {
64216 bfloat16x8_t __ret;
64217 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64218 return __ret;
64219}
64220__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_f32(float32x4_t __p0) {
64221 bfloat16x8_t __ret;
64222 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64223 return __ret;
64224}
64225__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_f16(float16x8_t __p0) {
64226 bfloat16x8_t __ret;
64227 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64228 return __ret;
64229}
64230__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s32(int32x4_t __p0) {
64231 bfloat16x8_t __ret;
64232 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64233 return __ret;
64234}
64235__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s64(int64x2_t __p0) {
64236 bfloat16x8_t __ret;
64237 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64238 return __ret;
64239}
64240__ai __attribute__((target("neon"))) bfloat16x8_t vreinterpretq_bf16_s16(int16x8_t __p0) {
64241 bfloat16x8_t __ret;
64242 __ret = __builtin_bit_cast(bfloat16x8_t, __p0);
64243 return __ret;
64244}
64245__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_p8(poly8x8_t __p0) {
64246 bfloat16x4_t __ret;
64247 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64248 return __ret;
64249}
64250__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_p64(poly64x1_t __p0) {
64251 bfloat16x4_t __ret;
64252 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64253 return __ret;
64254}
64255__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_p16(poly16x4_t __p0) {
64256 bfloat16x4_t __ret;
64257 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64258 return __ret;
64259}
64260__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u8(uint8x8_t __p0) {
64261 bfloat16x4_t __ret;
64262 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64263 return __ret;
64264}
64265__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u32(uint32x2_t __p0) {
64266 bfloat16x4_t __ret;
64267 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64268 return __ret;
64269}
64270__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u64(uint64x1_t __p0) {
64271 bfloat16x4_t __ret;
64272 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64273 return __ret;
64274}
64275__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_u16(uint16x4_t __p0) {
64276 bfloat16x4_t __ret;
64277 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64278 return __ret;
64279}
64280__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s8(int8x8_t __p0) {
64281 bfloat16x4_t __ret;
64282 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64283 return __ret;
64284}
64285__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_f64(float64x1_t __p0) {
64286 bfloat16x4_t __ret;
64287 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64288 return __ret;
64289}
64290__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_f32(float32x2_t __p0) {
64291 bfloat16x4_t __ret;
64292 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64293 return __ret;
64294}
64295__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_f16(float16x4_t __p0) {
64296 bfloat16x4_t __ret;
64297 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64298 return __ret;
64299}
64300__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s32(int32x2_t __p0) {
64301 bfloat16x4_t __ret;
64302 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64303 return __ret;
64304}
64305__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s64(int64x1_t __p0) {
64306 bfloat16x4_t __ret;
64307 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64308 return __ret;
64309}
64310__ai __attribute__((target("neon"))) bfloat16x4_t vreinterpret_bf16_s16(int16x4_t __p0) {
64311 bfloat16x4_t __ret;
64312 __ret = __builtin_bit_cast(bfloat16x4_t, __p0);
64313 return __ret;
64314}
64147__ai __attribute__((target("neon"))) uint64_t vrshld_u64(uint64_t __p0, int64_t __p1) {64315__ai __attribute__((target("neon"))) uint64_t vrshld_u64(uint64_t __p0, int64_t __p1) {
64148 uint64_t __ret;64316 uint64_t __ret;
64149 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vrshld_u64(__p0, __p1));64317 __ret = __builtin_bit_cast(uint64_t, __builtin_neon_vrshld_u64(__p0, __p1));
lib/include/arm_sme.h+12
...@@ -3732,6 +3732,18 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svzero_za64_vg4x2)))...@@ -3732,6 +3732,18 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svzero_za64_vg4x2)))
3732void svzero_za64_vg4x2(uint32_t);3732void svzero_za64_vg4x2(uint32_t);
3733__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svzero_za64_vg4x4)))3733__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svzero_za64_vg4x4)))
3734void svzero_za64_vg4x4(uint32_t);3734void svzero_za64_vg4x4(uint32_t);
3735__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svluti6_zt_u8)))
3736svuint8_t svluti6_zt_u8(uint64_t, svuint8_t);
3737__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svluti6_zt_s8)))
3738svint8_t svluti6_zt_s8(uint64_t, svuint8_t);
3739__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svluti6_zt_mf8)))
3740svmfloat8_t svluti6_zt_mf8(uint64_t, svuint8_t);
3741__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svluti6_zt_u8_x4)))
3742svuint8x4_t svluti6_zt_u8_x4(uint64_t, svuint8x3_t);
3743__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svluti6_zt_s8_x4)))
3744svint8x4_t svluti6_zt_s8_x4(uint64_t, svuint8x3_t);
3745__ai __attribute__((__clang_arm_builtin_alias(__builtin_sme_svluti6_zt_mf8_x4)))
3746svmfloat8x4_t svluti6_zt_mf8_x4(uint64_t, svuint8x3_t);
3735#ifdef __cplusplus3747#ifdef __cplusplus
3736} // extern "C"3748} // extern "C"
3737#endif3749#endif
lib/include/arm_sve.h+420
...@@ -4697,6 +4697,38 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f32_x4)))...@@ -4697,6 +4697,38 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f32_x4)))
4697svfloat32x4_t svmul(svfloat32x4_t, svfloat32x4_t);4697svfloat32x4_t svmul(svfloat32x4_t, svfloat32x4_t);
4698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f16_x4)))4698__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmul_f16_x4)))
4699svfloat16x4_t svmul(svfloat16x4_t, svfloat16x4_t);4699svfloat16x4_t svmul(svfloat16x4_t, svfloat16x4_t);
4700__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_u16_x4_u16_x2_u8_x2)))
4701svuint16x4_t svluti6_lane_u16_x4_u16_x2_u8_x2(svuint16x2_t, svuint8x2_t, uint64_t);
4702__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_bf16_x4_bf16_x2_u8_x2)))
4703svbfloat16x4_t svluti6_lane_bf16_x4_bf16_x2_u8_x2(svbfloat16x2_t, svuint8x2_t, uint64_t);
4704__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_f16_x4_f16_x2_u8_x2)))
4705svfloat16x4_t svluti6_lane_f16_x4_f16_x2_u8_x2(svfloat16x2_t, svuint8x2_t, uint64_t);
4706__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_s16_x4_s16_x2_u8_x2)))
4707svint16x4_t svluti6_lane_s16_x4_s16_x2_u8_x2(svint16x2_t, svuint8x2_t, uint64_t);
4708__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_u16_x4_u16_x2_u8_x3)))
4709svuint16x4_t svluti6_lane_u16_x4_u16_x2_u8_x3(svuint16x2_t, svuint8x3_t, uint64_t);
4710__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_bf16_x4_bf16_x2_u8_x3)))
4711svbfloat16x4_t svluti6_lane_bf16_x4_bf16_x2_u8_x3(svbfloat16x2_t, svuint8x3_t, uint64_t);
4712__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_f16_x4_f16_x2_u8_x3)))
4713svfloat16x4_t svluti6_lane_f16_x4_f16_x2_u8_x3(svfloat16x2_t, svuint8x3_t, uint64_t);
4714__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_s16_x4_s16_x2_u8_x3)))
4715svint16x4_t svluti6_lane_s16_x4_s16_x2_u8_x3(svint16x2_t, svuint8x3_t, uint64_t);
4716__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_u16_x4_u16_x2_u8_x2)))
4717svuint16x4_t svluti6_lane_u16_x4(svuint16x2_t, svuint8x2_t, uint64_t);
4718__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_bf16_x4_bf16_x2_u8_x2)))
4719svbfloat16x4_t svluti6_lane_bf16_x4(svbfloat16x2_t, svuint8x2_t, uint64_t);
4720__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_f16_x4_f16_x2_u8_x2)))
4721svfloat16x4_t svluti6_lane_f16_x4(svfloat16x2_t, svuint8x2_t, uint64_t);
4722__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_s16_x4_s16_x2_u8_x2)))
4723svint16x4_t svluti6_lane_s16_x4(svint16x2_t, svuint8x2_t, uint64_t);
4724__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_u16_x4_u16_x2_u8_x3)))
4725svuint16x4_t svluti6_lane_u16_x4(svuint16x2_t, svuint8x3_t, uint64_t);
4726__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_bf16_x4_bf16_x2_u8_x3)))
4727svbfloat16x4_t svluti6_lane_bf16_x4(svbfloat16x2_t, svuint8x3_t, uint64_t);
4728__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_f16_x4_f16_x2_u8_x3)))
4729svfloat16x4_t svluti6_lane_f16_x4(svfloat16x2_t, svuint8x3_t, uint64_t);
4730__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_s16_x4_s16_x2_u8_x3)))
4731svint16x4_t svluti6_lane_s16_x4(svint16x2_t, svuint8x3_t, uint64_t);
4700__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f64)))4732__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f64)))
4701float64_t svadda_f64(svbool_t, float64_t, svfloat64_t);4733float64_t svadda_f64(svbool_t, float64_t, svfloat64_t);
4702__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f32)))4734__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svadda_f32)))
...@@ -7223,6 +7255,12 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate2_b)))...@@ -7223,6 +7255,12 @@ __ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate2_b)))
7223svboolx2_t svcreate2_b(svbool_t, svbool_t);7255svboolx2_t svcreate2_b(svbool_t, svbool_t);
7224__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate4_b)))7256__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate4_b)))
7225svboolx4_t svcreate4_b(svbool_t, svbool_t, svbool_t, svbool_t);7257svboolx4_t svcreate4_b(svbool_t, svbool_t, svbool_t, svbool_t);
7258__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f32_f16)))
7259svfloat32_t svdot_n_f32_f16(svfloat32_t, svfloat16_t, float16_t);
7260__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_s32_s16)))
7261svint32_t svdot_n_s32_s16(svint32_t, svint16_t, int16_t);
7262__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_u32_u16)))
7263svuint32_t svdot_n_u32_u16(svuint32_t, svuint16_t, uint16_t);
7226__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_f16)))7264__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_f16)))
7227svfloat32_t svdot_f32_f16(svfloat32_t, svfloat16_t, svfloat16_t);7265svfloat32_t svdot_f32_f16(svfloat32_t, svfloat16_t, svfloat16_t);
7228__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_s32_s16)))7266__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_s32_s16)))
...@@ -7341,6 +7379,12 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate2_b)))...@@ -7341,6 +7379,12 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate2_b)))
7341svboolx2_t svcreate2(svbool_t, svbool_t);7379svboolx2_t svcreate2(svbool_t, svbool_t);
7342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate4_b)))7380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcreate4_b)))
7343svboolx4_t svcreate4(svbool_t, svbool_t, svbool_t, svbool_t);7381svboolx4_t svcreate4(svbool_t, svbool_t, svbool_t, svbool_t);
7382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_f32_f16)))
7383svfloat32_t svdot(svfloat32_t, svfloat16_t, float16_t);
7384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_s32_s16)))
7385svint32_t svdot(svint32_t, svint16_t, int16_t);
7386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_u32_u16)))
7387svuint32_t svdot(svuint32_t, svuint16_t, uint16_t);
7344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_f16)))7388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_f32_f16)))
7345svfloat32_t svdot(svfloat32_t, svfloat16_t, svfloat16_t);7389svfloat32_t svdot(svfloat32_t, svfloat16_t, svfloat16_t);
7346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_s32_s16)))7390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_s32_s16)))
...@@ -9049,6 +9093,346 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_mf8)))...@@ -9049,6 +9093,346 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_mf8)))
9049svmfloat8_t svexpand(svbool_t, svmfloat8_t);9093svmfloat8_t svexpand(svbool_t, svmfloat8_t);
9050__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s16)))9094__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svexpand_s16)))
9051svint16_t svexpand(svbool_t, svint16_t);9095svint16_t svexpand(svbool_t, svint16_t);
9096__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_s32)))
9097svint32_t svabal_n_s32(svint32_t, svint16_t, int16_t);
9098__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_s64)))
9099svint64_t svabal_n_s64(svint64_t, svint32_t, int32_t);
9100__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_s16)))
9101svint16_t svabal_n_s16(svint16_t, svint8_t, int8_t);
9102__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_u32)))
9103svuint32_t svabal_n_u32(svuint32_t, svuint16_t, uint16_t);
9104__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_u64)))
9105svuint64_t svabal_n_u64(svuint64_t, svuint32_t, uint32_t);
9106__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_u16)))
9107svuint16_t svabal_n_u16(svuint16_t, svuint8_t, uint8_t);
9108__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_s32)))
9109svint32_t svabal_s32(svint32_t, svint16_t, svint16_t);
9110__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_s64)))
9111svint64_t svabal_s64(svint64_t, svint32_t, svint32_t);
9112__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_s16)))
9113svint16_t svabal_s16(svint16_t, svint8_t, svint8_t);
9114__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_u32)))
9115svuint32_t svabal_u32(svuint32_t, svuint16_t, svuint16_t);
9116__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_u64)))
9117svuint64_t svabal_u64(svuint64_t, svuint32_t, svuint32_t);
9118__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_u16)))
9119svuint16_t svabal_u16(svuint16_t, svuint8_t, svuint8_t);
9120__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u8)))
9121svuint8_t svaddqp_u8(svuint8_t, svuint8_t);
9122__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u32)))
9123svuint32_t svaddqp_u32(svuint32_t, svuint32_t);
9124__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u64)))
9125svuint64_t svaddqp_u64(svuint64_t, svuint64_t);
9126__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u16)))
9127svuint16_t svaddqp_u16(svuint16_t, svuint16_t);
9128__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s8)))
9129svint8_t svaddqp_s8(svint8_t, svint8_t);
9130__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s32)))
9131svint32_t svaddqp_s32(svint32_t, svint32_t);
9132__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s64)))
9133svint64_t svaddqp_s64(svint64_t, svint64_t);
9134__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s16)))
9135svint16_t svaddqp_s16(svint16_t, svint16_t);
9136__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u8)))
9137svuint8_t svaddsubp_u8(svuint8_t, svuint8_t);
9138__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u32)))
9139svuint32_t svaddsubp_u32(svuint32_t, svuint32_t);
9140__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u64)))
9141svuint64_t svaddsubp_u64(svuint64_t, svuint64_t);
9142__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u16)))
9143svuint16_t svaddsubp_u16(svuint16_t, svuint16_t);
9144__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s8)))
9145svint8_t svaddsubp_s8(svint8_t, svint8_t);
9146__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s32)))
9147svint32_t svaddsubp_s32(svint32_t, svint32_t);
9148__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s64)))
9149svint64_t svaddsubp_s64(svint64_t, svint64_t);
9150__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s16)))
9151svint16_t svaddsubp_s16(svint16_t, svint16_t);
9152__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f64_s32)))
9153svfloat64_t svcvtb_f64_s32(svint32_t);
9154__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f32_s16)))
9155svfloat32_t svcvtb_f32_s16(svint16_t);
9156__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f16_s8)))
9157svfloat16_t svcvtb_f16_s8(svint8_t);
9158__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f64_u32)))
9159svfloat64_t svcvtb_f64_u32(svuint32_t);
9160__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f32_u16)))
9161svfloat32_t svcvtb_f32_u16(svuint16_t);
9162__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f16_u8)))
9163svfloat16_t svcvtb_f16_u8(svuint8_t);
9164__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_s32_f64_x2)))
9165svint32_t svcvtn_s32_f64_x2(svfloat64x2_t);
9166__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_s16_f32_x2)))
9167svint16_t svcvtn_s16_f32_x2(svfloat32x2_t);
9168__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_s8_f16_x2)))
9169svint8_t svcvtn_s8_f16_x2(svfloat16x2_t);
9170__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_u32_f64_x2)))
9171svuint32_t svcvtn_u32_f64_x2(svfloat64x2_t);
9172__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_u16_f32_x2)))
9173svuint16_t svcvtn_u16_f32_x2(svfloat32x2_t);
9174__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_u8_f16_x2)))
9175svuint8_t svcvtn_u8_f16_x2(svfloat16x2_t);
9176__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f64_s32)))
9177svfloat64_t svcvtt_f64_s32(svint32_t);
9178__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f32_s16)))
9179svfloat32_t svcvtt_f32_s16(svint16_t);
9180__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f16_s8)))
9181svfloat16_t svcvtt_f16_s8(svint8_t);
9182__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f64_u32)))
9183svfloat64_t svcvtt_f64_u32(svuint32_t);
9184__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f32_u16)))
9185svfloat32_t svcvtt_f32_u16(svuint16_t);
9186__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f16_u8)))
9187svfloat16_t svcvtt_f16_u8(svuint8_t);
9188__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_s16_s8)))
9189svint16_t svdot_n_s16_s8(svint16_t, svint8_t, int8_t);
9190__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_u16_u8)))
9191svuint16_t svdot_n_u16_u8(svuint16_t, svuint8_t, uint8_t);
9192__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_s16_s8)))
9193svint16_t svdot_s16_s8(svint16_t, svint8_t, svint8_t);
9194__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_u16_u8)))
9195svuint16_t svdot_u16_u8(svuint16_t, svuint8_t, svuint8_t);
9196__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_s16_s8)))
9197svint16_t svdot_lane_s16_s8(svint16_t, svint8_t, svint8_t, uint64_t);
9198__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_u16_u8)))
9199svuint16_t svdot_lane_u16_u8(svuint16_t, svuint8_t, svuint8_t, uint64_t);
9200__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqrshrn_n_s8_s16_x2)))
9201svint8_t svqrshrn_n_s8_s16_x2(svint16x2_t, uint64_t);
9202__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqrshrn_n_u8_u16_x2)))
9203svuint8_t svqrshrn_n_u8_u16_x2(svuint16x2_t, uint64_t);
9204__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqrshrun_n_u8_s16_x2)))
9205svuint8_t svqrshrun_n_u8_s16_x2(svint16x2_t, uint64_t);
9206__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_s16_s32_x2)))
9207svint16_t svqshrn_n_s16_s32_x2(svint32x2_t, uint64_t);
9208__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_s8_s16_x2)))
9209svint8_t svqshrn_n_s8_s16_x2(svint16x2_t, uint64_t);
9210__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_u16_u32_x2)))
9211svuint16_t svqshrn_n_u16_u32_x2(svuint32x2_t, uint64_t);
9212__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_u8_u16_x2)))
9213svuint8_t svqshrn_n_u8_u16_x2(svuint16x2_t, uint64_t);
9214__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrun_n_u16_s32_x2)))
9215svuint16_t svqshrun_n_u16_s32_x2(svint32x2_t, uint64_t);
9216__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrun_n_u8_s16_x2)))
9217svuint8_t svqshrun_n_u8_s16_x2(svint16x2_t, uint64_t);
9218__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u8_m)))
9219svuint8_t svsubp_u8_m(svbool_t, svuint8_t, svuint8_t);
9220__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u32_m)))
9221svuint32_t svsubp_u32_m(svbool_t, svuint32_t, svuint32_t);
9222__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u64_m)))
9223svuint64_t svsubp_u64_m(svbool_t, svuint64_t, svuint64_t);
9224__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u16_m)))
9225svuint16_t svsubp_u16_m(svbool_t, svuint16_t, svuint16_t);
9226__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s8_m)))
9227svint8_t svsubp_s8_m(svbool_t, svint8_t, svint8_t);
9228__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s32_m)))
9229svint32_t svsubp_s32_m(svbool_t, svint32_t, svint32_t);
9230__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s64_m)))
9231svint64_t svsubp_s64_m(svbool_t, svint64_t, svint64_t);
9232__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s16_m)))
9233svint16_t svsubp_s16_m(svbool_t, svint16_t, svint16_t);
9234__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u8_x)))
9235svuint8_t svsubp_u8_x(svbool_t, svuint8_t, svuint8_t);
9236__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u32_x)))
9237svuint32_t svsubp_u32_x(svbool_t, svuint32_t, svuint32_t);
9238__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u64_x)))
9239svuint64_t svsubp_u64_x(svbool_t, svuint64_t, svuint64_t);
9240__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u16_x)))
9241svuint16_t svsubp_u16_x(svbool_t, svuint16_t, svuint16_t);
9242__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s8_x)))
9243svint8_t svsubp_s8_x(svbool_t, svint8_t, svint8_t);
9244__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s32_x)))
9245svint32_t svsubp_s32_x(svbool_t, svint32_t, svint32_t);
9246__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s64_x)))
9247svint64_t svsubp_s64_x(svbool_t, svint64_t, svint64_t);
9248__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s16_x)))
9249svint16_t svsubp_s16_x(svbool_t, svint16_t, svint16_t);
9250__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u8_z)))
9251svuint8_t svsubp_u8_z(svbool_t, svuint8_t, svuint8_t);
9252__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u32_z)))
9253svuint32_t svsubp_u32_z(svbool_t, svuint32_t, svuint32_t);
9254__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u64_z)))
9255svuint64_t svsubp_u64_z(svbool_t, svuint64_t, svuint64_t);
9256__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u16_z)))
9257svuint16_t svsubp_u16_z(svbool_t, svuint16_t, svuint16_t);
9258__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s8_z)))
9259svint8_t svsubp_s8_z(svbool_t, svint8_t, svint8_t);
9260__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s32_z)))
9261svint32_t svsubp_s32_z(svbool_t, svint32_t, svint32_t);
9262__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s64_z)))
9263svint64_t svsubp_s64_z(svbool_t, svint64_t, svint64_t);
9264__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s16_z)))
9265svint16_t svsubp_s16_z(svbool_t, svint16_t, svint16_t);
9266__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_s32)))
9267svint32_t svabal(svint32_t, svint16_t, int16_t);
9268__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_s64)))
9269svint64_t svabal(svint64_t, svint32_t, int32_t);
9270__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_s16)))
9271svint16_t svabal(svint16_t, svint8_t, int8_t);
9272__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_u32)))
9273svuint32_t svabal(svuint32_t, svuint16_t, uint16_t);
9274__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_u64)))
9275svuint64_t svabal(svuint64_t, svuint32_t, uint32_t);
9276__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_n_u16)))
9277svuint16_t svabal(svuint16_t, svuint8_t, uint8_t);
9278__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_s32)))
9279svint32_t svabal(svint32_t, svint16_t, svint16_t);
9280__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_s64)))
9281svint64_t svabal(svint64_t, svint32_t, svint32_t);
9282__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_s16)))
9283svint16_t svabal(svint16_t, svint8_t, svint8_t);
9284__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_u32)))
9285svuint32_t svabal(svuint32_t, svuint16_t, svuint16_t);
9286__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_u64)))
9287svuint64_t svabal(svuint64_t, svuint32_t, svuint32_t);
9288__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabal_u16)))
9289svuint16_t svabal(svuint16_t, svuint8_t, svuint8_t);
9290__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u8)))
9291svuint8_t svaddqp(svuint8_t, svuint8_t);
9292__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u32)))
9293svuint32_t svaddqp(svuint32_t, svuint32_t);
9294__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u64)))
9295svuint64_t svaddqp(svuint64_t, svuint64_t);
9296__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_u16)))
9297svuint16_t svaddqp(svuint16_t, svuint16_t);
9298__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s8)))
9299svint8_t svaddqp(svint8_t, svint8_t);
9300__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s32)))
9301svint32_t svaddqp(svint32_t, svint32_t);
9302__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s64)))
9303svint64_t svaddqp(svint64_t, svint64_t);
9304__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddqp_s16)))
9305svint16_t svaddqp(svint16_t, svint16_t);
9306__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u8)))
9307svuint8_t svaddsubp(svuint8_t, svuint8_t);
9308__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u32)))
9309svuint32_t svaddsubp(svuint32_t, svuint32_t);
9310__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u64)))
9311svuint64_t svaddsubp(svuint64_t, svuint64_t);
9312__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_u16)))
9313svuint16_t svaddsubp(svuint16_t, svuint16_t);
9314__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s8)))
9315svint8_t svaddsubp(svint8_t, svint8_t);
9316__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s32)))
9317svint32_t svaddsubp(svint32_t, svint32_t);
9318__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s64)))
9319svint64_t svaddsubp(svint64_t, svint64_t);
9320__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaddsubp_s16)))
9321svint16_t svaddsubp(svint16_t, svint16_t);
9322__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f64_s32)))
9323svfloat64_t svcvtb_f64(svint32_t);
9324__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f32_s16)))
9325svfloat32_t svcvtb_f32(svint16_t);
9326__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f16_s8)))
9327svfloat16_t svcvtb_f16(svint8_t);
9328__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f64_u32)))
9329svfloat64_t svcvtb_f64(svuint32_t);
9330__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f32_u16)))
9331svfloat32_t svcvtb_f32(svuint16_t);
9332__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtb_f16_u8)))
9333svfloat16_t svcvtb_f16(svuint8_t);
9334__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_s32_f64_x2)))
9335svint32_t svcvtn_s32(svfloat64x2_t);
9336__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_s16_f32_x2)))
9337svint16_t svcvtn_s16(svfloat32x2_t);
9338__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_s8_f16_x2)))
9339svint8_t svcvtn_s8(svfloat16x2_t);
9340__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_u32_f64_x2)))
9341svuint32_t svcvtn_u32(svfloat64x2_t);
9342__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_u16_f32_x2)))
9343svuint16_t svcvtn_u16(svfloat32x2_t);
9344__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtn_u8_f16_x2)))
9345svuint8_t svcvtn_u8(svfloat16x2_t);
9346__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f64_s32)))
9347svfloat64_t svcvtt_f64(svint32_t);
9348__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f32_s16)))
9349svfloat32_t svcvtt_f32(svint16_t);
9350__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f16_s8)))
9351svfloat16_t svcvtt_f16(svint8_t);
9352__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f64_u32)))
9353svfloat64_t svcvtt_f64(svuint32_t);
9354__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f32_u16)))
9355svfloat32_t svcvtt_f32(svuint16_t);
9356__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svcvtt_f16_u8)))
9357svfloat16_t svcvtt_f16(svuint8_t);
9358__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_s16_s8)))
9359svint16_t svdot(svint16_t, svint8_t, int8_t);
9360__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_n_u16_u8)))
9361svuint16_t svdot(svuint16_t, svuint8_t, uint8_t);
9362__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_s16_s8)))
9363svint16_t svdot(svint16_t, svint8_t, svint8_t);
9364__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_u16_u8)))
9365svuint16_t svdot(svuint16_t, svuint8_t, svuint8_t);
9366__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_s16_s8)))
9367svint16_t svdot_lane(svint16_t, svint8_t, svint8_t, uint64_t);
9368__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svdot_lane_u16_u8)))
9369svuint16_t svdot_lane(svuint16_t, svuint8_t, svuint8_t, uint64_t);
9370__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqrshrn_n_s8_s16_x2)))
9371svint8_t svqrshrn_s8(svint16x2_t, uint64_t);
9372__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqrshrn_n_u8_u16_x2)))
9373svuint8_t svqrshrn_u8(svuint16x2_t, uint64_t);
9374__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqrshrun_n_u8_s16_x2)))
9375svuint8_t svqrshrun_u8(svint16x2_t, uint64_t);
9376__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_s16_s32_x2)))
9377svint16_t svqshrn_s16(svint32x2_t, uint64_t);
9378__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_s8_s16_x2)))
9379svint8_t svqshrn_s8(svint16x2_t, uint64_t);
9380__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_u16_u32_x2)))
9381svuint16_t svqshrn_u16(svuint32x2_t, uint64_t);
9382__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrn_n_u8_u16_x2)))
9383svuint8_t svqshrn_u8(svuint16x2_t, uint64_t);
9384__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrun_n_u16_s32_x2)))
9385svuint16_t svqshrun_u16(svint32x2_t, uint64_t);
9386__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqshrun_n_u8_s16_x2)))
9387svuint8_t svqshrun_u8(svint16x2_t, uint64_t);
9388__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u8_m)))
9389svuint8_t svsubp_m(svbool_t, svuint8_t, svuint8_t);
9390__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u32_m)))
9391svuint32_t svsubp_m(svbool_t, svuint32_t, svuint32_t);
9392__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u64_m)))
9393svuint64_t svsubp_m(svbool_t, svuint64_t, svuint64_t);
9394__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u16_m)))
9395svuint16_t svsubp_m(svbool_t, svuint16_t, svuint16_t);
9396__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s8_m)))
9397svint8_t svsubp_m(svbool_t, svint8_t, svint8_t);
9398__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s32_m)))
9399svint32_t svsubp_m(svbool_t, svint32_t, svint32_t);
9400__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s64_m)))
9401svint64_t svsubp_m(svbool_t, svint64_t, svint64_t);
9402__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s16_m)))
9403svint16_t svsubp_m(svbool_t, svint16_t, svint16_t);
9404__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u8_x)))
9405svuint8_t svsubp_x(svbool_t, svuint8_t, svuint8_t);
9406__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u32_x)))
9407svuint32_t svsubp_x(svbool_t, svuint32_t, svuint32_t);
9408__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u64_x)))
9409svuint64_t svsubp_x(svbool_t, svuint64_t, svuint64_t);
9410__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u16_x)))
9411svuint16_t svsubp_x(svbool_t, svuint16_t, svuint16_t);
9412__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s8_x)))
9413svint8_t svsubp_x(svbool_t, svint8_t, svint8_t);
9414__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s32_x)))
9415svint32_t svsubp_x(svbool_t, svint32_t, svint32_t);
9416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s64_x)))
9417svint64_t svsubp_x(svbool_t, svint64_t, svint64_t);
9418__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s16_x)))
9419svint16_t svsubp_x(svbool_t, svint16_t, svint16_t);
9420__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u8_z)))
9421svuint8_t svsubp_z(svbool_t, svuint8_t, svuint8_t);
9422__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u32_z)))
9423svuint32_t svsubp_z(svbool_t, svuint32_t, svuint32_t);
9424__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u64_z)))
9425svuint64_t svsubp_z(svbool_t, svuint64_t, svuint64_t);
9426__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_u16_z)))
9427svuint16_t svsubp_z(svbool_t, svuint16_t, svuint16_t);
9428__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s8_z)))
9429svint8_t svsubp_z(svbool_t, svint8_t, svint8_t);
9430__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s32_z)))
9431svint32_t svsubp_z(svbool_t, svint32_t, svint32_t);
9432__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s64_z)))
9433svint64_t svsubp_z(svbool_t, svint64_t, svint64_t);
9434__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsubp_s16_z)))
9435svint16_t svsubp_z(svbool_t, svint16_t, svint16_t);
9052__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s8)))9436__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s8)))
9053svint8_t svaba_n_s8(svint8_t, svint8_t, int8_t);9437svint8_t svaba_n_s8(svint8_t, svint8_t, int8_t);
9054__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s32)))9438__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svaba_n_s32)))
...@@ -16581,6 +16965,10 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_x)))...@@ -16581,6 +16965,10 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_x)))
16581svbfloat16_t svsub_x(svbool_t, svbfloat16_t, svbfloat16_t);16965svbfloat16_t svsub_x(svbool_t, svbfloat16_t, svbfloat16_t);
16582__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_z)))16966__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svsub_bf16_z)))
16583svbfloat16_t svsub_z(svbool_t, svbfloat16_t, svbfloat16_t);16967svbfloat16_t svsub_z(svbool_t, svbfloat16_t, svbfloat16_t);
16968__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_bf16)))
16969svbfloat16_t svmmla_bf16(svbfloat16_t, svbfloat16_t, svbfloat16_t);
16970__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_bf16)))
16971svbfloat16_t svmmla(svbfloat16_t, svbfloat16_t, svbfloat16_t);
16584__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_m)))16972__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_m)))
16585svbfloat16_t svscale_n_bf16_m(svbool_t, svbfloat16_t, int16_t);16973svbfloat16_t svscale_n_bf16_m(svbool_t, svbfloat16_t, int16_t);
16586__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_x)))16974__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svscale_n_bf16_x)))
...@@ -19415,6 +19803,38 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_s64))...@@ -19415,6 +19803,38 @@ __aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c64_s64))
19415svcount_t svwhilelt_c64(int64_t, int64_t, uint64_t);19803svcount_t svwhilelt_c64(int64_t, int64_t, uint64_t);
19416__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_s64)))19804__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svwhilelt_c16_s64)))
19417svcount_t svwhilelt_c16(int64_t, int64_t, uint64_t);19805svcount_t svwhilelt_c16(int64_t, int64_t, uint64_t);
19806__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f16)))
19807svfloat16_t svmmla_f16(svfloat16_t, svfloat16_t, svfloat16_t);
19808__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svmmla_f16)))
19809svfloat16_t svmmla(svfloat16_t, svfloat16_t, svfloat16_t);
19810__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_u8_x2)))
19811svuint8_t svluti6_u8_x2(svuint8x2_t, svuint8_t);
19812__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_s8_x2)))
19813svint8_t svluti6_s8_x2(svint8x2_t, svuint8_t);
19814__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_mf8_x2)))
19815svmfloat8_t svluti6_mf8_x2(svmfloat8x2_t, svuint8_t);
19816__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_u8_x2)))
19817svuint8_t svluti6(svuint8x2_t, svuint8_t);
19818__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_s8_x2)))
19819svint8_t svluti6(svint8x2_t, svuint8_t);
19820__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_mf8_x2)))
19821svmfloat8_t svluti6(svmfloat8x2_t, svuint8_t);
19822__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_u16_x2)))
19823svuint16_t svluti6_lane_u16_x2(svuint16x2_t, svuint8_t, uint64_t);
19824__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_bf16_x2)))
19825svbfloat16_t svluti6_lane_bf16_x2(svbfloat16x2_t, svuint8_t, uint64_t);
19826__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_f16_x2)))
19827svfloat16_t svluti6_lane_f16_x2(svfloat16x2_t, svuint8_t, uint64_t);
19828__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_s16_x2)))
19829svint16_t svluti6_lane_s16_x2(svint16x2_t, svuint8_t, uint64_t);
19830__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_u16_x2)))
19831svuint16_t svluti6_lane(svuint16x2_t, svuint8_t, uint64_t);
19832__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_bf16_x2)))
19833svbfloat16_t svluti6_lane(svbfloat16x2_t, svuint8_t, uint64_t);
19834__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_f16_x2)))
19835svfloat16_t svluti6_lane(svfloat16x2_t, svuint8_t, uint64_t);
19836__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svluti6_lane_s16_x2)))
19837svint16_t svluti6_lane(svint16x2_t, svuint8_t, uint64_t);
19418__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f64_m)))19838__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f64_m)))
19419svfloat64_t svabd_n_f64_m(svbool_t, svfloat64_t, float64_t);19839svfloat64_t svabd_n_f64_m(svbool_t, svfloat64_t, float64_t);
19420__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f32_m)))19840__ai __attribute__((__clang_arm_builtin_alias(__builtin_sve_svabd_n_f32_m)))
lib/include/avx2intrin.h+4-5
...@@ -1810,10 +1810,9 @@ _mm256_or_si256(__m256i __a, __m256i __b)...@@ -1810,10 +1810,9 @@ _mm256_or_si256(__m256i __a, __m256i __b)
1810/// \param __b1810/// \param __b
1811/// A 256-bit integer vector.1811/// A 256-bit integer vector.
1812/// \returns A 256-bit integer vector containing the result.1812/// \returns A 256-bit integer vector containing the result.
1813static __inline__ __m256i __DEFAULT_FN_ATTRS2561813static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1814_mm256_sad_epu8(__m256i __a, __m256i __b)1814_mm256_sad_epu8(__m256i __a, __m256i __b) {
1815{1815 return __builtin_ia32_psadbw256((__v32qu)__a, (__v32qu)__b);
1816 return __builtin_ia32_psadbw256((__v32qi)__a, (__v32qi)__b);
1817}1816}
18181817
1819/// Shuffles 8-bit integers in the 256-bit integer vector \a __a according1818/// Shuffles 8-bit integers in the 256-bit integer vector \a __a according
...@@ -3058,7 +3057,7 @@ _mm256_broadcastsi128_si256(__m128i __X) {...@@ -3058,7 +3057,7 @@ _mm256_broadcastsi128_si256(__m128i __X) {
3058/// An immediate 8-bit integer operand, with bits [7:0] specifying the3057/// An immediate 8-bit integer operand, with bits [7:0] specifying the
3059/// source for each element of the result. The position of the mask bit3058/// source for each element of the result. The position of the mask bit
3060/// corresponds to the index of a copied value. When a mask bit is 0, the3059/// corresponds to the index of a copied value. When a mask bit is 0, the
3061/// element is copied from \a V1; otherwise, it is is copied from \a V2.3060/// element is copied from \a V1; otherwise, it is copied from \a V2.
3062/// \returns A 256-bit vector of [8 x i32] containing the result.3061/// \returns A 256-bit vector of [8 x i32] containing the result.
3063#define _mm256_blend_epi32(V1, V2, M) \3062#define _mm256_blend_epi32(V1, V2, M) \
3064 ((__m256i)__builtin_ia32_pblendd256((__v8si)(__m256i)(V1), \3063 ((__m256i)__builtin_ia32_pblendd256((__v8si)(__m256i)(V1), \
lib/include/avx512bmmintrin.h created+174
...@@ -0,0 +1,174 @@
1/*===-------- avx512bmmintrin.h - AVX512BMM intrinsics *------------------===
2 *
3 *
4 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 * See https://llvm.org/LICENSE.txt for license information.
6 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *
8 *===---------------------------------------------------------------------===
9 */
10
11#ifndef __IMMINTRIN_H
12#error "Never use <avx512bmmintrin.h> directly; include <immintrin.h> instead."
13#endif
14
15#ifndef _AVX512BMMINTRIN_H
16#define _AVX512BMMINTRIN_H
17
18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, __target__("avx512bmm"), \
21 __min_vector_width__(512)))
22
23#if defined(__cplusplus) && (__cplusplus >= 201103L)
24#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
25#else
26#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
27#endif
28
29/// Multiplies two 16x16 bit matrices using OR reduction and ORs the product
30/// into a third 16x16 bit matrix (which is also the destination).
31///
32/// For the 512-bit ZMM form, each register contains two 16x16 (256-bit)
33/// matrices in bits [255:0] and [511:256]. The operation performs:
34/// \code{.operation}
35/// for i in 0 to 15
36/// for j in 0 to 15
37/// reduction_bit = __C[16*i+j]
38/// for k in 0 to 15
39/// reduction_bit |= __A[16*i+k] & __B[16*k+j]
40/// end for k
41/// dest[16*i+j] = reduction_bit
42/// end for j
43/// end for i
44/// \endcode
45///
46/// \headerfile <immintrin.h>
47///
48/// This intrinsic corresponds to the <c> VBMACOR16X16X16 </c> instruction.
49///
50/// \param __A
51/// A 512-bit vector containing two 16x16 bit matrices (one per 256-bit
52/// lane).
53/// \param __B
54/// A 512-bit vector containing two 16x16 bit matrices (one per 256-bit
55/// lane).
56/// \param __C
57/// A 512-bit accumulator vector containing the initial values to OR with.
58/// \returns A 512-bit vector containing the accumulated result for each lane.
59/// \note This instruction does not support masking.
60static __inline __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
61_mm512_bmacor16x16x16(__m512i __A, __m512i __B, __m512i __C) {
62 return (__m512i)__builtin_ia32_bmacor16x16x16_v32hi(
63 (__v32hi)__A, (__v32hi)__B, (__v32hi)__C);
64}
65
66/// Multiplies two 16x16 bit matrices using XOR reduction and XORs the product
67/// into a third 16x16 bit matrix (which is also the destination).
68///
69/// For the 512-bit ZMM form, each register contains two 16x16 (256-bit)
70/// matrices in bits [255:0] and [511:256]. The operation performs:
71/// \code{.operation}
72/// for i in 0 to 15
73/// for j in 0 to 15
74/// reduction_bit = __C[16*i+j]
75/// for k in 0 to 15
76/// reduction_bit ^= __A[16*i+k] & __B[16*k+j]
77/// end for k
78/// dest[16*i+j] = reduction_bit
79/// end for j
80/// end for i
81/// \endcode
82///
83/// \headerfile <immintrin.h>
84///
85/// This intrinsic corresponds to the <c> VBMACXOR16X16X16 </c> instruction.
86///
87/// \param __A
88/// A 512-bit vector containing two 16x16 bit matrices (one per 256-bit
89/// lane).
90/// \param __B
91/// A 512-bit vector containing two 16x16 bit matrices (one per 256-bit
92/// lane).
93/// \param __C
94/// A 512-bit accumulator vector containing the initial values to XOR with.
95/// \returns A 512-bit vector containing the accumulated result for each lane.
96/// \note This instruction does not support masking.
97static __inline __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
98_mm512_bmacxor16x16x16(__m512i __A, __m512i __B, __m512i __C) {
99 return (__m512i)__builtin_ia32_bmacxor16x16x16_v32hi(
100 (__v32hi)__A, (__v32hi)__B, (__v32hi)__C);
101}
102
103/// Reverses the bits within each byte of the source vector.
104///
105/// For each byte in the source, reverses the order of its 8 bits to generate
106/// the corresponding destination byte. For example, 0b10110001 becomes
107/// 0b10001101.
108///
109/// \headerfile <immintrin.h>
110///
111/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
112///
113/// \param __A
114/// A 512-bit vector of [64 x i8] where each byte will have its bits
115/// reversed.
116/// \returns A 512-bit vector of [64 x i8] with bit-reversed bytes.
117static __inline __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
118_mm512_bitrev_epi8(__m512i __A) {
119 return (__m512i)__builtin_elementwise_bitreverse((__v64qi)__A);
120}
121
122/// Reverses the bits within each byte of the source vector, using a writemask
123/// to conditionally select elements.
124///
125/// For each byte position, if the corresponding mask bit is 1, the byte from
126/// \a A has its bits reversed and stored in the result. If the mask bit is 0,
127/// the corresponding byte from \a B is copied to the result (merge masking).
128///
129/// \headerfile <immintrin.h>
130///
131/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
132///
133/// \param __U
134/// A 64-bit mask value where each bit controls one byte (per 8-bit element).
135/// A 1 performs bit reversal; a 0 selects the passthrough byte from __B.
136/// \param __A
137/// A 512-bit vector of [64 x i8] to be bit-reversed.
138/// \param __B
139/// A 512-bit vector of [64 x i8] providing passthrough values.
140/// \returns A 512-bit vector combining bit-reversed and passthrough bytes.
141static __inline __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
142_mm512_mask_bitrev_epi8(__mmask64 __U, __m512i __A, __m512i __B) {
143 return (__m512i)__builtin_ia32_selectb_512(
144 (__mmask64)__U, (__v64qi)_mm512_bitrev_epi8(__A), (__v64qi)__B);
145}
146
147/// Reverses the bits within each byte of the source vector, zeroing elements
148/// based on the writemask.
149///
150/// For each byte position, if the corresponding mask bit is 1, the byte from
151/// \a A has its bits reversed and stored in the result. If the mask bit is 0,
152/// the result byte is set to zero (zero masking).
153///
154/// \headerfile <immintrin.h>
155///
156/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
157///
158/// \param __U
159/// A 64-bit mask value where each bit controls one byte (per 8-bit element).
160/// A 1 performs bit reversal; a 0 sets the byte to zero.
161/// \param __A
162/// A 512-bit vector of [64 x i8] to be bit-reversed.
163/// \returns A 512-bit vector with bit-reversed or zeroed bytes.
164static __inline __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
165_mm512_maskz_bitrev_epi8(__mmask64 __U, __m512i __A) {
166 return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U,
167 (__v64qi)_mm512_bitrev_epi8(__A),
168 (__v64qi)_mm512_setzero_si512());
169}
170
171#undef __DEFAULT_FN_ATTRS
172#undef __DEFAULT_FN_ATTRS_CONSTEXPR
173
174#endif
lib/include/avx512bmmvlintrin.h created+245
...@@ -0,0 +1,245 @@
1/*===------------- avx512bmmvlintrin.h - BMM intrinsics ------------------===
2 *
3 *
4 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 * See https://llvm.org/LICENSE.txt for license information.
6 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *
8 *===-----------------------------------------------------------------------===
9 */
10#ifndef __IMMINTRIN_H
11#error \
12 "Never use <avx512bmmvlintrin.h> directly; include <immintrin.h> instead."
13#endif
14
15#ifndef __BMMVLINTRIN_H
16#define __BMMVLINTRIN_H
17
18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS128 \
20 __attribute__((__always_inline__, __nodebug__, \
21 __target__("avx512bmm,avx512vl"), __min_vector_width__(128)))
22#define __DEFAULT_FN_ATTRS256 \
23 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512bmm,avx512vl"), __min_vector_width__(256)))
25
26#if defined(__cplusplus) && (__cplusplus >= 201103L)
27#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
28#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256 constexpr
29#else
30#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
31#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
32#endif
33
34/// Multiplies two 16x16 bit matrices using OR reduction and ORs the product
35/// into a third 16x16 bit matrix (which is also the destination).
36///
37/// For the 256-bit YMM form, the source registers/memory each contain a single
38/// 16x16 (256-bit) matrix in bits [255:0]. The operation performs:
39/// \code{.operation}
40/// for i in 0 to 15
41/// for j in 0 to 15
42/// reduction_bit = __C[16*i+j]
43/// for k in 0 to 15
44/// reduction_bit |= __A[16*i+k] & __B[16*k+j]
45/// end for k
46/// dest[16*i+j] = reduction_bit
47/// end for j
48/// end for i
49/// \endcode
50///
51/// \headerfile <immintrin.h>
52///
53/// This intrinsic corresponds to the <c> VBMACOR16X16X16 </c> instruction.
54///
55/// \param __A
56/// A 256-bit vector containing a 16x16 bit matrix.
57/// \param __B
58/// A 256-bit vector containing a 16x16 bit matrix.
59/// \param __C
60/// A 256-bit accumulator vector containing the initial values to OR with.
61/// \returns A 256-bit vector containing the accumulated result.
62/// \note This instruction does not support masking.
63static __inline __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
64_mm256_bmacor16x16x16(__m256i __A, __m256i __B, __m256i __C) {
65 return (__m256i)__builtin_ia32_bmacor16x16x16_v16hi(
66 (__v16hi)__A, (__v16hi)__B, (__v16hi)__C);
67}
68
69/// Multiplies two 16x16 bit matrices using XOR reduction and XORs the product
70/// into a third 16x16 bit matrix (which is also the destination).
71///
72/// For the 256-bit YMM form, the source registers/memory each contain a single
73/// 16x16 (256-bit) matrix in bits [255:0]. The operation performs:
74/// \code{.operation}
75/// for i in 0 to 15
76/// for j in 0 to 15
77/// reduction_bit = __C[16*i+j]
78/// for k in 0 to 15
79/// reduction_bit ^= __A[16*i+k] & __B[16*k+j]
80/// end for k
81/// dest[16*i+j] = reduction_bit
82/// end for j
83/// end for i
84/// \endcode
85///
86/// \headerfile <immintrin.h>
87///
88/// This intrinsic corresponds to the <c> VBMACXOR16X16X16 </c> instruction.
89///
90/// \param __A
91/// A 256-bit vector containing a 16x16 bit matrix.
92/// \param __B
93/// A 256-bit vector containing a 16x16 bit matrix.
94/// \param __C
95/// A 256-bit accumulator vector containing the initial values to XOR with.
96/// \returns A 256-bit vector containing the accumulated result.
97/// \note This instruction does not support masking.
98static __inline __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
99_mm256_bmacxor16x16x16(__m256i __A, __m256i __B, __m256i __C) {
100 return (__m256i)__builtin_ia32_bmacxor16x16x16_v16hi(
101 (__v16hi)__A, (__v16hi)__B, (__v16hi)__C);
102}
103
104/// Reverses the bits within each byte of the source vector.
105///
106/// For each byte in the source, reverses the order of its 8 bits to generate
107/// the corresponding destination byte. For example, 0b10110001 becomes
108/// 0b10001101.
109///
110/// \headerfile <immintrin.h>
111///
112/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
113///
114/// \param __A
115/// A 128-bit vector of [16 x i8] where each byte will have its bits
116/// reversed.
117/// \returns A 128-bit vector of [16 x i8] with bit-reversed bytes.
118static __inline __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
119_mm128_bitrev_epi8(__m128i __A) {
120 return (__m128i)__builtin_elementwise_bitreverse((__v16qi)__A);
121}
122
123/// Reverses the bits within each byte of the source vector.
124///
125/// For each byte in the source, reverses the order of its 8 bits to generate
126/// the corresponding destination byte. For example, 0b10110001 becomes
127/// 0b10001101.
128///
129/// \headerfile <immintrin.h>
130///
131/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
132///
133/// \param __A
134/// A 256-bit vector of [32 x i8] where each byte will have its bits
135/// reversed.
136/// \returns A 256-bit vector of [32 x i8] with bit-reversed bytes.
137static __inline __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
138_mm256_bitrev_epi8(__m256i __A) {
139 return (__m256i)__builtin_elementwise_bitreverse((__v32qi)__A);
140}
141
142/// Reverses the bits within each byte of the source vector, using a writemask
143/// to conditionally select elements.
144///
145/// For each byte position, if the corresponding mask bit is 1, the byte from
146/// \a A has its bits reversed and stored in the result. If the mask bit is 0,
147/// the corresponding byte from \a B is copied to the result (merge masking).
148///
149/// \headerfile <immintrin.h>
150///
151/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
152///
153/// \param __U
154/// A 16-bit mask value where each bit controls one byte (per 8-bit element).
155/// A 1 performs bit reversal; a 0 selects the passthrough byte from __B.
156/// \param __A
157/// A 128-bit vector of [16 x i8] to be bit-reversed.
158/// \param __B
159/// A 128-bit vector of [16 x i8] providing passthrough values.
160/// \returns A 128-bit vector combining bit-reversed and passthrough bytes.
161static __inline __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
162_mm128_mask_bitrev_epi8(__mmask16 __U, __m128i __A, __m128i __B) {
163 return (__m128i)__builtin_ia32_selectb_128(
164 (__mmask16)__U, (__v16qi)_mm128_bitrev_epi8(__A), (__v16qi)__B);
165}
166
167/// Reverses the bits within each byte of the source vector, using a writemask
168/// to conditionally select elements.
169///
170/// For each byte position, if the corresponding mask bit is 1, the byte from
171/// \a A has its bits reversed and stored in the result. If the mask bit is 0,
172/// the corresponding byte from \a B is copied to the result (merge masking).
173///
174/// \headerfile <immintrin.h>
175///
176/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
177///
178/// \param __U
179/// A 32-bit mask value where each bit controls one byte (per 8-bit element).
180/// A 1 performs bit reversal; a 0 selects the passthrough byte from __B.
181/// \param __A
182/// A 256-bit vector of [32 x i8] to be bit-reversed.
183/// \param __B
184/// A 256-bit vector of [32 x i8] providing passthrough values.
185/// \returns A 256-bit vector combining bit-reversed and passthrough bytes.
186static __inline __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
187_mm256_mask_bitrev_epi8(__mmask32 __U, __m256i __A, __m256i __B) {
188 return (__m256i)__builtin_ia32_selectb_256(
189 (__mmask32)__U, (__v32qi)_mm256_bitrev_epi8(__A), (__v32qi)__B);
190}
191
192/// Reverses the bits within each byte of the source vector, zeroing elements
193/// based on the writemask.
194///
195/// For each byte position, if the corresponding mask bit is 1, the byte from
196/// \a A has its bits reversed and stored in the result. If the mask bit is 0,
197/// the result byte is set to zero (zero masking).
198///
199/// \headerfile <immintrin.h>
200///
201/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
202///
203/// \param __U
204/// A 16-bit mask value where each bit controls one byte (per 8-bit element).
205/// A 1 performs bit reversal; a 0 sets the byte to zero.
206/// \param __A
207/// A 128-bit vector of [16 x i8] to be bit-reversed.
208/// \returns A 128-bit vector with bit-reversed or zeroed bytes.
209static __inline __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
210_mm128_maskz_bitrev_epi8(__mmask16 __U, __m128i __A) {
211 return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U,
212 (__v16qi)_mm128_bitrev_epi8(__A),
213 (__v16qi)_mm_setzero_si128());
214}
215
216/// Reverses the bits within each byte of the source vector, zeroing elements
217/// based on the writemask.
218///
219/// For each byte position, if the corresponding mask bit is 1, the byte from
220/// \a A has its bits reversed and stored in the result. If the mask bit is 0,
221/// the result byte is set to zero (zero masking).
222///
223/// \headerfile <immintrin.h>
224///
225/// This intrinsic corresponds to the <c> VBITREV </c> instruction.
226///
227/// \param __U
228/// A 32-bit mask value where each bit controls one byte (per 8-bit element).
229/// A 1 performs bit reversal; a 0 sets the byte to zero.
230/// \param __A
231/// A 256-bit vector of [32 x i8] to be bit-reversed.
232/// \returns A 256-bit vector with bit-reversed or zeroed bytes.
233static __inline __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
234_mm256_maskz_bitrev_epi8(__mmask32 __U, __m256i __A) {
235 return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U,
236 (__v32qi)_mm256_bitrev_epi8(__A),
237 (__v32qi)_mm256_setzero_si256());
238}
239
240#undef __DEFAULT_FN_ATTRS128_CONSTEXPR
241#undef __DEFAULT_FN_ATTRS256_CONSTEXPR
242#undef __DEFAULT_FN_ATTRS128
243#undef __DEFAULT_FN_ATTRS256
244
245#endif
lib/include/avx512bwintrin.h+19-29
...@@ -1695,57 +1695,49 @@ _mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A)...@@ -1695,57 +1695,49 @@ _mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A)
1695 (__mmask64) __U);1695 (__mmask64) __U);
1696}1696}
16971697
1698static __inline__ __mmask64 __DEFAULT_FN_ATTRS5121698static __inline__ __mmask64 __DEFAULT_FN_ATTRS512_CONSTEXPR
1699_mm512_test_epi8_mask (__m512i __A, __m512i __B)1699_mm512_test_epi8_mask(__m512i __A, __m512i __B) {
1700{
1701 return _mm512_cmpneq_epi8_mask (_mm512_and_epi32 (__A, __B),1700 return _mm512_cmpneq_epi8_mask (_mm512_and_epi32 (__A, __B),
1702 _mm512_setzero_si512());1701 _mm512_setzero_si512());
1703}1702}
17041703
1705static __inline__ __mmask64 __DEFAULT_FN_ATTRS5121704static __inline__ __mmask64 __DEFAULT_FN_ATTRS512_CONSTEXPR
1706_mm512_mask_test_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B)1705_mm512_mask_test_epi8_mask(__mmask64 __U, __m512i __A, __m512i __B) {
1707{
1708 return _mm512_mask_cmpneq_epi8_mask (__U, _mm512_and_epi32 (__A, __B),1706 return _mm512_mask_cmpneq_epi8_mask (__U, _mm512_and_epi32 (__A, __B),
1709 _mm512_setzero_si512());1707 _mm512_setzero_si512());
1710}1708}
17111709
1712static __inline__ __mmask32 __DEFAULT_FN_ATTRS5121710static __inline__ __mmask32 __DEFAULT_FN_ATTRS512_CONSTEXPR
1713_mm512_test_epi16_mask (__m512i __A, __m512i __B)1711_mm512_test_epi16_mask(__m512i __A, __m512i __B) {
1714{
1715 return _mm512_cmpneq_epi16_mask (_mm512_and_epi32 (__A, __B),1712 return _mm512_cmpneq_epi16_mask (_mm512_and_epi32 (__A, __B),
1716 _mm512_setzero_si512());1713 _mm512_setzero_si512());
1717}1714}
17181715
1719static __inline__ __mmask32 __DEFAULT_FN_ATTRS5121716static __inline__ __mmask32 __DEFAULT_FN_ATTRS512_CONSTEXPR
1720_mm512_mask_test_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)1717_mm512_mask_test_epi16_mask(__mmask32 __U, __m512i __A, __m512i __B) {
1721{
1722 return _mm512_mask_cmpneq_epi16_mask (__U, _mm512_and_epi32 (__A, __B),1718 return _mm512_mask_cmpneq_epi16_mask (__U, _mm512_and_epi32 (__A, __B),
1723 _mm512_setzero_si512());1719 _mm512_setzero_si512());
1724}1720}
17251721
1726static __inline__ __mmask64 __DEFAULT_FN_ATTRS5121722static __inline__ __mmask64 __DEFAULT_FN_ATTRS512_CONSTEXPR
1727_mm512_testn_epi8_mask (__m512i __A, __m512i __B)1723_mm512_testn_epi8_mask(__m512i __A, __m512i __B) {
1728{
1729 return _mm512_cmpeq_epi8_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_si512());1724 return _mm512_cmpeq_epi8_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_si512());
1730}1725}
17311726
1732static __inline__ __mmask64 __DEFAULT_FN_ATTRS5121727static __inline__ __mmask64 __DEFAULT_FN_ATTRS512_CONSTEXPR
1733_mm512_mask_testn_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B)1728_mm512_mask_testn_epi8_mask(__mmask64 __U, __m512i __A, __m512i __B) {
1734{
1735 return _mm512_mask_cmpeq_epi8_mask (__U, _mm512_and_epi32 (__A, __B),1729 return _mm512_mask_cmpeq_epi8_mask (__U, _mm512_and_epi32 (__A, __B),
1736 _mm512_setzero_si512());1730 _mm512_setzero_si512());
1737}1731}
17381732
1739static __inline__ __mmask32 __DEFAULT_FN_ATTRS5121733static __inline__ __mmask32 __DEFAULT_FN_ATTRS512_CONSTEXPR
1740_mm512_testn_epi16_mask (__m512i __A, __m512i __B)1734_mm512_testn_epi16_mask(__m512i __A, __m512i __B) {
1741{
1742 return _mm512_cmpeq_epi16_mask (_mm512_and_epi32 (__A, __B),1735 return _mm512_cmpeq_epi16_mask (_mm512_and_epi32 (__A, __B),
1743 _mm512_setzero_si512());1736 _mm512_setzero_si512());
1744}1737}
17451738
1746static __inline__ __mmask32 __DEFAULT_FN_ATTRS5121739static __inline__ __mmask32 __DEFAULT_FN_ATTRS512_CONSTEXPR
1747_mm512_mask_testn_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B)1740_mm512_mask_testn_epi16_mask(__mmask32 __U, __m512i __A, __m512i __B) {
1748{
1749 return _mm512_mask_cmpeq_epi16_mask (__U, _mm512_and_epi32 (__A, __B),1741 return _mm512_mask_cmpeq_epi16_mask (__U, _mm512_and_epi32 (__A, __B),
1750 _mm512_setzero_si512());1742 _mm512_setzero_si512());
1751}1743}
...@@ -1880,11 +1872,9 @@ _mm512_mask_permutexvar_epi16(__m512i __W, __mmask32 __M, __m512i __A,...@@ -1880,11 +1872,9 @@ _mm512_mask_permutexvar_epi16(__m512i __W, __mmask32 __M, __m512i __A,
1880 (__v32hi)_mm512_dbsad_epu8((A), (B), (imm)), \1872 (__v32hi)_mm512_dbsad_epu8((A), (B), (imm)), \
1881 (__v32hi)_mm512_setzero_si512()))1873 (__v32hi)_mm512_setzero_si512()))
18821874
1883static __inline__ __m512i __DEFAULT_FN_ATTRS5121875static __inline__ __m512i
1884_mm512_sad_epu8 (__m512i __A, __m512i __B)1876 __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_sad_epu8(__m512i __A, __m512i __B) {
1885{1877 return (__m512i)__builtin_ia32_psadbw512((__v64qu)__A, (__v64qu)__B);
1886 return (__m512i) __builtin_ia32_psadbw512 ((__v64qi) __A,
1887 (__v64qi) __B);
1888}1878}
18891879
1890#undef __DEFAULT_FN_ATTRS5121880#undef __DEFAULT_FN_ATTRS512
lib/include/avx512fintrin.h+62-89
...@@ -42,11 +42,12 @@ typedef unsigned char __mmask8;...@@ -42,11 +42,12 @@ typedef unsigned char __mmask8;
42typedef unsigned short __mmask16;42typedef unsigned short __mmask16;
4343
44/* Rounding mode macros. */44/* Rounding mode macros. */
45#define _MM_FROUND_TO_NEAREST_INT 0x0045#define _MM_FROUND_TO_NEAREST_INT 0x00
46#define _MM_FROUND_TO_NEG_INF 0x0146#define _MM_FROUND_TO_NEAREST_TIES_EVEN 0x00
47#define _MM_FROUND_TO_POS_INF 0x0247#define _MM_FROUND_TO_NEG_INF 0x01
48#define _MM_FROUND_TO_ZERO 0x0348#define _MM_FROUND_TO_POS_INF 0x02
49#define _MM_FROUND_CUR_DIRECTION 0x0449#define _MM_FROUND_TO_ZERO 0x03
50#define _MM_FROUND_CUR_DIRECTION 0x04
5051
51/* Constants for integer comparison predicates */52/* Constants for integer comparison predicates */
52typedef enum {53typedef enum {
...@@ -986,10 +987,8 @@ _mm512_maskz_max_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -986,10 +987,8 @@ _mm512_maskz_max_ps(__mmask16 __U, __m512 __A, __m512 __B) {
986 (__v16sf)_mm512_setzero_ps());987 (__v16sf)_mm512_setzero_ps());
987}988}
988989
989static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_max_ss(__m128 __W,990static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
990 __mmask8 __U,991_mm_mask_max_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
991 __m128 __A,
992 __m128 __B) {
993 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,992 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,
994 (__v4sf) __B,993 (__v4sf) __B,
995 (__v4sf) __W,994 (__v4sf) __W,
...@@ -997,9 +996,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_max_ss(__m128 __W,...@@ -997,9 +996,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_max_ss(__m128 __W,
997 _MM_FROUND_CUR_DIRECTION);996 _MM_FROUND_CUR_DIRECTION);
998}997}
999998
1000static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_max_ss(__mmask8 __U,999static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1001 __m128 __A,1000_mm_maskz_max_ss(__mmask8 __U, __m128 __A, __m128 __B) {
1002 __m128 __B) {
1003 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,1001 return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A,
1004 (__v4sf) __B,1002 (__v4sf) __B,
1005 (__v4sf) _mm_setzero_ps (),1003 (__v4sf) _mm_setzero_ps (),
...@@ -1025,10 +1023,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_max_ss(__mmask8 __U,...@@ -1025,10 +1023,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_max_ss(__mmask8 __U,
1025 (__v4sf)_mm_setzero_ps(), \1023 (__v4sf)_mm_setzero_ps(), \
1026 (__mmask8)(U), (int)(R)))1024 (__mmask8)(U), (int)(R)))
10271025
1028static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_max_sd(__m128d __W,1026static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1029 __mmask8 __U,1027_mm_mask_max_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
1030 __m128d __A,
1031 __m128d __B) {
1032 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,1028 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,
1033 (__v2df) __B,1029 (__v2df) __B,
1034 (__v2df) __W,1030 (__v2df) __W,
...@@ -1036,9 +1032,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_max_sd(__m128d __W,...@@ -1036,9 +1032,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_max_sd(__m128d __W,
1036 _MM_FROUND_CUR_DIRECTION);1032 _MM_FROUND_CUR_DIRECTION);
1037}1033}
10381034
1039static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_maskz_max_sd(__mmask8 __U,1035static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1040 __m128d __A,1036_mm_maskz_max_sd(__mmask8 __U, __m128d __A, __m128d __B) {
1041 __m128d __B) {
1042 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,1037 return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A,
1043 (__v2df) __B,1038 (__v2df) __B,
1044 (__v2df) _mm_setzero_pd (),1039 (__v2df) _mm_setzero_pd (),
...@@ -1208,10 +1203,8 @@ _mm512_maskz_min_ps(__mmask16 __U, __m512 __A, __m512 __B) {...@@ -1208,10 +1203,8 @@ _mm512_maskz_min_ps(__mmask16 __U, __m512 __A, __m512 __B) {
1208 (__v16sf)_mm512_setzero_ps());1203 (__v16sf)_mm512_setzero_ps());
1209}1204}
12101205
1211static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_min_ss(__m128 __W,1206static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1212 __mmask8 __U,1207_mm_mask_min_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
1213 __m128 __A,
1214 __m128 __B) {
1215 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,1208 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,
1216 (__v4sf) __B,1209 (__v4sf) __B,
1217 (__v4sf) __W,1210 (__v4sf) __W,
...@@ -1219,9 +1212,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_min_ss(__m128 __W,...@@ -1219,9 +1212,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_mask_min_ss(__m128 __W,
1219 _MM_FROUND_CUR_DIRECTION);1212 _MM_FROUND_CUR_DIRECTION);
1220}1213}
12211214
1222static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_min_ss(__mmask8 __U,1215static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1223 __m128 __A,1216_mm_maskz_min_ss(__mmask8 __U, __m128 __A, __m128 __B) {
1224 __m128 __B) {
1225 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,1217 return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A,
1226 (__v4sf) __B,1218 (__v4sf) __B,
1227 (__v4sf) _mm_setzero_ps (),1219 (__v4sf) _mm_setzero_ps (),
...@@ -1247,10 +1239,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_min_ss(__mmask8 __U,...@@ -1247,10 +1239,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maskz_min_ss(__mmask8 __U,
1247 (__v4sf)_mm_setzero_ps(), \1239 (__v4sf)_mm_setzero_ps(), \
1248 (__mmask8)(U), (int)(R)))1240 (__mmask8)(U), (int)(R)))
12491241
1250static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_min_sd(__m128d __W,1242static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1251 __mmask8 __U,1243_mm_mask_min_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
1252 __m128d __A,
1253 __m128d __B) {
1254 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,1244 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,
1255 (__v2df) __B,1245 (__v2df) __B,
1256 (__v2df) __W,1246 (__v2df) __W,
...@@ -1258,9 +1248,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_min_sd(__m128d __W,...@@ -1258,9 +1248,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_mask_min_sd(__m128d __W,
1258 _MM_FROUND_CUR_DIRECTION);1248 _MM_FROUND_CUR_DIRECTION);
1259}1249}
12601250
1261static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_maskz_min_sd(__mmask8 __U,1251static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1262 __m128d __A,1252_mm_maskz_min_sd(__mmask8 __U, __m128d __A, __m128d __B) {
1263 __m128d __B) {
1264 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,1253 return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A,
1265 (__v2df) __B,1254 (__v2df) __B,
1266 (__v2df) _mm_setzero_pd (),1255 (__v2df) _mm_setzero_pd (),
...@@ -8108,68 +8097,60 @@ _mm512_stream_ps (void *__P, __m512 __A)...@@ -8108,68 +8097,60 @@ _mm512_stream_ps (void *__P, __m512 __A)
8108 __builtin_nontemporal_store((__v16sf_aligned)__A, (__v16sf_aligned*)__P);8097 __builtin_nontemporal_store((__v16sf_aligned)__A, (__v16sf_aligned*)__P);
8109}8098}
81108099
8111static __inline__ __m512d __DEFAULT_FN_ATTRS5128100static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8112_mm512_mask_compress_pd (__m512d __W, __mmask8 __U, __m512d __A)8101_mm512_mask_compress_pd(__m512d __W, __mmask8 __U, __m512d __A) {
8113{
8114 return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A,8102 return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A,
8115 (__v8df) __W,8103 (__v8df) __W,
8116 (__mmask8) __U);8104 (__mmask8) __U);
8117}8105}
81188106
8119static __inline__ __m512d __DEFAULT_FN_ATTRS5128107static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8120_mm512_maskz_compress_pd (__mmask8 __U, __m512d __A)8108_mm512_maskz_compress_pd(__mmask8 __U, __m512d __A) {
8121{
8122 return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A,8109 return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A,
8123 (__v8df)8110 (__v8df)
8124 _mm512_setzero_pd (),8111 _mm512_setzero_pd (),
8125 (__mmask8) __U);8112 (__mmask8) __U);
8126}8113}
81278114
8128static __inline__ __m512i __DEFAULT_FN_ATTRS5128115static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8129_mm512_mask_compress_epi64 (__m512i __W, __mmask8 __U, __m512i __A)8116_mm512_mask_compress_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
8130{
8131 return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A,8117 return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A,
8132 (__v8di) __W,8118 (__v8di) __W,
8133 (__mmask8) __U);8119 (__mmask8) __U);
8134}8120}
81358121
8136static __inline__ __m512i __DEFAULT_FN_ATTRS5128122static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8137_mm512_maskz_compress_epi64 (__mmask8 __U, __m512i __A)8123_mm512_maskz_compress_epi64(__mmask8 __U, __m512i __A) {
8138{
8139 return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A,8124 return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A,
8140 (__v8di)8125 (__v8di)
8141 _mm512_setzero_si512 (),8126 _mm512_setzero_si512 (),
8142 (__mmask8) __U);8127 (__mmask8) __U);
8143}8128}
81448129
8145static __inline__ __m512 __DEFAULT_FN_ATTRS5128130static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8146_mm512_mask_compress_ps (__m512 __W, __mmask16 __U, __m512 __A)8131_mm512_mask_compress_ps(__m512 __W, __mmask16 __U, __m512 __A) {
8147{
8148 return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A,8132 return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A,
8149 (__v16sf) __W,8133 (__v16sf) __W,
8150 (__mmask16) __U);8134 (__mmask16) __U);
8151}8135}
81528136
8153static __inline__ __m512 __DEFAULT_FN_ATTRS5128137static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8154_mm512_maskz_compress_ps (__mmask16 __U, __m512 __A)8138_mm512_maskz_compress_ps(__mmask16 __U, __m512 __A) {
8155{
8156 return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A,8139 return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A,
8157 (__v16sf)8140 (__v16sf)
8158 _mm512_setzero_ps (),8141 _mm512_setzero_ps (),
8159 (__mmask16) __U);8142 (__mmask16) __U);
8160}8143}
81618144
8162static __inline__ __m512i __DEFAULT_FN_ATTRS5128145static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8163_mm512_mask_compress_epi32 (__m512i __W, __mmask16 __U, __m512i __A)8146_mm512_mask_compress_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
8164{
8165 return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A,8147 return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A,
8166 (__v16si) __W,8148 (__v16si) __W,
8167 (__mmask16) __U);8149 (__mmask16) __U);
8168}8150}
81698151
8170static __inline__ __m512i __DEFAULT_FN_ATTRS5128152static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8171_mm512_maskz_compress_epi32 (__mmask16 __U, __m512i __A)8153_mm512_maskz_compress_epi32(__mmask16 __U, __m512i __A) {
8172{
8173 return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A,8154 return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A,
8174 (__v16si)8155 (__v16si)
8175 _mm512_setzero_si512 (),8156 _mm512_setzero_si512 (),
...@@ -8222,58 +8203,50 @@ _mm512_maskz_compress_epi32 (__mmask16 __U, __m512i __A)...@@ -8222,58 +8203,50 @@ _mm512_maskz_compress_epi32 (__mmask16 __U, __m512i __A)
82228203
8223/* Bit Test */8204/* Bit Test */
82248205
8225static __inline __mmask16 __DEFAULT_FN_ATTRS5128206static __inline __mmask16 __DEFAULT_FN_ATTRS512_CONSTEXPR
8226_mm512_test_epi32_mask (__m512i __A, __m512i __B)8207_mm512_test_epi32_mask(__m512i __A, __m512i __B) {
8227{
8228 return _mm512_cmpneq_epi32_mask (_mm512_and_epi32(__A, __B),8208 return _mm512_cmpneq_epi32_mask (_mm512_and_epi32(__A, __B),
8229 _mm512_setzero_si512());8209 _mm512_setzero_si512());
8230}8210}
82318211
8232static __inline__ __mmask16 __DEFAULT_FN_ATTRS5128212static __inline__ __mmask16 __DEFAULT_FN_ATTRS512_CONSTEXPR
8233_mm512_mask_test_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B)8213_mm512_mask_test_epi32_mask(__mmask16 __U, __m512i __A, __m512i __B) {
8234{
8235 return _mm512_mask_cmpneq_epi32_mask (__U, _mm512_and_epi32 (__A, __B),8214 return _mm512_mask_cmpneq_epi32_mask (__U, _mm512_and_epi32 (__A, __B),
8236 _mm512_setzero_si512());8215 _mm512_setzero_si512());
8237}8216}
82388217
8239static __inline __mmask8 __DEFAULT_FN_ATTRS5128218static __inline __mmask8 __DEFAULT_FN_ATTRS512_CONSTEXPR
8240_mm512_test_epi64_mask (__m512i __A, __m512i __B)8219_mm512_test_epi64_mask(__m512i __A, __m512i __B) {
8241{
8242 return _mm512_cmpneq_epi64_mask (_mm512_and_epi32 (__A, __B),8220 return _mm512_cmpneq_epi64_mask (_mm512_and_epi32 (__A, __B),
8243 _mm512_setzero_si512());8221 _mm512_setzero_si512());
8244}8222}
82458223
8246static __inline__ __mmask8 __DEFAULT_FN_ATTRS5128224static __inline__ __mmask8 __DEFAULT_FN_ATTRS512_CONSTEXPR
8247_mm512_mask_test_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B)8225_mm512_mask_test_epi64_mask(__mmask8 __U, __m512i __A, __m512i __B) {
8248{
8249 return _mm512_mask_cmpneq_epi64_mask (__U, _mm512_and_epi32 (__A, __B),8226 return _mm512_mask_cmpneq_epi64_mask (__U, _mm512_and_epi32 (__A, __B),
8250 _mm512_setzero_si512());8227 _mm512_setzero_si512());
8251}8228}
82528229
8253static __inline__ __mmask16 __DEFAULT_FN_ATTRS5128230static __inline__ __mmask16 __DEFAULT_FN_ATTRS512_CONSTEXPR
8254_mm512_testn_epi32_mask (__m512i __A, __m512i __B)8231_mm512_testn_epi32_mask(__m512i __A, __m512i __B) {
8255{
8256 return _mm512_cmpeq_epi32_mask (_mm512_and_epi32 (__A, __B),8232 return _mm512_cmpeq_epi32_mask (_mm512_and_epi32 (__A, __B),
8257 _mm512_setzero_si512());8233 _mm512_setzero_si512());
8258}8234}
82598235
8260static __inline__ __mmask16 __DEFAULT_FN_ATTRS5128236static __inline__ __mmask16 __DEFAULT_FN_ATTRS512_CONSTEXPR
8261_mm512_mask_testn_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B)8237_mm512_mask_testn_epi32_mask(__mmask16 __U, __m512i __A, __m512i __B) {
8262{
8263 return _mm512_mask_cmpeq_epi32_mask (__U, _mm512_and_epi32 (__A, __B),8238 return _mm512_mask_cmpeq_epi32_mask (__U, _mm512_and_epi32 (__A, __B),
8264 _mm512_setzero_si512());8239 _mm512_setzero_si512());
8265}8240}
82668241
8267static __inline__ __mmask8 __DEFAULT_FN_ATTRS5128242static __inline__ __mmask8 __DEFAULT_FN_ATTRS512_CONSTEXPR
8268_mm512_testn_epi64_mask (__m512i __A, __m512i __B)8243_mm512_testn_epi64_mask(__m512i __A, __m512i __B) {
8269{
8270 return _mm512_cmpeq_epi64_mask (_mm512_and_epi32 (__A, __B),8244 return _mm512_cmpeq_epi64_mask (_mm512_and_epi32 (__A, __B),
8271 _mm512_setzero_si512());8245 _mm512_setzero_si512());
8272}8246}
82738247
8274static __inline__ __mmask8 __DEFAULT_FN_ATTRS5128248static __inline__ __mmask8 __DEFAULT_FN_ATTRS512_CONSTEXPR
8275_mm512_mask_testn_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B)8249_mm512_mask_testn_epi64_mask(__mmask8 __U, __m512i __A, __m512i __B) {
8276{
8277 return _mm512_mask_cmpeq_epi64_mask (__U, _mm512_and_epi32 (__A, __B),8250 return _mm512_mask_cmpeq_epi64_mask (__U, _mm512_and_epi32 (__A, __B),
8278 _mm512_setzero_si512());8251 _mm512_setzero_si512());
8279}8252}
...@@ -8403,7 +8376,7 @@ _mm_maskz_load_sd (__mmask8 __U, const double* __A)...@@ -8403,7 +8376,7 @@ _mm_maskz_load_sd (__mmask8 __U, const double* __A)
8403 (__v16si)_mm512_shuffle_epi32((A), (I)), \8376 (__v16si)_mm512_shuffle_epi32((A), (I)), \
8404 (__v16si)_mm512_setzero_si512()))8377 (__v16si)_mm512_setzero_si512()))
84058378
8406static __inline__ __m512d __DEFAULT_FN_ATTRS5128379static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8407_mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A)8380_mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A)
8408{8381{
8409 return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A,8382 return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A,
...@@ -8411,7 +8384,7 @@ _mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A)...@@ -8411,7 +8384,7 @@ _mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A)
8411 (__mmask8) __U);8384 (__mmask8) __U);
8412}8385}
84138386
8414static __inline__ __m512d __DEFAULT_FN_ATTRS5128387static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
8415_mm512_maskz_expand_pd (__mmask8 __U, __m512d __A)8388_mm512_maskz_expand_pd (__mmask8 __U, __m512d __A)
8416{8389{
8417 return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A,8390 return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A,
...@@ -8419,7 +8392,7 @@ _mm512_maskz_expand_pd (__mmask8 __U, __m512d __A)...@@ -8419,7 +8392,7 @@ _mm512_maskz_expand_pd (__mmask8 __U, __m512d __A)
8419 (__mmask8) __U);8392 (__mmask8) __U);
8420}8393}
84218394
8422static __inline__ __m512i __DEFAULT_FN_ATTRS5128395static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8423_mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A)8396_mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
8424{8397{
8425 return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A,8398 return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A,
...@@ -8427,7 +8400,7 @@ _mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A)...@@ -8427,7 +8400,7 @@ _mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
8427 (__mmask8) __U);8400 (__mmask8) __U);
8428}8401}
84298402
8430static __inline__ __m512i __DEFAULT_FN_ATTRS5128403static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8431_mm512_maskz_expand_epi64 ( __mmask8 __U, __m512i __A)8404_mm512_maskz_expand_epi64 ( __mmask8 __U, __m512i __A)
8432{8405{
8433 return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A,8406 return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A,
...@@ -8499,7 +8472,7 @@ _mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P)...@@ -8499,7 +8472,7 @@ _mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P)
8499 (__mmask16) __U);8472 (__mmask16) __U);
8500}8473}
85018474
8502static __inline__ __m512 __DEFAULT_FN_ATTRS5128475static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8503_mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A)8476_mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A)
8504{8477{
8505 return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A,8478 return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A,
...@@ -8507,7 +8480,7 @@ _mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A)...@@ -8507,7 +8480,7 @@ _mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A)
8507 (__mmask16) __U);8480 (__mmask16) __U);
8508}8481}
85098482
8510static __inline__ __m512 __DEFAULT_FN_ATTRS5128483static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
8511_mm512_maskz_expand_ps (__mmask16 __U, __m512 __A)8484_mm512_maskz_expand_ps (__mmask16 __U, __m512 __A)
8512{8485{
8513 return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A,8486 return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A,
...@@ -8515,7 +8488,7 @@ _mm512_maskz_expand_ps (__mmask16 __U, __m512 __A)...@@ -8515,7 +8488,7 @@ _mm512_maskz_expand_ps (__mmask16 __U, __m512 __A)
8515 (__mmask16) __U);8488 (__mmask16) __U);
8516}8489}
85178490
8518static __inline__ __m512i __DEFAULT_FN_ATTRS5128491static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8519_mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A)8492_mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
8520{8493{
8521 return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A,8494 return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A,
...@@ -8523,7 +8496,7 @@ _mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A)...@@ -8523,7 +8496,7 @@ _mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
8523 (__mmask16) __U);8496 (__mmask16) __U);
8524}8497}
85258498
8526static __inline__ __m512i __DEFAULT_FN_ATTRS5128499static __inline__ __m512i __DEFAULT_FN_ATTRS512_CONSTEXPR
8527_mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A)8500_mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A)
8528{8501{
8529 return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A,8502 return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A,
lib/include/avx512fp16intrin.h+12-18
...@@ -720,25 +720,22 @@ _mm_maskz_div_sh(__mmask8 __U, __m128h __A, __m128h __B) {...@@ -720,25 +720,22 @@ _mm_maskz_div_sh(__mmask8 __U, __m128h __A, __m128h __B) {
720 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \720 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \
721 (__mmask8)(U), (int)(R)))721 (__mmask8)(U), (int)(R)))
722722
723static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_min_sh(__m128h __A,723static __inline__ __m128h
724 __m128h __B) {724 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_min_sh(__m128h __A, __m128h __B) {
725 return (__m128h)__builtin_ia32_minsh_round_mask(725 return (__m128h)__builtin_ia32_minsh_round_mask(
726 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)-1,726 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)-1,
727 _MM_FROUND_CUR_DIRECTION);727 _MM_FROUND_CUR_DIRECTION);
728}728}
729729
730static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_min_sh(__m128h __W,730static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
731 __mmask8 __U,731_mm_mask_min_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
732 __m128h __A,
733 __m128h __B) {
734 return (__m128h)__builtin_ia32_minsh_round_mask((__v8hf)__A, (__v8hf)__B,732 return (__m128h)__builtin_ia32_minsh_round_mask((__v8hf)__A, (__v8hf)__B,
735 (__v8hf)__W, (__mmask8)__U,733 (__v8hf)__W, (__mmask8)__U,
736 _MM_FROUND_CUR_DIRECTION);734 _MM_FROUND_CUR_DIRECTION);
737}735}
738736
739static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_min_sh(__mmask8 __U,737static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
740 __m128h __A,738_mm_maskz_min_sh(__mmask8 __U, __m128h __A, __m128h __B) {
741 __m128h __B) {
742 return (__m128h)__builtin_ia32_minsh_round_mask(739 return (__m128h)__builtin_ia32_minsh_round_mask(
743 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)__U,740 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)__U,
744 _MM_FROUND_CUR_DIRECTION);741 _MM_FROUND_CUR_DIRECTION);
...@@ -759,25 +756,22 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_min_sh(__mmask8 __U,...@@ -759,25 +756,22 @@ static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_min_sh(__mmask8 __U,
759 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \756 (__v8hf)(__m128h)(A), (__v8hf)(__m128h)(B), (__v8hf)_mm_setzero_ph(), \
760 (__mmask8)(U), (int)(R)))757 (__mmask8)(U), (int)(R)))
761758
762static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_max_sh(__m128h __A,759static __inline__ __m128h
763 __m128h __B) {760 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_max_sh(__m128h __A, __m128h __B) {
764 return (__m128h)__builtin_ia32_maxsh_round_mask(761 return (__m128h)__builtin_ia32_maxsh_round_mask(
765 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)-1,762 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)-1,
766 _MM_FROUND_CUR_DIRECTION);763 _MM_FROUND_CUR_DIRECTION);
767}764}
768765
769static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_mask_max_sh(__m128h __W,766static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
770 __mmask8 __U,767_mm_mask_max_sh(__m128h __W, __mmask8 __U, __m128h __A, __m128h __B) {
771 __m128h __A,
772 __m128h __B) {
773 return (__m128h)__builtin_ia32_maxsh_round_mask((__v8hf)__A, (__v8hf)__B,768 return (__m128h)__builtin_ia32_maxsh_round_mask((__v8hf)__A, (__v8hf)__B,
774 (__v8hf)__W, (__mmask8)__U,769 (__v8hf)__W, (__mmask8)__U,
775 _MM_FROUND_CUR_DIRECTION);770 _MM_FROUND_CUR_DIRECTION);
776}771}
777772
778static __inline__ __m128h __DEFAULT_FN_ATTRS128 _mm_maskz_max_sh(__mmask8 __U,773static __inline__ __m128h __DEFAULT_FN_ATTRS128_CONSTEXPR
779 __m128h __A,774_mm_maskz_max_sh(__mmask8 __U, __m128h __A, __m128h __B) {
780 __m128h __B) {
781 return (__m128h)__builtin_ia32_maxsh_round_mask(775 return (__m128h)__builtin_ia32_maxsh_round_mask(
782 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)__U,776 (__v8hf)__A, (__v8hf)__B, (__v8hf)_mm_setzero_ph(), (__mmask8)__U,
783 _MM_FROUND_CUR_DIRECTION);777 _MM_FROUND_CUR_DIRECTION);
lib/include/avx512vbmi2intrin.h+12-16
...@@ -25,33 +25,29 @@...@@ -25,33 +25,29 @@
25#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS25#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
26#endif26#endif
2727
28static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
29_mm512_mask_compress_epi16(__m512i __S, __mmask32 __U, __m512i __D)29_mm512_mask_compress_epi16(__m512i __S, __mmask32 __U, __m512i __D) {
30{
31 return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D,30 return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D,
32 (__v32hi) __S,31 (__v32hi) __S,
33 __U);32 __U);
34}33}
3534
36static __inline__ __m512i __DEFAULT_FN_ATTRS35static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
37_mm512_maskz_compress_epi16(__mmask32 __U, __m512i __D)36_mm512_maskz_compress_epi16(__mmask32 __U, __m512i __D) {
38{
39 return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D,37 return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D,
40 (__v32hi) _mm512_setzero_si512(),38 (__v32hi) _mm512_setzero_si512(),
41 __U);39 __U);
42}40}
4341
44static __inline__ __m512i __DEFAULT_FN_ATTRS42static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
45_mm512_mask_compress_epi8(__m512i __S, __mmask64 __U, __m512i __D)43_mm512_mask_compress_epi8(__m512i __S, __mmask64 __U, __m512i __D) {
46{
47 return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D,44 return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D,
48 (__v64qi) __S,45 (__v64qi) __S,
49 __U);46 __U);
50}47}
5148
52static __inline__ __m512i __DEFAULT_FN_ATTRS49static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
53_mm512_maskz_compress_epi8(__mmask64 __U, __m512i __D)50_mm512_maskz_compress_epi8(__mmask64 __U, __m512i __D) {
54{
55 return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D,51 return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D,
56 (__v64qi) _mm512_setzero_si512(),52 (__v64qi) _mm512_setzero_si512(),
57 __U);53 __U);
...@@ -71,7 +67,7 @@ _mm512_mask_compressstoreu_epi8(void *__P, __mmask64 __U, __m512i __D)...@@ -71,7 +67,7 @@ _mm512_mask_compressstoreu_epi8(void *__P, __mmask64 __U, __m512i __D)
71 __U);67 __U);
72}68}
7369
74static __inline__ __m512i __DEFAULT_FN_ATTRS70static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
75_mm512_mask_expand_epi16(__m512i __S, __mmask32 __U, __m512i __D)71_mm512_mask_expand_epi16(__m512i __S, __mmask32 __U, __m512i __D)
76{72{
77 return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D,73 return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D,
...@@ -79,7 +75,7 @@ _mm512_mask_expand_epi16(__m512i __S, __mmask32 __U, __m512i __D)...@@ -79,7 +75,7 @@ _mm512_mask_expand_epi16(__m512i __S, __mmask32 __U, __m512i __D)
79 __U);75 __U);
80}76}
8177
82static __inline__ __m512i __DEFAULT_FN_ATTRS78static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
83_mm512_maskz_expand_epi16(__mmask32 __U, __m512i __D)79_mm512_maskz_expand_epi16(__mmask32 __U, __m512i __D)
84{80{
85 return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D,81 return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D,
...@@ -87,7 +83,7 @@ _mm512_maskz_expand_epi16(__mmask32 __U, __m512i __D)...@@ -87,7 +83,7 @@ _mm512_maskz_expand_epi16(__mmask32 __U, __m512i __D)
87 __U);83 __U);
88}84}
8985
90static __inline__ __m512i __DEFAULT_FN_ATTRS86static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
91_mm512_mask_expand_epi8(__m512i __S, __mmask64 __U, __m512i __D)87_mm512_mask_expand_epi8(__m512i __S, __mmask64 __U, __m512i __D)
92{88{
93 return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D,89 return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D,
...@@ -95,7 +91,7 @@ _mm512_mask_expand_epi8(__m512i __S, __mmask64 __U, __m512i __D)...@@ -95,7 +91,7 @@ _mm512_mask_expand_epi8(__m512i __S, __mmask64 __U, __m512i __D)
95 __U);91 __U);
96}92}
9793
98static __inline__ __m512i __DEFAULT_FN_ATTRS94static __inline__ __m512i __DEFAULT_FN_ATTRS_CONSTEXPR
99_mm512_maskz_expand_epi8(__mmask64 __U, __m512i __D)95_mm512_maskz_expand_epi8(__mmask64 __U, __m512i __D)
100{96{
101 return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D,97 return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D,
lib/include/avx512vlbwintrin.h+24-36
...@@ -2394,36 +2394,31 @@ _mm256_test_epi8_mask(__m256i __A, __m256i __B) {...@@ -2394,36 +2394,31 @@ _mm256_test_epi8_mask(__m256i __A, __m256i __B) {
2394 _mm256_setzero_si256());2394 _mm256_setzero_si256());
2395}2395}
23962396
2397static __inline__ __mmask32 __DEFAULT_FN_ATTRS2562397static __inline__ __mmask32 __DEFAULT_FN_ATTRS256_CONSTEXPR
2398_mm256_mask_test_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B)2398_mm256_mask_test_epi8_mask(__mmask32 __U, __m256i __A, __m256i __B) {
2399{
2400 return _mm256_mask_cmpneq_epi8_mask (__U, _mm256_and_si256(__A, __B),2399 return _mm256_mask_cmpneq_epi8_mask (__U, _mm256_and_si256(__A, __B),
2401 _mm256_setzero_si256());2400 _mm256_setzero_si256());
2402}2401}
24032402
2404static __inline__ __mmask8 __DEFAULT_FN_ATTRS1282403static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
2405_mm_test_epi16_mask (__m128i __A, __m128i __B)2404_mm_test_epi16_mask(__m128i __A, __m128i __B) {
2406{
2407 return _mm_cmpneq_epi16_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());2405 return _mm_cmpneq_epi16_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
2408}2406}
24092407
2410static __inline__ __mmask8 __DEFAULT_FN_ATTRS1282408static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
2411_mm_mask_test_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B)2409_mm_mask_test_epi16_mask(__mmask8 __U, __m128i __A, __m128i __B) {
2412{
2413 return _mm_mask_cmpneq_epi16_mask (__U, _mm_and_si128 (__A, __B),2410 return _mm_mask_cmpneq_epi16_mask (__U, _mm_and_si128 (__A, __B),
2414 _mm_setzero_si128());2411 _mm_setzero_si128());
2415}2412}
24162413
2417static __inline__ __mmask16 __DEFAULT_FN_ATTRS2562414static __inline__ __mmask16 __DEFAULT_FN_ATTRS256_CONSTEXPR
2418_mm256_test_epi16_mask (__m256i __A, __m256i __B)2415_mm256_test_epi16_mask(__m256i __A, __m256i __B) {
2419{
2420 return _mm256_cmpneq_epi16_mask (_mm256_and_si256 (__A, __B),2416 return _mm256_cmpneq_epi16_mask (_mm256_and_si256 (__A, __B),
2421 _mm256_setzero_si256 ());2417 _mm256_setzero_si256 ());
2422}2418}
24232419
2424static __inline__ __mmask16 __DEFAULT_FN_ATTRS2562420static __inline__ __mmask16 __DEFAULT_FN_ATTRS256_CONSTEXPR
2425_mm256_mask_test_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B)2421_mm256_mask_test_epi16_mask(__mmask16 __U, __m256i __A, __m256i __B) {
2426{
2427 return _mm256_mask_cmpneq_epi16_mask (__U, _mm256_and_si256(__A, __B),2422 return _mm256_mask_cmpneq_epi16_mask (__U, _mm256_and_si256(__A, __B),
2428 _mm256_setzero_si256());2423 _mm256_setzero_si256());
2429}2424}
...@@ -2433,49 +2428,42 @@ _mm_testn_epi8_mask(__m128i __A, __m128i __B) {...@@ -2433,49 +2428,42 @@ _mm_testn_epi8_mask(__m128i __A, __m128i __B) {
2433 return _mm_cmpeq_epi8_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());2428 return _mm_cmpeq_epi8_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
2434}2429}
24352430
2436static __inline__ __mmask16 __DEFAULT_FN_ATTRS1282431static __inline__ __mmask16 __DEFAULT_FN_ATTRS128_CONSTEXPR
2437_mm_mask_testn_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B)2432_mm_mask_testn_epi8_mask(__mmask16 __U, __m128i __A, __m128i __B) {
2438{
2439 return _mm_mask_cmpeq_epi8_mask (__U, _mm_and_si128 (__A, __B),2433 return _mm_mask_cmpeq_epi8_mask (__U, _mm_and_si128 (__A, __B),
2440 _mm_setzero_si128());2434 _mm_setzero_si128());
2441}2435}
24422436
2443static __inline__ __mmask32 __DEFAULT_FN_ATTRS2562437static __inline__ __mmask32 __DEFAULT_FN_ATTRS256_CONSTEXPR
2444_mm256_testn_epi8_mask (__m256i __A, __m256i __B)2438_mm256_testn_epi8_mask(__m256i __A, __m256i __B) {
2445{
2446 return _mm256_cmpeq_epi8_mask (_mm256_and_si256 (__A, __B),2439 return _mm256_cmpeq_epi8_mask (_mm256_and_si256 (__A, __B),
2447 _mm256_setzero_si256());2440 _mm256_setzero_si256());
2448}2441}
24492442
2450static __inline__ __mmask32 __DEFAULT_FN_ATTRS2562443static __inline__ __mmask32 __DEFAULT_FN_ATTRS256_CONSTEXPR
2451_mm256_mask_testn_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B)2444_mm256_mask_testn_epi8_mask(__mmask32 __U, __m256i __A, __m256i __B) {
2452{
2453 return _mm256_mask_cmpeq_epi8_mask (__U, _mm256_and_si256 (__A, __B),2445 return _mm256_mask_cmpeq_epi8_mask (__U, _mm256_and_si256 (__A, __B),
2454 _mm256_setzero_si256());2446 _mm256_setzero_si256());
2455}2447}
24562448
2457static __inline__ __mmask8 __DEFAULT_FN_ATTRS1282449static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
2458_mm_testn_epi16_mask (__m128i __A, __m128i __B)2450_mm_testn_epi16_mask(__m128i __A, __m128i __B) {
2459{
2460 return _mm_cmpeq_epi16_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());2451 return _mm_cmpeq_epi16_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
2461}2452}
24622453
2463static __inline__ __mmask8 __DEFAULT_FN_ATTRS1282454static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
2464_mm_mask_testn_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B)2455_mm_mask_testn_epi16_mask(__mmask8 __U, __m128i __A, __m128i __B) {
2465{
2466 return _mm_mask_cmpeq_epi16_mask (__U, _mm_and_si128(__A, __B), _mm_setzero_si128());2456 return _mm_mask_cmpeq_epi16_mask (__U, _mm_and_si128(__A, __B), _mm_setzero_si128());
2467}2457}
24682458
2469static __inline__ __mmask16 __DEFAULT_FN_ATTRS2562459static __inline__ __mmask16 __DEFAULT_FN_ATTRS256_CONSTEXPR
2470_mm256_testn_epi16_mask (__m256i __A, __m256i __B)2460_mm256_testn_epi16_mask(__m256i __A, __m256i __B) {
2471{
2472 return _mm256_cmpeq_epi16_mask (_mm256_and_si256(__A, __B),2461 return _mm256_cmpeq_epi16_mask (_mm256_and_si256(__A, __B),
2473 _mm256_setzero_si256());2462 _mm256_setzero_si256());
2474}2463}
24752464
2476static __inline__ __mmask16 __DEFAULT_FN_ATTRS2562465static __inline__ __mmask16 __DEFAULT_FN_ATTRS256_CONSTEXPR
2477_mm256_mask_testn_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B)2466_mm256_mask_testn_epi16_mask(__mmask16 __U, __m256i __A, __m256i __B) {
2478{
2479 return _mm256_mask_cmpeq_epi16_mask (__U, _mm256_and_si256 (__A, __B),2467 return _mm256_mask_cmpeq_epi16_mask (__U, _mm256_and_si256 (__A, __B),
2480 _mm256_setzero_si256());2468 _mm256_setzero_si256());
2481}2469}
lib/include/avx512vlintrin.h+80-96
...@@ -1530,120 +1530,120 @@ _mm256_mask_blend_epi64(__mmask8 __U, __m256i __A, __m256i __W) {...@@ -1530,120 +1530,120 @@ _mm256_mask_blend_epi64(__mmask8 __U, __m256i __A, __m256i __W) {
1530 (__v4di) __A);1530 (__v4di) __A);
1531}1531}
15321532
1533static __inline__ __m128d __DEFAULT_FN_ATTRS1281533static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1534_mm_mask_compress_pd (__m128d __W, __mmask8 __U, __m128d __A) {1534_mm_mask_compress_pd(__m128d __W, __mmask8 __U, __m128d __A) {
1535 return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A,1535 return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A,
1536 (__v2df) __W,1536 (__v2df) __W,
1537 (__mmask8) __U);1537 (__mmask8) __U);
1538}1538}
15391539
1540static __inline__ __m128d __DEFAULT_FN_ATTRS1281540static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
1541_mm_maskz_compress_pd (__mmask8 __U, __m128d __A) {1541_mm_maskz_compress_pd(__mmask8 __U, __m128d __A) {
1542 return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A,1542 return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A,
1543 (__v2df)1543 (__v2df)
1544 _mm_setzero_pd (),1544 _mm_setzero_pd (),
1545 (__mmask8) __U);1545 (__mmask8) __U);
1546}1546}
15471547
1548static __inline__ __m256d __DEFAULT_FN_ATTRS2561548static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1549_mm256_mask_compress_pd (__m256d __W, __mmask8 __U, __m256d __A) {1549_mm256_mask_compress_pd(__m256d __W, __mmask8 __U, __m256d __A) {
1550 return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A,1550 return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A,
1551 (__v4df) __W,1551 (__v4df) __W,
1552 (__mmask8) __U);1552 (__mmask8) __U);
1553}1553}
15541554
1555static __inline__ __m256d __DEFAULT_FN_ATTRS2561555static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
1556_mm256_maskz_compress_pd (__mmask8 __U, __m256d __A) {1556_mm256_maskz_compress_pd(__mmask8 __U, __m256d __A) {
1557 return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A,1557 return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A,
1558 (__v4df)1558 (__v4df)
1559 _mm256_setzero_pd (),1559 _mm256_setzero_pd (),
1560 (__mmask8) __U);1560 (__mmask8) __U);
1561}1561}
15621562
1563static __inline__ __m128i __DEFAULT_FN_ATTRS1281563static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1564_mm_mask_compress_epi64 (__m128i __W, __mmask8 __U, __m128i __A) {1564_mm_mask_compress_epi64(__m128i __W, __mmask8 __U, __m128i __A) {
1565 return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A,1565 return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A,
1566 (__v2di) __W,1566 (__v2di) __W,
1567 (__mmask8) __U);1567 (__mmask8) __U);
1568}1568}
15691569
1570static __inline__ __m128i __DEFAULT_FN_ATTRS1281570static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1571_mm_maskz_compress_epi64 (__mmask8 __U, __m128i __A) {1571_mm_maskz_compress_epi64(__mmask8 __U, __m128i __A) {
1572 return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A,1572 return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A,
1573 (__v2di)1573 (__v2di)
1574 _mm_setzero_si128 (),1574 _mm_setzero_si128 (),
1575 (__mmask8) __U);1575 (__mmask8) __U);
1576}1576}
15771577
1578static __inline__ __m256i __DEFAULT_FN_ATTRS2561578static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1579_mm256_mask_compress_epi64 (__m256i __W, __mmask8 __U, __m256i __A) {1579_mm256_mask_compress_epi64(__m256i __W, __mmask8 __U, __m256i __A) {
1580 return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A,1580 return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A,
1581 (__v4di) __W,1581 (__v4di) __W,
1582 (__mmask8) __U);1582 (__mmask8) __U);
1583}1583}
15841584
1585static __inline__ __m256i __DEFAULT_FN_ATTRS2561585static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1586_mm256_maskz_compress_epi64 (__mmask8 __U, __m256i __A) {1586_mm256_maskz_compress_epi64(__mmask8 __U, __m256i __A) {
1587 return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A,1587 return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A,
1588 (__v4di)1588 (__v4di)
1589 _mm256_setzero_si256 (),1589 _mm256_setzero_si256 (),
1590 (__mmask8) __U);1590 (__mmask8) __U);
1591}1591}
15921592
1593static __inline__ __m128 __DEFAULT_FN_ATTRS1281593static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1594_mm_mask_compress_ps (__m128 __W, __mmask8 __U, __m128 __A) {1594_mm_mask_compress_ps(__m128 __W, __mmask8 __U, __m128 __A) {
1595 return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A,1595 return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A,
1596 (__v4sf) __W,1596 (__v4sf) __W,
1597 (__mmask8) __U);1597 (__mmask8) __U);
1598}1598}
15991599
1600static __inline__ __m128 __DEFAULT_FN_ATTRS1281600static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
1601_mm_maskz_compress_ps (__mmask8 __U, __m128 __A) {1601_mm_maskz_compress_ps(__mmask8 __U, __m128 __A) {
1602 return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A,1602 return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A,
1603 (__v4sf)1603 (__v4sf)
1604 _mm_setzero_ps (),1604 _mm_setzero_ps (),
1605 (__mmask8) __U);1605 (__mmask8) __U);
1606}1606}
16071607
1608static __inline__ __m256 __DEFAULT_FN_ATTRS2561608static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1609_mm256_mask_compress_ps (__m256 __W, __mmask8 __U, __m256 __A) {1609_mm256_mask_compress_ps(__m256 __W, __mmask8 __U, __m256 __A) {
1610 return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A,1610 return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A,
1611 (__v8sf) __W,1611 (__v8sf) __W,
1612 (__mmask8) __U);1612 (__mmask8) __U);
1613}1613}
16141614
1615static __inline__ __m256 __DEFAULT_FN_ATTRS2561615static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
1616_mm256_maskz_compress_ps (__mmask8 __U, __m256 __A) {1616_mm256_maskz_compress_ps(__mmask8 __U, __m256 __A) {
1617 return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A,1617 return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A,
1618 (__v8sf)1618 (__v8sf)
1619 _mm256_setzero_ps (),1619 _mm256_setzero_ps (),
1620 (__mmask8) __U);1620 (__mmask8) __U);
1621}1621}
16221622
1623static __inline__ __m128i __DEFAULT_FN_ATTRS1281623static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1624_mm_mask_compress_epi32 (__m128i __W, __mmask8 __U, __m128i __A) {1624_mm_mask_compress_epi32(__m128i __W, __mmask8 __U, __m128i __A) {
1625 return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A,1625 return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A,
1626 (__v4si) __W,1626 (__v4si) __W,
1627 (__mmask8) __U);1627 (__mmask8) __U);
1628}1628}
16291629
1630static __inline__ __m128i __DEFAULT_FN_ATTRS1281630static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
1631_mm_maskz_compress_epi32 (__mmask8 __U, __m128i __A) {1631_mm_maskz_compress_epi32(__mmask8 __U, __m128i __A) {
1632 return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A,1632 return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A,
1633 (__v4si)1633 (__v4si)
1634 _mm_setzero_si128 (),1634 _mm_setzero_si128 (),
1635 (__mmask8) __U);1635 (__mmask8) __U);
1636}1636}
16371637
1638static __inline__ __m256i __DEFAULT_FN_ATTRS2561638static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1639_mm256_mask_compress_epi32 (__m256i __W, __mmask8 __U, __m256i __A) {1639_mm256_mask_compress_epi32(__m256i __W, __mmask8 __U, __m256i __A) {
1640 return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A,1640 return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A,
1641 (__v8si) __W,1641 (__v8si) __W,
1642 (__mmask8) __U);1642 (__mmask8) __U);
1643}1643}
16441644
1645static __inline__ __m256i __DEFAULT_FN_ATTRS2561645static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
1646_mm256_maskz_compress_epi32 (__mmask8 __U, __m256i __A) {1646_mm256_maskz_compress_epi32(__mmask8 __U, __m256i __A) {
1647 return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A,1647 return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A,
1648 (__v8si)1648 (__v8si)
1649 _mm256_setzero_si256 (),1649 _mm256_setzero_si256 (),
...@@ -2250,14 +2250,14 @@ _mm256_maskz_div_ps(__mmask8 __U, __m256 __A, __m256 __B) {...@@ -2250,14 +2250,14 @@ _mm256_maskz_div_ps(__mmask8 __U, __m256 __A, __m256 __B) {
2250 (__v8sf)_mm256_setzero_ps());2250 (__v8sf)_mm256_setzero_ps());
2251}2251}
22522252
2253static __inline__ __m128d __DEFAULT_FN_ATTRS1282253static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2254_mm_mask_expand_pd (__m128d __W, __mmask8 __U, __m128d __A) {2254_mm_mask_expand_pd (__m128d __W, __mmask8 __U, __m128d __A) {
2255 return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A,2255 return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A,
2256 (__v2df) __W,2256 (__v2df) __W,
2257 (__mmask8) __U);2257 (__mmask8) __U);
2258}2258}
22592259
2260static __inline__ __m128d __DEFAULT_FN_ATTRS1282260static __inline__ __m128d __DEFAULT_FN_ATTRS128_CONSTEXPR
2261_mm_maskz_expand_pd (__mmask8 __U, __m128d __A) {2261_mm_maskz_expand_pd (__mmask8 __U, __m128d __A) {
2262 return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A,2262 return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A,
2263 (__v2df)2263 (__v2df)
...@@ -2265,14 +2265,14 @@ _mm_maskz_expand_pd (__mmask8 __U, __m128d __A) {...@@ -2265,14 +2265,14 @@ _mm_maskz_expand_pd (__mmask8 __U, __m128d __A) {
2265 (__mmask8) __U);2265 (__mmask8) __U);
2266}2266}
22672267
2268static __inline__ __m256d __DEFAULT_FN_ATTRS2562268static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2269_mm256_mask_expand_pd (__m256d __W, __mmask8 __U, __m256d __A) {2269_mm256_mask_expand_pd (__m256d __W, __mmask8 __U, __m256d __A) {
2270 return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A,2270 return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A,
2271 (__v4df) __W,2271 (__v4df) __W,
2272 (__mmask8) __U);2272 (__mmask8) __U);
2273}2273}
22742274
2275static __inline__ __m256d __DEFAULT_FN_ATTRS2562275static __inline__ __m256d __DEFAULT_FN_ATTRS256_CONSTEXPR
2276_mm256_maskz_expand_pd (__mmask8 __U, __m256d __A) {2276_mm256_maskz_expand_pd (__mmask8 __U, __m256d __A) {
2277 return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A,2277 return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A,
2278 (__v4df)2278 (__v4df)
...@@ -2280,14 +2280,14 @@ _mm256_maskz_expand_pd (__mmask8 __U, __m256d __A) {...@@ -2280,14 +2280,14 @@ _mm256_maskz_expand_pd (__mmask8 __U, __m256d __A) {
2280 (__mmask8) __U);2280 (__mmask8) __U);
2281}2281}
22822282
2283static __inline__ __m128i __DEFAULT_FN_ATTRS1282283static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2284_mm_mask_expand_epi64 (__m128i __W, __mmask8 __U, __m128i __A) {2284_mm_mask_expand_epi64 (__m128i __W, __mmask8 __U, __m128i __A) {
2285 return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A,2285 return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A,
2286 (__v2di) __W,2286 (__v2di) __W,
2287 (__mmask8) __U);2287 (__mmask8) __U);
2288}2288}
22892289
2290static __inline__ __m128i __DEFAULT_FN_ATTRS1282290static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2291_mm_maskz_expand_epi64 (__mmask8 __U, __m128i __A) {2291_mm_maskz_expand_epi64 (__mmask8 __U, __m128i __A) {
2292 return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A,2292 return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A,
2293 (__v2di)2293 (__v2di)
...@@ -2295,14 +2295,14 @@ _mm_maskz_expand_epi64 (__mmask8 __U, __m128i __A) {...@@ -2295,14 +2295,14 @@ _mm_maskz_expand_epi64 (__mmask8 __U, __m128i __A) {
2295 (__mmask8) __U);2295 (__mmask8) __U);
2296}2296}
22972297
2298static __inline__ __m256i __DEFAULT_FN_ATTRS2562298static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2299_mm256_mask_expand_epi64 (__m256i __W, __mmask8 __U, __m256i __A) {2299_mm256_mask_expand_epi64 (__m256i __W, __mmask8 __U, __m256i __A) {
2300 return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A,2300 return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A,
2301 (__v4di) __W,2301 (__v4di) __W,
2302 (__mmask8) __U);2302 (__mmask8) __U);
2303}2303}
23042304
2305static __inline__ __m256i __DEFAULT_FN_ATTRS2562305static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2306_mm256_maskz_expand_epi64 (__mmask8 __U, __m256i __A) {2306_mm256_maskz_expand_epi64 (__mmask8 __U, __m256i __A) {
2307 return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A,2307 return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A,
2308 (__v4di)2308 (__v4di)
...@@ -2445,14 +2445,14 @@ _mm256_maskz_expandloadu_epi32 (__mmask8 __U, void const *__P) {...@@ -2445,14 +2445,14 @@ _mm256_maskz_expandloadu_epi32 (__mmask8 __U, void const *__P) {
2445 __U);2445 __U);
2446}2446}
24472447
2448static __inline__ __m128 __DEFAULT_FN_ATTRS1282448static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2449_mm_mask_expand_ps (__m128 __W, __mmask8 __U, __m128 __A) {2449_mm_mask_expand_ps (__m128 __W, __mmask8 __U, __m128 __A) {
2450 return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A,2450 return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A,
2451 (__v4sf) __W,2451 (__v4sf) __W,
2452 (__mmask8) __U);2452 (__mmask8) __U);
2453}2453}
24542454
2455static __inline__ __m128 __DEFAULT_FN_ATTRS1282455static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR
2456_mm_maskz_expand_ps (__mmask8 __U, __m128 __A) {2456_mm_maskz_expand_ps (__mmask8 __U, __m128 __A) {
2457 return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A,2457 return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A,
2458 (__v4sf)2458 (__v4sf)
...@@ -2460,14 +2460,14 @@ _mm_maskz_expand_ps (__mmask8 __U, __m128 __A) {...@@ -2460,14 +2460,14 @@ _mm_maskz_expand_ps (__mmask8 __U, __m128 __A) {
2460 (__mmask8) __U);2460 (__mmask8) __U);
2461}2461}
24622462
2463static __inline__ __m256 __DEFAULT_FN_ATTRS2562463static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2464_mm256_mask_expand_ps (__m256 __W, __mmask8 __U, __m256 __A) {2464_mm256_mask_expand_ps (__m256 __W, __mmask8 __U, __m256 __A) {
2465 return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A,2465 return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A,
2466 (__v8sf) __W,2466 (__v8sf) __W,
2467 (__mmask8) __U);2467 (__mmask8) __U);
2468}2468}
24692469
2470static __inline__ __m256 __DEFAULT_FN_ATTRS2562470static __inline__ __m256 __DEFAULT_FN_ATTRS256_CONSTEXPR
2471_mm256_maskz_expand_ps (__mmask8 __U, __m256 __A) {2471_mm256_maskz_expand_ps (__mmask8 __U, __m256 __A) {
2472 return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A,2472 return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A,
2473 (__v8sf)2473 (__v8sf)
...@@ -2475,14 +2475,14 @@ _mm256_maskz_expand_ps (__mmask8 __U, __m256 __A) {...@@ -2475,14 +2475,14 @@ _mm256_maskz_expand_ps (__mmask8 __U, __m256 __A) {
2475 (__mmask8) __U);2475 (__mmask8) __U);
2476}2476}
24772477
2478static __inline__ __m128i __DEFAULT_FN_ATTRS1282478static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2479_mm_mask_expand_epi32 (__m128i __W, __mmask8 __U, __m128i __A) {2479_mm_mask_expand_epi32 (__m128i __W, __mmask8 __U, __m128i __A) {
2480 return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A,2480 return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A,
2481 (__v4si) __W,2481 (__v4si) __W,
2482 (__mmask8) __U);2482 (__mmask8) __U);
2483}2483}
24842484
2485static __inline__ __m128i __DEFAULT_FN_ATTRS1282485static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
2486_mm_maskz_expand_epi32 (__mmask8 __U, __m128i __A) {2486_mm_maskz_expand_epi32 (__mmask8 __U, __m128i __A) {
2487 return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A,2487 return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A,
2488 (__v4si)2488 (__v4si)
...@@ -2490,14 +2490,14 @@ _mm_maskz_expand_epi32 (__mmask8 __U, __m128i __A) {...@@ -2490,14 +2490,14 @@ _mm_maskz_expand_epi32 (__mmask8 __U, __m128i __A) {
2490 (__mmask8) __U);2490 (__mmask8) __U);
2491}2491}
24922492
2493static __inline__ __m256i __DEFAULT_FN_ATTRS2562493static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2494_mm256_mask_expand_epi32 (__m256i __W, __mmask8 __U, __m256i __A) {2494_mm256_mask_expand_epi32 (__m256i __W, __mmask8 __U, __m256i __A) {
2495 return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A,2495 return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A,
2496 (__v8si) __W,2496 (__v8si) __W,
2497 (__mmask8) __U);2497 (__mmask8) __U);
2498}2498}
24992499
2500static __inline__ __m256i __DEFAULT_FN_ATTRS2562500static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
2501_mm256_maskz_expand_epi32 (__mmask8 __U, __m256i __A) {2501_mm256_maskz_expand_epi32 (__mmask8 __U, __m256i __A) {
2502 return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A,2502 return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A,
2503 (__v8si)2503 (__v8si)
...@@ -5887,110 +5887,94 @@ _mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C) {...@@ -5887,110 +5887,94 @@ _mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C) {
5887 (__v8sf)_mm256_setzero_ps());5887 (__v8sf)_mm256_setzero_ps());
5888}5888}
58895889
5890static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285890static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5891_mm_test_epi32_mask (__m128i __A, __m128i __B)5891_mm_test_epi32_mask(__m128i __A, __m128i __B) {
5892{
5893 return _mm_cmpneq_epi32_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());5892 return _mm_cmpneq_epi32_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
5894}5893}
58955894
5896static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285895static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5897_mm_mask_test_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B)5896_mm_mask_test_epi32_mask(__mmask8 __U, __m128i __A, __m128i __B) {
5898{
5899 return _mm_mask_cmpneq_epi32_mask (__U, _mm_and_si128 (__A, __B),5897 return _mm_mask_cmpneq_epi32_mask (__U, _mm_and_si128 (__A, __B),
5900 _mm_setzero_si128());5898 _mm_setzero_si128());
5901}5899}
59025900
5903static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565901static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5904_mm256_test_epi32_mask (__m256i __A, __m256i __B)5902_mm256_test_epi32_mask(__m256i __A, __m256i __B) {
5905{
5906 return _mm256_cmpneq_epi32_mask (_mm256_and_si256 (__A, __B),5903 return _mm256_cmpneq_epi32_mask (_mm256_and_si256 (__A, __B),
5907 _mm256_setzero_si256());5904 _mm256_setzero_si256());
5908}5905}
59095906
5910static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565907static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5911_mm256_mask_test_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B)5908_mm256_mask_test_epi32_mask(__mmask8 __U, __m256i __A, __m256i __B) {
5912{
5913 return _mm256_mask_cmpneq_epi32_mask (__U, _mm256_and_si256 (__A, __B),5909 return _mm256_mask_cmpneq_epi32_mask (__U, _mm256_and_si256 (__A, __B),
5914 _mm256_setzero_si256());5910 _mm256_setzero_si256());
5915}5911}
59165912
5917static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285913static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5918_mm_test_epi64_mask (__m128i __A, __m128i __B)5914_mm_test_epi64_mask(__m128i __A, __m128i __B) {
5919{
5920 return _mm_cmpneq_epi64_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());5915 return _mm_cmpneq_epi64_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
5921}5916}
59225917
5923static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285918static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5924_mm_mask_test_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B)5919_mm_mask_test_epi64_mask(__mmask8 __U, __m128i __A, __m128i __B) {
5925{
5926 return _mm_mask_cmpneq_epi64_mask (__U, _mm_and_si128 (__A, __B),5920 return _mm_mask_cmpneq_epi64_mask (__U, _mm_and_si128 (__A, __B),
5927 _mm_setzero_si128());5921 _mm_setzero_si128());
5928}5922}
59295923
5930static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565924static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5931_mm256_test_epi64_mask (__m256i __A, __m256i __B)5925_mm256_test_epi64_mask(__m256i __A, __m256i __B) {
5932{
5933 return _mm256_cmpneq_epi64_mask (_mm256_and_si256 (__A, __B),5926 return _mm256_cmpneq_epi64_mask (_mm256_and_si256 (__A, __B),
5934 _mm256_setzero_si256());5927 _mm256_setzero_si256());
5935}5928}
59365929
5937static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565930static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5938_mm256_mask_test_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B)5931_mm256_mask_test_epi64_mask(__mmask8 __U, __m256i __A, __m256i __B) {
5939{
5940 return _mm256_mask_cmpneq_epi64_mask (__U, _mm256_and_si256 (__A, __B),5932 return _mm256_mask_cmpneq_epi64_mask (__U, _mm256_and_si256 (__A, __B),
5941 _mm256_setzero_si256());5933 _mm256_setzero_si256());
5942}5934}
59435935
5944static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285936static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5945_mm_testn_epi32_mask (__m128i __A, __m128i __B)5937_mm_testn_epi32_mask(__m128i __A, __m128i __B) {
5946{
5947 return _mm_cmpeq_epi32_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());5938 return _mm_cmpeq_epi32_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
5948}5939}
59495940
5950static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285941static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5951_mm_mask_testn_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B)5942_mm_mask_testn_epi32_mask(__mmask8 __U, __m128i __A, __m128i __B) {
5952{
5953 return _mm_mask_cmpeq_epi32_mask (__U, _mm_and_si128 (__A, __B),5943 return _mm_mask_cmpeq_epi32_mask (__U, _mm_and_si128 (__A, __B),
5954 _mm_setzero_si128());5944 _mm_setzero_si128());
5955}5945}
59565946
5957static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565947static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5958_mm256_testn_epi32_mask (__m256i __A, __m256i __B)5948_mm256_testn_epi32_mask(__m256i __A, __m256i __B) {
5959{
5960 return _mm256_cmpeq_epi32_mask (_mm256_and_si256 (__A, __B),5949 return _mm256_cmpeq_epi32_mask (_mm256_and_si256 (__A, __B),
5961 _mm256_setzero_si256());5950 _mm256_setzero_si256());
5962}5951}
59635952
5964static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565953static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5965_mm256_mask_testn_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B)5954_mm256_mask_testn_epi32_mask(__mmask8 __U, __m256i __A, __m256i __B) {
5966{
5967 return _mm256_mask_cmpeq_epi32_mask (__U, _mm256_and_si256 (__A, __B),5955 return _mm256_mask_cmpeq_epi32_mask (__U, _mm256_and_si256 (__A, __B),
5968 _mm256_setzero_si256());5956 _mm256_setzero_si256());
5969}5957}
59705958
5971static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285959static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5972_mm_testn_epi64_mask (__m128i __A, __m128i __B)5960_mm_testn_epi64_mask(__m128i __A, __m128i __B) {
5973{
5974 return _mm_cmpeq_epi64_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());5961 return _mm_cmpeq_epi64_mask (_mm_and_si128 (__A, __B), _mm_setzero_si128());
5975}5962}
59765963
5977static __inline__ __mmask8 __DEFAULT_FN_ATTRS1285964static __inline__ __mmask8 __DEFAULT_FN_ATTRS128_CONSTEXPR
5978_mm_mask_testn_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B)5965_mm_mask_testn_epi64_mask(__mmask8 __U, __m128i __A, __m128i __B) {
5979{
5980 return _mm_mask_cmpeq_epi64_mask (__U, _mm_and_si128 (__A, __B),5966 return _mm_mask_cmpeq_epi64_mask (__U, _mm_and_si128 (__A, __B),
5981 _mm_setzero_si128());5967 _mm_setzero_si128());
5982}5968}
59835969
5984static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565970static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5985_mm256_testn_epi64_mask (__m256i __A, __m256i __B)5971_mm256_testn_epi64_mask(__m256i __A, __m256i __B) {
5986{
5987 return _mm256_cmpeq_epi64_mask (_mm256_and_si256 (__A, __B),5972 return _mm256_cmpeq_epi64_mask (_mm256_and_si256 (__A, __B),
5988 _mm256_setzero_si256());5973 _mm256_setzero_si256());
5989}5974}
59905975
5991static __inline__ __mmask8 __DEFAULT_FN_ATTRS2565976static __inline__ __mmask8 __DEFAULT_FN_ATTRS256_CONSTEXPR
5992_mm256_mask_testn_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B)5977_mm256_mask_testn_epi64_mask(__mmask8 __U, __m256i __A, __m256i __B) {
5993{
5994 return _mm256_mask_cmpeq_epi64_mask (__U, _mm256_and_si256 (__A, __B),5978 return _mm256_mask_cmpeq_epi64_mask (__U, _mm256_and_si256 (__A, __B),
5995 _mm256_setzero_si256());5979 _mm256_setzero_si256());
5996}5980}
lib/include/avx512vlvbmi2intrin.h+24-32
...@@ -32,33 +32,29 @@...@@ -32,33 +32,29 @@
32#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS25632#define __DEFAULT_FN_ATTRS256_CONSTEXPR __DEFAULT_FN_ATTRS256
33#endif33#endif
3434
35static __inline__ __m128i __DEFAULT_FN_ATTRS12835static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
36_mm_mask_compress_epi16(__m128i __S, __mmask8 __U, __m128i __D)36_mm_mask_compress_epi16(__m128i __S, __mmask8 __U, __m128i __D) {
37{
38 return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D,37 return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D,
39 (__v8hi) __S,38 (__v8hi) __S,
40 __U);39 __U);
41}40}
4241
43static __inline__ __m128i __DEFAULT_FN_ATTRS12842static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
44_mm_maskz_compress_epi16(__mmask8 __U, __m128i __D)43_mm_maskz_compress_epi16(__mmask8 __U, __m128i __D) {
45{
46 return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D,44 return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D,
47 (__v8hi) _mm_setzero_si128(),45 (__v8hi) _mm_setzero_si128(),
48 __U);46 __U);
49}47}
5048
51static __inline__ __m128i __DEFAULT_FN_ATTRS12849static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
52_mm_mask_compress_epi8(__m128i __S, __mmask16 __U, __m128i __D)50_mm_mask_compress_epi8(__m128i __S, __mmask16 __U, __m128i __D) {
53{
54 return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D,51 return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D,
55 (__v16qi) __S,52 (__v16qi) __S,
56 __U);53 __U);
57}54}
5855
59static __inline__ __m128i __DEFAULT_FN_ATTRS12856static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
60_mm_maskz_compress_epi8(__mmask16 __U, __m128i __D)57_mm_maskz_compress_epi8(__mmask16 __U, __m128i __D) {
61{
62 return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D,58 return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D,
63 (__v16qi) _mm_setzero_si128(),59 (__v16qi) _mm_setzero_si128(),
64 __U);60 __U);
...@@ -78,7 +74,7 @@ _mm_mask_compressstoreu_epi8(void *__P, __mmask16 __U, __m128i __D)...@@ -78,7 +74,7 @@ _mm_mask_compressstoreu_epi8(void *__P, __mmask16 __U, __m128i __D)
78 __U);74 __U);
79}75}
8076
81static __inline__ __m128i __DEFAULT_FN_ATTRS12877static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
82_mm_mask_expand_epi16(__m128i __S, __mmask8 __U, __m128i __D)78_mm_mask_expand_epi16(__m128i __S, __mmask8 __U, __m128i __D)
83{79{
84 return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D,80 return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D,
...@@ -86,7 +82,7 @@ _mm_mask_expand_epi16(__m128i __S, __mmask8 __U, __m128i __D)...@@ -86,7 +82,7 @@ _mm_mask_expand_epi16(__m128i __S, __mmask8 __U, __m128i __D)
86 __U);82 __U);
87}83}
8884
89static __inline__ __m128i __DEFAULT_FN_ATTRS12885static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
90_mm_maskz_expand_epi16(__mmask8 __U, __m128i __D)86_mm_maskz_expand_epi16(__mmask8 __U, __m128i __D)
91{87{
92 return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D,88 return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D,
...@@ -94,7 +90,7 @@ _mm_maskz_expand_epi16(__mmask8 __U, __m128i __D)...@@ -94,7 +90,7 @@ _mm_maskz_expand_epi16(__mmask8 __U, __m128i __D)
94 __U);90 __U);
95}91}
9692
97static __inline__ __m128i __DEFAULT_FN_ATTRS12893static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
98_mm_mask_expand_epi8(__m128i __S, __mmask16 __U, __m128i __D)94_mm_mask_expand_epi8(__m128i __S, __mmask16 __U, __m128i __D)
99{95{
100 return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D,96 return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D,
...@@ -102,7 +98,7 @@ _mm_mask_expand_epi8(__m128i __S, __mmask16 __U, __m128i __D)...@@ -102,7 +98,7 @@ _mm_mask_expand_epi8(__m128i __S, __mmask16 __U, __m128i __D)
102 __U);98 __U);
103}99}
104100
105static __inline__ __m128i __DEFAULT_FN_ATTRS128101static __inline__ __m128i __DEFAULT_FN_ATTRS128_CONSTEXPR
106_mm_maskz_expand_epi8(__mmask16 __U, __m128i __D)102_mm_maskz_expand_epi8(__mmask16 __U, __m128i __D)
107{103{
108 return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D,104 return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D,
...@@ -142,33 +138,29 @@ _mm_maskz_expandloadu_epi8(__mmask16 __U, void const *__P)...@@ -142,33 +138,29 @@ _mm_maskz_expandloadu_epi8(__mmask16 __U, void const *__P)
142 __U);138 __U);
143}139}
144140
145static __inline__ __m256i __DEFAULT_FN_ATTRS256141static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
146_mm256_mask_compress_epi16(__m256i __S, __mmask16 __U, __m256i __D)142_mm256_mask_compress_epi16(__m256i __S, __mmask16 __U, __m256i __D) {
147{
148 return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D,143 return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D,
149 (__v16hi) __S,144 (__v16hi) __S,
150 __U);145 __U);
151}146}
152147
153static __inline__ __m256i __DEFAULT_FN_ATTRS256148static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
154_mm256_maskz_compress_epi16(__mmask16 __U, __m256i __D)149_mm256_maskz_compress_epi16(__mmask16 __U, __m256i __D) {
155{
156 return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D,150 return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D,
157 (__v16hi) _mm256_setzero_si256(),151 (__v16hi) _mm256_setzero_si256(),
158 __U);152 __U);
159}153}
160154
161static __inline__ __m256i __DEFAULT_FN_ATTRS256155static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
162_mm256_mask_compress_epi8(__m256i __S, __mmask32 __U, __m256i __D)156_mm256_mask_compress_epi8(__m256i __S, __mmask32 __U, __m256i __D) {
163{
164 return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D,157 return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D,
165 (__v32qi) __S,158 (__v32qi) __S,
166 __U);159 __U);
167}160}
168161
169static __inline__ __m256i __DEFAULT_FN_ATTRS256162static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
170_mm256_maskz_compress_epi8(__mmask32 __U, __m256i __D)163_mm256_maskz_compress_epi8(__mmask32 __U, __m256i __D) {
171{
172 return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D,164 return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D,
173 (__v32qi) _mm256_setzero_si256(),165 (__v32qi) _mm256_setzero_si256(),
174 __U);166 __U);
...@@ -188,7 +180,7 @@ _mm256_mask_compressstoreu_epi8(void *__P, __mmask32 __U, __m256i __D)...@@ -188,7 +180,7 @@ _mm256_mask_compressstoreu_epi8(void *__P, __mmask32 __U, __m256i __D)
188 __U);180 __U);
189}181}
190182
191static __inline__ __m256i __DEFAULT_FN_ATTRS256183static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
192_mm256_mask_expand_epi16(__m256i __S, __mmask16 __U, __m256i __D)184_mm256_mask_expand_epi16(__m256i __S, __mmask16 __U, __m256i __D)
193{185{
194 return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D,186 return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D,
...@@ -196,7 +188,7 @@ _mm256_mask_expand_epi16(__m256i __S, __mmask16 __U, __m256i __D)...@@ -196,7 +188,7 @@ _mm256_mask_expand_epi16(__m256i __S, __mmask16 __U, __m256i __D)
196 __U);188 __U);
197}189}
198190
199static __inline__ __m256i __DEFAULT_FN_ATTRS256191static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
200_mm256_maskz_expand_epi16(__mmask16 __U, __m256i __D)192_mm256_maskz_expand_epi16(__mmask16 __U, __m256i __D)
201{193{
202 return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D,194 return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D,
...@@ -204,7 +196,7 @@ _mm256_maskz_expand_epi16(__mmask16 __U, __m256i __D)...@@ -204,7 +196,7 @@ _mm256_maskz_expand_epi16(__mmask16 __U, __m256i __D)
204 __U);196 __U);
205}197}
206198
207static __inline__ __m256i __DEFAULT_FN_ATTRS256199static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
208_mm256_mask_expand_epi8(__m256i __S, __mmask32 __U, __m256i __D)200_mm256_mask_expand_epi8(__m256i __S, __mmask32 __U, __m256i __D)
209{201{
210 return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D,202 return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D,
...@@ -212,7 +204,7 @@ _mm256_mask_expand_epi8(__m256i __S, __mmask32 __U, __m256i __D)...@@ -212,7 +204,7 @@ _mm256_mask_expand_epi8(__m256i __S, __mmask32 __U, __m256i __D)
212 __U);204 __U);
213}205}
214206
215static __inline__ __m256i __DEFAULT_FN_ATTRS256207static __inline__ __m256i __DEFAULT_FN_ATTRS256_CONSTEXPR
216_mm256_maskz_expand_epi8(__mmask32 __U, __m256i __D)208_mm256_maskz_expand_epi8(__mmask32 __U, __m256i __D)
217{209{
218 return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D,210 return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D,
lib/include/avx512vlvnniintrin.h+29-34
...@@ -15,6 +15,16 @@...@@ -15,6 +15,16 @@
15#define __AVX512VLVNNIINTRIN_H15#define __AVX512VLVNNIINTRIN_H
1616
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#if defined(__cplusplus) && (__cplusplus >= 201103L)
19#define __DEFAULT_FN_ATTRS128 \
20 __attribute__((__always_inline__, __nodebug__, \
21 __target__("avx512vl,avx512vnni"), \
22 __min_vector_width__(128))) constexpr
23#define __DEFAULT_FN_ATTRS256 \
24 __attribute__((__always_inline__, __nodebug__, \
25 __target__("avx512vl,avx512vnni"), \
26 __min_vector_width__(256))) constexpr
27#else
18#define __DEFAULT_FN_ATTRS128 \28#define __DEFAULT_FN_ATTRS128 \
19 __attribute__((__always_inline__, __nodebug__, \29 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512vl,avx512vnni"), \30 __target__("avx512vl,avx512vnni"), \
...@@ -23,6 +33,7 @@...@@ -23,6 +33,7 @@
23 __attribute__((__always_inline__, __nodebug__, \33 __attribute__((__always_inline__, __nodebug__, \
24 __target__("avx512vl,avx512vnni"), \34 __target__("avx512vl,avx512vnni"), \
25 __min_vector_width__(256)))35 __min_vector_width__(256)))
36#endif
2637
27/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with38/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
28/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed39/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
...@@ -180,128 +191,112 @@...@@ -180,128 +191,112 @@
180 ((__m128i)__builtin_ia32_vpdpwssds128((__v4si)(S), (__v8hi)(A), (__v8hi)(B)))191 ((__m128i)__builtin_ia32_vpdpwssds128((__v4si)(S), (__v8hi)(A), (__v8hi)(B)))
181192
182static __inline__ __m256i __DEFAULT_FN_ATTRS256193static __inline__ __m256i __DEFAULT_FN_ATTRS256
183_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)194_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) {
184{
185 return (__m256i)__builtin_ia32_selectd_256(__U,195 return (__m256i)__builtin_ia32_selectd_256(__U,
186 (__v8si)_mm256_dpbusd_epi32(__S, __A, __B),196 (__v8si)_mm256_dpbusd_epi32(__S, __A, __B),
187 (__v8si)__S);197 (__v8si)__S);
188}198}
189199
190static __inline__ __m256i __DEFAULT_FN_ATTRS256200static __inline__ __m256i __DEFAULT_FN_ATTRS256
191_mm256_maskz_dpbusd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)201_mm256_maskz_dpbusd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) {
192{
193 return (__m256i)__builtin_ia32_selectd_256(__U,202 return (__m256i)__builtin_ia32_selectd_256(__U,
194 (__v8si)_mm256_dpbusd_epi32(__S, __A, __B),203 (__v8si)_mm256_dpbusd_epi32(__S, __A, __B),
195 (__v8si)_mm256_setzero_si256());204 (__v8si)_mm256_setzero_si256());
196}205}
197206
198static __inline__ __m256i __DEFAULT_FN_ATTRS256207static __inline__ __m256i __DEFAULT_FN_ATTRS256
199_mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)208_mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) {
200{
201 return (__m256i)__builtin_ia32_selectd_256(__U,209 return (__m256i)__builtin_ia32_selectd_256(__U,
202 (__v8si)_mm256_dpbusds_epi32(__S, __A, __B),210 (__v8si)_mm256_dpbusds_epi32(__S, __A, __B),
203 (__v8si)__S);211 (__v8si)__S);
204}212}
205213
206static __inline__ __m256i __DEFAULT_FN_ATTRS256214static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpbusds_epi32(
207_mm256_maskz_dpbusds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)215 __mmask8 __U, __m256i __S, __m256i __A, __m256i __B) {
208{
209 return (__m256i)__builtin_ia32_selectd_256(__U,216 return (__m256i)__builtin_ia32_selectd_256(__U,
210 (__v8si)_mm256_dpbusds_epi32(__S, __A, __B),217 (__v8si)_mm256_dpbusds_epi32(__S, __A, __B),
211 (__v8si)_mm256_setzero_si256());218 (__v8si)_mm256_setzero_si256());
212}219}
213220
214static __inline__ __m256i __DEFAULT_FN_ATTRS256221static __inline__ __m256i __DEFAULT_FN_ATTRS256
215_mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)222_mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) {
216{
217 return (__m256i)__builtin_ia32_selectd_256(__U,223 return (__m256i)__builtin_ia32_selectd_256(__U,
218 (__v8si)_mm256_dpwssd_epi32(__S, __A, __B),224 (__v8si)_mm256_dpwssd_epi32(__S, __A, __B),
219 (__v8si)__S);225 (__v8si)__S);
220}226}
221227
222static __inline__ __m256i __DEFAULT_FN_ATTRS256228static __inline__ __m256i __DEFAULT_FN_ATTRS256
223_mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)229_mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) {
224{
225 return (__m256i)__builtin_ia32_selectd_256(__U,230 return (__m256i)__builtin_ia32_selectd_256(__U,
226 (__v8si)_mm256_dpwssd_epi32(__S, __A, __B),231 (__v8si)_mm256_dpwssd_epi32(__S, __A, __B),
227 (__v8si)_mm256_setzero_si256());232 (__v8si)_mm256_setzero_si256());
228}233}
229234
230static __inline__ __m256i __DEFAULT_FN_ATTRS256235static __inline__ __m256i __DEFAULT_FN_ATTRS256
231_mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)236_mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) {
232{
233 return (__m256i)__builtin_ia32_selectd_256(__U,237 return (__m256i)__builtin_ia32_selectd_256(__U,
234 (__v8si)_mm256_dpwssds_epi32(__S, __A, __B),238 (__v8si)_mm256_dpwssds_epi32(__S, __A, __B),
235 (__v8si)__S);239 (__v8si)__S);
236}240}
237241
238static __inline__ __m256i __DEFAULT_FN_ATTRS256242static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_dpwssds_epi32(
239_mm256_maskz_dpwssds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)243 __mmask8 __U, __m256i __S, __m256i __A, __m256i __B) {
240{
241 return (__m256i)__builtin_ia32_selectd_256(__U,244 return (__m256i)__builtin_ia32_selectd_256(__U,
242 (__v8si)_mm256_dpwssds_epi32(__S, __A, __B),245 (__v8si)_mm256_dpwssds_epi32(__S, __A, __B),
243 (__v8si)_mm256_setzero_si256());246 (__v8si)_mm256_setzero_si256());
244}247}
245248
246static __inline__ __m128i __DEFAULT_FN_ATTRS128249static __inline__ __m128i __DEFAULT_FN_ATTRS128
247_mm_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)250_mm_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) {
248{
249 return (__m128i)__builtin_ia32_selectd_128(__U,251 return (__m128i)__builtin_ia32_selectd_128(__U,
250 (__v4si)_mm_dpbusd_epi32(__S, __A, __B),252 (__v4si)_mm_dpbusd_epi32(__S, __A, __B),
251 (__v4si)__S);253 (__v4si)__S);
252}254}
253255
254static __inline__ __m128i __DEFAULT_FN_ATTRS128256static __inline__ __m128i __DEFAULT_FN_ATTRS128
255_mm_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)257_mm_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) {
256{
257 return (__m128i)__builtin_ia32_selectd_128(__U,258 return (__m128i)__builtin_ia32_selectd_128(__U,
258 (__v4si)_mm_dpbusd_epi32(__S, __A, __B),259 (__v4si)_mm_dpbusd_epi32(__S, __A, __B),
259 (__v4si)_mm_setzero_si128());260 (__v4si)_mm_setzero_si128());
260}261}
261262
262static __inline__ __m128i __DEFAULT_FN_ATTRS128263static __inline__ __m128i __DEFAULT_FN_ATTRS128
263_mm_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)264_mm_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) {
264{
265 return (__m128i)__builtin_ia32_selectd_128(__U,265 return (__m128i)__builtin_ia32_selectd_128(__U,
266 (__v4si)_mm_dpbusds_epi32(__S, __A, __B),266 (__v4si)_mm_dpbusds_epi32(__S, __A, __B),
267 (__v4si)__S);267 (__v4si)__S);
268}268}
269269
270static __inline__ __m128i __DEFAULT_FN_ATTRS128270static __inline__ __m128i __DEFAULT_FN_ATTRS128
271_mm_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)271_mm_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) {
272{
273 return (__m128i)__builtin_ia32_selectd_128(__U,272 return (__m128i)__builtin_ia32_selectd_128(__U,
274 (__v4si)_mm_dpbusds_epi32(__S, __A, __B),273 (__v4si)_mm_dpbusds_epi32(__S, __A, __B),
275 (__v4si)_mm_setzero_si128());274 (__v4si)_mm_setzero_si128());
276}275}
277276
278static __inline__ __m128i __DEFAULT_FN_ATTRS128277static __inline__ __m128i __DEFAULT_FN_ATTRS128
279_mm_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)278_mm_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) {
280{
281 return (__m128i)__builtin_ia32_selectd_128(__U,279 return (__m128i)__builtin_ia32_selectd_128(__U,
282 (__v4si)_mm_dpwssd_epi32(__S, __A, __B),280 (__v4si)_mm_dpwssd_epi32(__S, __A, __B),
283 (__v4si)__S);281 (__v4si)__S);
284}282}
285283
286static __inline__ __m128i __DEFAULT_FN_ATTRS128284static __inline__ __m128i __DEFAULT_FN_ATTRS128
287_mm_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)285_mm_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) {
288{
289 return (__m128i)__builtin_ia32_selectd_128(__U,286 return (__m128i)__builtin_ia32_selectd_128(__U,
290 (__v4si)_mm_dpwssd_epi32(__S, __A, __B),287 (__v4si)_mm_dpwssd_epi32(__S, __A, __B),
291 (__v4si)_mm_setzero_si128());288 (__v4si)_mm_setzero_si128());
292}289}
293290
294static __inline__ __m128i __DEFAULT_FN_ATTRS128291static __inline__ __m128i __DEFAULT_FN_ATTRS128
295_mm_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)292_mm_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) {
296{
297 return (__m128i)__builtin_ia32_selectd_128(__U,293 return (__m128i)__builtin_ia32_selectd_128(__U,
298 (__v4si)_mm_dpwssds_epi32(__S, __A, __B),294 (__v4si)_mm_dpwssds_epi32(__S, __A, __B),
299 (__v4si)__S);295 (__v4si)__S);
300}296}
301297
302static __inline__ __m128i __DEFAULT_FN_ATTRS128298static __inline__ __m128i __DEFAULT_FN_ATTRS128
303_mm_maskz_dpwssds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)299_mm_maskz_dpwssds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) {
304{
305 return (__m128i)__builtin_ia32_selectd_128(__U,300 return (__m128i)__builtin_ia32_selectd_128(__U,
306 (__v4si)_mm_dpwssds_epi32(__S, __A, __B),301 (__v4si)_mm_dpwssds_epi32(__S, __A, __B),
307 (__v4si)_mm_setzero_si128());302 (__v4si)_mm_setzero_si128());
lib/include/avx512vnniintrin.h+32-35
...@@ -15,102 +15,99 @@...@@ -15,102 +15,99 @@
15#define __AVX512VNNIINTRIN_H15#define __AVX512VNNIINTRIN_H
1616
17/* Define the default attributes for the functions in this file. */17/* Define the default attributes for the functions in this file. */
18#if defined(__cplusplus) && (__cplusplus >= 201103L)
19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"), \
21 __min_vector_width__(512))) constexpr
22#else
18#define __DEFAULT_FN_ATTRS \23#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"), \24 __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"), \
20 __min_vector_width__(512)))25 __min_vector_width__(512)))
26#endif
2127
22static __inline__ __m512i __DEFAULT_FN_ATTRS28static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbusd_epi32(__m512i __S,
23_mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B)29 __m512i __A,
24{30 __m512i __B) {
25 return (__m512i)__builtin_ia32_vpdpbusd512((__v16si)__S, (__v64qu)__A,31 return (__m512i)__builtin_ia32_vpdpbusd512((__v16si)__S, (__v64qu)__A,
26 (__v64qi)__B);32 (__v64qi)__B);
27}33}
2834
29static __inline__ __m512i __DEFAULT_FN_ATTRS35static __inline__ __m512i __DEFAULT_FN_ATTRS
30_mm512_mask_dpbusd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)36_mm512_mask_dpbusd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) {
31{
32 return (__m512i)__builtin_ia32_selectd_512(__U,37 return (__m512i)__builtin_ia32_selectd_512(__U,
33 (__v16si)_mm512_dpbusd_epi32(__S, __A, __B),38 (__v16si)_mm512_dpbusd_epi32(__S, __A, __B),
34 (__v16si)__S);39 (__v16si)__S);
35}40}
3641
37static __inline__ __m512i __DEFAULT_FN_ATTRS42static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbusd_epi32(
38_mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)43 __mmask16 __U, __m512i __S, __m512i __A, __m512i __B) {
39{
40 return (__m512i)__builtin_ia32_selectd_512(__U,44 return (__m512i)__builtin_ia32_selectd_512(__U,
41 (__v16si)_mm512_dpbusd_epi32(__S, __A, __B),45 (__v16si)_mm512_dpbusd_epi32(__S, __A, __B),
42 (__v16si)_mm512_setzero_si512());46 (__v16si)_mm512_setzero_si512());
43}47}
4448
45static __inline__ __m512i __DEFAULT_FN_ATTRS49static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbusds_epi32(__m512i __S,
46_mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B)50 __m512i __A,
47{51 __m512i __B) {
48 return (__m512i)__builtin_ia32_vpdpbusds512((__v16si)__S, (__v64qu)__A,52 return (__m512i)__builtin_ia32_vpdpbusds512((__v16si)__S, (__v64qu)__A,
49 (__v64qi)__B);53 (__v64qi)__B);
50}54}
5155
52static __inline__ __m512i __DEFAULT_FN_ATTRS56static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbusds_epi32(
53_mm512_mask_dpbusds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)57 __m512i __S, __mmask16 __U, __m512i __A, __m512i __B) {
54{
55 return (__m512i)__builtin_ia32_selectd_512(__U,58 return (__m512i)__builtin_ia32_selectd_512(__U,
56 (__v16si)_mm512_dpbusds_epi32(__S, __A, __B),59 (__v16si)_mm512_dpbusds_epi32(__S, __A, __B),
57 (__v16si)__S);60 (__v16si)__S);
58}61}
5962
60static __inline__ __m512i __DEFAULT_FN_ATTRS63static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbusds_epi32(
61_mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)64 __mmask16 __U, __m512i __S, __m512i __A, __m512i __B) {
62{
63 return (__m512i)__builtin_ia32_selectd_512(__U,65 return (__m512i)__builtin_ia32_selectd_512(__U,
64 (__v16si)_mm512_dpbusds_epi32(__S, __A, __B),66 (__v16si)_mm512_dpbusds_epi32(__S, __A, __B),
65 (__v16si)_mm512_setzero_si512());67 (__v16si)_mm512_setzero_si512());
66}68}
6769
68static __inline__ __m512i __DEFAULT_FN_ATTRS70static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwssd_epi32(__m512i __S,
69_mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B)71 __m512i __A,
70{72 __m512i __B) {
71 return (__m512i)__builtin_ia32_vpdpwssd512((__v16si)__S, (__v32hi)__A,73 return (__m512i)__builtin_ia32_vpdpwssd512((__v16si)__S, (__v32hi)__A,
72 (__v32hi)__B);74 (__v32hi)__B);
73}75}
7476
75static __inline__ __m512i __DEFAULT_FN_ATTRS77static __inline__ __m512i __DEFAULT_FN_ATTRS
76_mm512_mask_dpwssd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)78_mm512_mask_dpwssd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) {
77{
78 return (__m512i)__builtin_ia32_selectd_512(__U,79 return (__m512i)__builtin_ia32_selectd_512(__U,
79 (__v16si)_mm512_dpwssd_epi32(__S, __A, __B),80 (__v16si)_mm512_dpwssd_epi32(__S, __A, __B),
80 (__v16si)__S);81 (__v16si)__S);
81}82}
8283
83static __inline__ __m512i __DEFAULT_FN_ATTRS84static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwssd_epi32(
84_mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)85 __mmask16 __U, __m512i __S, __m512i __A, __m512i __B) {
85{
86 return (__m512i)__builtin_ia32_selectd_512(__U,86 return (__m512i)__builtin_ia32_selectd_512(__U,
87 (__v16si)_mm512_dpwssd_epi32(__S, __A, __B),87 (__v16si)_mm512_dpwssd_epi32(__S, __A, __B),
88 (__v16si)_mm512_setzero_si512());88 (__v16si)_mm512_setzero_si512());
89}89}
9090
91static __inline__ __m512i __DEFAULT_FN_ATTRS91static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwssds_epi32(__m512i __S,
92_mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B)92 __m512i __A,
93{93 __m512i __B) {
94 return (__m512i)__builtin_ia32_vpdpwssds512((__v16si)__S, (__v32hi)__A,94 return (__m512i)__builtin_ia32_vpdpwssds512((__v16si)__S, (__v32hi)__A,
95 (__v32hi)__B);95 (__v32hi)__B);
96}96}
9797
98static __inline__ __m512i __DEFAULT_FN_ATTRS98static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwssds_epi32(
99_mm512_mask_dpwssds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)99 __m512i __S, __mmask16 __U, __m512i __A, __m512i __B) {
100{
101 return (__m512i)__builtin_ia32_selectd_512(__U,100 return (__m512i)__builtin_ia32_selectd_512(__U,
102 (__v16si)_mm512_dpwssds_epi32(__S, __A, __B),101 (__v16si)_mm512_dpwssds_epi32(__S, __A, __B),
103 (__v16si)__S);102 (__v16si)__S);
104}103}
105104
106static __inline__ __m512i __DEFAULT_FN_ATTRS105static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwssds_epi32(
107_mm512_maskz_dpwssds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)106 __mmask16 __U, __m512i __S, __m512i __A, __m512i __B) {
108{
109 return (__m512i)__builtin_ia32_selectd_512(__U,107 return (__m512i)__builtin_ia32_selectd_512(__U,
110 (__v16si)_mm512_dpwssds_epi32(__S, __A, __B),108 (__v16si)_mm512_dpwssds_epi32(__S, __A, __B),
111 (__v16si)_mm512_setzero_si512());109 (__v16si)_mm512_setzero_si512());
112}110}
113111
114#undef __DEFAULT_FN_ATTRS112#undef __DEFAULT_FN_ATTRS
115
116#endif113#endif
lib/include/avx512vp2intersectintrin.h+1-1
...@@ -22,7 +22,7 @@...@@ -22,7 +22,7 @@
22 *===-----------------------------------------------------------------------===22 *===-----------------------------------------------------------------------===
23 */23 */
24#ifndef __IMMINTRIN_H24#ifndef __IMMINTRIN_H
25#error "Never use <avx512vp2intersect.h> directly; include <immintrin.h> instead."25#error "Never use <avx512vp2intersectintrin.h> directly; include <immintrin.h> instead."
26#endif26#endif
2727
28#ifndef _AVX512VP2INTERSECT_H28#ifndef _AVX512VP2INTERSECT_H
lib/include/avxvnniintrin.h+23-18
...@@ -40,8 +40,21 @@...@@ -40,8 +40,21 @@
4040
41/* Intrinsics with _avx_ prefix are for compatibility with msvc. */41/* Intrinsics with _avx_ prefix are for compatibility with msvc. */
42/* Define the default attributes for the functions in this file. */42/* Define the default attributes for the functions in this file. */
43#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), __min_vector_width__(256)))43#if defined(__cplusplus) && (__cplusplus >= 201103L)
44#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), __min_vector_width__(128)))44#define __DEFAULT_FN_ATTRS256 \
45 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), \
46 __min_vector_width__(256))) constexpr
47#define __DEFAULT_FN_ATTRS128 \
48 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), \
49 __min_vector_width__(128))) constexpr
50#else
51#define __DEFAULT_FN_ATTRS256 \
52 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), \
53 __min_vector_width__(256)))
54#define __DEFAULT_FN_ATTRS128 \
55 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), \
56 __min_vector_width__(128)))
57#endif
4558
46/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with59/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
47/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate signed60/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate signed
...@@ -61,8 +74,7 @@...@@ -61,8 +74,7 @@
61/// DST[MAX:256] := 074/// DST[MAX:256] := 0
62/// \endcode75/// \endcode
63static __inline__ __m256i __DEFAULT_FN_ATTRS25676static __inline__ __m256i __DEFAULT_FN_ATTRS256
64_mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)77_mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B) {
65{
66 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v32qu)__A,78 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v32qu)__A,
67 (__v32qi)__B);79 (__v32qi)__B);
68}80}
...@@ -85,8 +97,7 @@ _mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -85,8 +97,7 @@ _mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
85/// DST[MAX:256] := 097/// DST[MAX:256] := 0
86/// \endcode98/// \endcode
87static __inline__ __m256i __DEFAULT_FN_ATTRS25699static __inline__ __m256i __DEFAULT_FN_ATTRS256
88_mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)100_mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B) {
89{
90 return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v32qu)__A,101 return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v32qu)__A,
91 (__v32qi)__B);102 (__v32qi)__B);
92}103}
...@@ -107,8 +118,7 @@ _mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -107,8 +118,7 @@ _mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
107/// DST[MAX:256] := 0118/// DST[MAX:256] := 0
108/// \endcode119/// \endcode
109static __inline__ __m256i __DEFAULT_FN_ATTRS256120static __inline__ __m256i __DEFAULT_FN_ATTRS256
110_mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)121_mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B) {
111{
112 return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v16hi)__A,122 return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v16hi)__A,
113 (__v16hi)__B);123 (__v16hi)__B);
114}124}
...@@ -129,8 +139,7 @@ _mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -129,8 +139,7 @@ _mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
129/// DST[MAX:256] := 0139/// DST[MAX:256] := 0
130/// \endcode140/// \endcode
131static __inline__ __m256i __DEFAULT_FN_ATTRS256141static __inline__ __m256i __DEFAULT_FN_ATTRS256
132_mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)142_mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B) {
133{
134 return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v16hi)__A,143 return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v16hi)__A,
135 (__v16hi)__B);144 (__v16hi)__B);
136}145}
...@@ -153,8 +162,7 @@ _mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)...@@ -153,8 +162,7 @@ _mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
153/// DST[MAX:128] := 0162/// DST[MAX:128] := 0
154/// \endcode163/// \endcode
155static __inline__ __m128i __DEFAULT_FN_ATTRS128164static __inline__ __m128i __DEFAULT_FN_ATTRS128
156_mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)165_mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B) {
157{
158 return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v16qu)__A,166 return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v16qu)__A,
159 (__v16qi)__B);167 (__v16qi)__B);
160}168}
...@@ -177,8 +185,7 @@ _mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)...@@ -177,8 +185,7 @@ _mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
177/// DST[MAX:128] := 0185/// DST[MAX:128] := 0
178/// \endcode186/// \endcode
179static __inline__ __m128i __DEFAULT_FN_ATTRS128187static __inline__ __m128i __DEFAULT_FN_ATTRS128
180_mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)188_mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B) {
181{
182 return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v16qu)__A,189 return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v16qu)__A,
183 (__v16qi)__B);190 (__v16qi)__B);
184}191}
...@@ -199,8 +206,7 @@ _mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)...@@ -199,8 +206,7 @@ _mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
199/// DST[MAX:128] := 0206/// DST[MAX:128] := 0
200/// \endcode207/// \endcode
201static __inline__ __m128i __DEFAULT_FN_ATTRS128208static __inline__ __m128i __DEFAULT_FN_ATTRS128
202_mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)209_mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B) {
203{
204 return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v8hi)__A,210 return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v8hi)__A,
205 (__v8hi)__B);211 (__v8hi)__B);
206}212}
...@@ -221,8 +227,7 @@ _mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)...@@ -221,8 +227,7 @@ _mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
221/// DST[MAX:128] := 0227/// DST[MAX:128] := 0
222/// \endcode228/// \endcode
223static __inline__ __m128i __DEFAULT_FN_ATTRS128229static __inline__ __m128i __DEFAULT_FN_ATTRS128
224_mm_dpwssds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)230_mm_dpwssds_avx_epi32(__m128i __S, __m128i __A, __m128i __B) {
225{
226 return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v8hi)__A,231 return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v8hi)__A,
227 (__v8hi)__B);232 (__v8hi)__B);
228}233}
lib/include/crc32intrin.h+10-8
...@@ -10,8 +10,14 @@...@@ -10,8 +10,14 @@
10#ifndef __CRC32INTRIN_H10#ifndef __CRC32INTRIN_H
11#define __CRC32INTRIN_H11#define __CRC32INTRIN_H
1212
13/// We only declare crc32 as a constexpr if we are compiling C++ code
14#if defined(__cplusplus) && (__cplusplus >= 201103L)
15#define __DEFAULT_FN_ATTRS \
16 __attribute__((__always_inline__, __nodebug__, __target__("crc32"))) constexpr
17#else
13#define __DEFAULT_FN_ATTRS \18#define __DEFAULT_FN_ATTRS \
14 __attribute__((__always_inline__, __nodebug__, __target__("crc32")))19 __attribute__((__always_inline__, __nodebug__, __target__("crc32")))
20#endif
1521
16/// Adds the unsigned integer operand to the CRC-32C checksum of the22/// Adds the unsigned integer operand to the CRC-32C checksum of the
17/// unsigned char operand.23/// unsigned char operand.
...@@ -28,8 +34,7 @@...@@ -28,8 +34,7 @@
28/// \returns The result of adding operand \a __C to the CRC-32C checksum of34/// \returns The result of adding operand \a __C to the CRC-32C checksum of
29/// operand \a __D.35/// operand \a __D.
30static __inline__ unsigned int __DEFAULT_FN_ATTRS36static __inline__ unsigned int __DEFAULT_FN_ATTRS
31_mm_crc32_u8(unsigned int __C, unsigned char __D)37_mm_crc32_u8(unsigned int __C, unsigned char __D) {
32{
33 return __builtin_ia32_crc32qi(__C, __D);38 return __builtin_ia32_crc32qi(__C, __D);
34}39}
3540
...@@ -48,8 +53,7 @@ _mm_crc32_u8(unsigned int __C, unsigned char __D)...@@ -48,8 +53,7 @@ _mm_crc32_u8(unsigned int __C, unsigned char __D)
48/// \returns The result of adding operand \a __C to the CRC-32C checksum of53/// \returns The result of adding operand \a __C to the CRC-32C checksum of
49/// operand \a __D.54/// operand \a __D.
50static __inline__ unsigned int __DEFAULT_FN_ATTRS55static __inline__ unsigned int __DEFAULT_FN_ATTRS
51_mm_crc32_u16(unsigned int __C, unsigned short __D)56_mm_crc32_u16(unsigned int __C, unsigned short __D) {
52{
53 return __builtin_ia32_crc32hi(__C, __D);57 return __builtin_ia32_crc32hi(__C, __D);
54}58}
5559
...@@ -68,8 +72,7 @@ _mm_crc32_u16(unsigned int __C, unsigned short __D)...@@ -68,8 +72,7 @@ _mm_crc32_u16(unsigned int __C, unsigned short __D)
68/// \returns The result of adding operand \a __C to the CRC-32C checksum of72/// \returns The result of adding operand \a __C to the CRC-32C checksum of
69/// operand \a __D.73/// operand \a __D.
70static __inline__ unsigned int __DEFAULT_FN_ATTRS74static __inline__ unsigned int __DEFAULT_FN_ATTRS
71_mm_crc32_u32(unsigned int __C, unsigned int __D)75_mm_crc32_u32(unsigned int __C, unsigned int __D) {
72{
73 return __builtin_ia32_crc32si(__C, __D);76 return __builtin_ia32_crc32si(__C, __D);
74}77}
7578
...@@ -89,8 +92,7 @@ _mm_crc32_u32(unsigned int __C, unsigned int __D)...@@ -89,8 +92,7 @@ _mm_crc32_u32(unsigned int __C, unsigned int __D)
89/// \returns The result of adding operand \a __C to the CRC-32C checksum of92/// \returns The result of adding operand \a __C to the CRC-32C checksum of
90/// operand \a __D.93/// operand \a __D.
91static __inline__ unsigned long long __DEFAULT_FN_ATTRS94static __inline__ unsigned long long __DEFAULT_FN_ATTRS
92_mm_crc32_u64(unsigned long long __C, unsigned long long __D)95_mm_crc32_u64(unsigned long long __C, unsigned long long __D) {
93{
94 return __builtin_ia32_crc32di(__C, __D);96 return __builtin_ia32_crc32di(__C, __D);
95}97}
96#endif /* __x86_64__ */98#endif /* __x86_64__ */
lib/include/emmintrin.h+8-8
...@@ -279,8 +279,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a) {...@@ -279,8 +279,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a) {
279/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the279/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
280/// minimum value between both operands. The upper 64 bits are copied from280/// minimum value between both operands. The upper 64 bits are copied from
281/// the upper 64 bits of the first source operand.281/// the upper 64 bits of the first source operand.
282static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_sd(__m128d __a,282static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_sd(__m128d __a,
283 __m128d __b) {283 __m128d __b) {
284 return __builtin_ia32_minsd((__v2df)__a, (__v2df)__b);284 return __builtin_ia32_minsd((__v2df)__a, (__v2df)__b);
285}285}
286286
...@@ -325,8 +325,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_pd(__m128d __a,...@@ -325,8 +325,8 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_pd(__m128d __a,
325/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the325/// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the
326/// maximum value between both operands. The upper 64 bits are copied from326/// maximum value between both operands. The upper 64 bits are copied from
327/// the upper 64 bits of the first source operand.327/// the upper 64 bits of the first source operand.
328static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_sd(__m128d __a,328static __inline__ __m128d __DEFAULT_FN_ATTRS_CONSTEXPR _mm_max_sd(__m128d __a,
329 __m128d __b) {329 __m128d __b) {
330 return __builtin_ia32_maxsd((__v2df)__a, (__v2df)__b);330 return __builtin_ia32_maxsd((__v2df)__a, (__v2df)__b);
331}331}
332332
...@@ -1343,7 +1343,7 @@ _mm_cvtepi32_pd(__m128i __a) {...@@ -1343,7 +1343,7 @@ _mm_cvtepi32_pd(__m128i __a) {
1343/// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the1343/// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the
1344/// converted values. The upper 64 bits are set to zero.1344/// converted values. The upper 64 bits are set to zero.
1345static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epi32(__m128d __a) {1345static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epi32(__m128d __a) {
1346 return __builtin_ia32_cvtpd2dq((__v2df)__a);1346 return (__m128i)__builtin_ia32_cvtpd2dq((__v2df)__a);
1347}1347}
13481348
1349/// Converts the low-order element of a 128-bit vector of [2 x double]1349/// Converts the low-order element of a 128-bit vector of [2 x double]
...@@ -2481,9 +2481,9 @@ _mm_mul_epu32(__m128i __a, __m128i __b) {...@@ -2481,9 +2481,9 @@ _mm_mul_epu32(__m128i __a, __m128i __b) {
2481/// A 128-bit integer vector containing one of the source operands.2481/// A 128-bit integer vector containing one of the source operands.
2482/// \returns A [2 x i64] vector containing the sums of the sets of absolute2482/// \returns A [2 x i64] vector containing the sums of the sets of absolute
2483/// differences between both operands.2483/// differences between both operands.
2484static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sad_epu8(__m128i __a,2484static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
2485 __m128i __b) {2485_mm_sad_epu8(__m128i __a, __m128i __b) {
2486 return __builtin_ia32_psadbw128((__v16qi)__a, (__v16qi)__b);2486 return __builtin_ia32_psadbw128((__v16qu)__a, (__v16qu)__b);
2487}2487}
24882488
2489/// Subtracts the corresponding 8-bit integer values in the operands.2489/// Subtracts the corresponding 8-bit integer values in the operands.
lib/include/endian.h created+91
...@@ -0,0 +1,91 @@
1//===-- Definition of macros from endian.h --------------------------------===//
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#ifndef __CLANG_ENDIAN_H
10#define __CLANG_ENDIAN_H
11
12// If the system has an endian.h, let's use that instead.
13#if __has_include_next(<endian.h>)
14#include_next <endian.h>
15#else
16
17#include <stdint.h>
18
19// Implementation taken from llvm libc endian-macros.h.
20#ifdef __cplusplus
21#define __CLANG_ENDIAN_CAST(cast, type, value) (cast<type>(value))
22#else
23#define __CLANG_ENDIAN_CAST(cast, type, value) ((type)(value))
24#endif
25
26#define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
27#define BIG_ENDIAN __ORDER_BIG_ENDIAN__
28#define PDP_ENDIAN __ORDER_PDP_ENDIAN__
29#define BYTE_ORDER __BYTE_ORDER__
30
31// Define some compatibility macros if they are not defined.
32#ifndef __BYTE_ORDER
33#define __BYTE_ORDER BYTE_ORDER
34#endif
35#ifndef __LITTLE_ENDIAN
36#define __LITTLE_ENDIAN LITTLE_ENDIAN
37#endif
38#ifndef __BIG_ENDIAN
39#define __BIG_ENDIAN BIG_ENDIAN
40#endif
41#ifndef __PDP_ENDIAN
42#define __PDP_ENDIAN PDP_ENDIAN
43#endif
44
45#if BYTE_ORDER == LITTLE_ENDIAN
46
47#define htobe16(x) \
48 __builtin_bswap16(__CLANG_ENDIAN_CAST(static_cast, uint16_t, x))
49#define htobe32(x) \
50 __builtin_bswap32(__CLANG_ENDIAN_CAST(static_cast, uint32_t, x))
51#define htobe64(x) \
52 __builtin_bswap64(__CLANG_ENDIAN_CAST(static_cast, uint64_t, x))
53#define htole16(x) __CLANG_ENDIAN_CAST(static_cast, uint16_t, x)
54#define htole32(x) __CLANG_ENDIAN_CAST(static_cast, uint32_t, x)
55#define htole64(x) __CLANG_ENDIAN_CAST(static_cast, uint64_t, x)
56#define be16toh(x) \
57 __builtin_bswap16(__CLANG_ENDIAN_CAST(static_cast, uint16_t, x))
58#define be32toh(x) \
59 __builtin_bswap32(__CLANG_ENDIAN_CAST(static_cast, uint32_t, x))
60#define be64toh(x) \
61 __builtin_bswap64(__CLANG_ENDIAN_CAST(static_cast, uint64_t, x))
62#define le16toh(x) __CLANG_ENDIAN_CAST(static_cast, uint16_t, x)
63#define le32toh(x) __CLANG_ENDIAN_CAST(static_cast, uint32_t, x)
64#define le64toh(x) __CLANG_ENDIAN_CAST(static_cast, uint64_t, x)
65
66#elif BYTE_ORDER == BIG_ENDIAN
67
68#define htobe16(x) __CLANG_ENDIAN_CAST(static_cast, uint16_t, x)
69#define htobe32(x) __CLANG_ENDIAN_CAST(static_cast, uint32_t, x)
70#define htobe64(x) __CLANG_ENDIAN_CAST(static_cast, uint64_t, x)
71#define htole16(x) \
72 __builtin_bswap16(__CLANG_ENDIAN_CAST(static_cast, uint16_t, x))
73#define htole32(x) \
74 __builtin_bswap32(__CLANG_ENDIAN_CAST(static_cast, uint32_t, x))
75#define htole64(x) \
76 __builtin_bswap64(__CLANG_ENDIAN_CAST(static_cast, uint64_t, x))
77#define be16toh(x) __CLANG_ENDIAN_CAST(static_cast, uint16_t, x)
78#define be32toh(x) __CLANG_ENDIAN_CAST(static_cast, uint32_t, x)
79#define be64toh(x) __CLANG_ENDIAN_CAST(static_cast, uint64_t, x)
80#define le16toh(x) \
81 __builtin_bswap16(__CLANG_ENDIAN_CAST(static_cast, uint16_t, x))
82#define le32toh(x) \
83 __builtin_bswap32(__CLANG_ENDIAN_CAST(static_cast, uint32_t, x))
84#define le64toh(x) \
85 __builtin_bswap64(__CLANG_ENDIAN_CAST(static_cast, uint64_t, x))
86
87#else
88#error "Unsupported endianness"
89#endif
90#endif // __has_include_next
91#endif // __CLANG_ENDIAN_H
lib/include/hvx_hexagon_protos.h+102-80
...@@ -4577,8 +4577,9 @@...@@ -4577,8 +4577,9 @@
4577#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4577#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4578/* ==========================================================================4578/* ==========================================================================
4579 Assembly Syntax: Vdd32.sf=vadd(Vu32.bf,Vv32.bf)4579 Assembly Syntax: Vdd32.sf=vadd(Vu32.bf,Vv32.bf)
4580 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vadd_VbfVbf(HVX_Vector Vu,4580 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vadd_VbfVbf(HVX_Vector Vu, HVX_Vector Vv)
4581 HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution Slots: SLOT234581 Instruction Type: CVI_VX_DV
4582 Execution Slots: SLOT23
4582 ========================================================================== */4583 ========================================================================== */
45834584
4584#define Q6_Wsf_vadd_VbfVbf(Vu, Vv) \4585#define Q6_Wsf_vadd_VbfVbf(Vu, Vv) \
...@@ -4636,8 +4637,9 @@...@@ -4636,8 +4637,9 @@
4636#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4637#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4637/* ==========================================================================4638/* ==========================================================================
4638 Assembly Syntax: Vd32.bf=vcvt(Vu32.sf,Vv32.sf)4639 Assembly Syntax: Vd32.bf=vcvt(Vu32.sf,Vv32.sf)
4639 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vcvt_VsfVsf(HVX_Vector Vu,4640 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vcvt_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
4640 HVX_Vector Vv) Instruction Type: CVI_VX Execution Slots: SLOT234641 Instruction Type: CVI_VX
4642 Execution Slots: SLOT23
4641 ========================================================================== */4643 ========================================================================== */
46424644
4643#define Q6_Vbf_vcvt_VsfVsf(Vu, Vv) \4645#define Q6_Vbf_vcvt_VsfVsf(Vu, Vv) \
...@@ -4647,8 +4649,9 @@...@@ -4647,8 +4649,9 @@
4647#if __HVX_ARCH__ >= 734649#if __HVX_ARCH__ >= 73
4648/* ==========================================================================4650/* ==========================================================================
4649 Assembly Syntax: Qd4=vcmp.gt(Vu32.bf,Vv32.bf)4651 Assembly Syntax: Qd4=vcmp.gt(Vu32.bf,Vv32.bf)
4650 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VbfVbf(HVX_Vector Vu,4652 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VbfVbf(HVX_Vector Vu, HVX_Vector Vv)
4651 HVX_Vector Vv) Instruction Type: CVI_VA Execution Slots: SLOT01234653 Instruction Type: CVI_VA
4654 Execution Slots: SLOT0123
4652 ========================================================================== */4655 ========================================================================== */
46534656
4654#define Q6_Q_vcmp_gt_VbfVbf(Vu, Vv) \4657#define Q6_Q_vcmp_gt_VbfVbf(Vu, Vv) \
...@@ -4659,9 +4662,9 @@...@@ -4659,9 +4662,9 @@
4659#if __HVX_ARCH__ >= 734662#if __HVX_ARCH__ >= 73
4660/* ==========================================================================4663/* ==========================================================================
4661 Assembly Syntax: Qx4&=vcmp.gt(Vu32.bf,Vv32.bf)4664 Assembly Syntax: Qx4&=vcmp.gt(Vu32.bf,Vv32.bf)
4662 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVbfVbf(HVX_VectorPred4665 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVbfVbf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
4663 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution4666 Instruction Type: CVI_VA
4664 Slots: SLOT01234667 Execution Slots: SLOT0123
4665 ========================================================================== */4668 ========================================================================== */
46664669
4667#define Q6_Q_vcmp_gtand_QVbfVbf(Qx, Vu, Vv) \4670#define Q6_Q_vcmp_gtand_QVbfVbf(Qx, Vu, Vv) \
...@@ -4675,9 +4678,9 @@...@@ -4675,9 +4678,9 @@
4675#if __HVX_ARCH__ >= 734678#if __HVX_ARCH__ >= 73
4676/* ==========================================================================4679/* ==========================================================================
4677 Assembly Syntax: Qx4|=vcmp.gt(Vu32.bf,Vv32.bf)4680 Assembly Syntax: Qx4|=vcmp.gt(Vu32.bf,Vv32.bf)
4678 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVbfVbf(HVX_VectorPred4681 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVbfVbf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
4679 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution4682 Instruction Type: CVI_VA
4680 Slots: SLOT01234683 Execution Slots: SLOT0123
4681 ========================================================================== */4684 ========================================================================== */
46824685
4683#define Q6_Q_vcmp_gtor_QVbfVbf(Qx, Vu, Vv) \4686#define Q6_Q_vcmp_gtor_QVbfVbf(Qx, Vu, Vv) \
...@@ -4691,9 +4694,9 @@...@@ -4691,9 +4694,9 @@
4691#if __HVX_ARCH__ >= 734694#if __HVX_ARCH__ >= 73
4692/* ==========================================================================4695/* ==========================================================================
4693 Assembly Syntax: Qx4^=vcmp.gt(Vu32.bf,Vv32.bf)4696 Assembly Syntax: Qx4^=vcmp.gt(Vu32.bf,Vv32.bf)
4694 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVbfVbf(HVX_VectorPred4697 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVbfVbf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
4695 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution4698 Instruction Type: CVI_VA
4696 Slots: SLOT01234699 Execution Slots: SLOT0123
4697 ========================================================================== */4700 ========================================================================== */
46984701
4699#define Q6_Q_vcmp_gtxacc_QVbfVbf(Qx, Vu, Vv) \4702#define Q6_Q_vcmp_gtxacc_QVbfVbf(Qx, Vu, Vv) \
...@@ -4707,8 +4710,9 @@...@@ -4707,8 +4710,9 @@
4707#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4710#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4708/* ==========================================================================4711/* ==========================================================================
4709 Assembly Syntax: Vd32.bf=vmax(Vu32.bf,Vv32.bf)4712 Assembly Syntax: Vd32.bf=vmax(Vu32.bf,Vv32.bf)
4710 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmax_VbfVbf(HVX_Vector Vu,4713 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmax_VbfVbf(HVX_Vector Vu, HVX_Vector Vv)
4711 HVX_Vector Vv) Instruction Type: CVI_VX_LATE Execution Slots: SLOT234714 Instruction Type: CVI_VX_LATE
4715 Execution Slots: SLOT23
4712 ========================================================================== */4716 ========================================================================== */
47134717
4714#define Q6_Vbf_vmax_VbfVbf(Vu, Vv) \4718#define Q6_Vbf_vmax_VbfVbf(Vu, Vv) \
...@@ -4718,8 +4722,9 @@...@@ -4718,8 +4722,9 @@
4718#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4722#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4719/* ==========================================================================4723/* ==========================================================================
4720 Assembly Syntax: Vd32.bf=vmin(Vu32.bf,Vv32.bf)4724 Assembly Syntax: Vd32.bf=vmin(Vu32.bf,Vv32.bf)
4721 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmin_VbfVbf(HVX_Vector Vu,4725 C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmin_VbfVbf(HVX_Vector Vu, HVX_Vector Vv)
4722 HVX_Vector Vv) Instruction Type: CVI_VX_LATE Execution Slots: SLOT234726 Instruction Type: CVI_VX_LATE
4727 Execution Slots: SLOT23
4723 ========================================================================== */4728 ========================================================================== */
47244729
4725#define Q6_Vbf_vmin_VbfVbf(Vu, Vv) \4730#define Q6_Vbf_vmin_VbfVbf(Vu, Vv) \
...@@ -4729,8 +4734,9 @@...@@ -4729,8 +4734,9 @@
4729#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4734#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4730/* ==========================================================================4735/* ==========================================================================
4731 Assembly Syntax: Vdd32.sf=vmpy(Vu32.bf,Vv32.bf)4736 Assembly Syntax: Vdd32.sf=vmpy(Vu32.bf,Vv32.bf)
4732 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VbfVbf(HVX_Vector Vu,4737 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VbfVbf(HVX_Vector Vu, HVX_Vector Vv)
4733 HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution Slots: SLOT234738 Instruction Type: CVI_VX_DV
4739 Execution Slots: SLOT23
4734 ========================================================================== */4740 ========================================================================== */
47354741
4736#define Q6_Wsf_vmpy_VbfVbf(Vu, Vv) \4742#define Q6_Wsf_vmpy_VbfVbf(Vu, Vv) \
...@@ -4740,9 +4746,9 @@...@@ -4740,9 +4746,9 @@
4740#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4746#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4741/* ==========================================================================4747/* ==========================================================================
4742 Assembly Syntax: Vxx32.sf+=vmpy(Vu32.bf,Vv32.bf)4748 Assembly Syntax: Vxx32.sf+=vmpy(Vu32.bf,Vv32.bf)
4743 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVbfVbf(HVX_VectorPair4749 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVbfVbf(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
4744 Vxx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution4750 Instruction Type: CVI_VX_DV
4745 Slots: SLOT234751 Execution Slots: SLOT23
4746 ========================================================================== */4752 ========================================================================== */
47474753
4748#define Q6_Wsf_vmpyacc_WsfVbfVbf(Vxx, Vu, Vv) \4754#define Q6_Wsf_vmpyacc_WsfVbfVbf(Vxx, Vu, Vv) \
...@@ -4752,8 +4758,9 @@...@@ -4752,8 +4758,9 @@
4752#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__4758#if __HVX_ARCH__ >= 73 && defined __HVX_IEEE_FP__
4753/* ==========================================================================4759/* ==========================================================================
4754 Assembly Syntax: Vdd32.sf=vsub(Vu32.bf,Vv32.bf)4760 Assembly Syntax: Vdd32.sf=vsub(Vu32.bf,Vv32.bf)
4755 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VbfVbf(HVX_Vector Vu,4761 C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VbfVbf(HVX_Vector Vu, HVX_Vector Vv)
4756 HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution Slots: SLOT234762 Instruction Type: CVI_VX_DV
4763 Execution Slots: SLOT23
4757 ========================================================================== */4764 ========================================================================== */
47584765
4759#define Q6_Wsf_vsub_VbfVbf(Vu, Vv) \4766#define Q6_Wsf_vsub_VbfVbf(Vu, Vv) \
...@@ -4775,9 +4782,9 @@...@@ -4775,9 +4782,9 @@
4775#if __HVX_ARCH__ >= 794782#if __HVX_ARCH__ >= 79
4776/* ==========================================================================4783/* ==========================================================================
4777 Assembly Syntax: Vx32|=vgetqfext(Vu32.x,Rt32)4784 Assembly Syntax: Vx32|=vgetqfext(Vu32.x,Rt32)
4778 C Intrinsic Prototype: HVX_Vector Q6_V_vgetqfextor_VVR(HVX_Vector Vx,4785 C Intrinsic Prototype: HVX_Vector Q6_V_vgetqfextor_VVR(HVX_Vector Vx, HVX_Vector Vu, Word32 Rt)
4779 HVX_Vector Vu, Word32 Rt) Instruction Type: CVI_VX Execution Slots:4786 Instruction Type: CVI_VX
4780 SLOT234787 Execution Slots: SLOT23
4781 ========================================================================== */4788 ========================================================================== */
47824789
4783#define Q6_V_vgetqfextor_VVR(Vx, Vu, Rt) \4790#define Q6_V_vgetqfextor_VVR(Vx, Vu, Rt) \
...@@ -4810,8 +4817,9 @@...@@ -4810,8 +4817,9 @@
4810#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__4817#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4811/* ==========================================================================4818/* ==========================================================================
4812 Assembly Syntax: Vdd32.hf=vadd(Vu32.f8,Vv32.f8)4819 Assembly Syntax: Vdd32.hf=vadd(Vu32.f8,Vv32.f8)
4813 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vadd_VV(HVX_Vector Vu,4820 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vadd_VV(HVX_Vector Vu, HVX_Vector Vv)
4814 HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution Slots: SLOT234821 Instruction Type: CVI_VX_DV
4822 Execution Slots: SLOT23
4815 ========================================================================== */4823 ========================================================================== */
48164824
4817#define Q6_Whf_vadd_VV(Vu, Vv) \4825#define Q6_Whf_vadd_VV(Vu, Vv) \
...@@ -4821,8 +4829,9 @@...@@ -4821,8 +4829,9 @@
4821#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__4829#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4822/* ==========================================================================4830/* ==========================================================================
4823 Assembly Syntax: Vd32.b=vcvt2(Vu32.hf,Vv32.hf)4831 Assembly Syntax: Vd32.b=vcvt2(Vu32.hf,Vv32.hf)
4824 C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt2_VhfVhf(HVX_Vector Vu,4832 C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt2_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
4825 HVX_Vector Vv) Instruction Type: CVI_VX Execution Slots: SLOT234833 Instruction Type: CVI_VX
4834 Execution Slots: SLOT23
4826 ========================================================================== */4835 ========================================================================== */
48274836
4828#define Q6_Vb_vcvt2_VhfVhf(Vu, Vv) \4837#define Q6_Vb_vcvt2_VhfVhf(Vu, Vv) \
...@@ -4856,8 +4865,9 @@...@@ -4856,8 +4865,9 @@
4856#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__4865#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4857/* ==========================================================================4866/* ==========================================================================
4858 Assembly Syntax: Vd32.ub=vcvt2(Vu32.hf,Vv32.hf)4867 Assembly Syntax: Vd32.ub=vcvt2(Vu32.hf,Vv32.hf)
4859 C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt2_VhfVhf(HVX_Vector Vu,4868 C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt2_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
4860 HVX_Vector Vv) Instruction Type: CVI_VX Execution Slots: SLOT234869 Instruction Type: CVI_VX
4870 Execution Slots: SLOT23
4861 ========================================================================== */4871 ========================================================================== */
48624872
4863#define Q6_Vub_vcvt2_VhfVhf(Vu, Vv) \4873#define Q6_Vub_vcvt2_VhfVhf(Vu, Vv) \
...@@ -4867,8 +4877,9 @@...@@ -4867,8 +4877,9 @@
4867#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__4877#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4868/* ==========================================================================4878/* ==========================================================================
4869 Assembly Syntax: Vd32.f8=vcvt(Vu32.hf,Vv32.hf)4879 Assembly Syntax: Vd32.f8=vcvt(Vu32.hf,Vv32.hf)
4870 C Intrinsic Prototype: HVX_Vector Q6_V_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector4880 C Intrinsic Prototype: HVX_Vector Q6_V_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
4871 Vv) Instruction Type: CVI_VX Execution Slots: SLOT234881 Instruction Type: CVI_VX
4882 Execution Slots: SLOT23
4872 ========================================================================== */4883 ========================================================================== */
48734884
4874#define Q6_V_vcvt_VhfVhf(Vu, Vv) \4885#define Q6_V_vcvt_VhfVhf(Vu, Vv) \
...@@ -4926,8 +4937,9 @@...@@ -4926,8 +4937,9 @@
4926#if __HVX_ARCH__ >= 794937#if __HVX_ARCH__ >= 79
4927/* ==========================================================================4938/* ==========================================================================
4928 Assembly Syntax: Vd32=vmerge(Vu32.x,Vv32.w)4939 Assembly Syntax: Vd32=vmerge(Vu32.x,Vv32.w)
4929 C Intrinsic Prototype: HVX_Vector Q6_V_vmerge_VVw(HVX_Vector Vu, HVX_Vector4940 C Intrinsic Prototype: HVX_Vector Q6_V_vmerge_VVw(HVX_Vector Vu, HVX_Vector Vv)
4930 Vv) Instruction Type: CVI_VS Execution Slots: SLOT01234941 Instruction Type: CVI_VS
4942 Execution Slots: SLOT0123
4931 ========================================================================== */4943 ========================================================================== */
49324944
4933#define Q6_V_vmerge_VVw(Vu, Vv) \4945#define Q6_V_vmerge_VVw(Vu, Vv) \
...@@ -4937,8 +4949,9 @@...@@ -4937,8 +4949,9 @@
4937#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__4949#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4938/* ==========================================================================4950/* ==========================================================================
4939 Assembly Syntax: Vdd32.hf=vmpy(Vu32.f8,Vv32.f8)4951 Assembly Syntax: Vdd32.hf=vmpy(Vu32.f8,Vv32.f8)
4940 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpy_VV(HVX_Vector Vu,4952 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpy_VV(HVX_Vector Vu, HVX_Vector Vv)
4941 HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution Slots: SLOT234953 Instruction Type: CVI_VX_DV
4954 Execution Slots: SLOT23
4942 ========================================================================== */4955 ========================================================================== */
49434956
4944#define Q6_Whf_vmpy_VV(Vu, Vv) \4957#define Q6_Whf_vmpy_VV(Vu, Vv) \
...@@ -4948,9 +4961,9 @@...@@ -4948,9 +4961,9 @@
4948#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__4961#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4949/* ==========================================================================4962/* ==========================================================================
4950 Assembly Syntax: Vxx32.hf+=vmpy(Vu32.f8,Vv32.f8)4963 Assembly Syntax: Vxx32.hf+=vmpy(Vu32.f8,Vv32.f8)
4951 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpyacc_WhfVV(HVX_VectorPair4964 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpyacc_WhfVV(HVX_VectorPair Vxx, HVX_Vector Vu, HVX_Vector Vv)
4952 Vxx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution4965 Instruction Type: CVI_VX_DV
4953 Slots: SLOT234966 Execution Slots: SLOT23
4954 ========================================================================== */4967 ========================================================================== */
49554968
4956#define Q6_Whf_vmpyacc_WhfVV(Vxx, Vu, Vv) \4969#define Q6_Whf_vmpyacc_WhfVV(Vxx, Vu, Vv) \
...@@ -4960,8 +4973,9 @@...@@ -4960,8 +4973,9 @@
4960#if __HVX_ARCH__ >= 794973#if __HVX_ARCH__ >= 79
4961/* ==========================================================================4974/* ==========================================================================
4962 Assembly Syntax: Vd32.qf16=vmpy(Vu32.hf,Rt32.hf)4975 Assembly Syntax: Vd32.qf16=vmpy(Vu32.hf,Rt32.hf)
4963 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vmpy_VhfRhf(HVX_Vector Vu, Word324976 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vmpy_VhfRhf(HVX_Vector Vu, Word32 Rt)
4964 Rt) Instruction Type: CVI_VX_DV Execution Slots: SLOT234977 Instruction Type: CVI_VX_DV
4978 Execution Slots: SLOT23
4965 ========================================================================== */4979 ========================================================================== */
49664980
4967#define Q6_Vqf16_vmpy_VhfRhf(Vu, Rt) \4981#define Q6_Vqf16_vmpy_VhfRhf(Vu, Rt) \
...@@ -4971,8 +4985,9 @@...@@ -4971,8 +4985,9 @@
4971#if __HVX_ARCH__ >= 794985#if __HVX_ARCH__ >= 79
4972/* ==========================================================================4986/* ==========================================================================
4973 Assembly Syntax: Vd32.qf16=vmpy(Vu32.qf16,Rt32.hf)4987 Assembly Syntax: Vd32.qf16=vmpy(Vu32.qf16,Rt32.hf)
4974 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vmpy_Vqf16Rhf(HVX_Vector Vu,4988 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vmpy_Vqf16Rhf(HVX_Vector Vu, Word32 Rt)
4975 Word32 Rt) Instruction Type: CVI_VX_DV Execution Slots: SLOT234989 Instruction Type: CVI_VX_DV
4990 Execution Slots: SLOT23
4976 ========================================================================== */4991 ========================================================================== */
49774992
4978#define Q6_Vqf16_vmpy_Vqf16Rhf(Vu, Rt) \4993#define Q6_Vqf16_vmpy_Vqf16Rhf(Vu, Rt) \
...@@ -4982,8 +4997,9 @@...@@ -4982,8 +4997,9 @@
4982#if __HVX_ARCH__ >= 794997#if __HVX_ARCH__ >= 79
4983/* ==========================================================================4998/* ==========================================================================
4984 Assembly Syntax: Vd32.qf32=vmpy(Vu32.sf,Rt32.sf)4999 Assembly Syntax: Vd32.qf32=vmpy(Vu32.sf,Rt32.sf)
4985 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vmpy_VsfRsf(HVX_Vector Vu, Word325000 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vmpy_VsfRsf(HVX_Vector Vu, Word32 Rt)
4986 Rt) Instruction Type: CVI_VX_DV Execution Slots: SLOT235001 Instruction Type: CVI_VX_DV
5002 Execution Slots: SLOT23
4987 ========================================================================== */5003 ========================================================================== */
49885004
4989#define Q6_Vqf32_vmpy_VsfRsf(Vu, Rt) \5005#define Q6_Vqf32_vmpy_VsfRsf(Vu, Rt) \
...@@ -4993,8 +5009,9 @@...@@ -4993,8 +5009,9 @@
4993#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__5009#if __HVX_ARCH__ >= 79 && defined __HVX_IEEE_FP__
4994/* ==========================================================================5010/* ==========================================================================
4995 Assembly Syntax: Vdd32.hf=vsub(Vu32.f8,Vv32.f8)5011 Assembly Syntax: Vdd32.hf=vsub(Vu32.f8,Vv32.f8)
4996 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vsub_VV(HVX_Vector Vu,5012 C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vsub_VV(HVX_Vector Vu, HVX_Vector Vv)
4997 HVX_Vector Vv) Instruction Type: CVI_VX_DV Execution Slots: SLOT235013 Instruction Type: CVI_VX_DV
5014 Execution Slots: SLOT23
4998 ========================================================================== */5015 ========================================================================== */
49995016
5000#define Q6_Whf_vsub_VV(Vu, Vv) \5017#define Q6_Whf_vsub_VV(Vu, Vv) \
...@@ -5052,8 +5069,9 @@...@@ -5052,8 +5069,9 @@
5052#if __HVX_ARCH__ >= 815069#if __HVX_ARCH__ >= 81
5053/* ==========================================================================5070/* ==========================================================================
5054 Assembly Syntax: Vd32=valign4(Vu32,Vv32,Rt8)5071 Assembly Syntax: Vd32=valign4(Vu32,Vv32,Rt8)
5055 C Intrinsic Prototype: HVX_Vector Q6_V_valign4_VVR(HVX_Vector Vu, HVX_Vector5072 C Intrinsic Prototype: HVX_Vector Q6_V_valign4_VVR(HVX_Vector Vu, HVX_Vector Vv, Word32 Rt)
5056 Vv, Word32 Rt) Instruction Type: CVI_VA Execution Slots: SLOT01235073 Instruction Type: CVI_VA
5074 Execution Slots: SLOT0123
5057 ========================================================================== */5075 ========================================================================== */
50585076
5059#define Q6_V_valign4_VVR(Vu, Vv, Rt) \5077#define Q6_V_valign4_VVR(Vu, Vv, Rt) \
...@@ -5159,8 +5177,9 @@...@@ -5159,8 +5177,9 @@
5159#if __HVX_ARCH__ >= 815177#if __HVX_ARCH__ >= 81
5160/* ==========================================================================5178/* ==========================================================================
5161 Assembly Syntax: Qd4=vcmp.eq(Vu32.hf,Vv32.hf)5179 Assembly Syntax: Qd4=vcmp.eq(Vu32.hf,Vv32.hf)
5162 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VhfVhf(HVX_Vector Vu,5180 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VhfVhf(HVX_Vector Vu, HVX_Vector Vv)
5163 HVX_Vector Vv) Instruction Type: CVI_VA Execution Slots: SLOT01235181 Instruction Type: CVI_VA
5182 Execution Slots: SLOT0123
5164 ========================================================================== */5183 ========================================================================== */
51655184
5166#define Q6_Q_vcmp_eq_VhfVhf(Vu, Vv) \5185#define Q6_Q_vcmp_eq_VhfVhf(Vu, Vv) \
...@@ -5171,9 +5190,9 @@...@@ -5171,9 +5190,9 @@
5171#if __HVX_ARCH__ >= 815190#if __HVX_ARCH__ >= 81
5172/* ==========================================================================5191/* ==========================================================================
5173 Assembly Syntax: Qx4&=vcmp.eq(Vu32.hf,Vv32.hf)5192 Assembly Syntax: Qx4&=vcmp.eq(Vu32.hf,Vv32.hf)
5174 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVhfVhf(HVX_VectorPred5193 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVhfVhf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
5175 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution5194 Instruction Type: CVI_VA
5176 Slots: SLOT01235195 Execution Slots: SLOT0123
5177 ========================================================================== */5196 ========================================================================== */
51785197
5179#define Q6_Q_vcmp_eqand_QVhfVhf(Qx, Vu, Vv) \5198#define Q6_Q_vcmp_eqand_QVhfVhf(Qx, Vu, Vv) \
...@@ -5187,9 +5206,9 @@...@@ -5187,9 +5206,9 @@
5187#if __HVX_ARCH__ >= 815206#if __HVX_ARCH__ >= 81
5188/* ==========================================================================5207/* ==========================================================================
5189 Assembly Syntax: Qx4|=vcmp.eq(Vu32.hf,Vv32.hf)5208 Assembly Syntax: Qx4|=vcmp.eq(Vu32.hf,Vv32.hf)
5190 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVhfVhf(HVX_VectorPred5209 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVhfVhf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
5191 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution5210 Instruction Type: CVI_VA
5192 Slots: SLOT01235211 Execution Slots: SLOT0123
5193 ========================================================================== */5212 ========================================================================== */
51945213
5195#define Q6_Q_vcmp_eqor_QVhfVhf(Qx, Vu, Vv) \5214#define Q6_Q_vcmp_eqor_QVhfVhf(Qx, Vu, Vv) \
...@@ -5203,9 +5222,9 @@...@@ -5203,9 +5222,9 @@
5203#if __HVX_ARCH__ >= 815222#if __HVX_ARCH__ >= 81
5204/* ==========================================================================5223/* ==========================================================================
5205 Assembly Syntax: Qx4^=vcmp.eq(Vu32.hf,Vv32.hf)5224 Assembly Syntax: Qx4^=vcmp.eq(Vu32.hf,Vv32.hf)
5206 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVhfVhf(HVX_VectorPred5225 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVhfVhf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
5207 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution5226 Instruction Type: CVI_VA
5208 Slots: SLOT01235227 Execution Slots: SLOT0123
5209 ========================================================================== */5228 ========================================================================== */
52105229
5211#define Q6_Q_vcmp_eqxacc_QVhfVhf(Qx, Vu, Vv) \5230#define Q6_Q_vcmp_eqxacc_QVhfVhf(Qx, Vu, Vv) \
...@@ -5219,8 +5238,9 @@...@@ -5219,8 +5238,9 @@
5219#if __HVX_ARCH__ >= 815238#if __HVX_ARCH__ >= 81
5220/* ==========================================================================5239/* ==========================================================================
5221 Assembly Syntax: Qd4=vcmp.eq(Vu32.sf,Vv32.sf)5240 Assembly Syntax: Qd4=vcmp.eq(Vu32.sf,Vv32.sf)
5222 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VsfVsf(HVX_Vector Vu,5241 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eq_VsfVsf(HVX_Vector Vu, HVX_Vector Vv)
5223 HVX_Vector Vv) Instruction Type: CVI_VA Execution Slots: SLOT01235242 Instruction Type: CVI_VA
5243 Execution Slots: SLOT0123
5224 ========================================================================== */5244 ========================================================================== */
52255245
5226#define Q6_Q_vcmp_eq_VsfVsf(Vu, Vv) \5246#define Q6_Q_vcmp_eq_VsfVsf(Vu, Vv) \
...@@ -5231,9 +5251,9 @@...@@ -5231,9 +5251,9 @@
5231#if __HVX_ARCH__ >= 815251#if __HVX_ARCH__ >= 81
5232/* ==========================================================================5252/* ==========================================================================
5233 Assembly Syntax: Qx4&=vcmp.eq(Vu32.sf,Vv32.sf)5253 Assembly Syntax: Qx4&=vcmp.eq(Vu32.sf,Vv32.sf)
5234 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVsfVsf(HVX_VectorPred5254 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqand_QVsfVsf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
5235 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution5255 Instruction Type: CVI_VA
5236 Slots: SLOT01235256 Execution Slots: SLOT0123
5237 ========================================================================== */5257 ========================================================================== */
52385258
5239#define Q6_Q_vcmp_eqand_QVsfVsf(Qx, Vu, Vv) \5259#define Q6_Q_vcmp_eqand_QVsfVsf(Qx, Vu, Vv) \
...@@ -5247,9 +5267,9 @@...@@ -5247,9 +5267,9 @@
5247#if __HVX_ARCH__ >= 815267#if __HVX_ARCH__ >= 81
5248/* ==========================================================================5268/* ==========================================================================
5249 Assembly Syntax: Qx4|=vcmp.eq(Vu32.sf,Vv32.sf)5269 Assembly Syntax: Qx4|=vcmp.eq(Vu32.sf,Vv32.sf)
5250 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVsfVsf(HVX_VectorPred5270 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqor_QVsfVsf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
5251 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution5271 Instruction Type: CVI_VA
5252 Slots: SLOT01235272 Execution Slots: SLOT0123
5253 ========================================================================== */5273 ========================================================================== */
52545274
5255#define Q6_Q_vcmp_eqor_QVsfVsf(Qx, Vu, Vv) \5275#define Q6_Q_vcmp_eqor_QVsfVsf(Qx, Vu, Vv) \
...@@ -5263,9 +5283,9 @@...@@ -5263,9 +5283,9 @@
5263#if __HVX_ARCH__ >= 815283#if __HVX_ARCH__ >= 81
5264/* ==========================================================================5284/* ==========================================================================
5265 Assembly Syntax: Qx4^=vcmp.eq(Vu32.sf,Vv32.sf)5285 Assembly Syntax: Qx4^=vcmp.eq(Vu32.sf,Vv32.sf)
5266 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVsfVsf(HVX_VectorPred5286 C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_eqxacc_QVsfVsf(HVX_VectorPred Qx, HVX_Vector Vu, HVX_Vector Vv)
5267 Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type: CVI_VA Execution5287 Instruction Type: CVI_VA
5268 Slots: SLOT01235288 Execution Slots: SLOT0123
5269 ========================================================================== */5289 ========================================================================== */
52705290
5271#define Q6_Q_vcmp_eqxacc_QVsfVsf(Qx, Vu, Vv) \5291#define Q6_Q_vcmp_eqxacc_QVsfVsf(Qx, Vu, Vv) \
...@@ -5375,8 +5395,9 @@...@@ -5375,8 +5395,9 @@
5375#if __HVX_ARCH__ >= 815395#if __HVX_ARCH__ >= 81
5376/* ==========================================================================5396/* ==========================================================================
5377 Assembly Syntax: Vd32.qf16=vsub(Vu32.hf,Vv32.qf16)5397 Assembly Syntax: Vd32.qf16=vsub(Vu32.hf,Vv32.qf16)
5378 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vsub_VhfVqf16(HVX_Vector Vu,5398 C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vsub_VhfVqf16(HVX_Vector Vu, HVX_Vector Vv)
5379 HVX_Vector Vv) Instruction Type: CVI_VS Execution Slots: SLOT01235399 Instruction Type: CVI_VS
5400 Execution Slots: SLOT0123
5380 ========================================================================== */5401 ========================================================================== */
53815402
5382#define Q6_Vqf16_vsub_VhfVqf16(Vu, Vv) \5403#define Q6_Vqf16_vsub_VhfVqf16(Vu, Vv) \
...@@ -5386,8 +5407,9 @@...@@ -5386,8 +5407,9 @@
5386#if __HVX_ARCH__ >= 815407#if __HVX_ARCH__ >= 81
5387/* ==========================================================================5408/* ==========================================================================
5388 Assembly Syntax: Vd32.qf32=vsub(Vu32.sf,Vv32.qf32)5409 Assembly Syntax: Vd32.qf32=vsub(Vu32.sf,Vv32.qf32)
5389 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vsub_VsfVqf32(HVX_Vector Vu,5410 C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vsub_VsfVqf32(HVX_Vector Vu, HVX_Vector Vv)
5390 HVX_Vector Vv) Instruction Type: CVI_VS Execution Slots: SLOT01235411 Instruction Type: CVI_VS
5412 Execution Slots: SLOT0123
5391 ========================================================================== */5413 ========================================================================== */
53925414
5393#define Q6_Vqf32_vsub_VsfVqf32(Vu, Vv) \5415#define Q6_Vqf32_vsub_VsfVqf32(Vu, Vv) \
lib/include/immintrin.h+4-2
...@@ -58,6 +58,10 @@...@@ -58,6 +58,10 @@
5858
59#include <avx512bitalgintrin.h>59#include <avx512bitalgintrin.h>
6060
61#include <avx512bmmintrin.h>
62
63#include <avx512bmmvlintrin.h>
64
61#include <avx512cdintrin.h>65#include <avx512cdintrin.h>
6266
63#include <avx512vpopcntdqintrin.h>67#include <avx512vpopcntdqintrin.h>
...@@ -479,8 +483,6 @@ _storebe_i64(void * __P, long long __D) {...@@ -479,8 +483,6 @@ _storebe_i64(void * __P, long long __D) {
479483
480#include <amxavx512intrin.h>484#include <amxavx512intrin.h>
481485
482#include <amxtf32intrin.h>
483
484#include <avx512vp2intersectintrin.h>486#include <avx512vp2intersectintrin.h>
485487
486#include <avx512vlvp2intersectintrin.h>488#include <avx512vlvp2intersectintrin.h>
lib/include/intrin.h+20-10
...@@ -44,8 +44,10 @@...@@ -44,8 +44,10 @@
4444
45#if __x86_64__45#if __x86_64__
46#define __LPTRINT_TYPE__ __int6446#define __LPTRINT_TYPE__ __int64
47#define __IPTRINT_TYPE__ __int64
47#else48#else
48#define __LPTRINT_TYPE__ long49#define __LPTRINT_TYPE__ long
50#define __IPTRINT_TYPE__ int
49#endif51#endif
5052
51#ifdef __cplusplus53#ifdef __cplusplus
...@@ -95,12 +97,12 @@ void __outdword(unsigned short, unsigned long);...@@ -95,12 +97,12 @@ void __outdword(unsigned short, unsigned long);
95void __outdwordstring(unsigned short, unsigned long *, unsigned long);97void __outdwordstring(unsigned short, unsigned long *, unsigned long);
96void __outword(unsigned short, unsigned short);98void __outword(unsigned short, unsigned short);
97void __outwordstring(unsigned short, unsigned short *, unsigned long);99void __outwordstring(unsigned short, unsigned short *, unsigned long);
98unsigned long __readcr0(void);100unsigned __LPTRINT_TYPE__ __readcr0(void);
99unsigned long __readcr2(void);101unsigned __LPTRINT_TYPE__ __readcr2(void);
100unsigned __LPTRINT_TYPE__ __readcr3(void);102unsigned __LPTRINT_TYPE__ __readcr3(void);
101unsigned __LPTRINT_TYPE__ __readcr4(void);103unsigned __LPTRINT_TYPE__ __readcr4(void);
102unsigned __int64 __readcr8(void);104unsigned __LPTRINT_TYPE__ __readcr8(void);
103unsigned int __readdr(unsigned int);105unsigned __IPTRINT_TYPE__ __readdr(unsigned int);
104#ifdef __i386__106#ifdef __i386__
105unsigned char __readfsbyte(unsigned long);107unsigned char __readfsbyte(unsigned long);
106unsigned short __readfsword(unsigned long);108unsigned short __readfsword(unsigned long);
...@@ -126,11 +128,12 @@ unsigned __int64 __ull_rshift(unsigned __int64, int);...@@ -126,11 +128,12 @@ unsigned __int64 __ull_rshift(unsigned __int64, int);
126void __vmx_off(void);128void __vmx_off(void);
127void __vmx_vmptrst(unsigned __int64 *);129void __vmx_vmptrst(unsigned __int64 *);
128void __wbinvd(void);130void __wbinvd(void);
129void __writecr0(unsigned int);131void __writecr0(unsigned __IPTRINT_TYPE__);
130void __writecr3(unsigned __INTPTR_TYPE__);132void __writecr2(unsigned __IPTRINT_TYPE__);
131void __writecr4(unsigned __INTPTR_TYPE__);133void __writecr3(unsigned __IPTRINT_TYPE__);
132void __writecr8(unsigned __int64);134void __writecr4(unsigned __IPTRINT_TYPE__);
133void __writedr(unsigned int, unsigned int);135void __writecr8(unsigned __IPTRINT_TYPE__);
136void __writedr(unsigned int, unsigned __IPTRINT_TYPE__);
134void __writefsbyte(unsigned long, unsigned char);137void __writefsbyte(unsigned long, unsigned char);
135void __writefsdword(unsigned long, unsigned long);138void __writefsdword(unsigned long, unsigned long);
136void __writefsqword(unsigned long, unsigned __int64);139void __writefsqword(unsigned long, unsigned __int64);
...@@ -374,6 +377,9 @@ static __inline__ void __DEFAULT_FN_ATTRS __nop(void) {...@@ -374,6 +377,9 @@ static __inline__ void __DEFAULT_FN_ATTRS __nop(void) {
374\*----------------------------------------------------------------------------*/377\*----------------------------------------------------------------------------*/
375#if defined(__aarch64__) || defined(__arm64ec__)378#if defined(__aarch64__) || defined(__arm64ec__)
376unsigned __int64 __getReg(int);379unsigned __int64 __getReg(int);
380double __getRegFp(int _Reg);
381void __setReg(int, unsigned __int64);
382void __setRegFp(int, double);
377unsigned char _interlockedbittestandreset_acq(long volatile *, long);383unsigned char _interlockedbittestandreset_acq(long volatile *, long);
378unsigned char _interlockedbittestandreset_nf(long volatile *, long);384unsigned char _interlockedbittestandreset_nf(long volatile *, long);
379unsigned char _interlockedbittestandreset_rel(long volatile *, long);385unsigned char _interlockedbittestandreset_rel(long volatile *, long);
...@@ -438,10 +444,13 @@ unsigned int _CountLeadingSigns(long);...@@ -438,10 +444,13 @@ unsigned int _CountLeadingSigns(long);
438unsigned int _CountLeadingSigns64(__int64);444unsigned int _CountLeadingSigns64(__int64);
439unsigned int _CountOneBits(unsigned long);445unsigned int _CountOneBits(unsigned long);
440unsigned int _CountOneBits64(unsigned __int64);446unsigned int _CountOneBits64(unsigned __int64);
447unsigned int _CountTrailingZeros(unsigned long);
448unsigned int _CountTrailingZeros64(unsigned __int64);
441449
442unsigned int __hlt(unsigned int, ...);450unsigned int __hlt(unsigned int, ...);
443451
444void __cdecl __prefetch(const void *);452void __cdecl __prefetch(const void *);
453void __cdecl __prefetch2(const void *, unsigned char);
445454
446#endif455#endif
447456
...@@ -474,7 +483,7 @@ static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr3(void) {...@@ -474,7 +483,7 @@ static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr3(void) {
474}483}
475484
476static __inline__ void __DEFAULT_FN_ATTRS485static __inline__ void __DEFAULT_FN_ATTRS
477__writecr3(unsigned __INTPTR_TYPE__ __cr3_val) {486__writecr3(unsigned __IPTRINT_TYPE__ __cr3_val) {
478 __asm__ ("mov {%0, %%cr3|cr3, %0}" : : "r"(__cr3_val) : "memory");487 __asm__ ("mov {%0, %%cr3|cr3, %0}" : : "r"(__cr3_val) : "memory");
479}488}
480#endif489#endif
...@@ -484,6 +493,7 @@ __writecr3(unsigned __INTPTR_TYPE__ __cr3_val) {...@@ -484,6 +493,7 @@ __writecr3(unsigned __INTPTR_TYPE__ __cr3_val) {
484#endif493#endif
485494
486#undef __LPTRINT_TYPE__495#undef __LPTRINT_TYPE__
496#undef __IPTRINT_TYPE__
487497
488#undef __DEFAULT_FN_ATTRS498#undef __DEFAULT_FN_ATTRS
489499
lib/include/larchintrin.h+2
...@@ -120,10 +120,12 @@ extern __inline int...@@ -120,10 +120,12 @@ extern __inline int
120120
121#define __ibar(/*ui15*/ _1) __builtin_loongarch_ibar((_1))121#define __ibar(/*ui15*/ _1) __builtin_loongarch_ibar((_1))
122122
123#ifdef __loongarch_hard_float
123#define __movfcsr2gr(/*ui5*/ _1) __builtin_loongarch_movfcsr2gr((_1));124#define __movfcsr2gr(/*ui5*/ _1) __builtin_loongarch_movfcsr2gr((_1));
124125
125#define __movgr2fcsr(/*ui5*/ _1, _2) \126#define __movgr2fcsr(/*ui5*/ _1, _2) \
126 __builtin_loongarch_movgr2fcsr((_1), (unsigned int)_2);127 __builtin_loongarch_movgr2fcsr((_1), (unsigned int)_2);
128#endif
127129
128#define __syscall(/*ui15*/ _1) __builtin_loongarch_syscall((_1))130#define __syscall(/*ui15*/ _1) __builtin_loongarch_syscall((_1))
129131
lib/include/llvm_libc_wrappers/ctype.h+3-2
...@@ -9,13 +9,14 @@...@@ -9,13 +9,14 @@
9#ifndef __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__9#ifndef __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
10#define __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__10#define __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
1111
12#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)12#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) && \
13 !defined(__SPIRV__)
13#error "This file is for GPU offloading compilation only"14#error "This file is for GPU offloading compilation only"
14#endif15#endif
1516
16#include_next <ctype.h>17#include_next <ctype.h>
1718
18#if defined(__HIP__) || defined(__CUDA__)19#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
19#define __LIBC_ATTRS __attribute__((device))20#define __LIBC_ATTRS __attribute__((device))
20#else21#else
21#define __LIBC_ATTRS22#define __LIBC_ATTRS
lib/include/llvm_libc_wrappers/string.h+3-2
...@@ -9,13 +9,14 @@...@@ -9,13 +9,14 @@
9#ifndef __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__9#ifndef __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
10#define __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__10#define __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
1111
12#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)12#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) && \
13 !defined(__SPIRV__)
13#error "This file is for GPU offloading compilation only"14#error "This file is for GPU offloading compilation only"
14#endif15#endif
1516
16#include_next <string.h>17#include_next <string.h>
1718
18#if defined(__HIP__) || defined(__CUDA__)19#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
19#define __LIBC_ATTRS __attribute__((device))20#define __LIBC_ATTRS __attribute__((device))
20#else21#else
21#define __LIBC_ATTRS22#define __LIBC_ATTRS
lib/include/module.modulemap+16-1
...@@ -21,10 +21,19 @@ module _Builtin_intrinsics [system] [extern_c] {...@@ -21,10 +21,19 @@ module _Builtin_intrinsics [system] [extern_c] {
21 export *21 export *
22 }22 }
2323
24 explicit module bf16 {
25 header "arm_bf16.h"
26 export *
27 }
28
29 explicit module fp16 {
30 header "arm_fp16.h"
31 export *
32 }
33
24 explicit module neon {34 explicit module neon {
25 requires neon35 requires neon
26 header "arm_neon.h"36 header "arm_neon.h"
27 header "arm_fp16.h"
28 export *37 export *
29 }38 }
3039
...@@ -41,6 +50,12 @@ module _Builtin_intrinsics [system] [extern_c] {...@@ -41,6 +50,12 @@ module _Builtin_intrinsics [system] [extern_c] {
4150
42 header "arm64intr.h"51 header "arm64intr.h"
43 export *52 export *
53
54 explicit module neon {
55 requires neon
56 header "arm64_neon.h"
57 export *
58 }
44 }59 }
4560
46 explicit module intel {61 explicit module intel {
lib/include/openmp_wrappers/__clang_openmp_device_functions.h+14
...@@ -55,6 +55,20 @@ extern "C" {...@@ -55,6 +55,20 @@ extern "C" {
55#pragma omp end declare variant55#pragma omp end declare variant
56#endif56#endif
5757
58#ifdef __SPIRV__
59#pragma omp begin declare variant match( \
60 device = {arch(spirv64)}, implementation = {extension(match_any)})
61
62#define __OPENMP_SPIRV__
63
64/// Include declarations for libdevice functions.
65#include <__clang_spirv_libdevice_declares.h>
66
67#undef __OPENMP_SPIRV__
68
69#pragma omp end declare variant
70#endif
71
58#ifdef __cplusplus72#ifdef __cplusplus
59} // extern "C"73} // extern "C"
60#endif74#endif
lib/include/openmp_wrappers/complex+7-1
...@@ -29,6 +29,12 @@...@@ -29,6 +29,12 @@
29#undef __OPENMP_AMDGCN__29#undef __OPENMP_AMDGCN__
30#endif // __AMDGCN__30#endif // __AMDGCN__
3131
32#ifdef __SPIRV__
33#define __OPENMP_SPIRV__
34#include <__clang_cuda_complex_builtins.h>
35#undef __OPENMP_SPIRV__
36#endif // __SPIRV__
37
32#endif38#endif
3339
34// Grab the host header too.40// Grab the host header too.
...@@ -45,7 +51,7 @@...@@ -45,7 +51,7 @@
45#ifndef _LIBCPP_STD_VER51#ifndef _LIBCPP_STD_VER
4652
47#pragma omp begin declare variant match( \53#pragma omp begin declare variant match( \
48 device = {arch(amdgcn, nvptx, nvptx64)}, \54 device = {arch(amdgcn, nvptx, nvptx64, spirv64)}, \
49 implementation = {extension(match_any, allow_templates)})55 implementation = {extension(match_any, allow_templates)})
5056
51#include <complex_cmath.h>57#include <complex_cmath.h>
lib/include/openmp_wrappers/complex.h+6
...@@ -29,6 +29,12 @@...@@ -29,6 +29,12 @@
29#undef __OPENMP_AMDGCN__29#undef __OPENMP_AMDGCN__
30#endif30#endif
3131
32#ifdef __SPIRV__
33#define __OPENMP_SPIRV__
34#include <__clang_cuda_complex_builtins.h>
35#undef __OPENMP_SPIRV__
36#endif // __SPIRV__
37
32#endif38#endif
3339
34// Grab the host header too.40// Grab the host header too.
lib/include/openmp_wrappers/math.h+10
...@@ -58,4 +58,14 @@...@@ -58,4 +58,14 @@
58#pragma omp end declare variant58#pragma omp end declare variant
59#endif59#endif
6060
61#ifdef __SPIRV__
62#pragma omp begin declare variant match(device = {arch(spirv64)})
63
64#define __OPENMP_SPIRV__
65#include <__clang_spirv_math.h>
66#undef __OPENMP_SPIRV__
67
68#pragma omp end declare variant
69#endif
70
61#endif71#endif
lib/include/ptrauth.h+90-12
...@@ -38,8 +38,7 @@ typedef enum {...@@ -38,8 +38,7 @@ typedef enum {
38 The extra data is always 0. */38 The extra data is always 0. */
39 ptrauth_key_function_pointer = ptrauth_key_process_independent_code,39 ptrauth_key_function_pointer = ptrauth_key_process_independent_code,
4040
41 /* The key used to sign C++ v-table pointers.41 /* The key used to sign pointers to C++ v-tables. */
42 The extra data is always 0. */
43 ptrauth_key_cxx_vtable_pointer = ptrauth_key_process_independent_data,42 ptrauth_key_cxx_vtable_pointer = ptrauth_key_process_independent_data,
4443
45 /* The key used to sign metadata pointers to Objective-C method-lists. */44 /* The key used to sign metadata pointers to Objective-C method-lists. */
...@@ -178,6 +177,56 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -178,6 +177,56 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
178 __builtin_ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \177 __builtin_ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \
179 __new_data)178 __new_data)
180179
180/* Authenticate a pointer using a PC-based signature scheme and resign
181 it using a different scheme.
182
183 If the result is subsequently authenticated using the new scheme, that
184 authentication is guaranteed to fail if and only if the initial
185 authentication failed.
186
187 The value must be an expression of pointer type.
188 The key must be a constant expression of type ptrauth_key.
189 The extra data must be an expression of pointer or integer type;
190 if an integer, it will be coerced to ptrauth_extra_data_t.
191 The oldpc must be an expression of pointer or integer type representing
192 the PC value where the original signature was created.
193 The result will have the same type as the original value.
194
195 This operation is guaranteed to not leave the intermediate value
196 available for attack before it is re-signed.
197
198 Do not pass a null pointer to this function. A null pointer
199 will not successfully authenticate. */
200#define ptrauth_auth_with_pc_and_resign(__value, __old_key, __old_data, \
201 __old_pc, __new_key, __new_data) \
202 __builtin_ptrauth_auth_with_pc_and_resign(__value, __old_key, __old_data, \
203 __old_pc, __new_key, __new_data)
204
205/* Authenticate a pointer using one scheme, load 32bit value at offset addend
206 from the pointer, and add this value to the pointer, sign using specified
207 scheme.
208
209 If the result is subsequently authenticated using the new scheme, that
210 authentication is guaranteed to fail if and only if the initial
211 authentication failed.
212
213 The value must be an expression of pointer type.
214 The key must be a constant expression of type ptrauth_key.
215 The extra data must be an expression of pointer or integer type;
216 if an integer, it will be coerced to ptrauth_extra_data_t.
217 The addend must be an immediate ptrdiff_t value.
218 The result will have the same type as the original value.
219
220 This operation is guaranteed to not leave the intermediate value
221 available for attack before it is re-signed.
222
223 Do not pass a null pointer to this function. A null pointer
224 will not successfully authenticate. */
225#define ptrauth_auth_load_relative_and_sign(__value, __old_key, __old_data, \
226 __new_key, __new_data, __offset) \
227 __builtin_ptrauth_auth_load_relative_and_sign( \
228 __value, __old_key, __old_data, __new_key, __new_data, __offset)
229
181/* Authenticate a pointer using one scheme and resign it as a C230/* Authenticate a pointer using one scheme and resign it as a C
182 function pointer.231 function pointer.
183232
...@@ -324,30 +373,38 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -324,30 +373,38 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
324 __ptrauth(ptrauth_key_objc_class_ro_pointer, 1, \373 __ptrauth(ptrauth_key_objc_class_ro_pointer, 1, \
325 __ptrauth_objc_class_ro_discriminator)374 __ptrauth_objc_class_ro_discriminator)
326375
376#if __has_feature(ptrauth_init_fini_address_discrimination)
377#define __ptrauth_init_fini_pointer \
378 __ptrauth(ptrauth_key_init_fini_pointer, 1, __ptrauth_init_fini_discriminator)
379#else
380#define __ptrauth_init_fini_pointer \
381 __ptrauth(ptrauth_key_init_fini_pointer, 0, __ptrauth_init_fini_discriminator)
382#endif
383
327#else384#else
328385
329#define ptrauth_strip(__value, __key) \386#define ptrauth_strip(__value, __key) \
330 ({ \387 __extension__({ \
331 (void)__key; \388 (void)__key; \
332 __value; \389 __value; \
333 })390 })
334391
335#define ptrauth_blend_discriminator(__pointer, __integer) \392#define ptrauth_blend_discriminator(__pointer, __integer) \
336 ({ \393 __extension__({ \
337 (void)__pointer; \394 (void)__pointer; \
338 (void)__integer; \395 (void)__integer; \
339 ((ptrauth_extra_data_t)0); \396 ((ptrauth_extra_data_t)0); \
340 })397 })
341398
342#define ptrauth_sign_constant(__value, __key, __data) \399#define ptrauth_sign_constant(__value, __key, __data) \
343 ({ \400 __extension__({ \
344 (void)__key; \401 (void)__key; \
345 (void)__data; \402 (void)__data; \
346 __value; \403 __value; \
347 })404 })
348405
349#define ptrauth_sign_unauthenticated(__value, __key, __data) \406#define ptrauth_sign_unauthenticated(__value, __key, __data) \
350 ({ \407 __extension__({ \
351 (void)__key; \408 (void)__key; \
352 (void)__data; \409 (void)__data; \
353 __value; \410 __value; \
...@@ -355,7 +412,7 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -355,7 +412,7 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
355412
356#define ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \413#define ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \
357 __new_data) \414 __new_data) \
358 ({ \415 __extension__({ \
359 (void)__old_key; \416 (void)__old_key; \
360 (void)__old_data; \417 (void)__old_data; \
361 (void)__new_key; \418 (void)__new_key; \
...@@ -363,22 +420,44 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -363,22 +420,44 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
363 __value; \420 __value; \
364 })421 })
365422
423#define ptrauth_auth_with_pc_and_resign(__value, __old_key, __old_data, \
424 __old_pc, __new_key, __new_data) \
425 __extension__({ \
426 (void)__old_key; \
427 (void)__old_data; \
428 (void)__old_pc; \
429 (void)__new_key; \
430 (void)__new_data; \
431 __value; \
432 })
433
434#define ptrauth_auth_load_relative_and_sign(__value, __old_key, __old_data, \
435 __new_key, __new_data, __offset) \
436 __extension__({ \
437 (void)__old_key; \
438 (void)__old_data; \
439 (void)__new_key; \
440 (void)__new_data; \
441 const char *__value_tmp = (const char *)(__value); \
442 (void *)(__value_tmp + *(const int *)(__value_tmp + (__offset))); \
443 })
444
366#define ptrauth_auth_function(__value, __old_key, __old_data) \445#define ptrauth_auth_function(__value, __old_key, __old_data) \
367 ({ \446 __extension__({ \
368 (void)__old_key; \447 (void)__old_key; \
369 (void)__old_data; \448 (void)__old_data; \
370 __value; \449 __value; \
371 })450 })
372451
373#define ptrauth_auth_data(__value, __old_key, __old_data) \452#define ptrauth_auth_data(__value, __old_key, __old_data) \
374 ({ \453 __extension__({ \
375 (void)__old_key; \454 (void)__old_key; \
376 (void)__old_data; \455 (void)__old_data; \
377 __value; \456 __value; \
378 })457 })
379458
380#define ptrauth_string_discriminator(__string) \459#define ptrauth_string_discriminator(__string) \
381 ({ \460 __extension__({ \
382 (void)__string; \461 (void)__string; \
383 ((ptrauth_extra_data_t)0); \462 ((ptrauth_extra_data_t)0); \
384 })463 })
...@@ -388,13 +467,12 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;...@@ -388,13 +467,12 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
388 ((ptrauth_extra_data_t)0)467 ((ptrauth_extra_data_t)0)
389468
390#define ptrauth_sign_generic_data(__value, __data) \469#define ptrauth_sign_generic_data(__value, __data) \
391 ({ \470 __extension__({ \
392 (void)__value; \471 (void)__value; \
393 (void)__data; \472 (void)__data; \
394 ((ptrauth_generic_signature_t)0); \473 ((ptrauth_generic_signature_t)0); \
395 })474 })
396475
397
398#define ptrauth_cxx_vtable_pointer(key, address_discrimination, \476#define ptrauth_cxx_vtable_pointer(key, address_discrimination, \
399 extra_discrimination...)477 extra_discrimination...)
400478
lib/include/riscv_bitmanip.h+7
...@@ -16,6 +16,13 @@...@@ -16,6 +16,13 @@
16extern "C" {16extern "C" {
17#endif17#endif
1818
19#define __riscv_intrinsic_b 1
20#define __riscv_intrinsic_zbb 1
21#define __riscv_intrinsic_zbc 1
22#define __riscv_intrinsic_zbkb 1
23#define __riscv_intrinsic_zbkc 1
24#define __riscv_intrinsic_zbkx 1
25
19#if defined(__riscv_zbb)26#if defined(__riscv_zbb)
20static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))27static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
21__riscv_orc_b_32(uint32_t __x) {28__riscv_orc_b_32(uint32_t __x) {
lib/include/riscv_corev_alu.h+2
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16extern "C" {16extern "C" {
17#endif17#endif
1818
19#define __riscv_intrinsic_xcvalu 1
20
19#if defined(__riscv_xcvalu)21#if defined(__riscv_xcvalu)
2022
21#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))23#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
lib/include/riscv_crypto.h+8
...@@ -16,6 +16,14 @@...@@ -16,6 +16,14 @@
16extern "C" {16extern "C" {
17#endif17#endif
1818
19#define __riscv_intrinsic_zkn 1
20#define __riscv_intrinsic_zknd 1
21#define __riscv_intrinsic_zkne 1
22#define __riscv_intrinsic_zknh 1
23#define __riscv_intrinsic_zks 1
24#define __riscv_intrinsic_zksed 1
25#define __riscv_intrinsic_zksh 1
26
19#if defined(__riscv_zknd)27#if defined(__riscv_zknd)
20#if __riscv_xlen == 3228#if __riscv_xlen == 32
21#define __riscv_aes32dsi(x, y, bs) __builtin_riscv_aes32dsi(x, y, bs)29#define __riscv_aes32dsi(x, y, bs) __builtin_riscv_aes32dsi(x, y, bs)
lib/include/riscv_mips.h+2
...@@ -14,6 +14,8 @@...@@ -14,6 +14,8 @@
14#error "This header is only meant to be used on riscv architecture"14#error "This header is only meant to be used on riscv architecture"
15#endif15#endif
1616
17#define __riscv_intrinsic_xmipsexectl 1
18
17#define __DEFAULT_FN_ATTRS \19#define __DEFAULT_FN_ATTRS \
18 __attribute__((__always_inline__, __nodebug__, __target__("xmipsexectl")))20 __attribute__((__always_inline__, __nodebug__, __target__("xmipsexectl")))
1921
lib/include/riscv_nds.h+3
...@@ -16,6 +16,9 @@...@@ -16,6 +16,9 @@
16extern "C" {16extern "C" {
17#endif17#endif
1818
19#define __riscv_intrinsic_xandesbfhcvt 1
20#define __riscv_intrinsic_xandesperf 1
21
19#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))22#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
2023
21#if defined(__riscv_xandesperf)24#if defined(__riscv_xandesperf)
lib/include/riscv_ntlh.h+2
...@@ -10,6 +10,8 @@...@@ -10,6 +10,8 @@
10#ifndef __RISCV_NTLH_H10#ifndef __RISCV_NTLH_H
11#define __RISCV_NTLH_H11#define __RISCV_NTLH_H
1212
13#define __riscv_intrinsic_zihintntl 1
14
13#ifndef __riscv_zihintntl15#ifndef __riscv_zihintntl
14#error "NTLH intrinsics require the NTLH extension."16#error "NTLH intrinsics require the NTLH extension."
15#endif17#endif
lib/include/riscv_packed_simd.h created+644
...@@ -0,0 +1,644 @@
1/*===---- riscv_packed_simd.h - RISC-V P intrinsics ------------------------===
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
10#ifndef __RISCV_PACKED_SIMD_H
11#define __RISCV_PACKED_SIMD_H
12
13#include <stdint.h>
14
15#if defined(__cplusplus)
16extern "C" {
17#endif
18
19/* Packed SIMD Types */
20
21typedef int8_t int8x4_t __attribute__((__vector_size__(4)));
22typedef uint8_t uint8x4_t __attribute__((__vector_size__(4)));
23typedef int16_t int16x2_t __attribute__((__vector_size__(4)));
24typedef uint16_t uint16x2_t __attribute__((__vector_size__(4)));
25
26typedef int8_t int8x8_t __attribute__((__vector_size__(8)));
27typedef uint8_t uint8x8_t __attribute__((__vector_size__(8)));
28typedef int16_t int16x4_t __attribute__((__vector_size__(8)));
29typedef uint16_t uint16x4_t __attribute__((__vector_size__(8)));
30typedef int32_t int32x2_t __attribute__((__vector_size__(8)));
31typedef uint32_t uint32x2_t __attribute__((__vector_size__(8)));
32
33#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
34
35#define __packed_splat2(ty, x) ((ty){(x), (x)})
36#define __packed_splat4(ty, x) ((ty){(x), (x), (x), (x)})
37#define __packed_splat8(ty, x) ((ty){(x), (x), (x), (x), (x), (x), (x), (x)})
38
39#define __packed_splat(name, ty, scalar_ty, splat) \
40 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(scalar_ty __x) { \
41 return splat(ty, __x); \
42 }
43
44#define __packed_shift(name, ty, op, mask) \
45 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
46 unsigned __rs2) { \
47 return __rs1 op(__rs2 & (mask)); \
48 }
49#define __packed_shift8(name, ty, op) __packed_shift(name, ty, op, 0x7)
50#define __packed_shift16(name, ty, op) __packed_shift(name, ty, op, 0xf)
51#define __packed_shift32(name, ty, op) __packed_shift(name, ty, op, 0x1f)
52
53#define __packed_scalar_binary_op(name, ty, scalar_ty, op, splat) \
54 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
55 scalar_ty __rs2) { \
56 return __rs1 op splat(ty, __rs2); \
57 }
58
59#define __packed_binary_op(name, ty, op) \
60 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \
61 return __rs1 op __rs2; \
62 }
63
64#define __packed_unary_op(name, ty, op) \
65 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
66 return op __rs1; \
67 }
68
69#define __packed_binary_builtin(name, ty, builtin) \
70 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \
71 return builtin(__rs1, __rs2); \
72 }
73
74#define __packed_sh1add(name, ty) \
75 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \
76 return (__rs1 << 1) + __rs2; \
77 }
78
79/* TODO: switch to sadd_sat(__builtin_elementwise_shl_sat(a, 1), b) once a
80 * generic elementwise shl_sat builtin exists. sadd_sat(a, a) is equivalent
81 * for signed types and the backend's saturating_shl1 PatFrags matches both
82 * shapes. */
83#define __packed_sh1sadd(name, ty) \
84 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \
85 return __builtin_elementwise_add_sat( \
86 __builtin_elementwise_add_sat(__rs1, __rs1), __rs2); \
87 }
88
89#define __packed_cmp(name, ty, rty, op) \
90 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
91 ty __rs2) { \
92 return (rty)(__rs1 op __rs2); \
93 }
94
95#define __packed_pabs(name, ty, rty) \
96 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
97 return (rty)__builtin_elementwise_abs(__rs1); \
98 }
99
100#define __packed_binary_builtin_cast(name, ty, rty, builtin) \
101 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
102 ty __rs2) { \
103 return (rty)builtin(__rs1, __rs2); \
104 }
105
106#define __packed_reduction(name, rty, ty, builtin) \
107 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
108 rty __rs2) { \
109 return builtin(__rs1, __rs2); \
110 }
111
112#define __packed_merge_builtin(name, ty, mask_ty, builtin) \
113 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2, \
114 mask_ty __rd) { \
115 return (ty)builtin(__rs1, __rs2, __rd); \
116 }
117
118#define __packed_psabs(name, ty, builtin) \
119 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
120 return builtin(__rs1); \
121 }
122
123#define __packed_widen_convert(name, rty, ty) \
124 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
125 return __builtin_convertvector(__rs1, rty); \
126 }
127#define __packed_widen_high2(name, rty, ty) \
128 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
129 return (rty)__builtin_shufflevector((ty){0}, __rs1, 0, 2, 1, 3); \
130 }
131#define __packed_widen_high4(name, rty, ty) \
132 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
133 return (rty)__builtin_shufflevector((ty){0}, __rs1, 0, 4, 1, 5, 2, 6, 3, \
134 7); \
135 }
136
137/* Packed Reverse: reverse the order of the elements. Lowered to a single
138 * rev8/rev16/ppairoe.* by the backend's packed reverse-shuffle handling. */
139#define __packed_reverse2(name, ty) \
140 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
141 return __builtin_shufflevector(__rs1, __rs1, 1, 0); \
142 }
143#define __packed_reverse4(name, ty) \
144 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
145 return __builtin_shufflevector(__rs1, __rs1, 3, 2, 1, 0); \
146 }
147#define __packed_reverse8(name, ty) \
148 static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
149 return __builtin_shufflevector(__rs1, __rs1, 7, 6, 5, 4, 3, 2, 1, 0); \
150 }
151
152#define __packed_zip2(name, rty, ty) \
153 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
154 ty __rs2) { \
155 return __builtin_shufflevector(__rs1, __rs2, 0, 2, 1, 3); \
156 }
157#define __packed_zip4(name, rty, ty) \
158 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
159 ty __rs2) { \
160 return __builtin_shufflevector(__rs1, __rs2, 0, 4, 1, 5, 2, 6, 3, 7); \
161 }
162#define __packed_unzipe2(name, rty, ty) \
163 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
164 return __builtin_shufflevector(__rs1, __rs1, 0, 2); \
165 }
166#define __packed_unzipe4(name, rty, ty) \
167 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
168 return __builtin_shufflevector(__rs1, __rs1, 0, 2, 4, 6); \
169 }
170#define __packed_unzipo2(name, rty, ty) \
171 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
172 return __builtin_shufflevector(__rs1, __rs1, 1, 3); \
173 }
174#define __packed_unzipo4(name, rty, ty) \
175 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \
176 return __builtin_shufflevector(__rs1, __rs1, 1, 3, 5, 7); \
177 }
178
179#define __packed_abdsum(name, rty, ty, builtin) \
180 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \
181 ty __rs2) { \
182 return builtin(__rs1, __rs2); \
183 }
184
185#define __packed_abdsum_acc(name, rty, ty, builtin) \
186 static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(rty __rd, ty __rs1, \
187 ty __rs2) { \
188 return builtin(__rd, __rs1, __rs2); \
189 }
190
191// clang-format off: macro call sites have no trailing semicolons, which
192// confuses clang-format into a deeply nested expression.
193
194/* Packed Splat (32-bit) */
195__packed_splat(pmv_s_u8x4, uint8x4_t, uint8_t, __packed_splat4)
196__packed_splat(pmv_s_i8x4, int8x4_t, int8_t, __packed_splat4)
197__packed_splat(pmv_s_u16x2, uint16x2_t, uint16_t, __packed_splat2)
198__packed_splat(pmv_s_i16x2, int16x2_t, int16_t, __packed_splat2)
199
200/* Packed Splat (64-bit) */
201__packed_splat(pmv_s_u8x8, uint8x8_t, uint8_t, __packed_splat8)
202__packed_splat(pmv_s_i8x8, int8x8_t, int8_t, __packed_splat8)
203__packed_splat(pmv_s_u16x4, uint16x4_t, uint16_t, __packed_splat4)
204__packed_splat(pmv_s_i16x4, int16x4_t, int16_t, __packed_splat4)
205__packed_splat(pmv_s_u32x2, uint32x2_t, uint32_t, __packed_splat2)
206__packed_splat(pmv_s_i32x2, int32x2_t, int32_t, __packed_splat2)
207
208/* Packed Addition and Subtraction (32-bit) */
209__packed_binary_op(padd_i8x4, int8x4_t, +)
210__packed_binary_op(padd_u8x4, uint8x4_t, +)
211__packed_binary_op(padd_i16x2, int16x2_t, +)
212__packed_binary_op(padd_u16x2, uint16x2_t, +)
213__packed_binary_op(psub_i8x4, int8x4_t, -)
214__packed_binary_op(psub_u8x4, uint8x4_t, -)
215__packed_binary_op(psub_i16x2, int16x2_t, -)
216__packed_binary_op(psub_u16x2, uint16x2_t, -)
217__packed_unary_op(pneg_i8x4, int8x4_t, -)
218__packed_unary_op(pneg_i16x2, int16x2_t, -)
219
220/* Packed Addition and Subtraction (64-bit) */
221__packed_binary_op(padd_i8x8, int8x8_t, +)
222__packed_binary_op(padd_u8x8, uint8x8_t, +)
223__packed_binary_op(padd_i16x4, int16x4_t, +)
224__packed_binary_op(padd_u16x4, uint16x4_t, +)
225__packed_binary_op(padd_i32x2, int32x2_t, +)
226__packed_binary_op(padd_u32x2, uint32x2_t, +)
227__packed_binary_op(psub_i8x8, int8x8_t, -)
228__packed_binary_op(psub_u8x8, uint8x8_t, -)
229__packed_binary_op(psub_i16x4, int16x4_t, -)
230__packed_binary_op(psub_u16x4, uint16x4_t, -)
231__packed_binary_op(psub_i32x2, int32x2_t, -)
232__packed_binary_op(psub_u32x2, uint32x2_t, -)
233__packed_unary_op(pneg_i8x8, int8x8_t, -)
234__packed_unary_op(pneg_i16x4, int16x4_t, -)
235__packed_unary_op(pneg_i32x2, int32x2_t, -)
236
237/* Packed Addition with Scalar (32-bit) */
238__packed_scalar_binary_op(padd_s_u8x4, uint8x4_t, uint8_t, +, __packed_splat4)
239__packed_scalar_binary_op(padd_s_i8x4, int8x4_t, int8_t, +, __packed_splat4)
240__packed_scalar_binary_op(padd_s_u16x2, uint16x2_t, uint16_t, +,
241 __packed_splat2)
242__packed_scalar_binary_op(padd_s_i16x2, int16x2_t, int16_t, +,
243 __packed_splat2)
244
245/* Packed Addition with Scalar (64-bit) */
246__packed_scalar_binary_op(padd_s_u8x8, uint8x8_t, uint8_t, +, __packed_splat8)
247__packed_scalar_binary_op(padd_s_i8x8, int8x8_t, int8_t, +, __packed_splat8)
248__packed_scalar_binary_op(padd_s_u16x4, uint16x4_t, uint16_t, +,
249 __packed_splat4)
250__packed_scalar_binary_op(padd_s_i16x4, int16x4_t, int16_t, +,
251 __packed_splat4)
252__packed_scalar_binary_op(padd_s_u32x2, uint32x2_t, uint32_t, +,
253 __packed_splat2)
254__packed_scalar_binary_op(padd_s_i32x2, int32x2_t, int32_t, +,
255 __packed_splat2)
256
257/* Packed Saturating Addition and Subtraction (32-bit) */
258__packed_binary_builtin(psadd_i8x4, int8x4_t, __builtin_elementwise_add_sat)
259__packed_binary_builtin(psadd_i16x2, int16x2_t, __builtin_elementwise_add_sat)
260__packed_binary_builtin(psaddu_u8x4, uint8x4_t, __builtin_elementwise_add_sat)
261__packed_binary_builtin(psaddu_u16x2, uint16x2_t, __builtin_elementwise_add_sat)
262__packed_binary_builtin(pssub_i8x4, int8x4_t, __builtin_elementwise_sub_sat)
263__packed_binary_builtin(pssub_i16x2, int16x2_t, __builtin_elementwise_sub_sat)
264__packed_binary_builtin(pssubu_u8x4, uint8x4_t, __builtin_elementwise_sub_sat)
265__packed_binary_builtin(pssubu_u16x2, uint16x2_t, __builtin_elementwise_sub_sat)
266
267/* Packed Saturating Addition and Subtraction (64-bit) */
268__packed_binary_builtin(psadd_i8x8, int8x8_t, __builtin_elementwise_add_sat)
269__packed_binary_builtin(psadd_i16x4, int16x4_t, __builtin_elementwise_add_sat)
270__packed_binary_builtin(psadd_i32x2, int32x2_t, __builtin_elementwise_add_sat)
271__packed_binary_builtin(psaddu_u8x8, uint8x8_t, __builtin_elementwise_add_sat)
272__packed_binary_builtin(psaddu_u16x4, uint16x4_t, __builtin_elementwise_add_sat)
273__packed_binary_builtin(psaddu_u32x2, uint32x2_t, __builtin_elementwise_add_sat)
274__packed_binary_builtin(pssub_i8x8, int8x8_t, __builtin_elementwise_sub_sat)
275__packed_binary_builtin(pssub_i16x4, int16x4_t, __builtin_elementwise_sub_sat)
276__packed_binary_builtin(pssub_i32x2, int32x2_t, __builtin_elementwise_sub_sat)
277__packed_binary_builtin(pssubu_u8x8, uint8x8_t, __builtin_elementwise_sub_sat)
278__packed_binary_builtin(pssubu_u16x4, uint16x4_t, __builtin_elementwise_sub_sat)
279__packed_binary_builtin(pssubu_u32x2, uint32x2_t, __builtin_elementwise_sub_sat)
280
281/* Packed Shift-Add (32-bit) */
282__packed_sh1add(psh1add_i16x2, int16x2_t)
283__packed_sh1add(psh1add_u16x2, uint16x2_t)
284__packed_sh1sadd(pssh1sadd_i16x2, int16x2_t)
285
286/* Packed Shift-Add (64-bit) */
287__packed_sh1add(psh1add_i16x4, int16x4_t)
288__packed_sh1add(psh1add_u16x4, uint16x4_t)
289__packed_sh1add(psh1add_i32x2, int32x2_t)
290__packed_sh1add(psh1add_u32x2, uint32x2_t)
291__packed_sh1sadd(pssh1sadd_i16x4, int16x4_t)
292__packed_sh1sadd(pssh1sadd_i32x2, int32x2_t)
293
294/* Packed Exchanged Addition and Subtraction (32-bit) */
295__packed_binary_builtin(pas_x_i16x2, int16x2_t, __builtin_riscv_pas_x_i16x2)
296__packed_binary_builtin(psa_x_i16x2, int16x2_t, __builtin_riscv_psa_x_i16x2)
297__packed_binary_builtin(psas_x_i16x2, int16x2_t, __builtin_riscv_psas_x_i16x2)
298__packed_binary_builtin(pssa_x_i16x2, int16x2_t, __builtin_riscv_pssa_x_i16x2)
299__packed_binary_builtin(paas_x_i16x2, int16x2_t, __builtin_riscv_paas_x_i16x2)
300__packed_binary_builtin(pasa_x_i16x2, int16x2_t, __builtin_riscv_pasa_x_i16x2)
301
302/* Packed Exchanged Addition and Subtraction (64-bit) */
303__packed_binary_builtin(pas_x_i16x4, int16x4_t, __builtin_riscv_pas_x_i16x4)
304__packed_binary_builtin(psa_x_i16x4, int16x4_t, __builtin_riscv_psa_x_i16x4)
305__packed_binary_builtin(psas_x_i16x4, int16x4_t, __builtin_riscv_psas_x_i16x4)
306__packed_binary_builtin(pssa_x_i16x4, int16x4_t, __builtin_riscv_pssa_x_i16x4)
307__packed_binary_builtin(paas_x_i16x4, int16x4_t, __builtin_riscv_paas_x_i16x4)
308__packed_binary_builtin(pasa_x_i16x4, int16x4_t, __builtin_riscv_pasa_x_i16x4)
309__packed_binary_builtin(pas_x_i32x2, int32x2_t, __builtin_riscv_pas_x_i32x2)
310__packed_binary_builtin(psa_x_i32x2, int32x2_t, __builtin_riscv_psa_x_i32x2)
311__packed_binary_builtin(psas_x_i32x2, int32x2_t, __builtin_riscv_psas_x_i32x2)
312__packed_binary_builtin(pssa_x_i32x2, int32x2_t, __builtin_riscv_pssa_x_i32x2)
313__packed_binary_builtin(paas_x_i32x2, int32x2_t, __builtin_riscv_paas_x_i32x2)
314__packed_binary_builtin(pasa_x_i32x2, int32x2_t, __builtin_riscv_pasa_x_i32x2)
315
316/* Packed Minimum and Maximum (32-bit) */
317__packed_binary_builtin(pmin_i8x4, int8x4_t, __builtin_elementwise_min)
318__packed_binary_builtin(pmin_i16x2, int16x2_t, __builtin_elementwise_min)
319__packed_binary_builtin(pminu_u8x4, uint8x4_t, __builtin_elementwise_min)
320__packed_binary_builtin(pminu_u16x2, uint16x2_t, __builtin_elementwise_min)
321__packed_binary_builtin(pmax_i8x4, int8x4_t, __builtin_elementwise_max)
322__packed_binary_builtin(pmax_i16x2, int16x2_t, __builtin_elementwise_max)
323__packed_binary_builtin(pmaxu_u8x4, uint8x4_t, __builtin_elementwise_max)
324__packed_binary_builtin(pmaxu_u16x2, uint16x2_t, __builtin_elementwise_max)
325
326/* Packed Minimum and Maximum (64-bit) */
327__packed_binary_builtin(pmin_i8x8, int8x8_t, __builtin_elementwise_min)
328__packed_binary_builtin(pmin_i16x4, int16x4_t, __builtin_elementwise_min)
329__packed_binary_builtin(pmin_i32x2, int32x2_t, __builtin_elementwise_min)
330__packed_binary_builtin(pminu_u8x8, uint8x8_t, __builtin_elementwise_min)
331__packed_binary_builtin(pminu_u16x4, uint16x4_t, __builtin_elementwise_min)
332__packed_binary_builtin(pminu_u32x2, uint32x2_t, __builtin_elementwise_min)
333__packed_binary_builtin(pmax_i8x8, int8x8_t, __builtin_elementwise_max)
334__packed_binary_builtin(pmax_i16x4, int16x4_t, __builtin_elementwise_max)
335__packed_binary_builtin(pmax_i32x2, int32x2_t, __builtin_elementwise_max)
336__packed_binary_builtin(pmaxu_u8x8, uint8x8_t, __builtin_elementwise_max)
337__packed_binary_builtin(pmaxu_u16x4, uint16x4_t, __builtin_elementwise_max)
338__packed_binary_builtin(pmaxu_u32x2, uint32x2_t, __builtin_elementwise_max)
339
340/* Packed Comparison (32-bit) */
341__packed_cmp(pmseq_i8x4_u8x4, int8x4_t, uint8x4_t, ==)
342__packed_cmp(pmseq_u8x4_u8x4, uint8x4_t, uint8x4_t, ==)
343__packed_cmp(pmsne_i8x4_u8x4, int8x4_t, uint8x4_t, !=)
344__packed_cmp(pmsne_u8x4_u8x4, uint8x4_t, uint8x4_t, !=)
345__packed_cmp(pmslt_u8x4, int8x4_t, uint8x4_t, <)
346__packed_cmp(pmsltu_u8x4, uint8x4_t, uint8x4_t, <)
347__packed_cmp(pmsgt_u8x4, int8x4_t, uint8x4_t, >)
348__packed_cmp(pmsgtu_u8x4, uint8x4_t, uint8x4_t, >)
349__packed_cmp(pmsge_u8x4, int8x4_t, uint8x4_t, >=)
350__packed_cmp(pmsgeu_u8x4, uint8x4_t, uint8x4_t, >=)
351__packed_cmp(pmsle_u8x4, int8x4_t, uint8x4_t, <=)
352__packed_cmp(pmsleu_u8x4, uint8x4_t, uint8x4_t, <=)
353__packed_cmp(pmseq_i16x2_u16x2, int16x2_t, uint16x2_t, ==)
354__packed_cmp(pmseq_u16x2_u16x2, uint16x2_t, uint16x2_t, ==)
355__packed_cmp(pmsne_i16x2_u16x2, int16x2_t, uint16x2_t, !=)
356__packed_cmp(pmsne_u16x2_u16x2, uint16x2_t, uint16x2_t, !=)
357__packed_cmp(pmslt_u16x2, int16x2_t, uint16x2_t, <)
358__packed_cmp(pmsltu_u16x2, uint16x2_t, uint16x2_t, <)
359__packed_cmp(pmsgt_u16x2, int16x2_t, uint16x2_t, >)
360__packed_cmp(pmsgtu_u16x2, uint16x2_t, uint16x2_t, >)
361__packed_cmp(pmsge_u16x2, int16x2_t, uint16x2_t, >=)
362__packed_cmp(pmsgeu_u16x2, uint16x2_t, uint16x2_t, >=)
363__packed_cmp(pmsle_u16x2, int16x2_t, uint16x2_t, <=)
364__packed_cmp(pmsleu_u16x2, uint16x2_t, uint16x2_t, <=)
365
366/* Packed Comparison (64-bit) */
367__packed_cmp(pmseq_i8x8_u8x8, int8x8_t, uint8x8_t, ==)
368__packed_cmp(pmseq_u8x8_u8x8, uint8x8_t, uint8x8_t, ==)
369__packed_cmp(pmsne_i8x8_u8x8, int8x8_t, uint8x8_t, !=)
370__packed_cmp(pmsne_u8x8_u8x8, uint8x8_t, uint8x8_t, !=)
371__packed_cmp(pmslt_u8x8, int8x8_t, uint8x8_t, <)
372__packed_cmp(pmsltu_u8x8, uint8x8_t, uint8x8_t, <)
373__packed_cmp(pmsgt_u8x8, int8x8_t, uint8x8_t, >)
374__packed_cmp(pmsgtu_u8x8, uint8x8_t, uint8x8_t, >)
375__packed_cmp(pmsge_u8x8, int8x8_t, uint8x8_t, >=)
376__packed_cmp(pmsgeu_u8x8, uint8x8_t, uint8x8_t, >=)
377__packed_cmp(pmsle_u8x8, int8x8_t, uint8x8_t, <=)
378__packed_cmp(pmsleu_u8x8, uint8x8_t, uint8x8_t, <=)
379__packed_cmp(pmseq_i16x4_u16x4, int16x4_t, uint16x4_t, ==)
380__packed_cmp(pmseq_u16x4_u16x4, uint16x4_t, uint16x4_t, ==)
381__packed_cmp(pmsne_i16x4_u16x4, int16x4_t, uint16x4_t, !=)
382__packed_cmp(pmsne_u16x4_u16x4, uint16x4_t, uint16x4_t, !=)
383__packed_cmp(pmslt_u16x4, int16x4_t, uint16x4_t, <)
384__packed_cmp(pmsltu_u16x4, uint16x4_t, uint16x4_t, <)
385__packed_cmp(pmsgt_u16x4, int16x4_t, uint16x4_t, >)
386__packed_cmp(pmsgtu_u16x4, uint16x4_t, uint16x4_t, >)
387__packed_cmp(pmsge_u16x4, int16x4_t, uint16x4_t, >=)
388__packed_cmp(pmsgeu_u16x4, uint16x4_t, uint16x4_t, >=)
389__packed_cmp(pmsle_u16x4, int16x4_t, uint16x4_t, <=)
390__packed_cmp(pmsleu_u16x4, uint16x4_t, uint16x4_t, <=)
391__packed_cmp(pmseq_i32x2_u32x2, int32x2_t, uint32x2_t, ==)
392__packed_cmp(pmseq_u32x2_u32x2, uint32x2_t, uint32x2_t, ==)
393__packed_cmp(pmsne_i32x2_u32x2, int32x2_t, uint32x2_t, !=)
394__packed_cmp(pmsne_u32x2_u32x2, uint32x2_t, uint32x2_t, !=)
395__packed_cmp(pmslt_u32x2, int32x2_t, uint32x2_t, <)
396__packed_cmp(pmsltu_u32x2, uint32x2_t, uint32x2_t, <)
397__packed_cmp(pmsgt_u32x2, int32x2_t, uint32x2_t, >)
398__packed_cmp(pmsgtu_u32x2, uint32x2_t, uint32x2_t, >)
399__packed_cmp(pmsge_u32x2, int32x2_t, uint32x2_t, >=)
400__packed_cmp(pmsgeu_u32x2, uint32x2_t, uint32x2_t, >=)
401__packed_cmp(pmsle_u32x2, int32x2_t, uint32x2_t, <=)
402__packed_cmp(pmsleu_u32x2, uint32x2_t, uint32x2_t, <=)
403
404/* Packed Shifts (32-bit) */
405__packed_shift8(psll_s_u8x4, uint8x4_t, <<)
406__packed_shift8(psll_s_i8x4, int8x4_t, <<)
407__packed_shift16(psll_s_u16x2, uint16x2_t, <<)
408__packed_shift16(psll_s_i16x2, int16x2_t, <<)
409__packed_shift8(psrl_s_u8x4, uint8x4_t, >>)
410__packed_shift16(psrl_s_u16x2, uint16x2_t, >>)
411__packed_shift8(psra_s_i8x4, int8x4_t, >>)
412__packed_shift16(psra_s_i16x2, int16x2_t, >>)
413
414/* Packed Shifts (64-bit) */
415__packed_shift8(psll_s_u8x8, uint8x8_t, <<)
416__packed_shift8(psll_s_i8x8, int8x8_t, <<)
417__packed_shift16(psll_s_u16x4, uint16x4_t, <<)
418__packed_shift16(psll_s_i16x4, int16x4_t, <<)
419__packed_shift32(psll_s_u32x2, uint32x2_t, <<)
420__packed_shift32(psll_s_i32x2, int32x2_t, <<)
421__packed_shift8(psrl_s_u8x8, uint8x8_t, >>)
422__packed_shift16(psrl_s_u16x4, uint16x4_t, >>)
423__packed_shift32(psrl_s_u32x2, uint32x2_t, >>)
424__packed_shift8(psra_s_i8x8, int8x8_t, >>)
425__packed_shift16(psra_s_i16x4, int16x4_t, >>)
426__packed_shift32(psra_s_i32x2, int32x2_t, >>)
427
428/* Packed Logical Operations (32-bit) */
429__packed_binary_op(pand_i8x4, int8x4_t, &)
430__packed_binary_op(pand_u8x4, uint8x4_t, &)
431__packed_binary_op(pand_i16x2, int16x2_t, &)
432__packed_binary_op(pand_u16x2, uint16x2_t, &)
433__packed_binary_op(por_i8x4, int8x4_t, |)
434__packed_binary_op(por_u8x4, uint8x4_t, |)
435__packed_binary_op(por_i16x2, int16x2_t, |)
436__packed_binary_op(por_u16x2, uint16x2_t, |)
437__packed_binary_op(pxor_i8x4, int8x4_t, ^)
438__packed_binary_op(pxor_u8x4, uint8x4_t, ^)
439__packed_binary_op(pxor_i16x2, int16x2_t, ^)
440__packed_binary_op(pxor_u16x2, uint16x2_t, ^)
441__packed_unary_op(pnot_i8x4, int8x4_t, ~)
442__packed_unary_op(pnot_u8x4, uint8x4_t, ~)
443__packed_unary_op(pnot_i16x2, int16x2_t, ~)
444__packed_unary_op(pnot_u16x2, uint16x2_t, ~)
445
446/* Packed Logical Operations (64-bit) */
447__packed_binary_op(pand_i8x8, int8x8_t, &)
448__packed_binary_op(pand_u8x8, uint8x8_t, &)
449__packed_binary_op(pand_i16x4, int16x4_t, &)
450__packed_binary_op(pand_u16x4, uint16x4_t, &)
451__packed_binary_op(pand_i32x2, int32x2_t, &)
452__packed_binary_op(pand_u32x2, uint32x2_t, &)
453__packed_binary_op(por_i8x8, int8x8_t, |)
454__packed_binary_op(por_u8x8, uint8x8_t, |)
455__packed_binary_op(por_i16x4, int16x4_t, |)
456__packed_binary_op(por_u16x4, uint16x4_t, |)
457__packed_binary_op(por_i32x2, int32x2_t, |)
458__packed_binary_op(por_u32x2, uint32x2_t, |)
459__packed_binary_op(pxor_i8x8, int8x8_t, ^)
460__packed_binary_op(pxor_u8x8, uint8x8_t, ^)
461__packed_binary_op(pxor_i16x4, int16x4_t, ^)
462__packed_binary_op(pxor_u16x4, uint16x4_t, ^)
463__packed_binary_op(pxor_i32x2, int32x2_t, ^)
464__packed_binary_op(pxor_u32x2, uint32x2_t, ^)
465__packed_unary_op(pnot_i8x8, int8x8_t, ~)
466__packed_unary_op(pnot_u8x8, uint8x8_t, ~)
467__packed_unary_op(pnot_i16x4, int16x4_t, ~)
468__packed_unary_op(pnot_u16x4, uint16x4_t, ~)
469__packed_unary_op(pnot_i32x2, int32x2_t, ~)
470__packed_unary_op(pnot_u32x2, uint32x2_t, ~)
471
472/* Packed Widening Convert */
473__packed_widen_convert(pwcvt_i16x4, int16x4_t, int8x4_t)
474__packed_widen_convert(pwcvt_i32x2, int32x2_t, int16x2_t)
475__packed_widen_convert(pwcvtu_u16x4, uint16x4_t, uint8x4_t)
476__packed_widen_convert(pwcvtu_u32x2, uint32x2_t, uint16x2_t)
477__packed_widen_high4(pwcvth_i16x4, int16x4_t, int8x4_t)
478__packed_widen_high4(pwcvth_u16x4, uint16x4_t, uint8x4_t)
479__packed_widen_high2(pwcvth_i32x2, int32x2_t, int16x2_t)
480__packed_widen_high2(pwcvth_u32x2, uint32x2_t, uint16x2_t)
481
482/* Packed Reverse (32-bit) */
483__packed_reverse4(prev_i8x4, int8x4_t)
484__packed_reverse4(prev_u8x4, uint8x4_t)
485__packed_reverse2(prev_i16x2, int16x2_t)
486__packed_reverse2(prev_u16x2, uint16x2_t)
487
488/* Packed Reverse (64-bit) */
489__packed_reverse8(prev_i8x8, int8x8_t)
490__packed_reverse8(prev_u8x8, uint8x8_t)
491__packed_reverse4(prev_i16x4, int16x4_t)
492__packed_reverse4(prev_u16x4, uint16x4_t)
493__packed_reverse2(prev_i32x2, int32x2_t)
494__packed_reverse2(prev_u32x2, uint32x2_t)
495
496/* Packed Zip */
497__packed_zip4(pzip_i8x8, int8x8_t, int8x4_t)
498__packed_zip4(pzip_u8x8, uint8x8_t, uint8x4_t)
499__packed_zip2(pzip_i16x4, int16x4_t, int16x2_t)
500__packed_zip2(pzip_u16x4, uint16x4_t, uint16x2_t)
501
502/* Packed Unzip */
503__packed_unzipe4(punzipe_i8x4, int8x4_t, int8x8_t)
504__packed_unzipo4(punzipo_i8x4, int8x4_t, int8x8_t)
505__packed_unzipe4(punzipe_u8x4, uint8x4_t, uint8x8_t)
506__packed_unzipo4(punzipo_u8x4, uint8x4_t, uint8x8_t)
507__packed_unzipe2(punzipe_i16x2, int16x2_t, int16x4_t)
508__packed_unzipo2(punzipo_i16x2, int16x2_t, int16x4_t)
509__packed_unzipe2(punzipe_u16x2, uint16x2_t, uint16x4_t)
510__packed_unzipo2(punzipo_u16x2, uint16x2_t, uint16x4_t)
511
512/* Packed Averaging Addition and Subtraction (32-bit) */
513__packed_binary_builtin(paadd_i8x4, int8x4_t, __builtin_riscv_paadd_i8x4)
514__packed_binary_builtin(paadd_i16x2, int16x2_t, __builtin_riscv_paadd_i16x2)
515__packed_binary_builtin(paaddu_u8x4, uint8x4_t, __builtin_riscv_paaddu_u8x4)
516__packed_binary_builtin(paaddu_u16x2, uint16x2_t, __builtin_riscv_paaddu_u16x2)
517__packed_binary_builtin(pasub_i8x4, int8x4_t, __builtin_riscv_pasub_i8x4)
518__packed_binary_builtin(pasub_i16x2, int16x2_t, __builtin_riscv_pasub_i16x2)
519__packed_binary_builtin(pasubu_u8x4, uint8x4_t, __builtin_riscv_pasubu_u8x4)
520__packed_binary_builtin(pasubu_u16x2, uint16x2_t, __builtin_riscv_pasubu_u16x2)
521
522/* Packed Averaging Addition and Subtraction (64-bit) */
523__packed_binary_builtin(paadd_i8x8, int8x8_t, __builtin_riscv_paadd_i8x8)
524__packed_binary_builtin(paadd_i16x4, int16x4_t, __builtin_riscv_paadd_i16x4)
525__packed_binary_builtin(paadd_i32x2, int32x2_t, __builtin_riscv_paadd_i32x2)
526__packed_binary_builtin(paaddu_u8x8, uint8x8_t, __builtin_riscv_paaddu_u8x8)
527__packed_binary_builtin(paaddu_u16x4, uint16x4_t, __builtin_riscv_paaddu_u16x4)
528__packed_binary_builtin(paaddu_u32x2, uint32x2_t, __builtin_riscv_paaddu_u32x2)
529__packed_binary_builtin(pasub_i8x8, int8x8_t, __builtin_riscv_pasub_i8x8)
530__packed_binary_builtin(pasub_i16x4, int16x4_t, __builtin_riscv_pasub_i16x4)
531__packed_binary_builtin(pasub_i32x2, int32x2_t, __builtin_riscv_pasub_i32x2)
532__packed_binary_builtin(pasubu_u8x8, uint8x8_t, __builtin_riscv_pasubu_u8x8)
533__packed_binary_builtin(pasubu_u16x4, uint16x4_t, __builtin_riscv_pasubu_u16x4)
534__packed_binary_builtin(pasubu_u32x2, uint32x2_t, __builtin_riscv_pasubu_u32x2)
535
536/* Packed Absolute Value and Absolute Difference (32-bit) */
537__packed_pabs(pabs_i8x4, int8x4_t, uint8x4_t)
538__packed_pabs(pabs_i16x2, int16x2_t, uint16x2_t)
539__packed_binary_builtin_cast(pabd_i8x4, int8x4_t, uint8x4_t, __builtin_riscv_pabd_i8x4)
540__packed_binary_builtin_cast(pabd_i16x2, int16x2_t, uint16x2_t, __builtin_riscv_pabd_i16x2)
541__packed_binary_builtin_cast(pabdu_u8x4, uint8x4_t, uint8x4_t, __builtin_riscv_pabdu_u8x4)
542__packed_binary_builtin_cast(pabdu_u16x2, uint16x2_t, uint16x2_t, __builtin_riscv_pabdu_u16x2)
543
544/* Packed Absolute Value and Absolute Difference (64-bit) */
545__packed_pabs(pabs_i8x8, int8x8_t, uint8x8_t)
546__packed_pabs(pabs_i16x4, int16x4_t, uint16x4_t)
547__packed_binary_builtin_cast(pabd_i8x8, int8x8_t, uint8x8_t, __builtin_riscv_pabd_i8x8)
548__packed_binary_builtin_cast(pabd_i16x4, int16x4_t, uint16x4_t, __builtin_riscv_pabd_i16x4)
549__packed_binary_builtin_cast(pabdu_u8x8, uint8x8_t, uint8x8_t, __builtin_riscv_pabdu_u8x8)
550__packed_binary_builtin_cast(pabdu_u16x4, uint16x4_t, uint16x4_t, __builtin_riscv_pabdu_u16x4)
551
552/* Packed Reduction Sum (32-bit) */
553__packed_reduction(predsum_i8x4_i32, int32_t, int8x4_t, __builtin_riscv_predsum_i8x4_i32)
554__packed_reduction(predsumu_u8x4_u32, uint32_t, uint8x4_t, __builtin_riscv_predsumu_u8x4_u32)
555__packed_reduction(predsum_i16x2_i32, int32_t, int16x2_t, __builtin_riscv_predsum_i16x2_i32)
556__packed_reduction(predsumu_u16x2_u32, uint32_t, uint16x2_t, __builtin_riscv_predsumu_u16x2_u32)
557
558/* Packed Reduction Sum (64-bit) */
559__packed_reduction(predsum_i8x8_i32, int32_t, int8x8_t, __builtin_riscv_predsum_i8x8_i32)
560__packed_reduction(predsumu_u8x8_u32, uint32_t, uint8x8_t, __builtin_riscv_predsumu_u8x8_u32)
561__packed_reduction(predsum_i16x4_i32, int32_t, int16x4_t, __builtin_riscv_predsum_i16x4_i32)
562__packed_reduction(predsumu_u16x4_u32, uint32_t, uint16x4_t, __builtin_riscv_predsumu_u16x4_u32)
563__packed_reduction(predsum_i8x8_i64, int64_t, int8x8_t, __builtin_riscv_predsum_i8x8_i64)
564__packed_reduction(predsumu_u8x8_u64, uint64_t, uint8x8_t, __builtin_riscv_predsumu_u8x8_u64)
565__packed_reduction(predsum_i16x4_i64, int64_t, int16x4_t, __builtin_riscv_predsum_i16x4_i64)
566__packed_reduction(predsumu_u16x4_u64, uint64_t, uint16x4_t, __builtin_riscv_predsumu_u16x4_u64)
567__packed_reduction(predsum_i32x2_i64, int64_t, int32x2_t, __builtin_riscv_predsum_i32x2_i64)
568__packed_reduction(predsumu_u32x2_u64, uint64_t, uint32x2_t, __builtin_riscv_predsumu_u32x2_u64)
569
570/* Packed Merge (32-bit) */
571__packed_merge_builtin(pmerge_u8x4, uint8x4_t, uint8x4_t, __builtin_riscv_pmerge_u8x4)
572__packed_merge_builtin(pmerge_i8x4, int8x4_t, uint8x4_t, __builtin_riscv_pmerge_i8x4)
573__packed_merge_builtin(pmerge_u16x2, uint16x2_t, uint16x2_t, __builtin_riscv_pmerge_u16x2)
574__packed_merge_builtin(pmerge_i16x2, int16x2_t, uint16x2_t, __builtin_riscv_pmerge_i16x2)
575
576/* Packed Merge (64-bit) */
577__packed_merge_builtin(pmerge_u8x8, uint8x8_t, uint8x8_t, __builtin_riscv_pmerge_u8x8)
578__packed_merge_builtin(pmerge_i8x8, int8x8_t, uint8x8_t, __builtin_riscv_pmerge_i8x8)
579__packed_merge_builtin(pmerge_u16x4, uint16x4_t, uint16x4_t, __builtin_riscv_pmerge_u16x4)
580__packed_merge_builtin(pmerge_i16x4, int16x4_t, uint16x4_t, __builtin_riscv_pmerge_i16x4)
581__packed_merge_builtin(pmerge_u32x2, uint32x2_t, uint32x2_t, __builtin_riscv_pmerge_u32x2)
582__packed_merge_builtin(pmerge_i32x2, int32x2_t, uint32x2_t, __builtin_riscv_pmerge_i32x2)
583
584/* Packed Absolute Difference Sum (32-bit) */
585__packed_abdsum(pabdsumu_u8x4_u32, uint32_t, uint8x4_t, __builtin_riscv_pabdsumu_u8x4_u32)
586__packed_abdsum_acc(pabdsumau_u8x4_u32, uint32_t, uint8x4_t, __builtin_riscv_pabdsumau_u8x4_u32)
587
588/* Packed Absolute Difference Sum (64-bit) */
589__packed_abdsum(pabdsumu_u8x8_u32, uint32_t, uint8x8_t, __builtin_riscv_pabdsumu_u8x8_u32)
590__packed_abdsum(pabdsumu_u8x8_u64, uint64_t, uint8x8_t, __builtin_riscv_pabdsumu_u8x8_u64)
591__packed_abdsum_acc(pabdsumau_u8x8_u32, uint32_t, uint8x8_t, __builtin_riscv_pabdsumau_u8x8_u32)
592__packed_abdsum_acc(pabdsumau_u8x8_u64, uint64_t, uint8x8_t, __builtin_riscv_pabdsumau_u8x8_u64)
593
594/* Packed Saturating Absolute Value (32-bit) */
595__packed_psabs(psabs_i8x4, int8x4_t, __builtin_riscv_psabs_i8x4)
596__packed_psabs(psabs_i16x2, int16x2_t, __builtin_riscv_psabs_i16x2)
597
598/* Packed Saturating Absolute Value (64-bit) */
599__packed_psabs(psabs_i8x8, int8x8_t, __builtin_riscv_psabs_i8x8)
600__packed_psabs(psabs_i16x4, int16x4_t, __builtin_riscv_psabs_i16x4)
601
602// clang-format on
603
604#undef __packed_splat2
605#undef __packed_splat4
606#undef __packed_splat8
607#undef __packed_splat
608#undef __packed_shift
609#undef __packed_shift8
610#undef __packed_shift16
611#undef __packed_shift32
612#undef __packed_scalar_binary_op
613#undef __packed_binary_op
614#undef __packed_unary_op
615#undef __packed_binary_builtin
616#undef __packed_sh1add
617#undef __packed_sh1sadd
618#undef __packed_cmp
619#undef __packed_pabs
620#undef __packed_binary_builtin_cast
621#undef __packed_reduction
622#undef __packed_merge_builtin
623#undef __packed_psabs
624#undef __packed_widen_convert
625#undef __packed_widen_high2
626#undef __packed_widen_high4
627#undef __packed_reverse2
628#undef __packed_reverse4
629#undef __packed_reverse8
630#undef __packed_zip2
631#undef __packed_zip4
632#undef __packed_unzipe2
633#undef __packed_unzipe4
634#undef __packed_unzipo2
635#undef __packed_unzipo4
636#undef __packed_abdsum
637#undef __packed_abdsum_acc
638#undef __DEFAULT_FN_ATTRS
639
640#if defined(__cplusplus)
641}
642#endif
643
644#endif /* __RISCV_PACKED_SIMD_H */
lib/include/riscv_vector.h+43
...@@ -20,6 +20,35 @@ extern "C" {...@@ -20,6 +20,35 @@ extern "C" {
2020
21#pragma clang riscv intrinsic vector21#pragma clang riscv intrinsic vector
2222
23#define __riscv_intrinsic_v 1
24#define __riscv_intrinsic_zvabd 1
25#define __riscv_intrinsic_zvbb 1
26#define __riscv_intrinsic_zvbc 1
27#define __riscv_intrinsic_zvdot4a8i 1
28#define __riscv_intrinsic_zve32f 1
29#define __riscv_intrinsic_zve32x 1
30#define __riscv_intrinsic_zve64d 1
31#define __riscv_intrinsic_zve64f 1
32#define __riscv_intrinsic_zve64x 1
33#define __riscv_intrinsic_zvfbfa 1
34#define __riscv_intrinsic_zvfbfmin 1
35#define __riscv_intrinsic_zvfbfwma 1
36#define __riscv_intrinsic_zvfh 1
37#define __riscv_intrinsic_zvfhmin 1
38#define __riscv_intrinsic_zvfofp8min 1
39#define __riscv_intrinsic_zvkb 1
40#define __riscv_intrinsic_zvkg 1
41#define __riscv_intrinsic_zvkn 1
42#define __riscv_intrinsic_zvknc 1
43#define __riscv_intrinsic_zvkned 1
44#define __riscv_intrinsic_zvkng 1
45#define __riscv_intrinsic_zvknha 1
46#define __riscv_intrinsic_zvknhb 1
47#define __riscv_intrinsic_zvks 1
48#define __riscv_intrinsic_zvksc 1
49#define __riscv_intrinsic_zvksed 1
50#define __riscv_intrinsic_zvksg 1
51#define __riscv_intrinsic_zvksh 1
2352
24enum __RISCV_FRM {53enum __RISCV_FRM {
25 __RISCV_FRM_RNE = 0,54 __RISCV_FRM_RNE = 0,
...@@ -415,6 +444,20 @@ typedef __rvv_bfloat16m2x4_t vbfloat16m2x4_t;...@@ -415,6 +444,20 @@ typedef __rvv_bfloat16m2x4_t vbfloat16m2x4_t;
415typedef __rvv_bfloat16m4_t vbfloat16m4_t;444typedef __rvv_bfloat16m4_t vbfloat16m4_t;
416typedef __rvv_bfloat16m4x2_t vbfloat16m4x2_t;445typedef __rvv_bfloat16m4x2_t vbfloat16m4x2_t;
417typedef __rvv_bfloat16m8_t vbfloat16m8_t;446typedef __rvv_bfloat16m8_t vbfloat16m8_t;
447typedef __rvv_float8e4m3mf8_t vfloat8e4m3mf8_t;
448typedef __rvv_float8e4m3mf4_t vfloat8e4m3mf4_t;
449typedef __rvv_float8e4m3mf2_t vfloat8e4m3mf2_t;
450typedef __rvv_float8e4m3m1_t vfloat8e4m3m1_t;
451typedef __rvv_float8e4m3m2_t vfloat8e4m3m2_t;
452typedef __rvv_float8e4m3m4_t vfloat8e4m3m4_t;
453typedef __rvv_float8e4m3m8_t vfloat8e4m3m8_t;
454typedef __rvv_float8e5m2mf8_t vfloat8e5m2mf8_t;
455typedef __rvv_float8e5m2mf4_t vfloat8e5m2mf4_t;
456typedef __rvv_float8e5m2mf2_t vfloat8e5m2mf2_t;
457typedef __rvv_float8e5m2m1_t vfloat8e5m2m1_t;
458typedef __rvv_float8e5m2m2_t vfloat8e5m2m2_t;
459typedef __rvv_float8e5m2m4_t vfloat8e5m2m4_t;
460typedef __rvv_float8e5m2m8_t vfloat8e5m2m8_t;
418461
419#ifdef __cplusplus462#ifdef __cplusplus
420}463}
lib/include/sifive_vector.h+18
...@@ -13,6 +13,24 @@...@@ -13,6 +13,24 @@
1313
14#pragma clang riscv intrinsic sifive_vector14#pragma clang riscv intrinsic sifive_vector
1515
16#define __riscv_intrinsic_xsfmm32a16f 1
17#define __riscv_intrinsic_xsfmm32a32f 1
18#define __riscv_intrinsic_xsfmm32a8f 1
19#define __riscv_intrinsic_xsfmm32a8i 1
20#define __riscv_intrinsic_xsfmm32a 1
21#define __riscv_intrinsic_xsfmm64a64f 1
22#define __riscv_intrinsic_xsfmmbase 1
23#define __riscv_intrinsic_xsfvcp 1
24#define __riscv_intrinsic_xsfvfbfexp16e 1
25#define __riscv_intrinsic_xsfvfexp16e 1
26#define __riscv_intrinsic_xsfvfexp32e 1
27#define __riscv_intrinsic_xsfvfexpa 1
28#define __riscv_intrinsic_xsfvfexpa64e 1
29#define __riscv_intrinsic_xsfvfnrclipxfqf 1
30#define __riscv_intrinsic_xsfvfwmaccqqq 1
31#define __riscv_intrinsic_xsfvqmaccdod 1
32#define __riscv_intrinsic_xsfvqmaccqoq 1
33
16#define __riscv_sf_vc_x_se_u8mf4(p27_26, p24_20, p11_7, rs1, vl) \34#define __riscv_sf_vc_x_se_u8mf4(p27_26, p24_20, p11_7, rs1, vl) \
17 __riscv_sf_vc_x_se(p27_26, p24_20, p11_7, (uint8_t)rs1, 8, 6, vl)35 __riscv_sf_vc_x_se(p27_26, p24_20, p11_7, (uint8_t)rs1, 8, 6, vl)
18#define __riscv_sf_vc_x_se_u8mf2(p27_26, p24_20, p11_7, rs1, vl) \36#define __riscv_sf_vc_x_se_u8mf2(p27_26, p24_20, p11_7, rs1, vl) \
lib/include/spirvintrin.h+2-29
...@@ -27,9 +27,6 @@ _Pragma("omp begin declare variant match(device = {arch(spirv64)})");...@@ -27,9 +27,6 @@ _Pragma("omp begin declare variant match(device = {arch(spirv64)})");
27#define __gpu_global __attribute__((address_space(1)))27#define __gpu_global __attribute__((address_space(1)))
28#define __gpu_generic __attribute__((address_space(4)))28#define __gpu_generic __attribute__((address_space(4)))
2929
30// Attribute to declare a function as a kernel.
31#define __gpu_kernel __attribute__((device_kernel, visibility("protected")))
32
33// Returns the number of workgroups in the 'x' dimension of the grid.30// Returns the number of workgroups in the 'x' dimension of the grid.
34_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_x(void) {31_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_x(void) {
35 return __builtin_spirv_num_workgroups(0);32 return __builtin_spirv_num_workgroups(0);
...@@ -146,37 +143,13 @@ __gpu_shuffle_idx_u32(uint64_t __lane_mask, uint32_t __idx, uint32_t __x,...@@ -146,37 +143,13 @@ __gpu_shuffle_idx_u32(uint64_t __lane_mask, uint32_t __idx, uint32_t __x,
146 return __builtin_spirv_subgroup_shuffle(__x, __lane);143 return __builtin_spirv_subgroup_shuffle(__x, __lane);
147}144}
148145
149// Returns a bitmask marking all lanes that have the same value of __x.
150_DEFAULT_FN_ATTRS static __inline__ uint64_t
151__gpu_match_any_u32(uint64_t __lane_mask, uint32_t __x) {
152 return __gpu_match_any_u32_impl(__lane_mask, __x);
153}
154
155// Returns a bitmask marking all lanes that have the same value of __x.
156_DEFAULT_FN_ATTRS static __inline__ uint64_t
157__gpu_match_any_u64(uint64_t __lane_mask, uint64_t __x) {
158 return __gpu_match_any_u64_impl(__lane_mask, __x);
159}
160
161// Returns the current lane mask if every lane contains __x.
162_DEFAULT_FN_ATTRS static __inline__ uint64_t
163__gpu_match_all_u32(uint64_t __lane_mask, uint32_t __x) {
164 return __gpu_match_all_u32_impl(__lane_mask, __x);
165}
166
167// Returns the current lane mask if every lane contains __x.
168_DEFAULT_FN_ATTRS static __inline__ uint64_t
169__gpu_match_all_u64(uint64_t __lane_mask, uint64_t __x) {
170 return __gpu_match_all_u64_impl(__lane_mask, __x);
171}
172
173// SPIR-V does not expose this, always return false.146// SPIR-V does not expose this, always return false.
174_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(void *ptr) {147_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(const void *ptr) {
175 return 0;148 return 0;
176}149}
177150
178// SPIR-V does not expose this, always return false.151// SPIR-V does not expose this, always return false.
179_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(void *ptr) {152_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(const void *ptr) {
180 return 0;153 return 0;
181}154}
182155
lib/include/stdint.h+5-14
...@@ -805,25 +805,16 @@ typedef __UINTMAX_TYPE__ uintmax_t;...@@ -805,25 +805,16 @@ typedef __UINTMAX_TYPE__ uintmax_t;
805#endif805#endif
806806
807/* C99 7.18.3 Limits of other integer types. */807/* C99 7.18.3 Limits of other integer types. */
808#define SIG_ATOMIC_MIN __INTN_MIN(__SIG_ATOMIC_WIDTH__)808#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
809#define SIG_ATOMIC_MAX __INTN_MAX(__SIG_ATOMIC_WIDTH__)809#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
810#ifdef __WINT_UNSIGNED__810#define WINT_MIN __WINT_MIN__
811# define WINT_MIN __UINTN_C(__WINT_WIDTH__, 0)811#define WINT_MAX __WINT_MAX__
812# define WINT_MAX __UINTN_MAX(__WINT_WIDTH__)
813#else
814# define WINT_MIN __INTN_MIN(__WINT_WIDTH__)
815# define WINT_MAX __INTN_MAX(__WINT_WIDTH__)
816#endif
817812
818#ifndef WCHAR_MAX813#ifndef WCHAR_MAX
819# define WCHAR_MAX __WCHAR_MAX__814# define WCHAR_MAX __WCHAR_MAX__
820#endif815#endif
821#ifndef WCHAR_MIN816#ifndef WCHAR_MIN
822# if __WCHAR_MAX__ == __INTN_MAX(__WCHAR_WIDTH__)817#define WCHAR_MIN __WCHAR_MIN__
823# define WCHAR_MIN __INTN_MIN(__WCHAR_WIDTH__)
824# else
825# define WCHAR_MIN __UINTN_C(__WCHAR_WIDTH__, 0)
826# endif
827#endif818#endif
828819
829/* 7.18.4.2 Macros for greatest-width integer constants. */820/* 7.18.4.2 Macros for greatest-width integer constants. */
lib/include/vecintrin.h+1-1
...@@ -207,7 +207,7 @@ vec_insert(unsigned long long __scalar, __vector unsigned long long __vec,...@@ -207,7 +207,7 @@ vec_insert(unsigned long long __scalar, __vector unsigned long long __vec,
207#if __ARCH__ >= 12207#if __ARCH__ >= 12
208static inline __ATTRS_o_ai __vector float208static inline __ATTRS_o_ai __vector float
209vec_insert(float __scalar, __vector float __vec, int __index) {209vec_insert(float __scalar, __vector float __vec, int __index) {
210 __vec[__index & 1] = __scalar;210 __vec[__index & 3] = __scalar;
211 return __vec;211 return __vec;
212}212}
213#endif213#endif
lib/include/wasm_simd128.h+17
...@@ -45,6 +45,7 @@ typedef int __i32x2 __attribute__((__vector_size__(8), __aligned__(8)));...@@ -45,6 +45,7 @@ typedef int __i32x2 __attribute__((__vector_size__(8), __aligned__(8)));
45typedef unsigned int __u32x245typedef unsigned int __u32x2
46 __attribute__((__vector_size__(8), __aligned__(8)));46 __attribute__((__vector_size__(8), __aligned__(8)));
47typedef float __f32x2 __attribute__((__vector_size__(8), __aligned__(8)));47typedef float __f32x2 __attribute__((__vector_size__(8), __aligned__(8)));
48typedef __fp16 __f16x4 __attribute__((__vector_size__(8), __aligned__(8)));
4849
49#define __DEFAULT_FN_ATTRS \50#define __DEFAULT_FN_ATTRS \
50 __attribute__((__always_inline__, __nodebug__, __target__("simd128"), \51 __attribute__((__always_inline__, __nodebug__, __target__("simd128"), \
...@@ -2010,6 +2011,22 @@ static __inline__ v128_t __FP16_FN_ATTRS wasm_f16x8_convert_u16x8(v128_t __a) {...@@ -2010,6 +2011,22 @@ static __inline__ v128_t __FP16_FN_ATTRS wasm_f16x8_convert_u16x8(v128_t __a) {
2010 return (v128_t) __builtin_convertvector((__u16x8)__a, __f16x8);2011 return (v128_t) __builtin_convertvector((__u16x8)__a, __f16x8);
2011}2012}
20122013
2014static __inline__ v128_t __FP16_FN_ATTRS
2015wasm_f32x4_promote_low_f16x8(v128_t __a) {
2016 return (v128_t) __builtin_convertvector(
2017 (__f16x4){((__f16x8)__a)[0], ((__f16x8)__a)[1], ((__f16x8)__a)[2],
2018 ((__f16x8)__a)[3]},
2019 __f32x4);
2020}
2021
2022static __inline__ v128_t __FP16_FN_ATTRS
2023wasm_f16x8_demote_f32x4_zero(v128_t __a) {
2024 return (v128_t) __builtin_convertvector(
2025 __builtin_shufflevector((__f32x4)__a, (__f32x4){0, 0, 0, 0}, 0, 1, 2, 3,
2026 4, 5, 6, 7),
2027 __f16x8);
2028}
2029
2013static __inline__ v128_t __FP16_FN_ATTRS wasm_f16x8_relaxed_madd(v128_t __a,2030static __inline__ v128_t __FP16_FN_ATTRS wasm_f16x8_relaxed_madd(v128_t __a,
2014 v128_t __b,2031 v128_t __b,
2015 v128_t __c) {2032 v128_t __c) {
lib/include/xmmintrin.h+8-7
...@@ -341,7 +341,8 @@ _mm_rsqrt_ps(__m128 __a)...@@ -341,7 +341,8 @@ _mm_rsqrt_ps(__m128 __a)
341/// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the341/// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
342/// minimum value between both operands. The upper 96 bits are copied from342/// minimum value between both operands. The upper 96 bits are copied from
343/// the upper 96 bits of the first source operand.343/// the upper 96 bits of the first source operand.
344static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_min_ss(__m128 __a, __m128 __b) {344static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_ss(__m128 __a,
345 __m128 __b) {
345 return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b);346 return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b);
346}347}
347348
...@@ -384,7 +385,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_ps(__m128 __a,...@@ -384,7 +385,8 @@ static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_min_ps(__m128 __a,
384/// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the385/// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
385/// maximum value between both operands. The upper 96 bits are copied from386/// maximum value between both operands. The upper 96 bits are copied from
386/// the upper 96 bits of the first source operand.387/// the upper 96 bits of the first source operand.
387static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_max_ss(__m128 __a, __m128 __b) {388static __inline__ __m128 __DEFAULT_FN_ATTRS_CONSTEXPR _mm_max_ss(__m128 __a,
389 __m128 __b) {
388 return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b);390 return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b);
389}391}
390392
...@@ -2569,11 +2571,10 @@ _mm_avg_pu16(__m64 __a, __m64 __b) {...@@ -2569,11 +2571,10 @@ _mm_avg_pu16(__m64 __a, __m64 __b) {
2569/// \returns A 64-bit integer vector whose lower 16 bits contain the sums of the2571/// \returns A 64-bit integer vector whose lower 16 bits contain the sums of the
2570/// sets of absolute differences between both operands. The upper bits are2572/// sets of absolute differences between both operands. The upper bits are
2571/// cleared.2573/// cleared.
2572static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE22574static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
2573_mm_sad_pu8(__m64 __a, __m64 __b)2575_mm_sad_pu8(__m64 __a, __m64 __b) {
2574{2576 return __trunc64(__builtin_ia32_psadbw128((__v16qu)__zext128(__a),
2575 return __trunc64(__builtin_ia32_psadbw128((__v16qi)__zext128(__a),2577 (__v16qu)__zext128(__b)));
2576 (__v16qi)__zext128(__b)));
2577}2578}
25782579
2579#if defined(__cplusplus)2580#if defined(__cplusplus)
lib/libc/include/any-darwin-any/os/os_sync_wait_on_address.h created+378
...@@ -0,0 +1,378 @@
1/*
2 * Copyright (c) 2016 Apple Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * @APPLE_APACHE_LICENSE_HEADER_END@
19 */
20
21#ifndef __OS_SYNC_WAIT_ON_ADDRESS__
22#define __OS_SYNC_WAIT_ON_ADDRESS__
23
24#include <Availability.h>
25#include <stddef.h>
26#include <stdint.h>
27#include <os/base.h>
28#include <os/clock.h>
29
30OS_ASSUME_NONNULL_BEGIN
31
32/*! @header
33 * Low-level Darwin's futex style APIs.
34 */
35
36__BEGIN_DECLS
37
38#define OS_WAIT_ON_ADDR_AVAILABILITY \
39 __API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4))
40
41/*!
42 * @typedef os_sync_wait_on_address_flags_t
43 *
44 * @const OS_SYNC_WAIT_ON_ADDRESS_NONE
45 * This flag should be used as a default flag when no other flags listed below
46 * are required.
47 *
48 * @const OS_SYNC_WAIT_ON_ADDRESS_SHARED
49 * This flag should be used when synchronizing among multiple processes by
50 * placing the @addr passed to os_sync_wait_on_address and its variants
51 * in a shared memory region.
52 *
53 * When using this flag, it is important to pass OS_SYNC_WAKE_BY_ADDRESS_SHARED
54 * flag along with the exact same @addr to os_sync_wake_by_address_any and
55 * its variants to correctly find and wake up blocked waiters on the @addr.
56 *
57 * This flag should not be used when synchronizing among multiple threads of
58 * a single process. It allows the kernel to perform performance optimizations
59 * as the @addr is local to the calling process.
60 */
61OS_OPTIONS(os_sync_wait_on_address_flags, uint32_t,
62 OS_SYNC_WAIT_ON_ADDRESS_NONE
63 OS_WAIT_ON_ADDR_AVAILABILITY = 0x00000000,
64 OS_SYNC_WAIT_ON_ADDRESS_SHARED
65 OS_WAIT_ON_ADDR_AVAILABILITY = 0x00000001,
66);
67
68/*!
69 * @function os_sync_wait_on_address
70 *
71 * This function provides an atomic compare-and-wait functionality that
72 * can be used to implement other higher level synchronization primitives.
73 *
74 * It reads a value from @addr, compares it to expected @value and blocks
75 * the calling thread if they are equal. This sequence of operations is
76 * done atomically with respect to other concurrent operations that can
77 * be performed on this @addr by other threads using this same function
78 * or os_sync_wake_by_addr variants. At this point, the blocked calling
79 * thread is considered to be a waiter on this @addr, waiting to be woken
80 * up by a call to os_sync_wake_by_addr variants. If the value at @addr
81 * turns out to be different than expected, the calling thread returns
82 * immediately without blocking.
83 *
84 * This function is expected to be used for implementing synchronization
85 * primitives that do not have a sense of ownership (e.g. condition
86 * variables, semaphores) as it does not provide priority inversion avoidance.
87 * For locking primitives, it is recommended that you use existing OS
88 * primitives such as os_unfair_lock API family / pthread mutex or
89 * std::mutex.
90 *
91 * @param addr
92 * The userspace address to be used for atomic compare-and-wait.
93 * This address must be aligned to @size.
94 *
95 * @param value
96 * The value expected at @addr.
97 *
98 * @param size
99 * The size of @value, in bytes. This can be either 4 or 8 today.
100 * For @value of @size 4 bytes, the upper 4 bytes of @value are ignored.
101 *
102 * @param flags
103 * Flags to alter behavior of os_sync_wait_on_address.
104 * See os_sync_wait_on_address_flags_t.
105 *
106 * @return
107 * If the calling thread is woken up by a call to os_sync_wake_by_addr
108 * variants or the value at @addr is different than expected, this function
109 * returns successfully and the return value indicates the number
110 * of outstanding waiters blocked on this address.
111 * In the event of an error, returns -1 with errno set to indicate the error.
112 *
113 * EINVAL : Invalid flags or size.
114 * EINVAL : The @addr passed is NULL or misaligned.
115 * EINVAL : The operation associated with existing kernel state
116 * at this @addr is inconsistent with what the caller
117 * has requested.
118 * It is important to make sure consistent values are
119 * passed across wait and wake APIs for @addr, @size
120 * and the shared memory specification
121 * (See os_sync_wait_on_address_flags_t).
122 *
123 * It is possible for the os_sync_wait_on_address and its variants to perform
124 * an early return in the event of following errors where user may want to
125 * re-try the wait operation. E.g. low memory conditions could cause such early
126 * return.
127 * It is important to read the current value at the @addr before re-trying
128 * to ensure that the new value still requires waiting on @addr.
129 *
130 * ENOMEM : Unable to allocate memory for kernel internal data
131 * structures.
132 * EINTR : The syscall was interrupted / spurious wake up.
133 * EFAULT : Unable to read value from the @addr. Kernel copyin failed.
134 * It is possible to receive EFAULT error in following cases:
135 * 1. The @addr is an invalid address. This is a programmer error.
136 * 2. The @addr is valid; but, this is a transient error such as
137 * due to low memory conditions. User may want to re-try the wait
138 * operation.
139 * Following code snippet illustrates a possible re-try loop.
140 * <code>
141 * retry:
142 * current = atomic_load_explicit(addr, memory_order_relaxed);
143 * if (current != expected) {
144 * int ret = os_sync_wait_on_address(addr, current, size, flags);
145 * if ((ret < 0) && ((errno == EINTR) || (errno == EFAULT))) {
146 * goto retry;
147 * }
148 * }
149 * </code>
150 */
151OS_WAIT_ON_ADDR_AVAILABILITY
152OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
153int
154os_sync_wait_on_address(void *addr,
155 uint64_t value,
156 size_t size,
157 os_sync_wait_on_address_flags_t flags);
158
159/*!
160 * @function os_sync_wait_on_address_with_deadline
161 *
162 * This function is a variant of os_sync_wait_on_address that
163 * allows the calling thread to specify a deadline
164 * until which it is willing to block.
165 *
166 * @param addr
167 * The userspace address to be used for atomic compare-and-wait.
168 * This address must be aligned to @size.
169 *
170 * @param value
171 * The value expected at @addr.
172 *
173 * @param size
174 * The size of @value, in bytes. This can be either 4 or 8 today.
175 * For @value of @size 4 bytes, the upper 4 bytes of @value are ignored.
176 *
177 * @param flags
178 * Flags to alter behavior of os_sync_wait_on_address_with_deadline.
179 * See os_sync_wait_on_address_flags_t.
180 *
181 * @param clockid
182 * This value anchors @deadline argument to a specific clock id.
183 * See os_clockid_t.
184 *
185 * @param deadline
186 * This value is used to specify a deadline until which the calling
187 * thread is willing to block.
188 * Passing zero for the @deadline results in an error being returned.
189 * It is recommended to use os_sync_wait_on_address API to block
190 * indefinitely until woken up by a call to os_sync_wake_by_address_any
191 * or os_sync_wake_by_address_all APIs.
192 *
193 * @return
194 * If the calling thread is woken up by a call to os_sync_wake_by_addr
195 * variants or the value at @addr is different than expected, this function
196 * returns successfully and the return value indicates the number
197 * of outstanding waiters blocked on this address.
198 * In the event of an error, returns -1 with errno set to indicate the error.
199 *
200 * In addition to errors returned by os_sync_wait_on_address, this function
201 * can return the following additional error codes.
202 *
203 * EINVAL : Invalid clock id.
204 * EINVAL : The @deadline passed is 0.
205 * ETIMEDOUT : Deadline expired.
206 */
207OS_WAIT_ON_ADDR_AVAILABILITY
208OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
209int
210os_sync_wait_on_address_with_deadline(void *addr,
211 uint64_t value,
212 size_t size,
213 os_sync_wait_on_address_flags_t flags,
214 os_clockid_t clockid,
215 uint64_t deadline);
216
217/*!
218 * @function os_sync_wait_on_address_with_timeout
219 *
220 * This function is a variant of os_sync_wait_on_address that
221 * allows the calling thread to specify a timeout
222 * until which it is willing to block.
223 *
224 * @param addr
225 * The userspace address to be used for atomic compare-and-wait.
226 * This address must be aligned to @size.
227 *
228 * @param value
229 * The value expected at @addr.
230 *
231 * @param size
232 * The size of @value, in bytes. This can be either 4 or 8 today.
233 * For @value of @size 4 bytes, the upper 4 bytes of @value are ignored.
234 *
235 * @param flags
236 * Flags to alter behavior of os_sync_wait_on_address_with_timeout.
237 * See os_sync_wait_on_address_flags_t.
238 *
239 * @param clockid
240 * This value anchors @timeout_ns argument to a specific clock id.
241 * See os_clockid_t.
242 *
243 * @param timeout_ns
244 * This value is used to specify a timeout in nanoseconds until which
245 * the calling thread is willing to block.
246 * Passing zero for the @timeout_ns results in an error being returned.
247 * It is recommended to use os_sync_wait_on_address API to block
248 * indefinitely until woken up by a call to os_sync_wake_by_address_any
249 * or os_sync_wake_by_address_all APIs.
250 *
251 * @return
252 * If the calling thread is woken up by a call to os_sync_wake_by_address
253 * variants or the value at @addr is different than expected, this function
254 * returns successfully and the return value indicates the number
255 * of outstanding waiters blocked on this address.
256 * In the event of an error, returns -1 with errno set to indicate the error.
257 *
258 * In addition to errors returned by os_sync_wait_on_address, this function
259 * can return the following additional error codes.
260 *
261 * EINVAL : Invalid clock id.
262 * EINVAL : The @timeout_ns passed is 0.
263 * ETIMEDOUT : Timeout expired.
264 */
265OS_WAIT_ON_ADDR_AVAILABILITY
266OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
267int
268os_sync_wait_on_address_with_timeout(void *addr,
269 uint64_t value,
270 size_t size,
271 os_sync_wait_on_address_flags_t flags,
272 os_clockid_t clockid,
273 uint64_t timeout_ns);
274
275/*!
276 * @typedef os_sync_wake_by_address_flags_t
277 *
278 * @const OS_SYNC_WAKE_BY_ADDRESS_NONE
279 * This flag should be used as a default flag when no other flags listed below
280 * are required.
281 *
282 * @const OS_SYNC_WAKE_BY_ADDRESS_SHARED
283 * This flag should be used when synchronizing among multiple processes by
284 * placing the @addr passed to os_sync_wake_by_address_any and its variants
285 * in a shared memory region.
286 *
287 * When using this flag, it is important to pass OS_SYNC_WAIT_ON_ADDRESS_SHARED
288 * flag along with the exact same @addr to os_sync_wait_on_address and
289 * its variants to correctly find and wake up blocked waiters on the @addr.
290 *
291 * This flag should not be used when synchronizing among multiple threads of
292 * a single process. It allows the kernel to perform performance optimizations
293 * as the @addr is local the calling process.
294 */
295OS_OPTIONS(os_sync_wake_by_address_flags, uint32_t,
296 OS_SYNC_WAKE_BY_ADDRESS_NONE
297 OS_WAIT_ON_ADDR_AVAILABILITY = 0x00000000,
298 OS_SYNC_WAKE_BY_ADDRESS_SHARED
299 OS_WAIT_ON_ADDR_AVAILABILITY = 0x00000001,
300);
301
302/*!
303 * @function os_sync_wake_by_address_any
304 *
305 * This function wakes up one waiter out of all those blocked in os_sync_wait_on_address
306 * or its variants on the @addr. No guarantee is provided about which
307 * specific waiter is woken up.
308 *
309 * @param addr
310 * The userspace address to be used for waking up the blocked waiter.
311 * It should be same as what is passed to os_sync_wait_on_address or its variants.
312 *
313 * @param size
314 * The size of lock value, in bytes. This can be either 4 or 8 today.
315 * It should be same as what is passed to os_sync_wait_on_address or its variants.
316 *
317 * @param flags
318 * Flags to alter behavior of os_sync_wake_by_address_any.
319 * See os_sync_wake_by_address_flags_t.
320 *
321 * @return
322 * Returns 0 on success.
323 * In the event of an error, returns -1 with errno set to indicate the error.
324 *
325 * EINVAL : Invalid flags or size.
326 * EINVAL : The @addr passed is NULL.
327 * EINVAL : The operation associated with existing kernel state
328 * at this @addr is inconsistent with what caller
329 * has requested.
330 * It is important to make sure consistent values are
331 * passed across wait and wake APIs for @addr, @size
332 * and the shared memory specification
333 * (See os_sync_wake_by_address_flags_t).
334 * ENOENT : No waiter(s) found waiting on the @addr.
335 */
336OS_WAIT_ON_ADDR_AVAILABILITY
337OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
338int
339os_sync_wake_by_address_any(void *addr,
340 size_t size,
341 os_sync_wake_by_address_flags_t flags);
342
343/*!
344 * @function os_sync_wake_by_address_all
345 *
346 * This function is a variant of os_sync_wake_by_address_any that wakes up all waiters
347 * blocked in os_sync_wait_on_address or its variants.
348 *
349 * @param addr
350 * The userspace address to be used for waking up the blocked waiters.
351 * It should be same as what is passed to os_sync_wait_on_address or its variants.
352 *
353 * @param size
354 * The size of lock value, in bytes. This can be either 4 or 8 today.
355 * It should be same as what is passed to os_sync_wait_on_address or its variants.
356 *
357 * @param flags
358 * Flags to alter behavior of os_sync_wake_by_address_all.
359 * See os_sync_wake_by_address_flags_t.
360 *
361 * @return
362 * Returns 0 on success.
363 * In the event of an error, returns -1 with errno set to indicate the error.
364 *
365 * This function returns same error codes as returned by os_sync_wait_on_address.
366 */
367OS_WAIT_ON_ADDR_AVAILABILITY
368OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
369int
370os_sync_wake_by_address_all(void *addr,
371 size_t size,
372 os_sync_wake_by_address_flags_t flags);
373
374__END_DECLS
375
376OS_ASSUME_NONNULL_END
377
378#endif // __OS_SYNC_WAIT_ON_ADDRESS__
lib/libc/include/generic-netbsd/machine/signal.h+1-2
...@@ -33,8 +33,7 @@...@@ -33,8 +33,7 @@
33#define _RISCV_SIGNAL_H_33#define _RISCV_SIGNAL_H_
3434
35#ifndef _LOCORE35#ifndef _LOCORE
36// zig patch: Clang does not define __SIG_ATOMIC_TYPE__36typedef __SIG_ATOMIC_TYPE__ sig_atomic_t;
37typedef int sig_atomic_t;
38#endif37#endif
3938
40#endif /* _RISCV_SIGNAL_H_ */39#endif /* _RISCV_SIGNAL_H_ */
lib/libc/include/generic-netbsd/riscv/signal.h+1-2
...@@ -33,8 +33,7 @@...@@ -33,8 +33,7 @@
33#define _RISCV_SIGNAL_H_33#define _RISCV_SIGNAL_H_
3434
35#ifndef _LOCORE35#ifndef _LOCORE
36// zig patch: Clang does not define __SIG_ATOMIC_TYPE__36typedef __SIG_ATOMIC_TYPE__ sig_atomic_t;
37typedef int sig_atomic_t;
38#endif37#endif
3938
40#endif /* _RISCV_SIGNAL_H_ */39#endif /* _RISCV_SIGNAL_H_ */
lib/libc/include/generic-netbsd/riscv/wchar_limits.h+1-11
...@@ -1,13 +1,3 @@...@@ -1,13 +1,3 @@
1/* $NetBSD: wchar_limits.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */1/* $NetBSD: wchar_limits.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */
22
3// zig patch: https://github.com/llvm/llvm-project/issues/1996783#include <sys/common_wchar_limits.h>
4#ifndef _RISCV_WCHAR_LIMITS_H_
5#define _RISCV_WCHAR_LIMITS_H_
6
7#define WCHAR_MIN (-0x7fffffff-1) /* wchar_t */
8#define WCHAR_MAX 0x7fffffff /* wchar_t */
9
10#define WINT_MIN (-0x7fffffff-1) /* wint_t */
11#define WINT_MAX 0x7fffffff /* wint_t */
12
13#endif /* !_RISCV_WCHAR_LIMITS_H_ */
lib/libc/include/riscv32-netbsd-none/machine/wchar_limits.h deleted-4
...@@ -1,4 +0,0 @@
1/* $NetBSD: wchar_limits.h,v 1.2 2005/12/11 12:17:12 christos Exp $ */
2
3// zig patch: https://github.com/llvm/llvm-project/issues/199678
4#include <riscv/wchar_limits.h>
lib/libc/include/riscv64-netbsd-none/machine/wchar_limits.h deleted-4
...@@ -1,4 +0,0 @@
1/* $NetBSD: wchar_limits.h,v 1.2 2005/12/11 12:17:12 christos Exp $ */
2
3// zig patch: https://github.com/llvm/llvm-project/issues/199678
4#include <riscv/wchar_limits.h>
lib/libcxx/include/__algorithm/clamp.h+4-2
...@@ -17,9 +17,10 @@...@@ -17,9 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20#if _LIBCPP_STD_VER >= 17
21
20_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
2123
22#if _LIBCPP_STD_VER >= 17
23template <class _Tp, class _Compare>24template <class _Tp, class _Compare>
24[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&25[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
25clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,26clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
...@@ -37,8 +38,9 @@ clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,...@@ -37,8 +38,9 @@ clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
37 _LIBCPP_LIFETIMEBOUND const _Tp& __hi) {38 _LIBCPP_LIFETIMEBOUND const _Tp& __hi) {
38 return std::clamp(__v, __lo, __hi, __less<>());39 return std::clamp(__v, __lo, __hi, __less<>());
39}40}
40#endif
4141
42_LIBCPP_END_NAMESPACE_STD42_LIBCPP_END_NAMESPACE_STD
4343
44#endif // _LIBCPP_STD_VER >= 17
45
44#endif // _LIBCPP___ALGORITHM_CLAMP_H46#endif // _LIBCPP___ALGORITHM_CLAMP_H
lib/libcxx/include/__algorithm/copy.h+16-15
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__algorithm/copy_move_common.h>12#include <__algorithm/copy_move_common.h>
13#include <__algorithm/for_each_segment.h>13#include <__algorithm/for_each_segment.h>
14#include <__algorithm/in_out_result.h>
14#include <__algorithm/min.h>15#include <__algorithm/min.h>
15#include <__algorithm/specialized_algorithms.h>16#include <__algorithm/specialized_algorithms.h>
16#include <__config>17#include <__config>
...@@ -19,7 +20,6 @@...@@ -19,7 +20,6 @@
19#include <__type_traits/common_type.h>20#include <__type_traits/common_type.h>
20#include <__type_traits/enable_if.h>21#include <__type_traits/enable_if.h>
21#include <__utility/move.h>22#include <__utility/move.h>
22#include <__utility/pair.h>
2323
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header25# pragma GCC system_header
...@@ -35,7 +35,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator...@@ -35,7 +35,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
35copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result);35copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result);
3636
37template <class _InIter, class _Sent, class _OutIter>37template <class _InIter, class _Sent, class _OutIter>
38inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter);38inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
39 __copy(_InIter, _Sent, _OutIter);
3940
40struct __copy_impl {41struct __copy_impl {
41 template <class _InIter,42 template <class _InIter,
...@@ -45,7 +46,7 @@ struct __copy_impl {...@@ -45,7 +46,7 @@ struct __copy_impl {
45 __iterator_pair<_InIter, _Sent>,46 __iterator_pair<_InIter, _Sent>,
46 __single_iterator<_OutIter> >::__has_algorithm,47 __single_iterator<_OutIter> >::__has_algorithm,
47 int> = 0>48 int> = 0>
48 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>49 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
49 operator()(_InIter __first, _Sent __last, _OutIter __result) const {50 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
50 while (__first != __last) {51 while (__first != __last) {
51 *__result = *__first;52 *__result = *__first;
...@@ -53,7 +54,7 @@ struct __copy_impl {...@@ -53,7 +54,7 @@ struct __copy_impl {
53 ++__result;54 ++__result;
54 }55 }
5556
56 return std::make_pair(std::move(__first), std::move(__result));57 return {std::move(__first), std::move(__result)};
57 }58 }
5859
59 template <class _InIter,60 template <class _InIter,
...@@ -63,20 +64,20 @@ struct __copy_impl {...@@ -63,20 +64,20 @@ struct __copy_impl {
63 __iterator_pair<_InIter, _Sent>,64 __iterator_pair<_InIter, _Sent>,
64 __single_iterator<_OutIter> >::__has_algorithm,65 __single_iterator<_OutIter> >::__has_algorithm,
65 int> = 0>66 int> = 0>
66 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static pair<_InIter, _OutIter>67 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static __in_out_result<_InIter, _OutIter>
67 operator()(_InIter __first, _Sent __last, _OutIter __result) {68 operator()(_InIter __first, _Sent __last, _OutIter __result) {
68 return __specialized_algorithm<_Algorithm::__copy, __iterator_pair<_InIter, _Sent>, __single_iterator<_OutIter> >()(69 return __specialized_algorithm<_Algorithm::__copy, __iterator_pair<_InIter, _Sent>, __single_iterator<_OutIter> >()(
69 std::move(__first), std::move(__last), std::move(__result));70 std::move(__first), std::move(__last), std::move(__result));
70 }71 }
7172
72 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>73 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
73 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>74 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
74 operator()(_InIter __first, _InIter __last, _OutIter __result) const {75 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
75 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;76 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;
76 std::__for_each_segment(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {77 std::__for_each_segment(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {
77 __result = std::__copy(std::move(__lfirst), std::move(__llast), std::move(__result)).second;78 __result = std::__copy(std::move(__lfirst), std::move(__llast), std::move(__result)).__out_;
78 });79 });
79 return std::make_pair(__last, std::move(__result));80 return {__last, std::move(__result)};
80 }81 }
8182
82 template <class _InIter,83 template <class _InIter,
...@@ -84,14 +85,14 @@ struct __copy_impl {...@@ -84,14 +85,14 @@ struct __copy_impl {
84 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&85 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
85 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,86 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
86 int> = 0>87 int> = 0>
87 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>88 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
88 operator()(_InIter __first, _InIter __last, _OutIter __result) const {89 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
89 using _Traits = __segmented_iterator_traits<_OutIter>;90 using _Traits = __segmented_iterator_traits<_OutIter>;
90 using _DiffT =91 using _DiffT =
91 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;92 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;
9293
93 if (__first == __last)94 if (__first == __last)
94 return std::make_pair(std::move(__first), std::move(__result));95 return {std::move(__first), std::move(__result)};
9596
96 auto __local_first = _Traits::__local(__result);97 auto __local_first = _Traits::__local(__result);
97 auto __segment_iterator = _Traits::__segment(__result);98 auto __segment_iterator = _Traits::__segment(__result);
...@@ -99,10 +100,10 @@ struct __copy_impl {...@@ -99,10 +100,10 @@ struct __copy_impl {
99 auto __local_last = _Traits::__end(__segment_iterator);100 auto __local_last = _Traits::__end(__segment_iterator);
100 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);101 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);
101 auto __iters = std::__copy(__first, __first + __size, __local_first);102 auto __iters = std::__copy(__first, __first + __size, __local_first);
102 __first = std::move(__iters.first);103 __first = std::move(__iters.__in_);
103104
104 if (__first == __last)105 if (__first == __last)
105 return std::make_pair(std::move(__first), _Traits::__compose(__segment_iterator, std::move(__iters.second)));106 return {std::move(__first), _Traits::__compose(__segment_iterator, std::move(__iters.__out_))};
106107
107 __local_first = _Traits::__begin(++__segment_iterator);108 __local_first = _Traits::__begin(++__segment_iterator);
108 }109 }
...@@ -110,14 +111,14 @@ struct __copy_impl {...@@ -110,14 +111,14 @@ struct __copy_impl {
110111
111 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.112 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
112 template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>113 template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
113 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>114 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_In*, _Out*>
114 operator()(_In* __first, _In* __last, _Out* __result) const {115 operator()(_In* __first, _In* __last, _Out* __result) const {
115 return std::__copy_trivial_impl(__first, __last, __result);116 return std::__copy_trivial_impl(__first, __last, __result);
116 }117 }
117};118};
118119
119template <class _InIter, class _Sent, class _OutIter>120template <class _InIter, class _Sent, class _OutIter>
120pair<_InIter, _OutIter> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14121__in_out_result<_InIter, _OutIter> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
121__copy(_InIter __first, _Sent __last, _OutIter __result) {122__copy(_InIter __first, _Sent __last, _OutIter __result) {
122 return std::__copy_move_unwrap_iters<__copy_impl>(std::move(__first), std::move(__last), std::move(__result));123 return std::__copy_move_unwrap_iters<__copy_impl>(std::move(__first), std::move(__last), std::move(__result));
123}124}
...@@ -125,7 +126,7 @@ __copy(_InIter __first, _Sent __last, _OutIter __result) {...@@ -125,7 +126,7 @@ __copy(_InIter __first, _Sent __last, _OutIter __result) {
125template <class _InputIterator, class _OutputIterator>126template <class _InputIterator, class _OutputIterator>
126_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator127_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
127copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {128copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
128 return std::__copy(__first, __last, __result).second;129 return std::__copy(__first, __last, __result).__out_;
129}130}
130131
131_LIBCPP_END_NAMESPACE_STD132_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/copy_backward.h+18-17
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#include <__algorithm/copy_move_common.h>12#include <__algorithm/copy_move_common.h>
13#include <__algorithm/copy_n.h>13#include <__algorithm/copy_n.h>
14#include <__algorithm/for_each_segment.h>14#include <__algorithm/for_each_segment.h>
15#include <__algorithm/in_out_result.h>
15#include <__algorithm/iterator_operations.h>16#include <__algorithm/iterator_operations.h>
16#include <__algorithm/min.h>17#include <__algorithm/min.h>
17#include <__config>18#include <__config>
...@@ -23,7 +24,6 @@...@@ -23,7 +24,6 @@
23#include <__type_traits/enable_if.h>24#include <__type_traits/enable_if.h>
24#include <__type_traits/is_constructible.h>25#include <__type_traits/is_constructible.h>
25#include <__utility/move.h>26#include <__utility/move.h>
26#include <__utility/pair.h>
2727
28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29# pragma GCC system_header29# pragma GCC system_header
...@@ -35,7 +35,7 @@ _LIBCPP_PUSH_MACROS...@@ -35,7 +35,7 @@ _LIBCPP_PUSH_MACROS
35_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
3636
37template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>37template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
38_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InIter, _OutIter>38_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_InIter, _OutIter>
39__copy_backward(_InIter __first, _Sent __last, _OutIter __result);39__copy_backward(_InIter __first, _Sent __last, _OutIter __result);
4040
41template <class _Cp, bool _IsConst>41template <class _Cp, bool _IsConst>
...@@ -159,7 +159,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> _...@@ -159,7 +159,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> _
159template <class _AlgPolicy>159template <class _AlgPolicy>
160struct __copy_backward_impl {160struct __copy_backward_impl {
161 template <class _InIter, class _Sent, class _OutIter>161 template <class _InIter, class _Sent, class _OutIter>
162 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>162 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
163 operator()(_InIter __first, _Sent __last, _OutIter __result) const {163 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
164 auto __last_iter = _IterOps<_AlgPolicy>::next(__first, __last);164 auto __last_iter = _IterOps<_AlgPolicy>::next(__first, __last);
165 auto __original_last_iter = __last_iter;165 auto __original_last_iter = __last_iter;
...@@ -168,17 +168,17 @@ struct __copy_backward_impl {...@@ -168,17 +168,17 @@ struct __copy_backward_impl {
168 *--__result = *--__last_iter;168 *--__result = *--__last_iter;
169 }169 }
170170
171 return std::make_pair(std::move(__original_last_iter), std::move(__result));171 return {std::move(__original_last_iter), std::move(__result)};
172 }172 }
173173
174 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>174 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
175 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>175 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
176 operator()(_InIter __first, _InIter __last, _OutIter __result) const {176 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
177 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;177 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;
178 std::__for_each_segment_backward(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {178 std::__for_each_segment_backward(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {
179 __result = std::__copy_backward<_AlgPolicy>(std::move(__lfirst), std::move(__llast), std::move(__result)).second;179 __result = std::__copy_backward<_AlgPolicy>(std::move(__lfirst), std::move(__llast), std::move(__result)).__out_;
180 });180 });
181 return std::make_pair(__last, std::move(__result));181 return {__last, std::move(__result)};
182 }182 }
183183
184 template <class _InIter,184 template <class _InIter,
...@@ -186,7 +186,7 @@ struct __copy_backward_impl {...@@ -186,7 +186,7 @@ struct __copy_backward_impl {
186 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&186 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
187 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,187 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
188 int> = 0>188 int> = 0>
189 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>189 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
190 operator()(_InIter __first, _InIter __last, _OutIter __result) const {190 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
191 using _Traits = __segmented_iterator_traits<_OutIter>;191 using _Traits = __segmented_iterator_traits<_OutIter>;
192 auto __orig_last = __last;192 auto __orig_last = __last;
...@@ -194,7 +194,7 @@ struct __copy_backward_impl {...@@ -194,7 +194,7 @@ struct __copy_backward_impl {
194194
195 // When the range contains no elements, __result might not be a valid iterator195 // When the range contains no elements, __result might not be a valid iterator
196 if (__first == __last)196 if (__first == __last)
197 return std::make_pair(__first, __result);197 return {__first, __result};
198198
199 auto __local_last = _Traits::__local(__result);199 auto __local_last = _Traits::__local(__result);
200 while (true) {200 while (true) {
...@@ -203,36 +203,37 @@ struct __copy_backward_impl {...@@ -203,36 +203,37 @@ struct __copy_backward_impl {
203203
204 auto __local_first = _Traits::__begin(__segment_iterator);204 auto __local_first = _Traits::__begin(__segment_iterator);
205 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);205 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);
206 auto __iter = std::__copy_backward<_AlgPolicy>(__last - __size, __last, __local_last).second;206 auto __iter = std::__copy_backward<_AlgPolicy>(__last - __size, __last, __local_last).__out_;
207 __last -= __size;207 __last -= __size;
208208
209 if (__first == __last)209 if (__first == __last)
210 return std::make_pair(std::move(__orig_last), _Traits::__compose(__segment_iterator, std::move(__iter)));210 return {std::move(__orig_last), _Traits::__compose(__segment_iterator, std::move(__iter))};
211 --__segment_iterator;211 --__segment_iterator;
212 __local_last = _Traits::__end(__segment_iterator);212 __local_last = _Traits::__end(__segment_iterator);
213 }213 }
214 }214 }
215215
216 template <class _Cp, bool _IsConst>216 template <class _Cp, bool _IsConst>
217 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >217 _LIBCPP_HIDE_FROM_ABI
218 _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >
218 operator()(__bit_iterator<_Cp, _IsConst> __first,219 operator()(__bit_iterator<_Cp, _IsConst> __first,
219 __bit_iterator<_Cp, _IsConst> __last,220 __bit_iterator<_Cp, _IsConst> __last,
220 __bit_iterator<_Cp, false> __result) {221 __bit_iterator<_Cp, false> __result) {
221 if (__last.__ctz_ == __result.__ctz_)222 if (__last.__ctz_ == __result.__ctz_)
222 return std::make_pair(__last, std::__copy_backward_aligned(__first, __last, __result));223 return {__last, std::__copy_backward_aligned(__first, __last, __result)};
223 return std::make_pair(__last, std::__copy_backward_unaligned(__first, __last, __result));224 return {__last, std::__copy_backward_unaligned(__first, __last, __result)};
224 }225 }
225226
226 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.227 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
227 template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>228 template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
228 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>229 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_In*, _Out*>
229 operator()(_In* __first, _In* __last, _Out* __result) const {230 operator()(_In* __first, _In* __last, _Out* __result) const {
230 return std::__copy_backward_trivial_impl(__first, __last, __result);231 return std::__copy_backward_trivial_impl(__first, __last, __result);
231 }232 }
232};233};
233234
234template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>235template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>
235_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_BidirectionalIterator1, _BidirectionalIterator2>236_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_BidirectionalIterator1, _BidirectionalIterator2>
236__copy_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result) {237__copy_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result) {
237 return std::__copy_move_unwrap_iters<__copy_backward_impl<_AlgPolicy> >(238 return std::__copy_move_unwrap_iters<__copy_backward_impl<_AlgPolicy> >(
238 std::move(__first), std::move(__last), std::move(__result));239 std::move(__first), std::move(__last), std::move(__result));
...@@ -245,7 +246,7 @@ copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _...@@ -245,7 +246,7 @@ copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _
245 std::is_copy_constructible<_BidirectionalIterator1>::value,246 std::is_copy_constructible<_BidirectionalIterator1>::value,
246 "Iterators must be copy constructible.");247 "Iterators must be copy constructible.");
247248
248 return std::__copy_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).second;249 return std::__copy_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).__out_;
249}250}
250251
251_LIBCPP_END_NAMESPACE_STD252_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/copy_if.h+4-3
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#ifndef _LIBCPP___ALGORITHM_COPY_IF_H9#ifndef _LIBCPP___ALGORITHM_COPY_IF_H
10#define _LIBCPP___ALGORITHM_COPY_IF_H10#define _LIBCPP___ALGORITHM_COPY_IF_H
1111
12#include <__algorithm/in_out_result.h>
12#include <__config>13#include <__config>
13#include <__functional/identity.h>14#include <__functional/identity.h>
14#include <__type_traits/invoke.h>15#include <__type_traits/invoke.h>
...@@ -25,7 +26,7 @@ _LIBCPP_PUSH_MACROS...@@ -25,7 +26,7 @@ _LIBCPP_PUSH_MACROS
25_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2627
27template <class _InIter, class _Sent, class _OutIter, class _Proj, class _Pred>28template <class _InIter, class _Sent, class _OutIter, class _Proj, class _Pred>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>29_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
29__copy_if(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj& __proj) {30__copy_if(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj& __proj) {
30 for (; __first != __last; ++__first) {31 for (; __first != __last; ++__first) {
31 if (std::__invoke(__pred, std::__invoke(__proj, *__first))) {32 if (std::__invoke(__pred, std::__invoke(__proj, *__first))) {
...@@ -33,14 +34,14 @@ __copy_if(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj...@@ -33,14 +34,14 @@ __copy_if(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj
33 ++__result;34 ++__result;
34 }35 }
35 }36 }
36 return std::make_pair(std::move(__first), std::move(__result));37 return {std::move(__first), std::move(__result)};
37}38}
3839
39template <class _InputIterator, class _OutputIterator, class _Predicate>40template <class _InputIterator, class _OutputIterator, class _Predicate>
40inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator41inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
41copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) {42copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) {
42 __identity __proj;43 __identity __proj;
43 return std::__copy_if(__first, __last, __result, __pred, __proj).second;44 return std::__copy_if(__first, __last, __result, __pred, __proj).__out_;
44}45}
4546
46_LIBCPP_END_NAMESPACE_STD47_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/copy_move_common.h+9-12
...@@ -9,21 +9,18 @@...@@ -9,21 +9,18 @@
9#ifndef _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H9#ifndef _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H
10#define _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H10#define _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H
1111
12#include <__algorithm/in_out_result.h>
12#include <__algorithm/unwrap_iter.h>13#include <__algorithm/unwrap_iter.h>
13#include <__algorithm/unwrap_range.h>14#include <__algorithm/unwrap_range.h>
14#include <__config>15#include <__config>
15#include <__cstddef/size_t.h>16#include <__cstddef/size_t.h>
16#include <__iterator/iterator_traits.h>
17#include <__memory/pointer_traits.h>
18#include <__string/constexpr_c_functions.h>17#include <__string/constexpr_c_functions.h>
19#include <__type_traits/enable_if.h>18#include <__type_traits/enable_if.h>
20#include <__type_traits/is_always_bitcastable.h>19#include <__type_traits/is_always_bitcastable.h>
21#include <__type_traits/is_constant_evaluated.h>
22#include <__type_traits/is_constructible.h>20#include <__type_traits/is_constructible.h>
23#include <__type_traits/is_trivially_assignable.h>21#include <__type_traits/is_trivially_assignable.h>
24#include <__type_traits/is_volatile.h>22#include <__type_traits/is_volatile.h>
25#include <__utility/move.h>23#include <__utility/move.h>
26#include <__utility/pair.h>
2724
28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29# pragma GCC system_header26# pragma GCC system_header
...@@ -57,24 +54,24 @@ struct __can_lower_move_assignment_to_memmove {...@@ -57,24 +54,24 @@ struct __can_lower_move_assignment_to_memmove {
57// `memmove` algorithms implementation.54// `memmove` algorithms implementation.
5855
59template <class _In, class _Out>56template <class _In, class _Out>
60_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>57_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_In*, _Out*>
61__copy_trivial_impl(_In* __first, _In* __last, _Out* __result) {58__copy_trivial_impl(_In* __first, _In* __last, _Out* __result) {
62 const size_t __n = static_cast<size_t>(__last - __first);59 const size_t __n = static_cast<size_t>(__last - __first);
6360
64 std::__constexpr_memmove(__result, __first, __element_count(__n));61 std::__constexpr_memmove(__result, __first, __element_count(__n));
6562
66 return std::make_pair(__last, __result + __n);63 return {__last, __result + __n};
67}64}
6865
69template <class _In, class _Out>66template <class _In, class _Out>
70_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>67_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_In*, _Out*>
71__copy_backward_trivial_impl(_In* __first, _In* __last, _Out* __result) {68__copy_backward_trivial_impl(_In* __first, _In* __last, _Out* __result) {
72 const size_t __n = static_cast<size_t>(__last - __first);69 const size_t __n = static_cast<size_t>(__last - __first);
73 __result -= __n;70 __result -= __n;
7471
75 std::__constexpr_memmove(__result, __first, __element_count(__n));72 std::__constexpr_memmove(__result, __first, __element_count(__n));
7673
77 return std::make_pair(__last, __result);74 return {__last, __result};
78}75}
7976
80// Iterator unwrapping and dispatching to the correct overload.77// Iterator unwrapping and dispatching to the correct overload.
...@@ -88,12 +85,12 @@ template <class _Algorithm,...@@ -88,12 +85,12 @@ template <class _Algorithm,
88 class _Sent,85 class _Sent,
89 class _OutIter,86 class _OutIter,
90 __enable_if_t<__can_rewrap<_InIter, _OutIter>::value, int> = 0>87 __enable_if_t<__can_rewrap<_InIter, _OutIter>::value, int> = 0>
91_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>88_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 __in_out_result<_InIter, _OutIter>
92__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {89__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {
93 auto __range = std::__unwrap_range(__first, std::move(__last));90 auto __range = std::__unwrap_range(__first, std::move(__last));
94 auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));91 auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
95 return std::make_pair(std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.first)),92 return {std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.__in_)),
96 std::__rewrap_iter(std::move(__out_first), std::move(__result.second)));93 std::__rewrap_iter(std::move(__out_first), std::move(__result.__out_))};
97}94}
9895
99template <class _Algorithm,96template <class _Algorithm,
...@@ -101,7 +98,7 @@ template <class _Algorithm,...@@ -101,7 +98,7 @@ template <class _Algorithm,
101 class _Sent,98 class _Sent,
102 class _OutIter,99 class _OutIter,
103 __enable_if_t<!__can_rewrap<_InIter, _OutIter>::value, int> = 0>100 __enable_if_t<!__can_rewrap<_InIter, _OutIter>::value, int> = 0>
104_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>101_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 __in_out_result<_InIter, _OutIter>
105__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {102__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {
106 return _Algorithm()(std::move(__first), std::move(__last), std::move(__out_first));103 return _Algorithm()(std::move(__first), std::move(__last), std::move(__out_first));
107}104}
lib/libcxx/include/__algorithm/copy_n.h+5-5
...@@ -10,13 +10,13 @@...@@ -10,13 +10,13 @@
10#define _LIBCPP___ALGORITHM_COPY_N_H10#define _LIBCPP___ALGORITHM_COPY_N_H
1111
12#include <__algorithm/copy.h>12#include <__algorithm/copy.h>
13#include <__algorithm/in_out_result.h>
13#include <__algorithm/iterator_operations.h>14#include <__algorithm/iterator_operations.h>
14#include <__config>15#include <__config>
15#include <__iterator/iterator_traits.h>16#include <__iterator/iterator_traits.h>
16#include <__type_traits/enable_if.h>17#include <__type_traits/enable_if.h>
17#include <__utility/convert_to_integral.h>18#include <__utility/convert_to_integral.h>
18#include <__utility/move.h>19#include <__utility/move.h>
19#include <__utility/pair.h>
2020
21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
22# pragma GCC system_header22# pragma GCC system_header
...@@ -31,7 +31,7 @@ template <class _AlgPolicy,...@@ -31,7 +31,7 @@ template <class _AlgPolicy,
31 class _InIter,31 class _InIter,
32 class _OutIter,32 class _OutIter,
33 __enable_if_t<__has_random_access_iterator_category<_InIter>::value, int> = 0>33 __enable_if_t<__has_random_access_iterator_category<_InIter>::value, int> = 0>
34_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InIter, _OutIter>34_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_InIter, _OutIter>
35__copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_type<_InIter> __n, _OutIter __result) {35__copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_type<_InIter> __n, _OutIter __result) {
36 return std::__copy(__first, __first + __n, std::move(__result));36 return std::__copy(__first, __first + __n, std::move(__result));
37}37}
...@@ -40,7 +40,7 @@ template <class _AlgPolicy,...@@ -40,7 +40,7 @@ template <class _AlgPolicy,
40 class _InIter,40 class _InIter,
41 class _OutIter,41 class _OutIter,
42 __enable_if_t<!__has_random_access_iterator_category<_InIter>::value, int> = 0>42 __enable_if_t<!__has_random_access_iterator_category<_InIter>::value, int> = 0>
43_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InIter, _OutIter>43_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_InIter, _OutIter>
44__copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_type<_InIter> __n, _OutIter __result) {44__copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_type<_InIter> __n, _OutIter __result) {
45 while (__n != 0) {45 while (__n != 0) {
46 *__result = *__first;46 *__result = *__first;
...@@ -48,7 +48,7 @@ __copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_t...@@ -48,7 +48,7 @@ __copy_n(_InIter __first, typename _IterOps<_AlgPolicy>::template __difference_t
48 ++__result;48 ++__result;
49 --__n;49 --__n;
50 }50 }
51 return std::make_pair(std::move(__first), std::move(__result));51 return {std::move(__first), std::move(__result)};
52}52}
5353
54// The InputIterator case is handled specially here because it's been written in a way to avoid incrementing __first54// The InputIterator case is handled specially here because it's been written in a way to avoid incrementing __first
...@@ -84,7 +84,7 @@ copy_n(_InputIterator __first, _Size __n, _OutputIterator __result) {...@@ -84,7 +84,7 @@ copy_n(_InputIterator __first, _Size __n, _OutputIterator __result) {
84 using _IntegralSize = decltype(std::__convert_to_integral(__n));84 using _IntegralSize = decltype(std::__convert_to_integral(__n));
85 _IntegralSize __converted = __n;85 _IntegralSize __converted = __n;
86 return std::__copy_n<_ClassicAlgPolicy>(__first, __iterator_difference_type<_InputIterator>(__converted), __result)86 return std::__copy_n<_ClassicAlgPolicy>(__first, __iterator_difference_type<_InputIterator>(__converted), __result)
87 .second;87 .__out_;
88}88}
8989
90_LIBCPP_END_NAMESPACE_STD90_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/equal.h+58-13
...@@ -11,15 +11,16 @@...@@ -11,15 +11,16 @@
11#define _LIBCPP___ALGORITHM_EQUAL_H11#define _LIBCPP___ALGORITHM_EQUAL_H
1212
13#include <__algorithm/comp.h>13#include <__algorithm/comp.h>
14#include <__algorithm/find_segment_if.h>
14#include <__algorithm/min.h>15#include <__algorithm/min.h>
15#include <__algorithm/unwrap_iter.h>16#include <__algorithm/unwrap_iter.h>
16#include <__config>17#include <__config>
17#include <__functional/identity.h>18#include <__functional/identity.h>
18#include <__fwd/bit_reference.h>19#include <__fwd/bit_reference.h>
19#include <__iterator/distance.h>
20#include <__iterator/iterator_traits.h>20#include <__iterator/iterator_traits.h>
21#include <__memory/pointer_traits.h>21#include <__iterator/segmented_iterator.h>
22#include <__string/constexpr_c_functions.h>22#include <__string/constexpr_c_functions.h>
23#include <__type_traits/common_type.h>
23#include <__type_traits/desugars_to.h>24#include <__type_traits/desugars_to.h>
24#include <__type_traits/enable_if.h>25#include <__type_traits/enable_if.h>
25#include <__type_traits/invoke.h>26#include <__type_traits/invoke.h>
...@@ -27,6 +28,7 @@...@@ -27,6 +28,7 @@
27#include <__type_traits/is_same.h>28#include <__type_traits/is_same.h>
28#include <__type_traits/is_volatile.h>29#include <__type_traits/is_volatile.h>
29#include <__utility/move.h>30#include <__utility/move.h>
31#include <__utility/unreachable.h>
3032
31#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)33#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
32# pragma GCC system_header34# pragma GCC system_header
...@@ -177,15 +179,6 @@ template <class _Cp,...@@ -177,15 +179,6 @@ template <class _Cp,
177 return std::__equal_unaligned(__first1, __last1, __first2);179 return std::__equal_unaligned(__first1, __last1, __first2);
178}180}
179181
180template <class _InIter1, class _Sent1, class _InIter2, class _Pred, class _Proj1, class _Proj2>
181[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(
182 _InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
183 for (; __first1 != __last1; ++__first1, (void)++__first2)
184 if (!std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
185 return false;
186 return true;
187}
188
189template <class _Tp,182template <class _Tp,
190 class _Up,183 class _Up,
191 class _BinaryPredicate,184 class _BinaryPredicate,
...@@ -200,6 +193,58 @@ __equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&,...@@ -200,6 +193,58 @@ __equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&,
200 return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));193 return std::__constexpr_memcmp_equal(__first1, __first2, __element_count(__last1 - __first1));
201}194}
202195
196template <class _InIter1, class _Sent1, class _InIter2, class _Pred, class _Proj1, class _Proj2>
197[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(
198 _InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
199#ifndef _LIBCPP_CXX03_LANG
200 if constexpr (__has_random_access_iterator_category<_InIter1>::value &&
201 __has_random_access_iterator_category<_InIter2>::value) {
202 if constexpr (is_same<_InIter1, _Sent1>::value && __is_segmented_iterator_v<_InIter1>) {
203 using __local_iterator_t = typename __segmented_iterator_traits<_InIter1>::__local_iterator;
204 bool __is_equal = true;
205 std::__find_segment_if(__first1, __last1, [&](__local_iterator_t __lfirst, __local_iterator_t __llast) {
206 if (std::__equal_iter_impl(
207 std::__unwrap_iter(__lfirst), std::__unwrap_iter(__llast), __first2, __pred, __proj1, __proj2)) {
208 __first2 += __llast - __lfirst;
209 return __llast;
210 }
211 __is_equal = false;
212 return __lfirst;
213 });
214 return __is_equal;
215 } else if constexpr (__is_segmented_iterator_v<_InIter2>) {
216 using _Traits = __segmented_iterator_traits<_InIter2>;
217 using _DiffT =
218 typename common_type<__iterator_difference_type<_InIter1>, __iterator_difference_type<_InIter2> >::type;
219
220 if (__first1 == __last1)
221 return true;
222
223 auto __local_first = _Traits::__local(__first2);
224 auto __segment_iterator = _Traits::__segment(__first2);
225
226 while (true) {
227 auto __local_last = _Traits::__end(__segment_iterator);
228 auto __size = std::min<_DiffT>(__local_last - __local_first, __last1 - __first1);
229 if (!std::__equal_iter_impl(
230 __first1, __first1 + __size, std::__unwrap_iter(__local_first), __pred, __proj1, __proj2))
231 return false;
232
233 __first1 += __size;
234 if (__first1 == __last1)
235 return true;
236
237 __local_first = _Traits::__begin(++__segment_iterator);
238 }
239 }
240 }
241#endif
242 for (; __first1 != __last1; ++__first1, (void)++__first2)
243 if (!std::__invoke(__pred, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
244 return false;
245 return true;
246}
247
203template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>248template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
204[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool249[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
205equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {250equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
...@@ -247,11 +292,11 @@ equal(_InputIterator1 __first1,...@@ -247,11 +292,11 @@ equal(_InputIterator1 __first1,
247 _InputIterator2 __first2,292 _InputIterator2 __first2,
248 _InputIterator2 __last2,293 _InputIterator2 __last2,
249 _BinaryPredicate __pred) {294 _BinaryPredicate __pred) {
250 static constexpr bool __both_random_access =295 constexpr bool __both_random_access =
251 __has_random_access_iterator_category<_InputIterator1>::value &&296 __has_random_access_iterator_category<_InputIterator1>::value &&
252 __has_random_access_iterator_category<_InputIterator2>::value;297 __has_random_access_iterator_category<_InputIterator2>::value;
253 if constexpr (__both_random_access) {298 if constexpr (__both_random_access) {
254 if (std::distance(__first1, __last1) != std::distance(__first2, __last2))299 if (__last1 - __first1 != __last2 - __first2)
255 return false;300 return false;
256 }301 }
257 __identity __proj;302 __identity __proj;
lib/libcxx/include/__algorithm/find.h+13-14
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#ifndef _LIBCPP___ALGORITHM_FIND_H10#ifndef _LIBCPP___ALGORITHM_FIND_H
11#define _LIBCPP___ALGORITHM_FIND_H11#define _LIBCPP___ALGORITHM_FIND_H
1212
13#include <__algorithm/find_if.h>
13#include <__algorithm/find_segment_if.h>14#include <__algorithm/find_segment_if.h>
14#include <__algorithm/min.h>15#include <__algorithm/min.h>
15#include <__algorithm/simd_utils.h>16#include <__algorithm/simd_utils.h>
...@@ -47,17 +48,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -47,17 +48,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
47// generic implementation48// generic implementation
48template <class _Iter, class _Sent, class _Tp, class _Proj>49template <class _Iter, class _Sent, class _Tp, class _Proj>
49_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter50_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
50__find_loop(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {51__find_generic(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
51 for (; __first != __last; ++__first)52 return std::__find_if(
52 if (std::__invoke(__proj, *__first) == __value)53 std::move(__first),
53 break;54 std::move(__last),
54 return __first;55 [&]<class _ValT>(_ValT&& __val) -> bool { return __val == __value; },
56 __proj);
55}57}
5658
57template <class _Iter, class _Sent, class _Tp, class _Proj>59template <class _Iter, class _Sent, class _Tp, class _Proj>
58_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter60_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
59__find(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {61__find(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
60 return std::__find_loop(std::move(__first), std::move(__last), __value, __proj);62 return std::__find_generic(std::move(__first), std::move(__last), __value, __proj);
61}63}
6264
63#if _LIBCPP_VECTORIZE_ALGORITHMS65#if _LIBCPP_VECTORIZE_ALGORITHMS
...@@ -108,7 +110,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find_vectorized(_Tp* __first, _Tp* __last,...@@ -108,7 +110,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find_vectorized(_Tp* __first, _Tp* __last,
108 }110 }
109111
110 __identity __proj;112 __identity __proj;
111 return std::__find_loop(__first, __last, __value, __proj);113 return std::__find_generic(__first, __last, __value, __proj);
112}114}
113#endif115#endif
114116
...@@ -138,7 +140,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _T...@@ -138,7 +140,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _T
138# endif140# endif
139 else {141 else {
140 __identity __proj;142 __identity __proj;
141 return std::__find_loop(__first, __last, __value, __proj);143 return std::__find_generic(__first, __last, __value, __proj);
142 }144 }
143}145}
144#endif146#endif
...@@ -216,13 +218,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator...@@ -216,13 +218,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator
216__find(_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) {218__find(_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) {
217 using __local_iterator = typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator;219 using __local_iterator = typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator;
218 return std::__find_segment_if(220 return std::__find_segment_if(
219 std::move(__first),221 std::move(__first), std::move(__last), [&__value, &__proj](__local_iterator __lfirst, __local_iterator __llast) {
220 std::move(__last),
221 [&__value](__local_iterator __lfirst, __local_iterator __llast, _Proj& __lproj) {
222 return std::__rewrap_iter(222 return std::__rewrap_iter(
223 __lfirst, std::__find(std::__unwrap_iter(__lfirst), std::__unwrap_iter(__llast), __value, __lproj));223 __lfirst, std::__find(std::__unwrap_iter(__lfirst), std::__unwrap_iter(__llast), __value, __proj));
224 },224 });
225 __proj);
226}225}
227226
228// public API227// public API
lib/libcxx/include/__algorithm/find_if.h+22-4
...@@ -11,6 +11,9 @@...@@ -11,6 +11,9 @@
11#define _LIBCPP___ALGORITHM_FIND_IF_H11#define _LIBCPP___ALGORITHM_FIND_IF_H
1212
13#include <__config>13#include <__config>
14#include <__functional/identity.h>
15#include <__memory/valid_range.h>
16#include <__type_traits/invoke.h>
1417
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header19# pragma GCC system_header
...@@ -18,13 +21,28 @@...@@ -18,13 +21,28 @@
1821
19_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
2023
24template <class _Iter, class _Sent, class _Pred, class _Proj>
25_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Iter
26__find_if(_Iter __first, _Sent __last, _Pred&& __pred, _Proj&& __proj) {
27 // Don't make the valid range assumption for empty ranges since using unaligned sentinel
28 // values to implement iterators of empty ranges is a common occurence.
29 if (__first == __last)
30 return __first;
31
32 std::__assume_valid_range(__first, __last);
33
34 do {
35 if (std::__invoke(__pred, std::__invoke(__proj, *__first)))
36 break;
37 ++__first;
38 } while (__first != __last);
39 return __first;
40}
41
21template <class _InputIterator, class _Predicate>42template <class _InputIterator, class _Predicate>
22[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator43[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
23find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {44find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
24 for (; __first != __last; ++__first)45 return std::__find_if(__first, __last, __pred, __identity());
25 if (__pred(*__first))
26 break;
27 return __first;
28}46}
2947
30_LIBCPP_END_NAMESPACE_STD48_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/find_if_not.h+20-4
...@@ -10,23 +10,39 @@...@@ -10,23 +10,39 @@
10#ifndef _LIBCPP___ALGORITHM_FIND_IF_NOT_H10#ifndef _LIBCPP___ALGORITHM_FIND_IF_NOT_H
11#define _LIBCPP___ALGORITHM_FIND_IF_NOT_H11#define _LIBCPP___ALGORITHM_FIND_IF_NOT_H
1212
13#include <__algorithm/find_if.h>
13#include <__config>14#include <__config>
15#include <__functional/identity.h>
16#include <__type_traits/invoke.h>
17#include <__utility/move.h>
1418
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header20# pragma GCC system_header
17#endif21#endif
1822
23_LIBCPP_PUSH_MACROS
24#include <__undef_macros>
25
19_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2027
28template <class _Iter, class _Sent, class _Pred, class _Proj>
29_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
30__find_if_not(_Iter __first, _Sent __last, _Pred&& __pred, _Proj&& __proj) {
31 return std::__find_if(
32 std::move(__first),
33 std::move(__last),
34 [&]<class _ValT>(_ValT&& __val) -> bool { return !std::__invoke(__pred, __val); },
35 __proj);
36}
37
21template <class _InputIterator, class _Predicate>38template <class _InputIterator, class _Predicate>
22[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator39[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
23find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) {40find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
24 for (; __first != __last; ++__first)41 return std::__find_if_not(__first, __last, __pred, __identity());
25 if (!__pred(*__first))
26 break;
27 return __first;
28}42}
2943
30_LIBCPP_END_NAMESPACE_STD44_LIBCPP_END_NAMESPACE_STD
3145
46_LIBCPP_POP_MACROS
47
32#endif // _LIBCPP___ALGORITHM_FIND_IF_NOT_H48#endif // _LIBCPP___ALGORITHM_FIND_IF_NOT_H
lib/libcxx/include/__algorithm/find_segment_if.h+8-9
...@@ -19,14 +19,13 @@...@@ -19,14 +19,13 @@
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
2020
21// __find_segment_if is a utility function for optimizing iteration over segmented iterators linearly.21// __find_segment_if is a utility function for optimizing iteration over segmented iterators linearly.
22// [__first, __last) has to be a segmented range. __pred is expected to take a range of local iterators and the __proj.22// [__first, __last) has to be a segmented range. __pred is expected to take a range of local iterators.
23// It returns an iterator to the first element that satisfies the predicate, or a one-past-the-end iterator if there was23// It returns an iterator to the first element that satisfies the predicate, or a one-past-the-end iterator if there was
24// no match. __proj may be anything that should be passed to __pred, but is expected to be a projection to support24// no match.
25// ranges algorithms, or __identity for classic algorithms.
2625
27template <class _SegmentedIterator, class _Pred, class _Proj>26template <class _SegmentedIterator, class _Pred>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator27_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator
29__find_segment_if(_SegmentedIterator __first, _SegmentedIterator __last, _Pred __pred, _Proj& __proj) {28__find_segment_if(_SegmentedIterator __first, _SegmentedIterator __last, _Pred __pred) {
30 using _Traits = __segmented_iterator_traits<_SegmentedIterator>;29 using _Traits = __segmented_iterator_traits<_SegmentedIterator>;
3130
32 auto __sfirst = _Traits::__segment(__first);31 auto __sfirst = _Traits::__segment(__first);
...@@ -34,11 +33,11 @@ __find_segment_if(_SegmentedIterator __first, _SegmentedIterator __last, _Pred _...@@ -34,11 +33,11 @@ __find_segment_if(_SegmentedIterator __first, _SegmentedIterator __last, _Pred _
3433
35 // We are in a single segment, so we might not be at the beginning or end34 // We are in a single segment, so we might not be at the beginning or end
36 if (__sfirst == __slast)35 if (__sfirst == __slast)
37 return _Traits::__compose(__sfirst, __pred(_Traits::__local(__first), _Traits::__local(__last), __proj));36 return _Traits::__compose(__sfirst, __pred(_Traits::__local(__first), _Traits::__local(__last)));
3837
39 { // We have more than one segment. Iterate over the first segment, since we might not start at the beginning38 { // We have more than one segment. Iterate over the first segment, since we might not start at the beginning
40 auto __llast = _Traits::__end(__sfirst);39 auto __llast = _Traits::__end(__sfirst);
41 auto __liter = __pred(_Traits::__local(__first), __llast, __proj);40 auto __liter = __pred(_Traits::__local(__first), __llast);
42 if (__liter != __llast)41 if (__liter != __llast)
43 return _Traits::__compose(__sfirst, __liter);42 return _Traits::__compose(__sfirst, __liter);
44 }43 }
...@@ -47,14 +46,14 @@ __find_segment_if(_SegmentedIterator __first, _SegmentedIterator __last, _Pred _...@@ -47,14 +46,14 @@ __find_segment_if(_SegmentedIterator __first, _SegmentedIterator __last, _Pred _
47 // Iterate over the segments which are guaranteed to be completely in the range46 // Iterate over the segments which are guaranteed to be completely in the range
48 while (__sfirst != __slast) {47 while (__sfirst != __slast) {
49 auto __llast = _Traits::__end(__sfirst);48 auto __llast = _Traits::__end(__sfirst);
50 auto __liter = __pred(_Traits::__begin(__sfirst), _Traits::__end(__sfirst), __proj);49 auto __liter = __pred(_Traits::__begin(__sfirst), _Traits::__end(__sfirst));
51 if (__liter != __llast)50 if (__liter != __llast)
52 return _Traits::__compose(__sfirst, __liter);51 return _Traits::__compose(__sfirst, __liter);
53 ++__sfirst;52 ++__sfirst;
54 }53 }
5554
56 // Iterate over the last segment55 // Iterate over the last segment
57 return _Traits::__compose(__sfirst, __pred(_Traits::__begin(__sfirst), _Traits::__local(__last), __proj));56 return _Traits::__compose(__sfirst, __pred(_Traits::__begin(__sfirst), _Traits::__local(__last)));
58}57}
5958
60_LIBCPP_END_NAMESPACE_STD59_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/for_each.h+1-1
...@@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2626
27template <class _InputIterator, class _Sent, class _Func, class _Proj>27template <class _InputIterator, class _Sent, class _Func, class _Proj>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
29__for_each(_InputIterator __first, _Sent __last, _Func& __func, _Proj& __proj) {29__for_each(_InputIterator __first, _Sent __last, _Func&& __func, _Proj& __proj) {
30#ifndef _LIBCPP_CXX03_LANG30#ifndef _LIBCPP_CXX03_LANG
31 if constexpr (using _SpecialAlg =31 if constexpr (using _SpecialAlg =
32 __specialized_algorithm<_Algorithm::__for_each, __iterator_pair<_InputIterator, _Sent>>;32 __specialized_algorithm<_Algorithm::__for_each, __iterator_pair<_InputIterator, _Sent>>;
lib/libcxx/include/__algorithm/for_each_n.h+3-2
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#include <__iterator/segmented_iterator.h>18#include <__iterator/segmented_iterator.h>
19#include <__type_traits/invoke.h>19#include <__type_traits/invoke.h>
20#include <__utility/convert_to_integral.h>20#include <__utility/convert_to_integral.h>
21#include <__utility/forward.h>
21#include <__utility/move.h>22#include <__utility/move.h>
2223
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -31,7 +32,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -31,7 +32,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3132
32template <class _InputIterator, class _Size, class _Func, class _Proj>33template <class _InputIterator, class _Size, class _Func, class _Proj>
33_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator34_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
34__for_each_n(_InputIterator __first, _Size __orig_n, _Func& __f, _Proj& __proj) {35__for_each_n(_InputIterator __first, _Size __orig_n, _Func&& __f, _Proj& __proj) {
35 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;36 typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;
36 _IntegralSize __n = __orig_n;37 _IntegralSize __n = __orig_n;
3738
...@@ -43,7 +44,7 @@ __for_each_n(_InputIterator __first, _Size __orig_n, _Func& __f, _Proj& __proj)...@@ -43,7 +44,7 @@ __for_each_n(_InputIterator __first, _Size __orig_n, _Func& __f, _Proj& __proj)
43 std::__for_each(__lfirst, __llast, __f, __proj);44 std::__for_each(__lfirst, __llast, __f, __proj);
44 });45 });
45 } else {46 } else {
46 return std::__for_each(__first, __first + __n, __f, __proj);47 return std::__for_each(__first, __first + __n, std::forward<_Func>(__f), __proj);
47 }48 }
48 } else49 } else
49#endif50#endif
lib/libcxx/include/__algorithm/generate_n.h+5-2
...@@ -29,8 +29,11 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator...@@ -29,8 +29,11 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
29__generate_n(_OutputIterator __first, _Size __orig_n, _Generator& __gen) {29__generate_n(_OutputIterator __first, _Size __orig_n, _Generator& __gen) {
30 using __iter_ref = decltype(*__first);30 using __iter_ref = decltype(*__first);
31 __identity __proj;31 __identity __proj;
32 auto __f = [&](__iter_ref __element) { std::forward<__iter_ref>(__element) = __gen(); };32 return std::__for_each_n(
33 return std::__for_each_n(std::move(__first), __orig_n, __f, __proj);33 std::move(__first),
34 __orig_n,
35 [&](__iter_ref __element) { std::forward<__iter_ref>(__element) = __gen(); },
36 __proj);
34}37}
3538
36template <class _OutputIterator, class _Size, class _Generator>39template <class _OutputIterator, class _Size, class _Generator>
lib/libcxx/include/__algorithm/in_out_result.h+14
...@@ -49,6 +49,20 @@ struct in_out_result {...@@ -49,6 +49,20 @@ struct in_out_result {
4949
50#endif // _LIBCPP_STD_VER >= 2050#endif // _LIBCPP_STD_VER >= 20
5151
52template <class _InIter, class _OutIter>
53struct __in_out_result {
54 _InIter __in_;
55 _OutIter __out_;
56
57#if _LIBCPP_STD_VER >= 20
58 template <class _InIter2, class _OutIter2>
59 requires convertible_to<_InIter, _InIter2> && convertible_to<_OutIter, _OutIter2>
60 constexpr operator ranges::in_out_result<_InIter2, _OutIter2>() && {
61 return {std::move(__in_), std::move(__out_)};
62 }
63#endif
64};
65
52_LIBCPP_END_NAMESPACE_STD66_LIBCPP_END_NAMESPACE_STD
5367
54_LIBCPP_POP_MACROS68_LIBCPP_POP_MACROS
lib/libcxx/include/__algorithm/lexicographical_compare_three_way.h+4-4
...@@ -27,10 +27,10 @@...@@ -27,10 +27,10 @@
27_LIBCPP_PUSH_MACROS27_LIBCPP_PUSH_MACROS
28#include <__undef_macros>28#include <__undef_macros>
2929
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32#if _LIBCPP_STD_VER >= 2030#if _LIBCPP_STD_VER >= 20
3331
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34// Fast path for random access iterators which computes the number of loop iterations up-front and34// Fast path for random access iterators which computes the number of loop iterations up-front and
35// then skips the iterator comparisons inside the loop.35// then skips the iterator comparisons inside the loop.
36template <class _InputIterator1, class _InputIterator2, class _Cmp>36template <class _InputIterator1, class _InputIterator2, class _Cmp>
...@@ -116,10 +116,10 @@ template <class _InputIterator1, class _InputIterator2>...@@ -116,10 +116,10 @@ template <class _InputIterator1, class _InputIterator2>
116 std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::compare_three_way());116 std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::compare_three_way());
117}117}
118118
119#endif // _LIBCPP_STD_VER >= 20
120
121_LIBCPP_END_NAMESPACE_STD119_LIBCPP_END_NAMESPACE_STD
122120
121#endif // _LIBCPP_STD_VER >= 20
122
123_LIBCPP_POP_MACROS123_LIBCPP_POP_MACROS
124124
125#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H125#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
lib/libcxx/include/__algorithm/lower_bound.h+5-4
...@@ -56,11 +56,11 @@ template <class _AlgPolicy, class _Iter, class _Type, class _Proj, class _Comp>...@@ -56,11 +56,11 @@ template <class _AlgPolicy, class _Iter, class _Type, class _Proj, class _Comp>
56// would yield \Omega(n*log(n)) comparisons and, for non-random-access iterators, \Omega(n^2) iterator increments,56// would yield \Omega(n*log(n)) comparisons and, for non-random-access iterators, \Omega(n^2) iterator increments,
57// whereas the one-sided version will yield O(n) operations on both counts, with a \Omega(log(n)) bound on the number of57// whereas the one-sided version will yield O(n) operations on both counts, with a \Omega(log(n)) bound on the number of
58// comparisons.58// comparisons.
59template <class _AlgPolicy, class _ForwardIterator, class _Sent, class _Type, class _Proj, class _Comp>59template <class _AlgPolicy, class _ForwardIterator, class _Sent, class _Type, class _Comp>
60[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator60[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
61__lower_bound_onesided(_ForwardIterator __first, _Sent __last, const _Type& __value, _Comp& __comp, _Proj& __proj) {61__lower_bound_onesided(_ForwardIterator __first, _Sent __last, const _Type& __value, _Comp& __comp) {
62 // step = 0, ensuring we can always short-circuit when distance is 1 later on62 // step = 0, ensuring we can always short-circuit when distance is 1 later on
63 if (__first == __last || !std::__invoke(__comp, std::__invoke(__proj, *__first), __value))63 if (__first == __last || !std::__invoke(__comp, *__first, __value))
64 return __first;64 return __first;
6565
66 using _Distance = typename iterator_traits<_ForwardIterator>::difference_type;66 using _Distance = typename iterator_traits<_ForwardIterator>::difference_type;
...@@ -69,11 +69,12 @@ __lower_bound_onesided(_ForwardIterator __first, _Sent __last, const _Type& __va...@@ -69,11 +69,12 @@ __lower_bound_onesided(_ForwardIterator __first, _Sent __last, const _Type& __va
69 auto __dist = __step - _IterOps<_AlgPolicy>::__advance_to(__it, __step, __last);69 auto __dist = __step - _IterOps<_AlgPolicy>::__advance_to(__it, __step, __last);
70 // once we reach the last range where needle can be we must start70 // once we reach the last range where needle can be we must start
71 // looking inwards, bisecting that range71 // looking inwards, bisecting that range
72 if (__it == __last || !std::__invoke(__comp, std::__invoke(__proj, *__it), __value)) {72 if (__it == __last || !std::__invoke(__comp, *__it, __value)) {
73 // we've already checked the previous value and it was less, we can save73 // we've already checked the previous value and it was less, we can save
74 // one comparison by skipping bisection74 // one comparison by skipping bisection
75 if (__dist == 1)75 if (__dist == 1)
76 return __it;76 return __it;
77 __identity __proj;
77 return std::__lower_bound_bisecting<_AlgPolicy>(__first, __value, __dist, __comp, __proj);78 return std::__lower_bound_bisecting<_AlgPolicy>(__first, __value, __dist, __comp, __proj);
78 }79 }
79 // range not found, move forward!80 // range not found, move forward!
lib/libcxx/include/__algorithm/move.h+16-15
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#include <__algorithm/copy.h>12#include <__algorithm/copy.h>
13#include <__algorithm/copy_move_common.h>13#include <__algorithm/copy_move_common.h>
14#include <__algorithm/for_each_segment.h>14#include <__algorithm/for_each_segment.h>
15#include <__algorithm/in_out_result.h>
15#include <__algorithm/iterator_operations.h>16#include <__algorithm/iterator_operations.h>
16#include <__algorithm/min.h>17#include <__algorithm/min.h>
17#include <__config>18#include <__config>
...@@ -22,7 +23,6 @@...@@ -22,7 +23,6 @@
22#include <__type_traits/enable_if.h>23#include <__type_traits/enable_if.h>
23#include <__type_traits/is_constructible.h>24#include <__type_traits/is_constructible.h>
24#include <__utility/move.h>25#include <__utility/move.h>
25#include <__utility/pair.h>
2626
27#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)27#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28# pragma GCC system_header28# pragma GCC system_header
...@@ -34,30 +34,30 @@ _LIBCPP_PUSH_MACROS...@@ -34,30 +34,30 @@ _LIBCPP_PUSH_MACROS
34_LIBCPP_BEGIN_NAMESPACE_STD34_LIBCPP_BEGIN_NAMESPACE_STD
3535
36template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>36template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
37inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>37inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
38__move(_InIter __first, _Sent __last, _OutIter __result);38__move(_InIter __first, _Sent __last, _OutIter __result);
3939
40template <class _AlgPolicy>40template <class _AlgPolicy>
41struct __move_impl {41struct __move_impl {
42 template <class _InIter, class _Sent, class _OutIter>42 template <class _InIter, class _Sent, class _OutIter>
43 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>43 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
44 operator()(_InIter __first, _Sent __last, _OutIter __result) const {44 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
45 while (__first != __last) {45 while (__first != __last) {
46 *__result = _IterOps<_AlgPolicy>::__iter_move(__first);46 *__result = _IterOps<_AlgPolicy>::__iter_move(__first);
47 ++__first;47 ++__first;
48 ++__result;48 ++__result;
49 }49 }
50 return std::make_pair(std::move(__first), std::move(__result));50 return {std::move(__first), std::move(__result)};
51 }51 }
5252
53 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>53 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
54 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>54 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
55 operator()(_InIter __first, _InIter __last, _OutIter __result) const {55 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
56 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;56 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;
57 std::__for_each_segment(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {57 std::__for_each_segment(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {
58 __result = std::__move<_AlgPolicy>(__lfirst, __llast, std::move(__result)).second;58 __result = std::__move<_AlgPolicy>(__lfirst, __llast, std::move(__result)).__out_;
59 });59 });
60 return std::make_pair(__last, std::move(__result));60 return {__last, std::move(__result)};
61 }61 }
6262
63 template <class _InIter,63 template <class _InIter,
...@@ -65,14 +65,14 @@ struct __move_impl {...@@ -65,14 +65,14 @@ struct __move_impl {
65 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&65 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
66 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,66 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
67 int> = 0>67 int> = 0>
68 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>68 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
69 operator()(_InIter __first, _InIter __last, _OutIter __result) const {69 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
70 using _Traits = __segmented_iterator_traits<_OutIter>;70 using _Traits = __segmented_iterator_traits<_OutIter>;
71 using _DiffT =71 using _DiffT =
72 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;72 typename common_type<__iterator_difference_type<_InIter>, __iterator_difference_type<_OutIter> >::type;
7373
74 if (__first == __last)74 if (__first == __last)
75 return std::make_pair(std::move(__first), std::move(__result));75 return {std::move(__first), std::move(__result)};
7676
77 auto __local_first = _Traits::__local(__result);77 auto __local_first = _Traits::__local(__result);
78 auto __segment_iterator = _Traits::__segment(__result);78 auto __segment_iterator = _Traits::__segment(__result);
...@@ -80,17 +80,18 @@ struct __move_impl {...@@ -80,17 +80,18 @@ struct __move_impl {
80 auto __local_last = _Traits::__end(__segment_iterator);80 auto __local_last = _Traits::__end(__segment_iterator);
81 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);81 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);
82 auto __iters = std::__move<_AlgPolicy>(__first, __first + __size, __local_first);82 auto __iters = std::__move<_AlgPolicy>(__first, __first + __size, __local_first);
83 __first = std::move(__iters.first);83 __first = std::move(__iters.__in_);
8484
85 if (__first == __last)85 if (__first == __last)
86 return std::make_pair(std::move(__first), _Traits::__compose(__segment_iterator, std::move(__iters.second)));86 return {std::move(__first), _Traits::__compose(__segment_iterator, std::move(__iters.__out_))};
8787
88 __local_first = _Traits::__begin(++__segment_iterator);88 __local_first = _Traits::__begin(++__segment_iterator);
89 }89 }
90 }90 }
9191
92 template <class _Cp, bool _IsConst>92 template <class _Cp, bool _IsConst>
93 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >93 _LIBCPP_HIDE_FROM_ABI
94 _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >
94 operator()(__bit_iterator<_Cp, _IsConst> __first,95 operator()(__bit_iterator<_Cp, _IsConst> __first,
95 __bit_iterator<_Cp, _IsConst> __last,96 __bit_iterator<_Cp, _IsConst> __last,
96 __bit_iterator<_Cp, false> __result) {97 __bit_iterator<_Cp, false> __result) {
...@@ -99,14 +100,14 @@ struct __move_impl {...@@ -99,14 +100,14 @@ struct __move_impl {
99100
100 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.101 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
101 template <class _In, class _Out, __enable_if_t<__can_lower_move_assignment_to_memmove<_In, _Out>::value, int> = 0>102 template <class _In, class _Out, __enable_if_t<__can_lower_move_assignment_to_memmove<_In, _Out>::value, int> = 0>
102 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>103 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_In*, _Out*>
103 operator()(_In* __first, _In* __last, _Out* __result) const {104 operator()(_In* __first, _In* __last, _Out* __result) const {
104 return std::__copy_trivial_impl(__first, __last, __result);105 return std::__copy_trivial_impl(__first, __last, __result);
105 }106 }
106};107};
107108
108template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>109template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
109inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>110inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
110__move(_InIter __first, _Sent __last, _OutIter __result) {111__move(_InIter __first, _Sent __last, _OutIter __result) {
111 return std::__copy_move_unwrap_iters<__move_impl<_AlgPolicy> >(112 return std::__copy_move_unwrap_iters<__move_impl<_AlgPolicy> >(
112 std::move(__first), std::move(__last), std::move(__result));113 std::move(__first), std::move(__last), std::move(__result));
...@@ -118,7 +119,7 @@ move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {...@@ -118,7 +119,7 @@ move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
118 static_assert(is_copy_constructible<_InputIterator>::value, "Iterators has to be copy constructible.");119 static_assert(is_copy_constructible<_InputIterator>::value, "Iterators has to be copy constructible.");
119 static_assert(is_copy_constructible<_OutputIterator>::value, "The output iterator has to be copy constructible.");120 static_assert(is_copy_constructible<_OutputIterator>::value, "The output iterator has to be copy constructible.");
120121
121 return std::__move<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).second;122 return std::__move<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).__out_;
122}123}
123124
124_LIBCPP_END_NAMESPACE_STD125_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/move_backward.h+16-14
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#include <__algorithm/copy_backward.h>12#include <__algorithm/copy_backward.h>
13#include <__algorithm/copy_move_common.h>13#include <__algorithm/copy_move_common.h>
14#include <__algorithm/for_each_segment.h>14#include <__algorithm/for_each_segment.h>
15#include <__algorithm/in_out_result.h>
15#include <__algorithm/iterator_operations.h>16#include <__algorithm/iterator_operations.h>
16#include <__algorithm/min.h>17#include <__algorithm/min.h>
17#include <__config>18#include <__config>
...@@ -34,13 +35,13 @@ _LIBCPP_PUSH_MACROS...@@ -34,13 +35,13 @@ _LIBCPP_PUSH_MACROS
34_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
3536
36template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>37template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>
37_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_BidirectionalIterator1, _BidirectionalIterator2>38_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_BidirectionalIterator1, _BidirectionalIterator2>
38__move_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result);39__move_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result);
3940
40template <class _AlgPolicy>41template <class _AlgPolicy>
41struct __move_backward_impl {42struct __move_backward_impl {
42 template <class _InIter, class _Sent, class _OutIter>43 template <class _InIter, class _Sent, class _OutIter>
43 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>44 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
44 operator()(_InIter __first, _Sent __last, _OutIter __result) const {45 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
45 auto __last_iter = _IterOps<_AlgPolicy>::next(__first, __last);46 auto __last_iter = _IterOps<_AlgPolicy>::next(__first, __last);
46 auto __original_last_iter = __last_iter;47 auto __original_last_iter = __last_iter;
...@@ -49,17 +50,17 @@ struct __move_backward_impl {...@@ -49,17 +50,17 @@ struct __move_backward_impl {
49 *--__result = _IterOps<_AlgPolicy>::__iter_move(--__last_iter);50 *--__result = _IterOps<_AlgPolicy>::__iter_move(--__last_iter);
50 }51 }
5152
52 return std::make_pair(std::move(__original_last_iter), std::move(__result));53 return {std::move(__original_last_iter), std::move(__result)};
53 }54 }
5455
55 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>56 template <class _InIter, class _OutIter, __enable_if_t<__is_segmented_iterator_v<_InIter>, int> = 0>
56 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>57 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
57 operator()(_InIter __first, _InIter __last, _OutIter __result) const {58 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
58 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;59 using __local_iterator = typename __segmented_iterator_traits<_InIter>::__local_iterator;
59 std::__for_each_segment_backward(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {60 std::__for_each_segment_backward(__first, __last, [&__result](__local_iterator __lfirst, __local_iterator __llast) {
60 __result = std::__move_backward<_AlgPolicy>(std::move(__lfirst), std::move(__llast), std::move(__result)).second;61 __result = std::__move_backward<_AlgPolicy>(std::move(__lfirst), std::move(__llast), std::move(__result)).__out_;
61 });62 });
62 return std::make_pair(__last, std::move(__result));63 return {__last, std::move(__result)};
63 }64 }
6465
65 template <class _InIter,66 template <class _InIter,
...@@ -67,7 +68,7 @@ struct __move_backward_impl {...@@ -67,7 +68,7 @@ struct __move_backward_impl {
67 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&68 __enable_if_t<__has_random_access_iterator_category<_InIter>::value &&
68 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,69 !__is_segmented_iterator_v<_InIter> && __is_segmented_iterator_v<_OutIter>,
69 int> = 0>70 int> = 0>
70 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>71 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_InIter, _OutIter>
71 operator()(_InIter __first, _InIter __last, _OutIter __result) const {72 operator()(_InIter __first, _InIter __last, _OutIter __result) const {
72 using _Traits = __segmented_iterator_traits<_OutIter>;73 using _Traits = __segmented_iterator_traits<_OutIter>;
73 using _DiffT =74 using _DiffT =
...@@ -75,7 +76,7 @@ struct __move_backward_impl {...@@ -75,7 +76,7 @@ struct __move_backward_impl {
7576
76 // When the range contains no elements, __result might not be a valid iterator77 // When the range contains no elements, __result might not be a valid iterator
77 if (__first == __last)78 if (__first == __last)
78 return std::make_pair(__first, __result);79 return {__first, __result};
7980
80 auto __orig_last = __last;81 auto __orig_last = __last;
8182
...@@ -84,18 +85,19 @@ struct __move_backward_impl {...@@ -84,18 +85,19 @@ struct __move_backward_impl {
84 while (true) {85 while (true) {
85 auto __local_first = _Traits::__begin(__segment_iterator);86 auto __local_first = _Traits::__begin(__segment_iterator);
86 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);87 auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first);
87 auto __iter = std::__move_backward<_AlgPolicy>(__last - __size, __last, __local_last).second;88 auto __iter = std::__move_backward<_AlgPolicy>(__last - __size, __last, __local_last).__out_;
88 __last -= __size;89 __last -= __size;
8990
90 if (__first == __last)91 if (__first == __last)
91 return std::make_pair(std::move(__orig_last), _Traits::__compose(__segment_iterator, std::move(__iter)));92 return {std::move(__orig_last), _Traits::__compose(__segment_iterator, std::move(__iter))};
9293
93 __local_last = _Traits::__end(--__segment_iterator);94 __local_last = _Traits::__end(--__segment_iterator);
94 }95 }
95 }96 }
9697
97 template <class _Cp, bool _IsConst>98 template <class _Cp, bool _IsConst>
98 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >99 _LIBCPP_HIDE_FROM_ABI
100 _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >
99 operator()(__bit_iterator<_Cp, _IsConst> __first,101 operator()(__bit_iterator<_Cp, _IsConst> __first,
100 __bit_iterator<_Cp, _IsConst> __last,102 __bit_iterator<_Cp, _IsConst> __last,
101 __bit_iterator<_Cp, false> __result) {103 __bit_iterator<_Cp, false> __result) {
...@@ -104,14 +106,14 @@ struct __move_backward_impl {...@@ -104,14 +106,14 @@ struct __move_backward_impl {
104106
105 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.107 // At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
106 template <class _In, class _Out, __enable_if_t<__can_lower_move_assignment_to_memmove<_In, _Out>::value, int> = 0>108 template <class _In, class _Out, __enable_if_t<__can_lower_move_assignment_to_memmove<_In, _Out>::value, int> = 0>
107 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>109 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __in_out_result<_In*, _Out*>
108 operator()(_In* __first, _In* __last, _Out* __result) const {110 operator()(_In* __first, _In* __last, _Out* __result) const {
109 return std::__copy_backward_trivial_impl(__first, __last, __result);111 return std::__copy_backward_trivial_impl(__first, __last, __result);
110 }112 }
111};113};
112114
113template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>115template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>
114_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_BidirectionalIterator1, _BidirectionalIterator2>116_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_BidirectionalIterator1, _BidirectionalIterator2>
115__move_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result) {117__move_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result) {
116 static_assert(std::is_copy_constructible<_BidirectionalIterator1>::value &&118 static_assert(std::is_copy_constructible<_BidirectionalIterator1>::value &&
117 std::is_copy_constructible<_BidirectionalIterator1>::value,119 std::is_copy_constructible<_BidirectionalIterator1>::value,
...@@ -124,7 +126,7 @@ __move_backward(_BidirectionalIterator1 __first, _Sentinel __last, _Bidirectiona...@@ -124,7 +126,7 @@ __move_backward(_BidirectionalIterator1 __first, _Sentinel __last, _Bidirectiona
124template <class _BidirectionalIterator1, class _BidirectionalIterator2>126template <class _BidirectionalIterator1, class _BidirectionalIterator2>
125inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _BidirectionalIterator2127inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _BidirectionalIterator2
126move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) {128move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) {
127 return std::__move_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).second;129 return std::__move_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).__out_;
128}130}
129131
130_LIBCPP_END_NAMESPACE_STD132_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/out_value_result.h+4-4
...@@ -21,10 +21,10 @@...@@ -21,10 +21,10 @@
21_LIBCPP_PUSH_MACROS21_LIBCPP_PUSH_MACROS
22#include <__undef_macros>22#include <__undef_macros>
2323
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26#if _LIBCPP_STD_VER >= 2324#if _LIBCPP_STD_VER >= 23
2725
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28namespace ranges {28namespace ranges {
2929
30template <class _OutIter1, class _ValType1>30template <class _OutIter1, class _ValType1>
...@@ -47,10 +47,10 @@ struct out_value_result {...@@ -47,10 +47,10 @@ struct out_value_result {
4747
48} // namespace ranges48} // namespace ranges
4949
50#endif // _LIBCPP_STD_VER >= 23
51
52_LIBCPP_END_NAMESPACE_STD50_LIBCPP_END_NAMESPACE_STD
5351
52#endif // _LIBCPP_STD_VER >= 23
53
54_LIBCPP_POP_MACROS54_LIBCPP_POP_MACROS
5555
56#endif // _LIBCPP___ALGORITHM_OUT_VALUE_RESULT_H56#endif // _LIBCPP___ALGORITHM_OUT_VALUE_RESULT_H
lib/libcxx/include/__algorithm/partial_sort_copy.h+5-4
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__algorithm/comp.h>12#include <__algorithm/comp.h>
13#include <__algorithm/comp_ref_type.h>13#include <__algorithm/comp_ref_type.h>
14#include <__algorithm/in_out_result.h>
14#include <__algorithm/iterator_operations.h>15#include <__algorithm/iterator_operations.h>
15#include <__algorithm/make_heap.h>16#include <__algorithm/make_heap.h>
16#include <__algorithm/make_projected.h>17#include <__algorithm/make_projected.h>
...@@ -41,7 +42,8 @@ template <class _AlgPolicy,...@@ -41,7 +42,8 @@ template <class _AlgPolicy,
41 class _Sentinel2,42 class _Sentinel2,
42 class _Proj1,43 class _Proj1,
43 class _Proj2>44 class _Proj2>
44_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator, _RandomAccessIterator> __partial_sort_copy(45_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<_InputIterator, _RandomAccessIterator>
46__partial_sort_copy(
45 _InputIterator __first,47 _InputIterator __first,
46 _Sentinel1 __last,48 _Sentinel1 __last,
47 _RandomAccessIterator __result_first,49 _RandomAccessIterator __result_first,
...@@ -65,8 +67,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator, _Random...@@ -65,8 +67,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator, _Random
65 std::__sort_heap<_AlgPolicy>(__result_first, __r, __projected_comp);67 std::__sort_heap<_AlgPolicy>(__result_first, __r, __projected_comp);
66 }68 }
6769
68 return pair<_InputIterator, _RandomAccessIterator>(70 return {_IterOps<_AlgPolicy>::next(std::move(__first), std::move(__last)), std::move(__r)};
69 _IterOps<_AlgPolicy>::next(std::move(__first), std::move(__last)), std::move(__r));
70}71}
7172
72template <class _InputIterator, class _RandomAccessIterator, class _Compare>73template <class _InputIterator, class _RandomAccessIterator, class _Compare>
...@@ -87,7 +88,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator...@@ -87,7 +88,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator
87 static_cast<__comp_ref_type<_Compare> >(__comp),88 static_cast<__comp_ref_type<_Compare> >(__comp),
88 __identity(),89 __identity(),
89 __identity());90 __identity());
90 return __result.second;91 return __result.__out_;
91}92}
9293
93template <class _InputIterator, class _RandomAccessIterator>94template <class _InputIterator, class _RandomAccessIterator>
lib/libcxx/include/__algorithm/pstl.h+90
...@@ -293,6 +293,54 @@ find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __l...@@ -293,6 +293,54 @@ find(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __l
293 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), __value);293 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), __value);
294}294}
295295
296template <class _ExecutionPolicy,
297 class _ForwardIterator1,
298 class _ForwardIterator2,
299 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
300 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
301[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ForwardIterator1 find_first_of(
302 _ExecutionPolicy&& __policy,
303 _ForwardIterator1 __first1,
304 _ForwardIterator1 __last1,
305 _ForwardIterator2 __first2,
306 _ForwardIterator2 __last2) {
307 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "find_first_of requires ForwardIterators");
308 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "find_first_of requires ForwardIterators");
309 using _Implementation = __pstl::__dispatch<__pstl::__find_first_of, __pstl::__current_configuration, _RawPolicy>;
310 return __pstl::__handle_exception<_Implementation>(
311 std::forward<_ExecutionPolicy>(__policy),
312 std::move(__first1),
313 std::move(__last1),
314 std::move(__first2),
315 std::move(__last2),
316 std::equal_to<>{});
317}
318
319template <class _ExecutionPolicy,
320 class _ForwardIterator1,
321 class _ForwardIterator2,
322 class _BinaryPredicate,
323 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
324 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
325[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ForwardIterator1 find_first_of(
326 _ExecutionPolicy&& __policy,
327 _ForwardIterator1 __first1,
328 _ForwardIterator1 __last1,
329 _ForwardIterator2 __first2,
330 _ForwardIterator2 __last2,
331 _BinaryPredicate __pred) {
332 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator1, "find_first_of requires ForwardIterators");
333 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator2, "find_first_of requires ForwardIterators");
334 using _Implementation = __pstl::__dispatch<__pstl::__find_first_of, __pstl::__current_configuration, _RawPolicy>;
335 return __pstl::__handle_exception<_Implementation>(
336 std::forward<_ExecutionPolicy>(__policy),
337 std::move(__first1),
338 std::move(__last1),
339 std::move(__first2),
340 std::move(__last2),
341 std::move(__pred));
342}
343
296template <class _ExecutionPolicy,344template <class _ExecutionPolicy,
297 class _ForwardIterator,345 class _ForwardIterator,
298 class _Function,346 class _Function,
...@@ -347,6 +395,23 @@ generate_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _Ge...@@ -347,6 +395,23 @@ generate_n(_ExecutionPolicy&& __policy, _ForwardIterator __first, _Size __n, _Ge
347 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__n), std::move(__gen));395 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__n), std::move(__gen));
348}396}
349397
398template <class _ExecutionPolicy,
399 class _BidirectionalIterator,
400 class _ForwardIterator,
401 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
402 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
403[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ForwardIterator reverse_copy(
404 _ExecutionPolicy&& __policy,
405 _BidirectionalIterator __first,
406 _BidirectionalIterator __last,
407 _ForwardIterator __result) {
408 _LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(_BidirectionalIterator, "reverse_copy requires a BidirectionalIterator");
409 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reverse_copy requires a ForwardIterator");
410 using _Implementation = __pstl::__dispatch<__pstl::__reverse_copy, __pstl::__current_configuration, _RawPolicy>;
411 return __pstl::__handle_exception<_Implementation>(
412 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__result));
413}
414
350template <class _ExecutionPolicy,415template <class _ExecutionPolicy,
351 class _ForwardIterator,416 class _ForwardIterator,
352 class _Predicate,417 class _Predicate,
...@@ -654,6 +719,31 @@ _LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform(...@@ -654,6 +719,31 @@ _LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform(
654 std::move(__op));719 std::move(__op));
655}720}
656721
722template <class _ExecutionPolicy,
723 class _ForwardIterator,
724 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
725 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
726[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
727is_sorted(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) {
728 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "is_sorted requires ForwardIterators");
729 using _Implementation = __pstl::__dispatch<__pstl::__is_sorted, __pstl::__current_configuration, _RawPolicy>;
730 return __pstl::__handle_exception<_Implementation>(
731 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), less{});
732}
733
734template <class _ExecutionPolicy,
735 class _ForwardIterator,
736 class _Comp,
737 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
738 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
739[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
740is_sorted(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Comp __comp) {
741 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "is_sorted requires ForwardIterators");
742 using _Implementation = __pstl::__dispatch<__pstl::__is_sorted, __pstl::__current_configuration, _RawPolicy>;
743 return __pstl::__handle_exception<_Implementation>(
744 std::forward<_ExecutionPolicy>(__policy), std::move(__first), std::move(__last), std::move(__comp));
745}
746
657_LIBCPP_END_NAMESPACE_STD747_LIBCPP_END_NAMESPACE_STD
658748
659#endif // _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17749#endif // _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17
lib/libcxx/include/__algorithm/radix_sort.h+4-4
...@@ -67,10 +67,10 @@...@@ -67,10 +67,10 @@
67_LIBCPP_PUSH_MACROS67_LIBCPP_PUSH_MACROS
68#include <__undef_macros>68#include <__undef_macros>
6969
70_LIBCPP_BEGIN_NAMESPACE_STD
71
72#if _LIBCPP_STD_VER >= 1470#if _LIBCPP_STD_VER >= 14
7371
72_LIBCPP_BEGIN_NAMESPACE_STD
73
74template <class _InputIterator, class _OutputIterator>74template <class _InputIterator, class _OutputIterator>
75_LIBCPP_HIDE_FROM_ABI constexpr pair<_OutputIterator, __iterator_value_type<_InputIterator>>75_LIBCPP_HIDE_FROM_ABI constexpr pair<_OutputIterator, __iterator_value_type<_InputIterator>>
76__partial_sum_max(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {76__partial_sum_max(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
...@@ -422,10 +422,10 @@ __radix_sort(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _Ran...@@ -422,10 +422,10 @@ __radix_sort(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _Ran
422 std::__radix_sort(__first, __last, __buffer, __identity{}, __low_byte_fn{});422 std::__radix_sort(__first, __last, __buffer, __identity{}, __low_byte_fn{});
423}423}
424424
425#endif // _LIBCPP_STD_VER >= 14
426
427_LIBCPP_END_NAMESPACE_STD425_LIBCPP_END_NAMESPACE_STD
428426
427#endif // _LIBCPP_STD_VER >= 14
428
429_LIBCPP_POP_MACROS429_LIBCPP_POP_MACROS
430430
431#endif // _LIBCPP___ALGORITHM_RADIX_SORT_H431#endif // _LIBCPP___ALGORITHM_RADIX_SORT_H
lib/libcxx/include/__algorithm/ranges_copy.h+2-4
...@@ -41,16 +41,14 @@ struct __copy {...@@ -41,16 +41,14 @@ struct __copy {
41 requires indirectly_copyable<_InIter, _OutIter>41 requires indirectly_copyable<_InIter, _OutIter>
42 _LIBCPP_HIDE_FROM_ABI constexpr copy_result<_InIter, _OutIter>42 _LIBCPP_HIDE_FROM_ABI constexpr copy_result<_InIter, _OutIter>
43 operator()(_InIter __first, _Sent __last, _OutIter __result) const {43 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
44 auto __ret = std::__copy(std::move(__first), std::move(__last), std::move(__result));44 return std::__copy(std::move(__first), std::move(__last), std::move(__result));
45 return {std::move(__ret.first), std::move(__ret.second)};
46 }45 }
4746
48 template <input_range _Range, weakly_incrementable _OutIter>47 template <input_range _Range, weakly_incrementable _OutIter>
49 requires indirectly_copyable<iterator_t<_Range>, _OutIter>48 requires indirectly_copyable<iterator_t<_Range>, _OutIter>
50 _LIBCPP_HIDE_FROM_ABI constexpr copy_result<borrowed_iterator_t<_Range>, _OutIter>49 _LIBCPP_HIDE_FROM_ABI constexpr copy_result<borrowed_iterator_t<_Range>, _OutIter>
51 operator()(_Range&& __r, _OutIter __result) const {50 operator()(_Range&& __r, _OutIter __result) const {
52 auto __ret = std::__copy(ranges::begin(__r), ranges::end(__r), std::move(__result));51 return std::__copy(ranges::begin(__r), ranges::end(__r), std::move(__result));
53 return {std::move(__ret.first), std::move(__ret.second)};
54 }52 }
55};53};
5654
lib/libcxx/include/__algorithm/ranges_copy_backward.h+2-4
...@@ -40,16 +40,14 @@ struct __copy_backward {...@@ -40,16 +40,14 @@ struct __copy_backward {
40 requires indirectly_copyable<_InIter1, _InIter2>40 requires indirectly_copyable<_InIter1, _InIter2>
41 _LIBCPP_HIDE_FROM_ABI constexpr copy_backward_result<_InIter1, _InIter2>41 _LIBCPP_HIDE_FROM_ABI constexpr copy_backward_result<_InIter1, _InIter2>
42 operator()(_InIter1 __first, _Sent1 __last, _InIter2 __result) const {42 operator()(_InIter1 __first, _Sent1 __last, _InIter2 __result) const {
43 auto __ret = std::__copy_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));43 return std::__copy_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
44 return {std::move(__ret.first), std::move(__ret.second)};
45 }44 }
4645
47 template <bidirectional_range _Range, bidirectional_iterator _Iter>46 template <bidirectional_range _Range, bidirectional_iterator _Iter>
48 requires indirectly_copyable<iterator_t<_Range>, _Iter>47 requires indirectly_copyable<iterator_t<_Range>, _Iter>
49 _LIBCPP_HIDE_FROM_ABI constexpr copy_backward_result<borrowed_iterator_t<_Range>, _Iter>48 _LIBCPP_HIDE_FROM_ABI constexpr copy_backward_result<borrowed_iterator_t<_Range>, _Iter>
50 operator()(_Range&& __r, _Iter __result) const {49 operator()(_Range&& __r, _Iter __result) const {
51 auto __ret = std::__copy_backward<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), std::move(__result));50 return std::__copy_backward<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), std::move(__result));
52 return {std::move(__ret.first), std::move(__ret.second)};
53 }51 }
54};52};
5553
lib/libcxx/include/__algorithm/ranges_copy_if.h+2-4
...@@ -46,8 +46,7 @@ struct __copy_if {...@@ -46,8 +46,7 @@ struct __copy_if {
46 requires indirectly_copyable<_Iter, _OutIter>46 requires indirectly_copyable<_Iter, _OutIter>
47 _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<_Iter, _OutIter>47 _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<_Iter, _OutIter>
48 operator()(_Iter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {48 operator()(_Iter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
49 auto __res = std::__copy_if(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);49 return std::__copy_if(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
50 return {std::move(__res.first), std::move(__res.second)};
51 }50 }
5251
53 template <input_range _Range,52 template <input_range _Range,
...@@ -57,8 +56,7 @@ struct __copy_if {...@@ -57,8 +56,7 @@ struct __copy_if {
57 requires indirectly_copyable<iterator_t<_Range>, _OutIter>56 requires indirectly_copyable<iterator_t<_Range>, _OutIter>
58 _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<borrowed_iterator_t<_Range>, _OutIter>57 _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
59 operator()(_Range&& __r, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {58 operator()(_Range&& __r, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
60 auto __res = std::__copy_if(ranges::begin(__r), ranges::end(__r), std::move(__result), __pred, __proj);59 return std::__copy_if(ranges::begin(__r), ranges::end(__r), std::move(__result), __pred, __proj);
61 return {std::move(__res.first), std::move(__res.second)};
62 }60 }
63};61};
6462
lib/libcxx/include/__algorithm/ranges_copy_n.h+5-6
...@@ -24,10 +24,10 @@...@@ -24,10 +24,10 @@
24_LIBCPP_PUSH_MACROS24_LIBCPP_PUSH_MACROS
25#include <__undef_macros>25#include <__undef_macros>
2626
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 2027#if _LIBCPP_STD_VER >= 20
3028
29_LIBCPP_BEGIN_NAMESPACE_STD
30
31namespace ranges {31namespace ranges {
3232
33template <class _Ip, class _Op>33template <class _Ip, class _Op>
...@@ -38,8 +38,7 @@ struct __copy_n {...@@ -38,8 +38,7 @@ struct __copy_n {
38 requires indirectly_copyable<_Ip, _Op>38 requires indirectly_copyable<_Ip, _Op>
39 _LIBCPP_HIDE_FROM_ABI constexpr copy_n_result<_Ip, _Op>39 _LIBCPP_HIDE_FROM_ABI constexpr copy_n_result<_Ip, _Op>
40 operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const {40 operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const {
41 auto __res = std::__copy_n<_RangeAlgPolicy>(std::move(__first), __n, std::move(__result));41 return std::__copy_n<_RangeAlgPolicy>(std::move(__first), __n, std::move(__result));
42 return {std::move(__res.first), std::move(__res.second)};
43 }42 }
44};43};
4544
...@@ -48,10 +47,10 @@ inline constexpr auto copy_n = __copy_n{};...@@ -48,10 +47,10 @@ inline constexpr auto copy_n = __copy_n{};
48} // namespace __cpo47} // namespace __cpo
49} // namespace ranges48} // namespace ranges
5049
51#endif // _LIBCPP_STD_VER >= 20
52
53_LIBCPP_END_NAMESPACE_STD50_LIBCPP_END_NAMESPACE_STD
5451
52#endif // _LIBCPP_STD_VER >= 20
53
55_LIBCPP_POP_MACROS54_LIBCPP_POP_MACROS
5655
57#endif // _LIBCPP___ALGORITHM_RANGES_COPY_N_H56#endif // _LIBCPP___ALGORITHM_RANGES_COPY_N_H
lib/libcxx/include/__algorithm/ranges_equal.h+2-2
...@@ -50,7 +50,7 @@ struct __equal {...@@ -50,7 +50,7 @@ struct __equal {
50 _Pred __pred = {},50 _Pred __pred = {},
51 _Proj1 __proj1 = {},51 _Proj1 __proj1 = {},
52 _Proj2 __proj2 = {}) const {52 _Proj2 __proj2 = {}) const {
53 static constexpr bool __both_sized = sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>;53 constexpr bool __both_sized = sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>;
54 if constexpr (__both_sized) {54 if constexpr (__both_sized) {
55 if (__last1 - __first1 != __last2 - __first2)55 if (__last1 - __first1 != __last2 - __first2)
56 return false;56 return false;
...@@ -71,7 +71,7 @@ struct __equal {...@@ -71,7 +71,7 @@ struct __equal {
71 requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>71 requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
72 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(72 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
73 _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {73 _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
74 static constexpr bool __both_sized = sized_range<_Range1> && sized_range<_Range2>;74 constexpr bool __both_sized = sized_range<_Range1> && sized_range<_Range2>;
75 if constexpr (__both_sized) {75 if constexpr (__both_sized) {
76 if (ranges::size(__range1) != ranges::size(__range2))76 if (ranges::size(__range1) != ranges::size(__range2))
77 return false;77 return false;
lib/libcxx/include/__algorithm/ranges_find_if.h+3-12
...@@ -9,10 +9,10 @@...@@ -9,10 +9,10 @@
9#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_H9#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
10#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_H10#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
1111
12#include <__algorithm/find_if.h>
12#include <__config>13#include <__config>
13#include <__functional/identity.h>14#include <__functional/identity.h>
14#include <__functional/invoke.h>15#include <__functional/invoke.h>
15#include <__functional/ranges_operations.h>
16#include <__iterator/concepts.h>16#include <__iterator/concepts.h>
17#include <__iterator/projected.h>17#include <__iterator/projected.h>
18#include <__ranges/access.h>18#include <__ranges/access.h>
...@@ -33,15 +33,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -33,15 +33,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3333
34namespace ranges {34namespace ranges {
3535
36template <class _Ip, class _Sp, class _Pred, class _Proj>
37_LIBCPP_HIDE_FROM_ABI constexpr _Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
38 for (; __first != __last; ++__first) {
39 if (std::invoke(__pred, std::invoke(__proj, *__first)))
40 break;
41 }
42 return __first;
43}
44
45struct __find_if {36struct __find_if {
46 template <input_iterator _Ip,37 template <input_iterator _Ip,
47 sentinel_for<_Ip> _Sp,38 sentinel_for<_Ip> _Sp,
...@@ -49,13 +40,13 @@ struct __find_if {...@@ -49,13 +40,13 @@ struct __find_if {
49 indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>40 indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
50 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip41 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip
51 operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {42 operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
52 return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);43 return std::__find_if(std::move(__first), std::move(__last), __pred, __proj);
53 }44 }
5445
55 template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>46 template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
56 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
57 operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {48 operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
58 return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);49 return std::__find_if(ranges::begin(__r), ranges::end(__r), __pred, __proj);
59 }50 }
60};51};
6152
lib/libcxx/include/__algorithm/ranges_find_if_not.h+3-8
...@@ -9,17 +9,14 @@...@@ -9,17 +9,14 @@
9#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H9#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
10#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H10#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
1111
12#include <__algorithm/ranges_find_if.h>12#include <__algorithm/find_if_not.h>
13#include <__config>13#include <__config>
14#include <__functional/identity.h>14#include <__functional/identity.h>
15#include <__functional/invoke.h>
16#include <__functional/ranges_operations.h>
17#include <__iterator/concepts.h>15#include <__iterator/concepts.h>
18#include <__iterator/projected.h>16#include <__iterator/projected.h>
19#include <__ranges/access.h>17#include <__ranges/access.h>
20#include <__ranges/concepts.h>18#include <__ranges/concepts.h>
21#include <__ranges/dangling.h>19#include <__ranges/dangling.h>
22#include <__utility/forward.h>
23#include <__utility/move.h>20#include <__utility/move.h>
2421
25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -41,15 +38,13 @@ struct __find_if_not {...@@ -41,15 +38,13 @@ struct __find_if_not {
41 indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>38 indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
42 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip39 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Ip
43 operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {40 operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
44 auto __pred2 = [&](auto&& __e) -> bool { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };41 return std::__find_if_not(std::move(__first), std::move(__last), __pred, __proj);
45 return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred2, __proj);
46 }42 }
4743
48 template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>44 template <input_range _Rp, class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
49 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>45 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Rp>
50 operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {46 operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
51 auto __pred2 = [&](auto&& __e) -> bool { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };47 return std::__find_if_not(ranges::begin(__r), ranges::end(__r), __pred, __proj);
52 return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred2, __proj);
53 }48 }
54};49};
5550
lib/libcxx/include/__algorithm/ranges_fold.h+145-4
...@@ -10,17 +10,21 @@...@@ -10,17 +10,21 @@
10#ifndef _LIBCPP___ALGORITHM_RANGES_FOLD_H10#ifndef _LIBCPP___ALGORITHM_RANGES_FOLD_H
11#define _LIBCPP___ALGORITHM_RANGES_FOLD_H11#define _LIBCPP___ALGORITHM_RANGES_FOLD_H
1212
13#include <__algorithm/for_each.h>
13#include <__concepts/assignable.h>14#include <__concepts/assignable.h>
14#include <__concepts/constructible.h>15#include <__concepts/constructible.h>
15#include <__concepts/convertible_to.h>16#include <__concepts/convertible_to.h>
16#include <__concepts/invocable.h>17#include <__concepts/invocable.h>
17#include <__concepts/movable.h>18#include <__concepts/movable.h>
18#include <__config>19#include <__config>
20#include <__functional/identity.h>
19#include <__functional/invoke.h>21#include <__functional/invoke.h>
20#include <__functional/reference_wrapper.h>22#include <__functional/reference_wrapper.h>
21#include <__iterator/concepts.h>23#include <__iterator/concepts.h>
22#include <__iterator/iterator_traits.h>24#include <__iterator/iterator_traits.h>
23#include <__iterator/next.h>25#include <__iterator/next.h>
26#include <__iterator/prev.h>
27#include <__iterator/reverse_iterator.h>
24#include <__ranges/access.h>28#include <__ranges/access.h>
25#include <__ranges/concepts.h>29#include <__ranges/concepts.h>
26#include <__ranges/dangling.h>30#include <__ranges/dangling.h>
...@@ -28,6 +32,7 @@...@@ -28,6 +32,7 @@
28#include <__type_traits/invoke.h>32#include <__type_traits/invoke.h>
29#include <__utility/forward.h>33#include <__utility/forward.h>
30#include <__utility/move.h>34#include <__utility/move.h>
35#include <optional>
3136
32#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)37#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
33# pragma GCC system_header38# pragma GCC system_header
...@@ -62,6 +67,9 @@ struct in_value_result {...@@ -62,6 +67,9 @@ struct in_value_result {
62template <class _Ip, class _Tp>67template <class _Ip, class _Tp>
63using fold_left_with_iter_result = in_value_result<_Ip, _Tp>;68using fold_left_with_iter_result = in_value_result<_Ip, _Tp>;
6469
70template <class _Ip, class _Tp>
71using fold_left_first_with_iter_result = in_value_result<_Ip, _Tp>;
72
65template <class _Fp, class _Tp, class _Ip, class _Rp, class _Up = decay_t<_Rp>>73template <class _Fp, class _Tp, class _Ip, class _Rp, class _Up = decay_t<_Rp>>
66concept __indirectly_binary_left_foldable_impl =74concept __indirectly_binary_left_foldable_impl =
67 convertible_to<_Rp, _Up> && //75 convertible_to<_Rp, _Up> && //
...@@ -77,6 +85,22 @@ concept __indirectly_binary_left_foldable =...@@ -77,6 +85,22 @@ concept __indirectly_binary_left_foldable =
77 invocable<_Fp&, _Tp, iter_reference_t<_Ip>> && //85 invocable<_Fp&, _Tp, iter_reference_t<_Ip>> && //
78 __indirectly_binary_left_foldable_impl<_Fp, _Tp, _Ip, invoke_result_t<_Fp&, _Tp, iter_reference_t<_Ip>>>;86 __indirectly_binary_left_foldable_impl<_Fp, _Tp, _Ip, invoke_result_t<_Fp&, _Tp, iter_reference_t<_Ip>>>;
7987
88template <class _Func>
89struct __flipped {
90 _Func __func;
91
92 template <class _Tp, class _Up>
93 requires invocable<_Func&, _Up, _Tp>
94 invoke_result_t<_Func&, _Up, _Tp> operator()(_Tp&&, _Up&&);
95};
96
97template <class _Func, class _Tp, class _Iter>
98concept __indirectly_binary_right_foldable =
99 __indirectly_binary_left_foldable_impl<__flipped<_Func>,
100 _Tp,
101 _Iter,
102 invoke_result_t<_Func&, _Tp, iter_reference_t<_Iter>>>;
103
80struct __fold_left_with_iter {104struct __fold_left_with_iter {
81 template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, __indirectly_binary_left_foldable<_Tp, _Ip> _Fp>105 template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, __indirectly_binary_left_foldable<_Tp, _Ip> _Fp>
82 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) {106 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) {
...@@ -87,11 +111,17 @@ struct __fold_left_with_iter {...@@ -87,11 +111,17 @@ struct __fold_left_with_iter {
87 }111 }
88112
89 _Up __result = std::invoke(__f, std::move(__init), *__first);113 _Up __result = std::invoke(__f, std::move(__init), *__first);
90 for (++__first; __first != __last; ++__first) {114 ++__first;
91 __result = std::invoke(__f, std::move(__result), *__first);115 __identity __proj;
92 }116 auto __end = std::__for_each(
117 std::move(__first),
118 std::move(__last),
119 [&](auto&& __element) {
120 __result = std::invoke(__f, std::move(__result), std::forward<decltype(__element)>(__element));
121 },
122 __proj);
93123
94 return fold_left_with_iter_result<_Ip, _Up>{std::move(__first), std::move(__result)};124 return fold_left_with_iter_result<_Ip, _Up>{std::move(__end), std::move(__result)};
95 }125 }
96126
97 template <input_range _Rp, class _Tp, __indirectly_binary_left_foldable<_Tp, iterator_t<_Rp>> _Fp>127 template <input_range _Rp, class _Tp, __indirectly_binary_left_foldable<_Tp, iterator_t<_Rp>> _Fp>
...@@ -118,6 +148,117 @@ struct __fold_left {...@@ -118,6 +148,117 @@ struct __fold_left {
118};148};
119149
120inline constexpr auto fold_left = __fold_left();150inline constexpr auto fold_left = __fold_left();
151
152struct __fold_left_first_with_iter {
153 template <input_iterator _Iter,
154 sentinel_for<_Iter> _Sent,
155 __indirectly_binary_left_foldable<iter_value_t<_Iter>, _Iter> _Func>
156 requires constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>>
157 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Iter __first, _Sent __last, _Func __func) {
158 using _Up = decltype(fold_left(std::move(__first), __last, iter_value_t<_Iter>(*__first), __func));
159
160 if (__first == __last)
161 return fold_left_first_with_iter_result<_Iter, optional<_Up>>{std::move(__first), optional<_Up>()};
162
163 _Up __result(*__first);
164 ++__first;
165 __identity __proj;
166 auto __end = std::__for_each(
167 std::move(__first),
168 std::move(__last),
169 [&](auto&& __element) {
170 __result = std::invoke(__func, std::move(__result), std::forward<decltype(__element)>(__element));
171 },
172 __proj);
173
174 return fold_left_first_with_iter_result<_Iter, optional<_Up>>{std::move(__end), optional<_Up>(std::move(__result))};
175 }
176
177 template <input_range _Range, __indirectly_binary_left_foldable<range_value_t<_Range>, iterator_t<_Range>> _Func>
178 requires constructible_from<range_value_t<_Range>, range_reference_t<_Range>>
179 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range, _Func __func) {
180 auto __result = operator()(ranges::begin(__range), ranges::end(__range), std::ref(__func));
181
182 using _Up = decltype(fold_left(
183 ranges::begin(__range), ranges::end(__range), range_value_t<_Range>(*ranges::begin(__range)), __func));
184 return fold_left_first_with_iter_result<borrowed_iterator_t<_Range>, optional<_Up>>{
185 std::move(__result.in), std::move(__result.value)};
186 }
187};
188
189inline constexpr auto fold_left_first_with_iter = __fold_left_first_with_iter();
190
191struct __fold_left_first {
192 template <input_iterator _Iter,
193 sentinel_for<_Iter> _Sent,
194 __indirectly_binary_left_foldable<iter_value_t<_Iter>, _Iter> _Func>
195 requires constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>>
196 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Iter __first, _Sent __last, _Func __func) {
197 return fold_left_first_with_iter(std::move(__first), std::move(__last), std::ref(__func)).value;
198 }
199
200 template <input_range _Range, __indirectly_binary_left_foldable<range_value_t<_Range>, iterator_t<_Range>> _Func>
201 requires constructible_from<range_value_t<_Range>, range_reference_t<_Range>>
202 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range, _Func __func) {
203 return fold_left_first_with_iter(ranges::begin(__range), ranges::end(__range), std::ref(__func)).value;
204 }
205};
206
207inline constexpr auto fold_left_first = __fold_left_first();
208
209struct __fold_right {
210 template <bidirectional_iterator _Iter,
211 sentinel_for<_Iter> _Sp,
212 class _Tp,
213 __indirectly_binary_right_foldable<_Tp, _Iter> _Func>
214 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
215 operator()(_Iter __first, _Sp __last, _Tp __init, _Func __func) {
216 using _Up = decay_t<invoke_result_t<_Func&, iter_reference_t<_Iter>, _Tp>>;
217
218 if (__first == __last)
219 return _Up(std::move(__init));
220
221 _Iter __tail = ranges::next(__first, __last);
222 --__tail;
223 _Up __result = std::invoke(__func, *__tail, std::move(__init));
224 std::for_each(std::make_reverse_iterator(__tail), std::make_reverse_iterator(__first), [&](auto&& __element) {
225 __result = std::invoke(__func, std::forward<decltype(__element)>(__element), std::move(__result));
226 });
227
228 return __result;
229 }
230
231 template <bidirectional_range _Range, class _Tp, __indirectly_binary_right_foldable<_Tp, iterator_t<_Range>> _Func>
232 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range, _Tp __init, _Func __func) {
233 return operator()(ranges::begin(__range), ranges::end(__range), std::move(__init), std::ref(__func));
234 }
235};
236
237inline constexpr auto fold_right = __fold_right();
238
239struct __fold_right_last {
240 template <bidirectional_iterator _Iter,
241 sentinel_for<_Iter> _Sp,
242 __indirectly_binary_right_foldable<iter_value_t<_Iter>, _Iter> _Func>
243 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Iter __first, _Sp __last, _Func __func) {
244 using _Up = decltype(fold_right(__first, __last, iter_value_t<_Iter>(*__first), __func));
245
246 if (__first == __last)
247 return optional<_Up>();
248
249 _Iter __tail = ranges::prev(ranges::next(__first, __last));
250 return optional<_Up>(
251 in_place, ranges::fold_right(std::move(__first), __tail, iter_value_t<_Iter>(*__tail), std::move(__func)));
252 }
253
254 template <bidirectional_range _Range,
255 __indirectly_binary_right_foldable<range_value_t<_Range>, iterator_t<_Range>> _Func>
256 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range, _Func __func) {
257 return operator()(ranges::begin(__range), ranges::end(__range), std::ref(__func));
258 }
259};
260
261inline constexpr auto fold_right_last = __fold_right_last();
121} // namespace ranges262} // namespace ranges
122263
123#endif // _LIBCPP_STD_VER >= 23264#endif // _LIBCPP_STD_VER >= 23
lib/libcxx/include/__algorithm/ranges_move.h+2-9
...@@ -36,25 +36,18 @@ template <class _InIter, class _OutIter>...@@ -36,25 +36,18 @@ template <class _InIter, class _OutIter>
36using move_result = in_out_result<_InIter, _OutIter>;36using move_result = in_out_result<_InIter, _OutIter>;
3737
38struct __move {38struct __move {
39 template <class _InIter, class _Sent, class _OutIter>
40 _LIBCPP_HIDE_FROM_ABI constexpr static move_result<_InIter, _OutIter>
41 __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
42 auto __ret = std::__move<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
43 return {std::move(__ret.first), std::move(__ret.second)};
44 }
45
46 template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>39 template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
47 requires indirectly_movable<_InIter, _OutIter>40 requires indirectly_movable<_InIter, _OutIter>
48 _LIBCPP_HIDE_FROM_ABI constexpr move_result<_InIter, _OutIter>41 _LIBCPP_HIDE_FROM_ABI constexpr move_result<_InIter, _OutIter>
49 operator()(_InIter __first, _Sent __last, _OutIter __result) const {42 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
50 return __move_impl(std::move(__first), std::move(__last), std::move(__result));43 return std::__move<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
51 }44 }
5245
53 template <input_range _Range, weakly_incrementable _OutIter>46 template <input_range _Range, weakly_incrementable _OutIter>
54 requires indirectly_movable<iterator_t<_Range>, _OutIter>47 requires indirectly_movable<iterator_t<_Range>, _OutIter>
55 _LIBCPP_HIDE_FROM_ABI constexpr move_result<borrowed_iterator_t<_Range>, _OutIter>48 _LIBCPP_HIDE_FROM_ABI constexpr move_result<borrowed_iterator_t<_Range>, _OutIter>
56 operator()(_Range&& __range, _OutIter __result) const {49 operator()(_Range&& __range, _OutIter __result) const {
57 return __move_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));50 return std::__move<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), std::move(__result));
58 }51 }
59};52};
6053
lib/libcxx/include/__algorithm/ranges_move_backward.h+2-9
...@@ -38,25 +38,18 @@ template <class _InIter, class _OutIter>...@@ -38,25 +38,18 @@ template <class _InIter, class _OutIter>
38using move_backward_result = in_out_result<_InIter, _OutIter>;38using move_backward_result = in_out_result<_InIter, _OutIter>;
3939
40struct __move_backward {40struct __move_backward {
41 template <class _InIter, class _Sent, class _OutIter>
42 _LIBCPP_HIDE_FROM_ABI constexpr static move_backward_result<_InIter, _OutIter>
43 __move_backward_impl(_InIter __first, _Sent __last, _OutIter __result) {
44 auto __ret = std::__move_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
45 return {std::move(__ret.first), std::move(__ret.second)};
46 }
47
48 template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, bidirectional_iterator _OutIter>41 template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, bidirectional_iterator _OutIter>
49 requires indirectly_movable<_InIter, _OutIter>42 requires indirectly_movable<_InIter, _OutIter>
50 _LIBCPP_HIDE_FROM_ABI constexpr move_backward_result<_InIter, _OutIter>43 _LIBCPP_HIDE_FROM_ABI constexpr move_backward_result<_InIter, _OutIter>
51 operator()(_InIter __first, _Sent __last, _OutIter __result) const {44 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
52 return __move_backward_impl(std::move(__first), std::move(__last), std::move(__result));45 return std::__move_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
53 }46 }
5447
55 template <bidirectional_range _Range, bidirectional_iterator _Iter>48 template <bidirectional_range _Range, bidirectional_iterator _Iter>
56 requires indirectly_movable<iterator_t<_Range>, _Iter>49 requires indirectly_movable<iterator_t<_Range>, _Iter>
57 _LIBCPP_HIDE_FROM_ABI constexpr move_backward_result<borrowed_iterator_t<_Range>, _Iter>50 _LIBCPP_HIDE_FROM_ABI constexpr move_backward_result<borrowed_iterator_t<_Range>, _Iter>
58 operator()(_Range&& __range, _Iter __result) const {51 operator()(_Range&& __range, _Iter __result) const {
59 return __move_backward_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));52 return std::__move_backward<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), std::move(__result));
60 }53 }
61};54};
6255
lib/libcxx/include/__algorithm/ranges_partial_sort_copy.h+2-4
...@@ -60,7 +60,7 @@ struct __partial_sort_copy {...@@ -60,7 +60,7 @@ struct __partial_sort_copy {
60 _Comp __comp = {},60 _Comp __comp = {},
61 _Proj1 __proj1 = {},61 _Proj1 __proj1 = {},
62 _Proj2 __proj2 = {}) const {62 _Proj2 __proj2 = {}) const {
63 auto __result = std::__partial_sort_copy<_RangeAlgPolicy>(63 return std::__partial_sort_copy<_RangeAlgPolicy>(
64 std::move(__first),64 std::move(__first),
65 std::move(__last),65 std::move(__last),
66 std::move(__result_first),66 std::move(__result_first),
...@@ -68,7 +68,6 @@ struct __partial_sort_copy {...@@ -68,7 +68,6 @@ struct __partial_sort_copy {
68 __comp,68 __comp,
69 __proj1,69 __proj1,
70 __proj2);70 __proj2);
71 return {std::move(__result.first), std::move(__result.second)};
72 }71 }
7372
74 template <input_range _Range1,73 template <input_range _Range1,
...@@ -84,7 +83,7 @@ struct __partial_sort_copy {...@@ -84,7 +83,7 @@ struct __partial_sort_copy {
84 _LIBCPP_HIDE_FROM_ABI constexpr partial_sort_copy_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>>83 _LIBCPP_HIDE_FROM_ABI constexpr partial_sort_copy_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>>
85 operator()(84 operator()(
86 _Range1&& __range, _Range2&& __result_range, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {85 _Range1&& __range, _Range2&& __result_range, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
87 auto __result = std::__partial_sort_copy<_RangeAlgPolicy>(86 return std::__partial_sort_copy<_RangeAlgPolicy>(
88 ranges::begin(__range),87 ranges::begin(__range),
89 ranges::end(__range),88 ranges::end(__range),
90 ranges::begin(__result_range),89 ranges::begin(__result_range),
...@@ -92,7 +91,6 @@ struct __partial_sort_copy {...@@ -92,7 +91,6 @@ struct __partial_sort_copy {
92 __comp,91 __comp,
93 __proj1,92 __proj1,
94 __proj2);93 __proj2);
95 return {std::move(__result.first), std::move(__result.second)};
96 }94 }
97};95};
9896
lib/libcxx/include/__algorithm/ranges_remove_if.h+2-3
...@@ -10,10 +10,9 @@...@@ -10,10 +10,9 @@
10#define _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H10#define _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H
11#include <__config>11#include <__config>
1212
13#include <__algorithm/ranges_find_if.h>13#include <__algorithm/find_if.h>
14#include <__functional/identity.h>14#include <__functional/identity.h>
15#include <__functional/invoke.h>15#include <__functional/invoke.h>
16#include <__functional/ranges_operations.h>
17#include <__iterator/concepts.h>16#include <__iterator/concepts.h>
18#include <__iterator/iter_move.h>17#include <__iterator/iter_move.h>
19#include <__iterator/permutable.h>18#include <__iterator/permutable.h>
...@@ -39,7 +38,7 @@ namespace ranges {...@@ -39,7 +38,7 @@ namespace ranges {
39template <class _Iter, class _Sent, class _Proj, class _Pred>38template <class _Iter, class _Sent, class _Proj, class _Pred>
40_LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>39_LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
41__remove_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {40__remove_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
42 auto __new_end = ranges::__find_if_impl(__first, __last, __pred, __proj);41 auto __new_end = std::__find_if(__first, __last, __pred, __proj);
43 if (__new_end == __last)42 if (__new_end == __last)
44 return {__new_end, __new_end};43 return {__new_end, __new_end};
4544
lib/libcxx/include/__algorithm/ranges_reverse_copy.h+2-1
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#include <__ranges/access.h>18#include <__ranges/access.h>
19#include <__ranges/concepts.h>19#include <__ranges/concepts.h>
20#include <__ranges/dangling.h>20#include <__ranges/dangling.h>
21#include <__ranges/reverse_view.h>
21#include <__ranges/subrange.h>22#include <__ranges/subrange.h>
22#include <__utility/move.h>23#include <__utility/move.h>
2324
...@@ -49,7 +50,7 @@ struct __reverse_copy {...@@ -49,7 +50,7 @@ struct __reverse_copy {
49 requires indirectly_copyable<iterator_t<_Range>, _OutIter>50 requires indirectly_copyable<iterator_t<_Range>, _OutIter>
50 _LIBCPP_HIDE_FROM_ABI constexpr reverse_copy_result<borrowed_iterator_t<_Range>, _OutIter>51 _LIBCPP_HIDE_FROM_ABI constexpr reverse_copy_result<borrowed_iterator_t<_Range>, _OutIter>
51 operator()(_Range&& __range, _OutIter __result) const {52 operator()(_Range&& __range, _OutIter __result) const {
52 auto __ret = ranges::copy(std::__reverse_range(__range), std::move(__result));53 auto __ret = ranges::copy(__range | views::reverse, std::move(__result));
53 return {ranges::next(ranges::begin(__range), ranges::end(__range)), std::move(__ret.out)};54 return {ranges::next(ranges::begin(__range), ranges::end(__range)), std::move(__ret.out)};
54 }55 }
55};56};
lib/libcxx/include/__algorithm/ranges_set_difference.h+2-7
...@@ -14,16 +14,13 @@...@@ -14,16 +14,13 @@
14#include <__algorithm/set_difference.h>14#include <__algorithm/set_difference.h>
15#include <__config>15#include <__config>
16#include <__functional/identity.h>16#include <__functional/identity.h>
17#include <__functional/invoke.h>
18#include <__functional/ranges_operations.h>17#include <__functional/ranges_operations.h>
19#include <__iterator/concepts.h>18#include <__iterator/concepts.h>
20#include <__iterator/mergeable.h>19#include <__iterator/mergeable.h>
21#include <__ranges/access.h>20#include <__ranges/access.h>
22#include <__ranges/concepts.h>21#include <__ranges/concepts.h>
23#include <__ranges/dangling.h>22#include <__ranges/dangling.h>
24#include <__type_traits/decay.h>
25#include <__utility/move.h>23#include <__utility/move.h>
26#include <__utility/pair.h>
2724
28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29# pragma GCC system_header26# pragma GCC system_header
...@@ -60,9 +57,8 @@ struct __set_difference {...@@ -60,9 +57,8 @@ struct __set_difference {
60 _Comp __comp = {},57 _Comp __comp = {},
61 _Proj1 __proj1 = {},58 _Proj1 __proj1 = {},
62 _Proj2 __proj2 = {}) const {59 _Proj2 __proj2 = {}) const {
63 auto __ret = std::__set_difference(60 return std::__set_difference(
64 __first1, __last1, __first2, __last2, __result, ranges::__make_projected_comp(__comp, __proj1, __proj2));61 __first1, __last1, __first2, __last2, __result, ranges::__make_projected_comp(__comp, __proj1, __proj2));
65 return {std::move(__ret.first), std::move(__ret.second)};
66 }62 }
6763
68 template <input_range _Range1,64 template <input_range _Range1,
...@@ -79,14 +75,13 @@ struct __set_difference {...@@ -79,14 +75,13 @@ struct __set_difference {
79 _Comp __comp = {},75 _Comp __comp = {},
80 _Proj1 __proj1 = {},76 _Proj1 __proj1 = {},
81 _Proj2 __proj2 = {}) const {77 _Proj2 __proj2 = {}) const {
82 auto __ret = std::__set_difference(78 return std::__set_difference(
83 ranges::begin(__range1),79 ranges::begin(__range1),
84 ranges::end(__range1),80 ranges::end(__range1),
85 ranges::begin(__range2),81 ranges::begin(__range2),
86 ranges::end(__range2),82 ranges::end(__range2),
87 __result,83 __result,
88 ranges::__make_projected_comp(__comp, __proj1, __proj2));84 ranges::__make_projected_comp(__comp, __proj1, __proj2));
89 return {std::move(__ret.first), std::move(__ret.second)};
90 }85 }
91};86};
9287
lib/libcxx/include/__algorithm/ranges_shift_left.h created+73
...@@ -0,0 +1,73 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___ALGORITHM_RANGES_SHIFT_LEFT_H
10#define _LIBCPP___ALGORITHM_RANGES_SHIFT_LEFT_H
11
12#include <__algorithm/iterator_operations.h>
13#include <__algorithm/shift_left.h>
14#include <__config>
15#include <__iterator/concepts.h>
16#include <__iterator/distance.h>
17#include <__iterator/incrementable_traits.h>
18#include <__iterator/permutable.h>
19#include <__ranges/access.h>
20#include <__ranges/concepts.h>
21#include <__ranges/subrange.h>
22#include <__utility/move.h>
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28_LIBCPP_PUSH_MACROS
29#include <__undef_macros>
30
31_LIBCPP_BEGIN_NAMESPACE_STD
32
33#if _LIBCPP_STD_VER >= 23
34
35namespace ranges {
36namespace __shift_left {
37
38struct __fn {
39 template <permutable _Iter, sentinel_for<_Iter> _Sent>
40 _LIBCPP_HIDE_FROM_ABI static constexpr subrange<_Iter>
41 operator()(_Iter __first, _Sent __last, iter_difference_t<_Iter> __n) {
42 auto __ret = std::__shift_left<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__n));
43 return {std::move(__ret.first), std::move(__ret.second)};
44 }
45
46 template <forward_range _Range>
47 requires permutable<iterator_t<_Range>>
48 _LIBCPP_HIDE_FROM_ABI static constexpr borrowed_subrange_t<_Range>
49 operator()(_Range&& __range, range_difference_t<_Range> __n) {
50 if constexpr (sized_range<_Range>) {
51 if (__n >= ranges::distance(__range)) {
52 return {ranges::begin(__range), ranges::begin(__range)};
53 }
54 }
55
56 auto __ret = std::__shift_left<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), std::move(__n));
57 return {std::move(__ret.first), std::move(__ret.second)};
58 }
59};
60} // namespace __shift_left
61
62inline namespace __cpo {
63inline constexpr auto shift_left = __shift_left::__fn{};
64} // namespace __cpo
65} // namespace ranges
66
67#endif // _LIBCPP_STD_VER >= 23
68
69_LIBCPP_END_NAMESPACE_STD
70
71_LIBCPP_POP_MACROS
72
73#endif // _LIBCPP___ALGORITHM_RANGES_SHIFT_LEFT_H
lib/libcxx/include/__algorithm/ranges_shift_right.h created+76
...@@ -0,0 +1,76 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___ALGORITHM_RANGES_SHIFT_RIGHT_H
10#define _LIBCPP___ALGORITHM_RANGES_SHIFT_RIGHT_H
11
12#include <__algorithm/iterator_operations.h>
13#include <__algorithm/shift_right.h>
14#include <__config>
15#include <__iterator/concepts.h>
16#include <__iterator/distance.h>
17#include <__iterator/incrementable_traits.h>
18#include <__iterator/permutable.h>
19#include <__ranges/access.h>
20#include <__ranges/concepts.h>
21#include <__ranges/subrange.h>
22#include <__utility/move.h>
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28_LIBCPP_PUSH_MACROS
29#include <__undef_macros>
30
31_LIBCPP_BEGIN_NAMESPACE_STD
32
33#if _LIBCPP_STD_VER >= 23
34
35namespace ranges {
36namespace __shift_right {
37
38struct __fn {
39 template <permutable _Iter, sentinel_for<_Iter> _Sent>
40 _LIBCPP_HIDE_FROM_ABI static constexpr subrange<_Iter>
41 operator()(_Iter __first, _Sent __last, iter_difference_t<_Iter> __n) {
42 auto __ret = std::__shift_right<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__n));
43 return {std::move(__ret.first), std::move(__ret.second)};
44 }
45
46 template <forward_range _Range>
47 requires permutable<iterator_t<_Range>>
48 _LIBCPP_HIDE_FROM_ABI static constexpr borrowed_subrange_t<_Range>
49 operator()(_Range&& __range, range_difference_t<_Range> __n) {
50 if constexpr (sized_range<_Range>) {
51 if (__n >= ranges::distance(__range)) {
52 auto __iter = ranges::begin(__range);
53 auto __end = ranges::end(__range);
54 ranges::advance(__iter, __end);
55 return {__iter, std::move(__iter)};
56 }
57 }
58
59 auto __ret = std::__shift_right<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), std::move(__n));
60 return {std::move(__ret.first), std::move(__ret.second)};
61 }
62};
63} // namespace __shift_right
64
65inline namespace __cpo {
66inline constexpr auto shift_right = __shift_right::__fn{};
67} // namespace __cpo
68} // namespace ranges
69
70#endif // _LIBCPP_STD_VER >= 23
71
72_LIBCPP_END_NAMESPACE_STD
73
74_LIBCPP_POP_MACROS
75
76#endif // _LIBCPP___ALGORITHM_RANGES_SHIFT_RIGHT_H
lib/libcxx/include/__algorithm/ranges_swap_ranges.h+30-3
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
1111
12#include <__algorithm/in_in_result.h>12#include <__algorithm/in_in_result.h>
13#include <__algorithm/iterator_operations.h>13#include <__algorithm/iterator_operations.h>
14#include <__algorithm/min.h>
14#include <__algorithm/swap_ranges.h>15#include <__algorithm/swap_ranges.h>
15#include <__config>16#include <__config>
16#include <__iterator/concepts.h>17#include <__iterator/concepts.h>
...@@ -18,7 +19,9 @@...@@ -18,7 +19,9 @@
18#include <__ranges/access.h>19#include <__ranges/access.h>
19#include <__ranges/concepts.h>20#include <__ranges/concepts.h>
20#include <__ranges/dangling.h>21#include <__ranges/dangling.h>
22#include <__type_traits/is_same.h>
21#include <__utility/move.h>23#include <__utility/move.h>
24#include <__utility/pair.h>
2225
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24# pragma GCC system_header27# pragma GCC system_header
...@@ -41,9 +44,33 @@ struct __swap_ranges {...@@ -41,9 +44,33 @@ struct __swap_ranges {
41 requires indirectly_swappable<_I1, _I2>44 requires indirectly_swappable<_I1, _I2>
42 _LIBCPP_HIDE_FROM_ABI constexpr swap_ranges_result<_I1, _I2>45 _LIBCPP_HIDE_FROM_ABI constexpr swap_ranges_result<_I1, _I2>
43 operator()(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2) const {46 operator()(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2) const {
44 auto __ret = std::__swap_ranges<_RangeAlgPolicy>(47 if constexpr (sized_sentinel_for<_I1, _S1> && sized_sentinel_for<_I2, _S2> &&
45 std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2));48 (random_access_iterator<_I1> || random_access_iterator<_I2> ||
46 return {std::move(__ret.first), std::move(__ret.second)};49 (is_same_v<_I1, _S1> && is_same_v<_I2, _S2>))) {
50 auto __offset = std::min(__last1 - __first1, __last2 - __first2);
51
52 auto __ret = [&] {
53 if constexpr (random_access_iterator<_I1>)
54 return std::__swap_ranges<_RangeAlgPolicy>(__first1, __first1 + __offset, std::move(__first2));
55 else if constexpr (random_access_iterator<_I2>)
56 return std::__swap_ranges<_RangeAlgPolicy>(__first2, __first2 + __offset, std::move(__first1));
57 else if (__last2 - __first2 < __last1 - __first1) {
58 auto __reversed =
59 std::__swap_ranges<_RangeAlgPolicy>(std::move(__first2), std::move(__last2), std::move(__first1));
60 return std::pair<_I1, _I2>(std::move(__reversed.second), std::move(__reversed.first));
61 } else
62 return std::__swap_ranges<_RangeAlgPolicy>(std::move(__first1), std::move(__last1), std::move(__first2));
63 }();
64 return {std::move(__ret.first), std::move(__ret.second)};
65 } else {
66 while (__first1 != __last1 && __first2 != __last2) {
67 ranges::iter_swap(__first1, __first2);
68 ++__first1;
69 ++__first2;
70 }
71
72 return {std::move(__first1), std::move(__first2)};
73 }
47 }74 }
4875
49 template <input_range _R1, input_range _R2>76 template <input_range _R1, input_range _R2>
lib/libcxx/include/__algorithm/ranges_unique_copy.h+2-5
...@@ -26,7 +26,6 @@...@@ -26,7 +26,6 @@
26#include <__ranges/dangling.h>26#include <__ranges/dangling.h>
27#include <__utility/forward.h>27#include <__utility/forward.h>
28#include <__utility/move.h>28#include <__utility/move.h>
29#include <__utility/pair.h>
3029
31#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)30#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
32# pragma GCC system_header31# pragma GCC system_header
...@@ -73,13 +72,12 @@ struct __unique_copy {...@@ -73,13 +72,12 @@ struct __unique_copy {
73 indirectly_copyable_storable<_InIter, _OutIter>)72 indirectly_copyable_storable<_InIter, _OutIter>)
74 _LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<_InIter, _OutIter>73 _LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<_InIter, _OutIter>
75 operator()(_InIter __first, _Sent __last, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {74 operator()(_InIter __first, _Sent __last, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
76 auto __ret = std::__unique_copy<_RangeAlgPolicy>(75 return std::__unique_copy<_RangeAlgPolicy>(
77 std::move(__first),76 std::move(__first),
78 std::move(__last),77 std::move(__last),
79 std::move(__result),78 std::move(__result),
80 std::__make_projected(__comp, __proj),79 std::__make_projected(__comp, __proj),
81 __algo_tag_t<_InIter, _OutIter>());80 __algo_tag_t<_InIter, _OutIter>());
82 return {std::move(__ret.first), std::move(__ret.second)};
83 }81 }
8482
85 template <input_range _Range,83 template <input_range _Range,
...@@ -92,13 +90,12 @@ struct __unique_copy {...@@ -92,13 +90,12 @@ struct __unique_copy {
92 indirectly_copyable_storable<iterator_t<_Range>, _OutIter>)90 indirectly_copyable_storable<iterator_t<_Range>, _OutIter>)
93 _LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<borrowed_iterator_t<_Range>, _OutIter>91 _LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<borrowed_iterator_t<_Range>, _OutIter>
94 operator()(_Range&& __range, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {92 operator()(_Range&& __range, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
95 auto __ret = std::__unique_copy<_RangeAlgPolicy>(93 return std::__unique_copy<_RangeAlgPolicy>(
96 ranges::begin(__range),94 ranges::begin(__range),
97 ranges::end(__range),95 ranges::end(__range),
98 std::move(__result),96 std::move(__result),
99 std::__make_projected(__comp, __proj),97 std::__make_projected(__comp, __proj),
100 __algo_tag_t<iterator_t<_Range>, _OutIter>());98 __algo_tag_t<iterator_t<_Range>, _OutIter>());
101 return {std::move(__ret.first), std::move(__ret.second)};
102 }99 }
103};100};
104101
lib/libcxx/include/__algorithm/rotate.h+2-2
...@@ -39,7 +39,7 @@ __rotate_left(_ForwardIterator __first, _ForwardIterator __last) {...@@ -39,7 +39,7 @@ __rotate_left(_ForwardIterator __first, _ForwardIterator __last) {
39 using _Ops = _IterOps<_AlgPolicy>;39 using _Ops = _IterOps<_AlgPolicy>;
4040
41 value_type __tmp = _Ops::__iter_move(__first);41 value_type __tmp = _Ops::__iter_move(__first);
42 _ForwardIterator __lm1 = std::__move<_AlgPolicy>(_Ops::next(__first), __last, __first).second;42 _ForwardIterator __lm1 = std::__move<_AlgPolicy>(_Ops::next(__first), __last, __first).__out_;
43 *__lm1 = std::move(__tmp);43 *__lm1 = std::move(__tmp);
44 return __lm1;44 return __lm1;
45}45}
...@@ -52,7 +52,7 @@ __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last) {...@@ -52,7 +52,7 @@ __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last) {
5252
53 _BidirectionalIterator __lm1 = _Ops::prev(__last);53 _BidirectionalIterator __lm1 = _Ops::prev(__last);
54 value_type __tmp = _Ops::__iter_move(__lm1);54 value_type __tmp = _Ops::__iter_move(__lm1);
55 _BidirectionalIterator __fp1 = std::__move_backward<_AlgPolicy>(__first, __lm1, std::move(__last)).second;55 _BidirectionalIterator __fp1 = std::__move_backward<_AlgPolicy>(__first, __lm1, std::move(__last)).__out_;
56 *__first = std::move(__tmp);56 *__first = std::move(__tmp);
57 return __fp1;57 return __fp1;
58}58}
lib/libcxx/include/__algorithm/set_difference.h+5-6
...@@ -12,12 +12,10 @@...@@ -12,12 +12,10 @@
12#include <__algorithm/comp.h>12#include <__algorithm/comp.h>
13#include <__algorithm/comp_ref_type.h>13#include <__algorithm/comp_ref_type.h>
14#include <__algorithm/copy.h>14#include <__algorithm/copy.h>
15#include <__algorithm/in_out_result.h>
15#include <__config>16#include <__config>
16#include <__functional/identity.h>
17#include <__iterator/iterator_traits.h>
18#include <__type_traits/remove_cvref.h>17#include <__type_traits/remove_cvref.h>
19#include <__utility/move.h>18#include <__utility/move.h>
20#include <__utility/pair.h>
2119
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
23# pragma GCC system_header21# pragma GCC system_header
...@@ -29,7 +27,8 @@ _LIBCPP_PUSH_MACROS...@@ -29,7 +27,8 @@ _LIBCPP_PUSH_MACROS
29_LIBCPP_BEGIN_NAMESPACE_STD27_LIBCPP_BEGIN_NAMESPACE_STD
3028
31template <class _Comp, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>29template <class _Comp, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
32_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__remove_cvref_t<_InIter1>, __remove_cvref_t<_OutIter> >30_LIBCPP_HIDE_FROM_ABI
31_LIBCPP_CONSTEXPR_SINCE_CXX20 __in_out_result<__remove_cvref_t<_InIter1>, __remove_cvref_t<_OutIter> >
33__set_difference(32__set_difference(
34 _InIter1&& __first1, _Sent1&& __last1, _InIter2&& __first2, _Sent2&& __last2, _OutIter&& __result, _Comp&& __comp) {33 _InIter1&& __first1, _Sent1&& __last1, _InIter2&& __first2, _Sent2&& __last2, _OutIter&& __result, _Comp&& __comp) {
35 while (__first1 != __last1 && __first2 != __last2) {34 while (__first1 != __last1 && __first2 != __last2) {
...@@ -56,7 +55,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_d...@@ -56,7 +55,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_d
56 _OutputIterator __result,55 _OutputIterator __result,
57 _Compare __comp) {56 _Compare __comp) {
58 return std::__set_difference<__comp_ref_type<_Compare> >(__first1, __last1, __first2, __last2, __result, __comp)57 return std::__set_difference<__comp_ref_type<_Compare> >(__first1, __last1, __first2, __last2, __result, __comp)
59 .second;58 .__out_;
60}59}
6160
62template <class _InputIterator1, class _InputIterator2, class _OutputIterator>61template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
...@@ -66,7 +65,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_d...@@ -66,7 +65,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator set_d
66 _InputIterator2 __first2,65 _InputIterator2 __first2,
67 _InputIterator2 __last2,66 _InputIterator2 __last2,
68 _OutputIterator __result) {67 _OutputIterator __result) {
69 return std::__set_difference(__first1, __last1, __first2, __last2, __result, __less<>()).second;68 return std::__set_difference(__first1, __last1, __first2, __last2, __result, __less<>()).__out_;
70}69}
7170
72_LIBCPP_END_NAMESPACE_STD71_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/set_intersection.h+2-5
...@@ -96,12 +96,10 @@ __set_intersection(...@@ -96,12 +96,10 @@ __set_intersection(
96 _Compare&& __comp,96 _Compare&& __comp,
97 std::forward_iterator_tag,97 std::forward_iterator_tag,
98 std::forward_iterator_tag) {98 std::forward_iterator_tag) {
99 _LIBCPP_CONSTEXPR std::__identity __proj;
100 bool __prev_may_be_equal = false;99 bool __prev_may_be_equal = false;
101100
102 while (__first2 != __last2) {101 while (__first2 != __last2) {
103 _InForwardIter1 __first1_next =102 _InForwardIter1 __first1_next = std::__lower_bound_onesided<_AlgPolicy>(__first1, __last1, *__first2, __comp);
104 std::__lower_bound_onesided<_AlgPolicy>(__first1, __last1, *__first2, __comp, __proj);
105 std::swap(__first1_next, __first1);103 std::swap(__first1_next, __first1);
106 // keeping in mind that a==b iff !(a<b) && !(b<a):104 // keeping in mind that a==b iff !(a<b) && !(b<a):
107 // if we can't advance __first1, that means !(*__first1 < *_first2), therefore __may_be_equal==true105 // if we can't advance __first1, that means !(*__first1 < *_first2), therefore __may_be_equal==true
...@@ -110,8 +108,7 @@ __set_intersection(...@@ -110,8 +108,7 @@ __set_intersection(
110 if (__first1 == __last1)108 if (__first1 == __last1)
111 break;109 break;
112110
113 _InForwardIter2 __first2_next =111 _InForwardIter2 __first2_next = std::__lower_bound_onesided<_AlgPolicy>(__first2, __last2, *__first1, __comp);
114 std::__lower_bound_onesided<_AlgPolicy>(__first2, __last2, *__first1, __comp, __proj);
115 std::swap(__first2_next, __first2);112 std::swap(__first2_next, __first2);
116 std::__set_intersection_add_output_if_equal(113 std::__set_intersection_add_output_if_equal(
117 __first2 == __first2_next, __first1, __first2, __result, __prev_may_be_equal);114 __first2 == __first2_next, __first1, __first2, __result, __prev_may_be_equal);
lib/libcxx/include/__algorithm/set_symmetric_difference.h+2-2
...@@ -46,7 +46,7 @@ __set_symmetric_difference(...@@ -46,7 +46,7 @@ __set_symmetric_difference(
46 if (__first2 == __last2) {46 if (__first2 == __last2) {
47 auto __ret1 = std::__copy(std::move(__first1), std::move(__last1), std::move(__result));47 auto __ret1 = std::__copy(std::move(__first1), std::move(__last1), std::move(__result));
48 return __set_symmetric_difference_result<_InIter1, _InIter2, _OutIter>(48 return __set_symmetric_difference_result<_InIter1, _InIter2, _OutIter>(
49 std::move(__ret1.first), std::move(__first2), std::move((__ret1.second)));49 std::move(__ret1.__in_), std::move(__first2), std::move((__ret1.__out_)));
50 }50 }
51 if (__comp(*__first1, *__first2)) {51 if (__comp(*__first1, *__first2)) {
52 *__result = *__first1;52 *__result = *__first1;
...@@ -64,7 +64,7 @@ __set_symmetric_difference(...@@ -64,7 +64,7 @@ __set_symmetric_difference(
64 }64 }
65 auto __ret2 = std::__copy(std::move(__first2), std::move(__last2), std::move(__result));65 auto __ret2 = std::__copy(std::move(__first2), std::move(__last2), std::move(__result));
66 return __set_symmetric_difference_result<_InIter1, _InIter2, _OutIter>(66 return __set_symmetric_difference_result<_InIter1, _InIter2, _OutIter>(
67 std::move(__first1), std::move(__ret2.first), std::move((__ret2.second)));67 std::move(__first1), std::move(__ret2.__in_), std::move((__ret2.__out_)));
68}68}
6969
70template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>70template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
lib/libcxx/include/__algorithm/set_union.h+2-2
...@@ -45,7 +45,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __set_union_result<_InIter1,...@@ -45,7 +45,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __set_union_result<_InIter1,
45 if (__first2 == __last2) {45 if (__first2 == __last2) {
46 auto __ret1 = std::__copy(std::move(__first1), std::move(__last1), std::move(__result));46 auto __ret1 = std::__copy(std::move(__first1), std::move(__last1), std::move(__result));
47 return __set_union_result<_InIter1, _InIter2, _OutIter>(47 return __set_union_result<_InIter1, _InIter2, _OutIter>(
48 std::move(__ret1.first), std::move(__first2), std::move((__ret1.second)));48 std::move(__ret1.__in_), std::move(__first2), std::move((__ret1.__out_)));
49 }49 }
50 if (__comp(*__first2, *__first1)) {50 if (__comp(*__first2, *__first1)) {
51 *__result = *__first2;51 *__result = *__first2;
...@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __set_union_result<_InIter1,...@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __set_union_result<_InIter1,
60 }60 }
61 auto __ret2 = std::__copy(std::move(__first2), std::move(__last2), std::move(__result));61 auto __ret2 = std::__copy(std::move(__first2), std::move(__last2), std::move(__result));
62 return __set_union_result<_InIter1, _InIter2, _OutIter>(62 return __set_union_result<_InIter1, _InIter2, _OutIter>(
63 std::move(__first1), std::move(__ret2.first), std::move((__ret2.second)));63 std::move(__first1), std::move(__ret2.__in_), std::move((__ret2.__out_)));
64}64}
6565
66template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>66template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
lib/libcxx/include/__algorithm/shift_left.h+30-13
...@@ -9,9 +9,14 @@...@@ -9,9 +9,14 @@
9#ifndef _LIBCPP___ALGORITHM_SHIFT_LEFT_H9#ifndef _LIBCPP___ALGORITHM_SHIFT_LEFT_H
10#define _LIBCPP___ALGORITHM_SHIFT_LEFT_H10#define _LIBCPP___ALGORITHM_SHIFT_LEFT_H
1111
12#include <__algorithm/iterator_operations.h>
12#include <__algorithm/move.h>13#include <__algorithm/move.h>
14#include <__assert>
13#include <__config>15#include <__config>
16#include <__iterator/concepts.h>
14#include <__iterator/iterator_traits.h>17#include <__iterator/iterator_traits.h>
18#include <__utility/move.h>
19#include <__utility/pair.h>
1520
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header22# pragma GCC system_header
...@@ -24,30 +29,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -24,30 +29,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2429
25#if _LIBCPP_STD_VER >= 2030#if _LIBCPP_STD_VER >= 20
2631
27template <class _ForwardIterator>32template <class _AlgPolicy, class _Iter, class _Sent>
28inline _LIBCPP_HIDE_FROM_ABI constexpr _ForwardIterator33_LIBCPP_HIDE_FROM_ABI constexpr pair<_Iter, _Iter>
29shift_left(_ForwardIterator __first,34__shift_left(_Iter __first, _Sent __last, typename _IterOps<_AlgPolicy>::template __difference_type<_Iter> __n) {
30 _ForwardIterator __last,35 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n >= 0, "n must be greater than or equal to 0");
31 typename iterator_traits<_ForwardIterator>::difference_type __n) {36
32 if (__n == 0) {37 if (__n == 0) {
33 return __last;38 _Iter __end = _IterOps<_AlgPolicy>::next(__first, __last);
39 return {std::move(__first), std::move(__end)};
34 }40 }
3541
36 _ForwardIterator __m = __first;42 _Iter __m = __first;
37 if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value) {43 if constexpr (sized_sentinel_for<_Sent, _Iter>) {
38 if (__n >= __last - __first) {44 auto __size = _IterOps<_AlgPolicy>::distance(__first, __last);
39 return __first;45 if (__n >= __size) {
46 return {__first, std::move(__first)};
40 }47 }
41 __m += __n;48 _IterOps<_AlgPolicy>::advance(__m, __n);
42 } else {49 } else {
43 for (; __n > 0; --__n) {50 for (; __n > 0; --__n) {
44 if (__m == __last) {51 if (__m == __last) {
45 return __first;52 return {__first, std::move(__first)};
46 }53 }
47 ++__m;54 ++__m;
48 }55 }
49 }56 }
50 return std::move(__m, __last, __first);57
58 _Iter __result = std::__move<_AlgPolicy>(__m, __last, __first).__out_;
59 return {std::move(__first), std::move(__result)};
60}
61
62template <class _ForwardIterator>
63_LIBCPP_HIDE_FROM_ABI constexpr _ForwardIterator
64shift_left(_ForwardIterator __first,
65 _ForwardIterator __last,
66 typename iterator_traits<_ForwardIterator>::difference_type __n) {
67 return std::__shift_left<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __n).second;
51}68}
5269
53#endif // _LIBCPP_STD_VER >= 2070#endif // _LIBCPP_STD_VER >= 20
lib/libcxx/include/__algorithm/shift_right.h+53-27
...@@ -9,11 +9,17 @@...@@ -9,11 +9,17 @@
9#ifndef _LIBCPP___ALGORITHM_SHIFT_RIGHT_H9#ifndef _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
10#define _LIBCPP___ALGORITHM_SHIFT_RIGHT_H10#define _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
1111
12#include <__algorithm/iterator_operations.h>
12#include <__algorithm/move.h>13#include <__algorithm/move.h>
13#include <__algorithm/move_backward.h>14#include <__algorithm/move_backward.h>
14#include <__algorithm/swap_ranges.h>15#include <__algorithm/swap_ranges.h>
16#include <__assert>
17#include <__concepts/derived_from.h>
15#include <__config>18#include <__config>
19#include <__iterator/concepts.h>
16#include <__iterator/iterator_traits.h>20#include <__iterator/iterator_traits.h>
21#include <__utility/move.h>
22#include <__utility/pair.h>
17#include <__utility/swap.h>23#include <__utility/swap.h>
1824
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -27,36 +33,48 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -27,36 +33,48 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2733
28#if _LIBCPP_STD_VER >= 2034#if _LIBCPP_STD_VER >= 20
2935
30template <class _ForwardIterator>36template <class _AlgPolicy, class _Iter, class _Sent>
31inline _LIBCPP_HIDE_FROM_ABI constexpr _ForwardIterator37_LIBCPP_HIDE_FROM_ABI constexpr pair<_Iter, _Iter>
32shift_right(_ForwardIterator __first,38__shift_right(_Iter __first, _Sent __last, typename _IterOps<_AlgPolicy>::template __difference_type<_Iter> __n) {
33 _ForwardIterator __last,39 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n >= 0, "Providing a negative shift amount to shift_right is UB");
34 typename iterator_traits<_ForwardIterator>::difference_type __n) {
35 if (__n == 0) {40 if (__n == 0) {
36 return __first;41 _Iter __end = _IterOps<_AlgPolicy>::next(__first, __last);
42 return pair<_Iter, _Iter>(std::move(__first), std::move(__end));
37 }43 }
3844
39 if constexpr (__has_random_access_iterator_category<_ForwardIterator>::value) {45 using _IterCategory = typename _IterOps<_AlgPolicy>::template __iterator_category<_Iter>;
40 decltype(__n) __d = __last - __first;46
41 if (__n >= __d) {47 if constexpr (derived_from<_IterCategory, random_access_iterator_tag>) {
42 return __last;48 _Iter __end = _IterOps<_AlgPolicy>::next(__first, __last);
49 auto __size = __end - __first;
50 if (__n >= __size) {
51 return pair<_Iter, _Iter>(__end, std::move(__end));
52 }
53 _Iter __m = __first;
54 _IterOps<_AlgPolicy>::advance(__m, (__size - __n));
55 auto __ret = std::__move_backward<_AlgPolicy>(std::move(__first), std::move(__m), __end);
56 return pair<_Iter, _Iter>(std::move(__ret.__out_), std::move(__end));
57 } else if constexpr (derived_from<_IterCategory, bidirectional_iterator_tag>) {
58 _Iter __end = _IterOps<_AlgPolicy>::next(__first, __last);
59 if constexpr (sized_sentinel_for<_Sent, _Iter>) {
60 if (__n >= ranges::distance(__first, __last)) {
61 return pair<_Iter, _Iter>(__end, std::move(__end));
62 }
43 }63 }
44 _ForwardIterator __m = __first + (__d - __n);64 _Iter __m = __end;
45 return std::move_backward(__first, __m, __last);
46 } else if constexpr (__has_bidirectional_iterator_category<_ForwardIterator>::value) {
47 _ForwardIterator __m = __last;
48 for (; __n > 0; --__n) {65 for (; __n > 0; --__n) {
49 if (__m == __first) {66 if (__m == __first) {
50 return __last;67 return pair<_Iter, _Iter>(__end, std::move(__end));
51 }68 }
52 --__m;69 --__m;
53 }70 }
54 return std::move_backward(__first, __m, __last);71 auto __ret = std::__move_backward<_AlgPolicy>(std::move(__first), std::move(__m), __end);
72 return pair<_Iter, _Iter>(std::move(__ret.__out_), std::move(__end));
55 } else {73 } else {
56 _ForwardIterator __ret = __first;74 _Iter __ret = __first;
57 for (; __n > 0; --__n) {75 for (; __n > 0; --__n) {
58 if (__ret == __last) {76 if (__ret == __last) {
59 return __last;77 return pair<_Iter, _Iter>(__ret, std::move(__ret));
60 }78 }
61 ++__ret;79 ++__ret;
62 }80 }
...@@ -64,28 +82,28 @@ shift_right(_ForwardIterator __first,...@@ -64,28 +82,28 @@ shift_right(_ForwardIterator __first,
64 // We have an __n-element scratch space from __first to __ret.82 // We have an __n-element scratch space from __first to __ret.
65 // Slide an __n-element window [__trail, __lead) from left to right.83 // Slide an __n-element window [__trail, __lead) from left to right.
66 // We're essentially doing swap_ranges(__first, __ret, __trail, __lead)84 // We're essentially doing swap_ranges(__first, __ret, __trail, __lead)
67 // over and over; but once __lead reaches __last we needn't bother85 // over and over; but once __lead reaches __end we needn't bother
68 // to save the values of elements [__trail, __last).86 // to save the values of elements [__trail, __end).
6987
70 auto __trail = __first;88 auto __trail = __first;
71 auto __lead = __ret;89 auto __lead = __ret;
72 while (__trail != __ret) {90 while (__trail != __ret) {
73 if (__lead == __last) {91 if (__lead == __last) {
74 std::move(__first, __trail, __ret);92 std::__move<_AlgPolicy>(std::move(__first), std::move(__trail), __ret);
75 return __ret;93 return pair<_Iter, _Iter>(__ret, std::move(__lead));
76 }94 }
77 ++__trail;95 ++__trail;
78 ++__lead;96 ++__lead;
79 }97 }
8098
81 _ForwardIterator __mid = __first;99 _Iter __mid = __first;
82 while (true) {100 while (true) {
83 if (__lead == __last) {101 if (__lead == __last) {
84 __trail = std::move(__mid, __ret, __trail);102 __trail = std::__move<_AlgPolicy>(__mid, __ret, __trail).__out_;
85 std::move(__first, __mid, __trail);103 std::__move<_AlgPolicy>(std::move(__first), std::move(__mid), std::move(__trail));
86 return __ret;104 return pair<_Iter, _Iter>(__ret, std::move(__lead));
87 }105 }
88 swap(*__mid, *__trail);106 _IterOps<_AlgPolicy>::iter_swap(__mid, __trail);
89 ++__mid;107 ++__mid;
90 ++__trail;108 ++__trail;
91 ++__lead;109 ++__lead;
...@@ -96,6 +114,14 @@ shift_right(_ForwardIterator __first,...@@ -96,6 +114,14 @@ shift_right(_ForwardIterator __first,
96 }114 }
97}115}
98116
117template <class _ForwardIterator>
118_LIBCPP_HIDE_FROM_ABI constexpr _ForwardIterator
119shift_right(_ForwardIterator __first,
120 _ForwardIterator __last,
121 typename iterator_traits<_ForwardIterator>::difference_type __n) {
122 return std::__shift_right<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __n).first;
123}
124
99#endif // _LIBCPP_STD_VER >= 20125#endif // _LIBCPP_STD_VER >= 20
100126
101_LIBCPP_END_NAMESPACE_STD127_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__algorithm/shuffle.h+2
...@@ -28,6 +28,7 @@ _LIBCPP_PUSH_MACROS...@@ -28,6 +28,7 @@ _LIBCPP_PUSH_MACROS
2828
29_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
3030
31_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
31class _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_randomizer {32class _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_randomizer {
32public:33public:
33 _LIBCPP_HIDE_FROM_ABI __libcpp_debug_randomizer() {34 _LIBCPP_HIDE_FROM_ABI __libcpp_debug_randomizer() {
...@@ -160,6 +161,7 @@ shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, _UniformRan...@@ -160,6 +161,7 @@ shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, _UniformRan
160 std::move(__first), std::move(__last), std::forward<_UniformRandomNumberGenerator>(__g));161 std::move(__first), std::move(__last), std::forward<_UniformRandomNumberGenerator>(__g));
161}162}
162163
164_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
163_LIBCPP_END_NAMESPACE_STD165_LIBCPP_END_NAMESPACE_STD
164166
165_LIBCPP_POP_MACROS167_LIBCPP_POP_MACROS
lib/libcxx/include/__algorithm/simd_utils.h+4-12
...@@ -90,6 +90,9 @@ inline constexpr size_t __native_vector_size = 1;...@@ -90,6 +90,9 @@ inline constexpr size_t __native_vector_size = 1;
90template <class _ArithmeticT, size_t _Np>90template <class _ArithmeticT, size_t _Np>
91using __simd_vector __attribute__((__ext_vector_type__(_Np))) _LIBCPP_NODEBUG = _ArithmeticT;91using __simd_vector __attribute__((__ext_vector_type__(_Np))) _LIBCPP_NODEBUG = _ArithmeticT;
9292
93_LIBCPP_DIAGNOSTIC_PUSH
94_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi")
95
93template <class _VecT>96template <class _VecT>
94inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {97inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
95 static_assert(_False, "Not a vector!");98 static_assert(_False, "Not a vector!");
...@@ -115,8 +118,6 @@ template <class _VecT, class _Iter>...@@ -115,8 +118,6 @@ template <class _VecT, class _Iter>
115}118}
116119
117// Load the first _Np elements, zero the rest120// Load the first _Np elements, zero the rest
118_LIBCPP_DIAGNOSTIC_PUSH
119_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi")
120template <class _VecT, size_t _Np, class _Iter>121template <class _VecT, size_t _Np, class _Iter>
121[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __partial_load(_Iter __iter) noexcept {122[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __partial_load(_Iter __iter) noexcept {
122 return [=]<size_t... _LoadIndices, size_t... _ZeroIndices>(123 return [=]<size_t... _LoadIndices, size_t... _ZeroIndices>(
...@@ -125,16 +126,6 @@ template <class _VecT, size_t _Np, class _Iter>...@@ -125,16 +126,6 @@ template <class _VecT, size_t _Np, class _Iter>
125 }(make_index_sequence<_Np>{}, make_index_sequence<__simd_vector_size_v<_VecT> - _Np>{});126 }(make_index_sequence<_Np>{}, make_index_sequence<__simd_vector_size_v<_VecT> - _Np>{});
126}127}
127128
128// Create a vector where every elements is __val
129template <class _VecT>
130[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT
131__broadcast(__simd_vector_underlying_type_t<_VecT> __val) {
132 return [&]<std::size_t... _Indices>(index_sequence<_Indices...>) {
133 return _VecT{((void)_Indices, __val)...};
134 }(make_index_sequence<__simd_vector_size_v<_VecT>>());
135}
136_LIBCPP_DIAGNOSTIC_POP
137
138template <class _Tp, size_t _Np>129template <class _Tp, size_t _Np>
139[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __any_of(__simd_vector<_Tp, _Np> __vec) noexcept {130[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __any_of(__simd_vector<_Tp, _Np> __vec) noexcept {
140 return __builtin_reduce_or(__builtin_convertvector(__vec, __simd_vector<bool, _Np>));131 return __builtin_reduce_or(__builtin_convertvector(__vec, __simd_vector<bool, _Np>));
...@@ -183,6 +174,7 @@ template <class _Tp, size_t _Np>...@@ -183,6 +174,7 @@ template <class _Tp, size_t _Np>
183[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_not_set(__simd_vector<_Tp, _Np> __vec) noexcept {174[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_not_set(__simd_vector<_Tp, _Np> __vec) noexcept {
184 return std::__find_first_set(~__vec);175 return std::__find_first_set(~__vec);
185}176}
177_LIBCPP_DIAGNOSTIC_POP
186178
187_LIBCPP_END_NAMESPACE_STD179_LIBCPP_END_NAMESPACE_STD
188180
lib/libcxx/include/__algorithm/sort.h+2
...@@ -828,6 +828,7 @@ void __introsort(_RandomAccessIterator __first,...@@ -828,6 +828,7 @@ void __introsort(_RandomAccessIterator __first,
828 }828 }
829}829}
830830
831_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
831template <class _Comp, class _RandomAccessIterator>832template <class _Comp, class _RandomAccessIterator>
832void __sort(_RandomAccessIterator, _RandomAccessIterator, _Comp);833void __sort(_RandomAccessIterator, _RandomAccessIterator, _Comp);
833834
...@@ -856,6 +857,7 @@ extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<float>&, float*>(fl...@@ -856,6 +857,7 @@ extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<float>&, float*>(fl
856extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<double>&, double*>(double*, double*, __less<double>&);857extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
857extern template _LIBCPP_EXPORTED_FROM_ABI void858extern template _LIBCPP_EXPORTED_FROM_ABI void
858__sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);859__sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
860_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
859861
860template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>862template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
861_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void863_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
lib/libcxx/include/__algorithm/specialized_algorithms.h+1
...@@ -21,6 +21,7 @@ namespace _Algorithm {...@@ -21,6 +21,7 @@ namespace _Algorithm {
21struct __copy {};21struct __copy {};
22struct __fill_n {};22struct __fill_n {};
23struct __for_each {};23struct __for_each {};
24struct __swap_ranges {};
24} // namespace _Algorithm25} // namespace _Algorithm
2526
26template <class>27template <class>
lib/libcxx/include/__algorithm/swap_ranges.h+24-178
...@@ -10,12 +10,11 @@...@@ -10,12 +10,11 @@
10#define _LIBCPP___ALGORITHM_SWAP_RANGES_H10#define _LIBCPP___ALGORITHM_SWAP_RANGES_H
1111
12#include <__algorithm/iterator_operations.h>12#include <__algorithm/iterator_operations.h>
13#include <__algorithm/min.h>13#include <__algorithm/specialized_algorithms.h>
14#include <__config>14#include <__config>
15#include <__fwd/bit_reference.h>15#include <__type_traits/enable_if.h>
16#include <__utility/move.h>16#include <__utility/move.h>
17#include <__utility/pair.h>17#include <__utility/pair.h>
18#include <__utility/swap.h>
1918
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21# pragma GCC system_header20# pragma GCC system_header
...@@ -26,189 +25,36 @@ _LIBCPP_PUSH_MACROS...@@ -26,189 +25,36 @@ _LIBCPP_PUSH_MACROS
2625
27_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2827
29template <class _Cl, class _Cr>28template <
30_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cr, false> __swap_ranges_aligned(29 class _AlgPolicy,
31 __bit_iterator<_Cl, false> __first, __bit_iterator<_Cl, false> __last, __bit_iterator<_Cr, false> __result) {30 class _Iter1,
32 using _I1 = __bit_iterator<_Cl, false>;31 class _Sent1,
33 using difference_type = typename _I1::difference_type;32 class _Iter2,
34 using __storage_type = typename _I1::__storage_type;33 class _SpecialAlg =
3534 __specialized_algorithm<_Algorithm::__swap_ranges, __iterator_pair<_Iter1, _Sent1>, __single_iterator<_Iter2> >,
36 const int __bits_per_word = _I1::__bits_per_word;35 __enable_if_t<_SpecialAlg::__has_algorithm, int> = 0>
37 difference_type __n = __last - __first;36_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter2>
38 if (__n > 0) {37__swap_ranges(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
39 // do first word38 return _SpecialAlg()(std::move(__first1), std::move(__last1), std::move(__first2));
40 if (__first.__ctz_ != 0) {
41 unsigned __clz = __bits_per_word - __first.__ctz_;
42 difference_type __dn = std::min(static_cast<difference_type>(__clz), __n);
43 __n -= __dn;
44 __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
45 __storage_type __b1 = *__first.__seg_ & __m;
46 *__first.__seg_ &= ~__m;
47 __storage_type __b2 = *__result.__seg_ & __m;
48 *__result.__seg_ &= ~__m;
49 *__result.__seg_ |= __b1;
50 *__first.__seg_ |= __b2;
51 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
52 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
53 ++__first.__seg_;
54 // __first.__ctz_ = 0;
55 }
56 // __first.__ctz_ == 0;
57 // do middle words
58 for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_, ++__result.__seg_)
59 swap(*__first.__seg_, *__result.__seg_);
60 // do last word
61 if (__n > 0) {
62 __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
63 __storage_type __b1 = *__first.__seg_ & __m;
64 *__first.__seg_ &= ~__m;
65 __storage_type __b2 = *__result.__seg_ & __m;
66 *__result.__seg_ &= ~__m;
67 *__result.__seg_ |= __b1;
68 *__first.__seg_ |= __b2;
69 __result.__ctz_ = static_cast<unsigned>(__n);
70 }
71 }
72 return __result;
73}
74
75template <class _Cl, class _Cr>
76_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cr, false> __swap_ranges_unaligned(
77 __bit_iterator<_Cl, false> __first, __bit_iterator<_Cl, false> __last, __bit_iterator<_Cr, false> __result) {
78 using _I1 = __bit_iterator<_Cl, false>;
79 using difference_type = typename _I1::difference_type;
80 using __storage_type = typename _I1::__storage_type;
81
82 const int __bits_per_word = _I1::__bits_per_word;
83 difference_type __n = __last - __first;
84 if (__n > 0) {
85 // do first word
86 if (__first.__ctz_ != 0) {
87 unsigned __clz_f = __bits_per_word - __first.__ctz_;
88 difference_type __dn = std::min(static_cast<difference_type>(__clz_f), __n);
89 __n -= __dn;
90 __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
91 __storage_type __b1 = *__first.__seg_ & __m;
92 *__first.__seg_ &= ~__m;
93 unsigned __clz_r = __bits_per_word - __result.__ctz_;
94 __storage_type __ddn = std::min<__storage_type>(__dn, __clz_r);
95 __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
96 __storage_type __b2 = *__result.__seg_ & __m;
97 *__result.__seg_ &= ~__m;
98 if (__result.__ctz_ > __first.__ctz_) {
99 unsigned __s = __result.__ctz_ - __first.__ctz_;
100 *__result.__seg_ |= __b1 << __s;
101 *__first.__seg_ |= __b2 >> __s;
102 } else {
103 unsigned __s = __first.__ctz_ - __result.__ctz_;
104 *__result.__seg_ |= __b1 >> __s;
105 *__first.__seg_ |= __b2 << __s;
106 }
107 __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word;
108 __result.__ctz_ = static_cast<unsigned>((__ddn + __result.__ctz_) % __bits_per_word);
109 __dn -= __ddn;
110 if (__dn > 0) {
111 __m = ~__storage_type(0) >> (__bits_per_word - __dn);
112 __b2 = *__result.__seg_ & __m;
113 *__result.__seg_ &= ~__m;
114 unsigned __s = __first.__ctz_ + __ddn;
115 *__result.__seg_ |= __b1 >> __s;
116 *__first.__seg_ |= __b2 << __s;
117 __result.__ctz_ = static_cast<unsigned>(__dn);
118 }
119 ++__first.__seg_;
120 // __first.__ctz_ = 0;
121 }
122 // __first.__ctz_ == 0;
123 // do middle words
124 __storage_type __m = ~__storage_type(0) << __result.__ctz_;
125 unsigned __clz_r = __bits_per_word - __result.__ctz_;
126 for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) {
127 __storage_type __b1 = *__first.__seg_;
128 __storage_type __b2 = *__result.__seg_ & __m;
129 *__result.__seg_ &= ~__m;
130 *__result.__seg_ |= __b1 << __result.__ctz_;
131 *__first.__seg_ = __b2 >> __result.__ctz_;
132 ++__result.__seg_;
133 __b2 = *__result.__seg_ & ~__m;
134 *__result.__seg_ &= __m;
135 *__result.__seg_ |= __b1 >> __clz_r;
136 *__first.__seg_ |= __b2 << __clz_r;
137 }
138 // do last word
139 if (__n > 0) {
140 __m = ~__storage_type(0) >> (__bits_per_word - __n);
141 __storage_type __b1 = *__first.__seg_ & __m;
142 *__first.__seg_ &= ~__m;
143 __storage_type __dn = std::min<__storage_type>(__n, __clz_r);
144 __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
145 __storage_type __b2 = *__result.__seg_ & __m;
146 *__result.__seg_ &= ~__m;
147 *__result.__seg_ |= __b1 << __result.__ctz_;
148 *__first.__seg_ |= __b2 >> __result.__ctz_;
149 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
150 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
151 __n -= __dn;
152 if (__n > 0) {
153 __m = ~__storage_type(0) >> (__bits_per_word - __n);
154 __b2 = *__result.__seg_ & __m;
155 *__result.__seg_ &= ~__m;
156 *__result.__seg_ |= __b1 >> __dn;
157 *__first.__seg_ |= __b2 << __dn;
158 __result.__ctz_ = static_cast<unsigned>(__n);
159 }
160 }
161 }
162 return __result;
163}
164
165// 2+1 iterators: size2 >= size1; used by std::swap_ranges.
166template <class, class _Cl, class _Cr>
167_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cl, false>, __bit_iterator<_Cr, false> >
168__swap_ranges(__bit_iterator<_Cl, false> __first1,
169 __bit_iterator<_Cl, false> __last1,
170 __bit_iterator<_Cr, false> __first2) {
171 if (__first1.__ctz_ == __first2.__ctz_)
172 return std::make_pair(__last1, std::__swap_ranges_aligned(__first1, __last1, __first2));
173 return std::make_pair(__last1, std::__swap_ranges_unaligned(__first1, __last1, __first2));
174}
175
176// 2+2 iterators: used by std::ranges::swap_ranges.
177template <class _AlgPolicy, class _Cl, class _Cr>
178_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cl, false>, __bit_iterator<_Cr, false> >
179__swap_ranges(__bit_iterator<_Cl, false> __first1,
180 __bit_iterator<_Cl, false> __last1,
181 __bit_iterator<_Cr, false> __first2,
182 __bit_iterator<_Cr, false> __last2) {
183 if (__last1 - __first1 < __last2 - __first2)
184 return std::make_pair(__last1, std::__swap_ranges<_AlgPolicy>(__first1, __last1, __first2).second);
185 return std::make_pair(std::__swap_ranges<_AlgPolicy>(__first2, __last2, __first1).second, __last2);
186}
187
188// 2+2 iterators: the shorter size will be used.
189template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _ForwardIterator2, class _Sentinel2>
190_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator1, _ForwardIterator2>
191__swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2 __first2, _Sentinel2 __last2) {
192 while (__first1 != __last1 && __first2 != __last2) {
193 _IterOps<_AlgPolicy>::iter_swap(__first1, __first2);
194 ++__first1;
195 ++__first2;
196 }
197
198 return pair<_ForwardIterator1, _ForwardIterator2>(std::move(__first1), std::move(__first2));
199}39}
20040
201// 2+1 iterators: size2 >= size1.41template <
202template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _ForwardIterator2>42 class _AlgPolicy,
203_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator1, _ForwardIterator2>43 class _Iter1,
204__swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2 __first2) {44 class _Sent1,
45 class _Iter2,
46 class _SpecialAlg =
47 __specialized_algorithm<_Algorithm::__swap_ranges, __iterator_pair<_Iter1, _Sent1>, __single_iterator<_Iter2> >,
48 __enable_if_t<!_SpecialAlg::__has_algorithm, int> = 0>
49_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter2>
50__swap_ranges(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
205 while (__first1 != __last1) {51 while (__first1 != __last1) {
206 _IterOps<_AlgPolicy>::iter_swap(__first1, __first2);52 _IterOps<_AlgPolicy>::iter_swap(__first1, __first2);
207 ++__first1;53 ++__first1;
208 ++__first2;54 ++__first2;
209 }55 }
21056
211 return pair<_ForwardIterator1, _ForwardIterator2>(std::move(__first1), std::move(__first2));57 return pair<_Iter1, _Iter2>(std::move(__first1), std::move(__first2));
212}58}
21359
214template <class _ForwardIterator1, class _ForwardIterator2>60template <class _ForwardIterator1, class _ForwardIterator2>
lib/libcxx/include/__algorithm/three_way_comp_ref_type.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <class _Comp>26template <class _Comp>
27struct __debug_three_way_comp {27struct __debug_three_way_comp {
28 _Comp& __comp_;28 _Comp& __comp_;
...@@ -67,8 +67,8 @@ template <class _Comp>...@@ -67,8 +67,8 @@ template <class _Comp>
67using __three_way_comp_ref_type _LIBCPP_NODEBUG = _Comp&;67using __three_way_comp_ref_type _LIBCPP_NODEBUG = _Comp&;
68# endif68# endif
6969
70#endif // _LIBCPP_STD_VER >= 20
71
72_LIBCPP_END_NAMESPACE_STD70_LIBCPP_END_NAMESPACE_STD
7371
72#endif // _LIBCPP_STD_VER >= 20
73
74#endif // _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H74#endif // _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
lib/libcxx/include/__algorithm/unique_copy.h+8-8
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#define _LIBCPP___ALGORITHM_UNIQUE_COPY_H10#define _LIBCPP___ALGORITHM_UNIQUE_COPY_H
1111
12#include <__algorithm/comp.h>12#include <__algorithm/comp.h>
13#include <__algorithm/in_out_result.h>
13#include <__algorithm/iterator_operations.h>14#include <__algorithm/iterator_operations.h>
14#include <__config>15#include <__config>
15#include <__iterator/iterator_traits.h>16#include <__iterator/iterator_traits.h>
...@@ -17,7 +18,6 @@...@@ -17,7 +18,6 @@
17#include <__type_traits/is_base_of.h>18#include <__type_traits/is_base_of.h>
18#include <__type_traits/is_same.h>19#include <__type_traits/is_same.h>
19#include <__utility/move.h>20#include <__utility/move.h>
20#include <__utility/pair.h>
2121
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
23# pragma GCC system_header23# pragma GCC system_header
...@@ -37,7 +37,7 @@ struct __read_from_tmp_value_tag {};...@@ -37,7 +37,7 @@ struct __read_from_tmp_value_tag {};
37} // namespace __unique_copy_tags37} // namespace __unique_copy_tags
3838
39template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _OutputIterator>39template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _OutputIterator>
40_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _OutputIterator>40_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __in_out_result<_InputIterator, _OutputIterator>
41__unique_copy(_InputIterator __first,41__unique_copy(_InputIterator __first,
42 _Sent __last,42 _Sent __last,
43 _OutputIterator __result,43 _OutputIterator __result,
...@@ -55,11 +55,11 @@ __unique_copy(_InputIterator __first,...@@ -55,11 +55,11 @@ __unique_copy(_InputIterator __first,
55 }55 }
56 }56 }
57 }57 }
58 return pair<_InputIterator, _OutputIterator>(std::move(__first), std::move(__result));58 return {std::move(__first), std::move(__result)};
59}59}
6060
61template <class _AlgPolicy, class _BinaryPredicate, class _ForwardIterator, class _Sent, class _OutputIterator>61template <class _AlgPolicy, class _BinaryPredicate, class _ForwardIterator, class _Sent, class _OutputIterator>
62_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pair<_ForwardIterator, _OutputIterator>62_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __in_out_result<_ForwardIterator, _OutputIterator>
63__unique_copy(_ForwardIterator __first,63__unique_copy(_ForwardIterator __first,
64 _Sent __last,64 _Sent __last,
65 _OutputIterator __result,65 _OutputIterator __result,
...@@ -77,11 +77,11 @@ __unique_copy(_ForwardIterator __first,...@@ -77,11 +77,11 @@ __unique_copy(_ForwardIterator __first,
77 }77 }
78 }78 }
79 }79 }
80 return pair<_ForwardIterator, _OutputIterator>(std::move(__first), std::move(__result));80 return {std::move(__first), std::move(__result)};
81}81}
8282
83template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _InputAndOutputIterator>83template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _InputAndOutputIterator>
84_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _InputAndOutputIterator>84_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __in_out_result<_InputIterator, _InputAndOutputIterator>
85__unique_copy(_InputIterator __first,85__unique_copy(_InputIterator __first,
86 _Sent __last,86 _Sent __last,
87 _InputAndOutputIterator __result,87 _InputAndOutputIterator __result,
...@@ -94,7 +94,7 @@ __unique_copy(_InputIterator __first,...@@ -94,7 +94,7 @@ __unique_copy(_InputIterator __first,
94 *++__result = *__first;94 *++__result = *__first;
95 ++__result;95 ++__result;
96 }96 }
97 return pair<_InputIterator, _InputAndOutputIterator>(std::move(__first), std::move(__result));97 return {std::move(__first), std::move(__result)};
98}98}
9999
100template <class _InputIterator, class _OutputIterator, class _BinaryPredicate>100template <class _InputIterator, class _OutputIterator, class _BinaryPredicate>
...@@ -111,7 +111,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res...@@ -111,7 +111,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
111 __unique_copy_tags::__read_from_tmp_value_tag> >;111 __unique_copy_tags::__read_from_tmp_value_tag> >;
112 return std::__unique_copy<_ClassicAlgPolicy>(112 return std::__unique_copy<_ClassicAlgPolicy>(
113 std::move(__first), std::move(__last), std::move(__result), __pred, __algo_tag())113 std::move(__first), std::move(__last), std::move(__result), __pred, __algo_tag())
114 .second;114 .__out_;
115}115}
116116
117template <class _InputIterator, class _OutputIterator>117template <class _InputIterator, class _OutputIterator>
lib/libcxx/include/__algorithm/unwrap_iter.h+8-10
...@@ -57,21 +57,19 @@ struct __unwrap_iter_impl<_Iter, true> {...@@ -57,21 +57,19 @@ struct __unwrap_iter_impl<_Iter, true> {
57 }57 }
58};58};
5959
60template <class _Iter,60template <class _Iter, class _Impl = __unwrap_iter_impl<_Iter> >
61 class _Impl = __unwrap_iter_impl<_Iter>,
62 __enable_if_t<is_copy_constructible<_Iter>::value, int> = 0>
63inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 decltype(_Impl::__unwrap(std::declval<_Iter>()))61inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 decltype(_Impl::__unwrap(std::declval<_Iter>()))
64__unwrap_iter(_Iter __i) _NOEXCEPT {62__unwrap_iter(_Iter __i) _NOEXCEPT {
65 return _Impl::__unwrap(__i);
66}
67
68// Allow input_iterators to be passed to __unwrap_iter (but not __rewrap_iter)63// Allow input_iterators to be passed to __unwrap_iter (but not __rewrap_iter)
69#if _LIBCPP_STD_VER >= 2064#if _LIBCPP_STD_VER >= 20
70template <class _Iter, __enable_if_t<!is_copy_constructible<_Iter>::value, int> = 0>65 if constexpr (!is_copy_constructible_v<_Iter>) {
71inline _LIBCPP_HIDE_FROM_ABI constexpr _Iter __unwrap_iter(_Iter __i) noexcept {66 return __i;
72 return __i;67 } else
73}
74#endif68#endif
69 {
70 return _Impl::__unwrap(__i);
71 }
72}
7573
76template <class _OrigIter, class _Iter, class _Impl = __unwrap_iter_impl<_OrigIter> >74template <class _OrigIter, class _Iter, class _Impl = __unwrap_iter_impl<_OrigIter> >
77_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {75_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
lib/libcxx/include/__algorithm/unwrap_range.h+13-42
...@@ -10,10 +10,9 @@...@@ -10,10 +10,9 @@
10#define _LIBCPP___ALGORITHM_UNWRAP_RANGE_H10#define _LIBCPP___ALGORITHM_UNWRAP_RANGE_H
1111
12#include <__algorithm/unwrap_iter.h>12#include <__algorithm/unwrap_iter.h>
13#include <__concepts/constructible.h>
14#include <__config>13#include <__config>
15#include <__iterator/concepts.h>14#include <__iterator/concepts.h>
16#include <__iterator/next.h>15#include <__type_traits/is_same.h>
17#include <__utility/declval.h>16#include <__utility/declval.h>
18#include <__utility/move.h>17#include <__utility/move.h>
19#include <__utility/pair.h>18#include <__utility/pair.h>
...@@ -33,52 +32,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -33,52 +32,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3332
34#if _LIBCPP_STD_VER >= 2033#if _LIBCPP_STD_VER >= 20
35template <class _Iter, class _Sent>34template <class _Iter, class _Sent>
36struct __unwrap_range_impl {35_LIBCPP_HIDE_FROM_ABI constexpr auto __unwrap_range(_Iter __first, _Sent __last) {
37 _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __sent)36 if constexpr (is_same_v<_Iter, _Sent>)
38 requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
39 {
40 auto __last = ranges::next(__first, __sent);
41 return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};37 return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
42 }38 else if constexpr (random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) {
4339 auto __iter_last = __first + (__last - __first);
44 _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __last) {40 return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__iter_last))};
41 } else
45 return pair{std::move(__first), std::move(__last)};42 return pair{std::move(__first), std::move(__last)};
46 }
47
48 _LIBCPP_HIDE_FROM_ABI static constexpr auto
49 __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(std::move(__orig_iter))) __iter)
50 requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
51 {
52 return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
53 }
54
55 _LIBCPP_HIDE_FROM_ABI static constexpr auto __rewrap(const _Iter&, _Iter __iter)
56 requires(!(random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>))
57 {
58 return __iter;
59 }
60};
61
62template <class _Iter>
63struct __unwrap_range_impl<_Iter, _Iter> {
64 _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Iter __last) {
65 return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
66 }
67
68 _LIBCPP_HIDE_FROM_ABI static constexpr auto
69 __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter) {
70 return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
71 }
72};
73
74template <class _Iter, class _Sent>
75_LIBCPP_HIDE_FROM_ABI constexpr auto __unwrap_range(_Iter __first, _Sent __last) {
76 return __unwrap_range_impl<_Iter, _Sent>::__unwrap(std::move(__first), std::move(__last));
77}43}
7844
79template < class _Sent, class _Iter, class _Unwrapped>45template < class _Sent, class _Iter, class _Unwrapped>
80_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {46_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
81 return __unwrap_range_impl<_Iter, _Sent>::__rewrap(std::move(__orig_iter), std::move(__iter));47 if constexpr (is_same_v<_Iter, _Sent>)
48 return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
49 else if constexpr (random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>)
50 return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
51 else
52 return __iter;
82}53}
83#else // _LIBCPP_STD_VER >= 2054#else // _LIBCPP_STD_VER >= 20
84template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>55template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>
lib/libcxx/include/__assert+1-1
...@@ -20,7 +20,7 @@...@@ -20,7 +20,7 @@
20#define _LIBCPP_ASSERT(expression, message) \20#define _LIBCPP_ASSERT(expression, message) \
21 (__builtin_expect(static_cast<bool>(expression), 1) \21 (__builtin_expect(static_cast<bool>(expression), 1) \
22 ? (void)0 \22 ? (void)0 \
23 : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING( \23 : _LIBCPP_ASSERTION_HANDLER(__FILE_NAME__ ":" _LIBCPP_TOSTRING( \
24 __LINE__) ": libc++ Hardening assertion " _LIBCPP_TOSTRING(expression) " failed: " message "\n"))24 __LINE__) ": libc++ Hardening assertion " _LIBCPP_TOSTRING(expression) " failed: " message "\n"))
2525
26// WARNING: __builtin_assume can currently inhibit optimizations. Only add assumptions with a clear26// WARNING: __builtin_assume can currently inhibit optimizations. Only add assumptions with a clear
lib/libcxx/include/__atomic/atomic.h+2-4
...@@ -26,9 +26,7 @@...@@ -26,9 +26,7 @@
26#include <__type_traits/is_nothrow_constructible.h>26#include <__type_traits/is_nothrow_constructible.h>
27#include <__type_traits/is_same.h>27#include <__type_traits/is_same.h>
28#include <__type_traits/is_trivially_copyable.h>28#include <__type_traits/is_trivially_copyable.h>
29#include <__type_traits/remove_const.h>
30#include <__type_traits/remove_pointer.h>29#include <__type_traits/remove_pointer.h>
31#include <__type_traits/remove_volatile.h>
32#include <__utility/forward.h>30#include <__utility/forward.h>
33#include <cstring>31#include <cstring>
3432
...@@ -297,13 +295,13 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> {...@@ -297,13 +295,13 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> {
297 }295 }
298296
299 _LIBCPP_HIDE_FROM_ABI _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {297 _LIBCPP_HIDE_FROM_ABI _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
300 // __atomic_fetch_add accepts function pointers, guard against them.298 // __atomic_fetch_sub accepts function pointers, guard against them.
301 static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");299 static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
302 return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);300 return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
303 }301 }
304302
305 _LIBCPP_HIDE_FROM_ABI _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {303 _LIBCPP_HIDE_FROM_ABI _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
306 // __atomic_fetch_add accepts function pointers, guard against them.304 // __atomic_fetch_sub accepts function pointers, guard against them.
307 static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");305 static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
308 return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);306 return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
309 }307 }
lib/libcxx/include/__atomic/atomic_flag.h+14-20
...@@ -11,14 +11,10 @@...@@ -11,14 +11,10 @@
1111
12#include <__atomic/atomic_sync.h>12#include <__atomic/atomic_sync.h>
13#include <__atomic/atomic_waitable_traits.h>13#include <__atomic/atomic_waitable_traits.h>
14#include <__atomic/contention_t.h>
15#include <__atomic/memory_order.h>14#include <__atomic/memory_order.h>
16#include <__atomic/support.h>15#include <__atomic/support.h>
17#include <__chrono/duration.h>
18#include <__config>16#include <__config>
19#include <__memory/addressof.h>17#include <__memory/addressof.h>
20#include <__thread/support.h>
21#include <cstdint>
2218
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24# pragma GCC system_header20# pragma GCC system_header
...@@ -27,34 +23,34 @@...@@ -27,34 +23,34 @@
27_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
2824
29struct atomic_flag {25struct atomic_flag {
30 __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_;26 __cxx_atomic_impl<bool> __a_;
3127
32 _LIBCPP_HIDE_FROM_ABI bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {28 _LIBCPP_HIDE_FROM_ABI bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {
33 return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);29 return __cxx_atomic_load(&__a_, __m);
34 }30 }
35 _LIBCPP_HIDE_FROM_ABI bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT {31 _LIBCPP_HIDE_FROM_ABI bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
36 return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);32 return __cxx_atomic_load(&__a_, __m);
37 }33 }
3834
39 _LIBCPP_HIDE_FROM_ABI bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {35 _LIBCPP_HIDE_FROM_ABI bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
40 return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);36 return __cxx_atomic_exchange(&__a_, true, __m);
41 }37 }
42 _LIBCPP_HIDE_FROM_ABI bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT {38 _LIBCPP_HIDE_FROM_ABI bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT {
43 return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);39 return __cxx_atomic_exchange(&__a_, true, __m);
44 }40 }
45 _LIBCPP_HIDE_FROM_ABI void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {41 _LIBCPP_HIDE_FROM_ABI void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
46 __cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);42 __cxx_atomic_store(&__a_, false, __m);
47 }43 }
48 _LIBCPP_HIDE_FROM_ABI void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT {44 _LIBCPP_HIDE_FROM_ABI void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT {
49 __cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);45 __cxx_atomic_store(&__a_, false, __m);
50 }46 }
5147
52#if _LIBCPP_STD_VER >= 2048#if _LIBCPP_STD_VER >= 20
53 _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {49 _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {
54 std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);50 std::__atomic_wait(*this, __v, __m);
55 }51 }
56 _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {52 _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
57 std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);53 std::__atomic_wait(*this, __v, __m);
58 }54 }
59 _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT { std::__atomic_notify_one(*this); }55 _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT { std::__atomic_notify_one(*this); }
60 _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }56 _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }
...@@ -78,23 +74,21 @@ struct atomic_flag {...@@ -78,23 +74,21 @@ struct atomic_flag {
78#if _LIBCPP_STD_VER >= 2074#if _LIBCPP_STD_VER >= 20
79template <>75template <>
80struct __atomic_waitable_traits<atomic_flag> {76struct __atomic_waitable_traits<atomic_flag> {
81 using __value_type _LIBCPP_NODEBUG = _LIBCPP_ATOMIC_FLAG_TYPE;77 using __value_type _LIBCPP_NODEBUG = bool;
8278
83 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATOMIC_FLAG_TYPE __atomic_load(const atomic_flag& __a, memory_order __order) {79 static _LIBCPP_HIDE_FROM_ABI bool __atomic_load(const atomic_flag& __a, memory_order __order) {
84 return std::__cxx_atomic_load(&__a.__a_, __order);80 return std::__cxx_atomic_load(&__a.__a_, __order);
85 }81 }
8682
87 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATOMIC_FLAG_TYPE83 static _LIBCPP_HIDE_FROM_ABI bool __atomic_load(const volatile atomic_flag& __a, memory_order __order) {
88 __atomic_load(const volatile atomic_flag& __a, memory_order __order) {
89 return std::__cxx_atomic_load(&__a.__a_, __order);84 return std::__cxx_atomic_load(&__a.__a_, __order);
90 }85 }
9186
92 static _LIBCPP_HIDE_FROM_ABI const __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE>*87 static _LIBCPP_HIDE_FROM_ABI const __cxx_atomic_impl<bool>* __atomic_contention_address(const atomic_flag& __a) {
93 __atomic_contention_address(const atomic_flag& __a) {
94 return std::addressof(__a.__a_);88 return std::addressof(__a.__a_);
95 }89 }
9690
97 static _LIBCPP_HIDE_FROM_ABI const volatile __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE>*91 static _LIBCPP_HIDE_FROM_ABI const volatile __cxx_atomic_impl<bool>*
98 __atomic_contention_address(const volatile atomic_flag& __a) {92 __atomic_contention_address(const volatile atomic_flag& __a) {
99 return std::addressof(__a.__a_);93 return std::addressof(__a.__a_);
100 }94 }
lib/libcxx/include/__atomic/atomic_ref.h+14-5
...@@ -30,9 +30,10 @@...@@ -30,9 +30,10 @@
30#include <__cstddef/byte.h>30#include <__cstddef/byte.h>
31#include <__cstddef/ptrdiff_t.h>31#include <__cstddef/ptrdiff_t.h>
32#include <__memory/addressof.h>32#include <__memory/addressof.h>
33#include <__memory/is_sufficiently_aligned.h>
34#include <__type_traits/copy_cv.h>
33#include <__type_traits/has_unique_object_representation.h>35#include <__type_traits/has_unique_object_representation.h>
34#include <__type_traits/is_trivially_copyable.h>36#include <__type_traits/is_trivially_copyable.h>
35#include <cstdint>
36#include <cstring>37#include <cstring>
3738
38#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)39#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -224,7 +225,7 @@ public:...@@ -224,7 +225,7 @@ public:
224 _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); }225 _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); }
225 _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); }226 _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); }
226# if _LIBCPP_STD_VER >= 26227# if _LIBCPP_STD_VER >= 26
227 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* address() const noexcept { return __ptr_; }228 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __copy_cv_t<_Tp, void>* address() const noexcept { return __ptr_; }
228# endif229# endif
229230
230protected:231protected:
...@@ -254,10 +255,12 @@ struct atomic_ref : public __atomic_ref_base<_Tp> {...@@ -254,10 +255,12 @@ struct atomic_ref : public __atomic_ref_base<_Tp> {
254255
255 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) {256 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) {
256 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(257 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
257 reinterpret_cast<uintptr_t>(std::addressof(__obj)) % __base::required_alignment == 0,258 std::__is_sufficiently_aligned<__base::required_alignment>(std::addressof(__obj)),
258 "atomic_ref ctor: referenced object must be aligned to required_alignment");259 "atomic_ref ctor: referenced object must be aligned to required_alignment");
259 }260 }
260261
262 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp&&) = delete;
263
261 _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default;264 _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default;
262265
263 _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); }266 _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); }
...@@ -274,10 +277,12 @@ struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> {...@@ -274,10 +277,12 @@ struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> {
274277
275 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) {278 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) {
276 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(279 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
277 reinterpret_cast<uintptr_t>(std::addressof(__obj)) % __base::required_alignment == 0,280 std::__is_sufficiently_aligned<__base::required_alignment>(std::addressof(__obj)),
278 "atomic_ref ctor: referenced object must be aligned to required_alignment");281 "atomic_ref ctor: referenced object must be aligned to required_alignment");
279 }282 }
280283
284 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp&&) = delete;
285
281 _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default;286 _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default;
282287
283 _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); }288 _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); }
...@@ -320,10 +325,12 @@ struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> {...@@ -320,10 +325,12 @@ struct atomic_ref<_Tp> : public __atomic_ref_base<_Tp> {
320325
321 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) {326 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp& __obj) : __base(__obj) {
322 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(327 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(
323 reinterpret_cast<uintptr_t>(std::addressof(__obj)) % __base::required_alignment == 0,328 std::__is_sufficiently_aligned<__base::required_alignment>(std::addressof(__obj)),
324 "atomic_ref ctor: referenced object must be aligned to required_alignment");329 "atomic_ref ctor: referenced object must be aligned to required_alignment");
325 }330 }
326331
332 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp&&) = delete;
333
327 _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default;334 _LIBCPP_HIDE_FROM_ABI atomic_ref(const atomic_ref&) noexcept = default;
328335
329 _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); }336 _LIBCPP_HIDE_FROM_ABI _Tp operator=(_Tp __desired) const noexcept { return __base::operator=(__desired); }
...@@ -367,6 +374,8 @@ struct atomic_ref<_Tp*> : public __atomic_ref_base<_Tp*> {...@@ -367,6 +374,8 @@ struct atomic_ref<_Tp*> : public __atomic_ref_base<_Tp*> {
367374
368 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp*& __ptr) : __base(__ptr) {}375 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp*& __ptr) : __base(__ptr) {}
369376
377 _LIBCPP_HIDE_FROM_ABI explicit atomic_ref(_Tp*&&) = delete;
378
370 _LIBCPP_HIDE_FROM_ABI _Tp* operator=(_Tp* __desired) const noexcept { return __base::operator=(__desired); }379 _LIBCPP_HIDE_FROM_ABI _Tp* operator=(_Tp* __desired) const noexcept { return __base::operator=(__desired); }
371380
372 atomic_ref& operator=(const atomic_ref&) = delete;381 atomic_ref& operator=(const atomic_ref&) = delete;
lib/libcxx/include/__atomic/atomic_sync.h+8-9
...@@ -12,28 +12,25 @@...@@ -12,28 +12,25 @@
12#include <__atomic/atomic_waitable_traits.h>12#include <__atomic/atomic_waitable_traits.h>
13#include <__atomic/contention_t.h>13#include <__atomic/contention_t.h>
14#include <__atomic/memory_order.h>14#include <__atomic/memory_order.h>
15#include <__atomic/to_gcc_order.h>
16#include <__chrono/duration.h>15#include <__chrono/duration.h>
17#include <__config>16#include <__config>
18#include <__memory/addressof.h>17#include <__memory/addressof.h>
19#include <__thread/poll_with_backoff.h>18#include <__thread/poll_with_backoff.h>
20#include <__type_traits/conjunction.h>
21#include <__type_traits/decay.h>19#include <__type_traits/decay.h>
22#include <__type_traits/invoke.h>
23#include <__type_traits/is_same.h>
24#include <__type_traits/void_t.h>
25#include <__utility/declval.h>
26#include <cstring>20#include <cstring>
2721
28#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29# pragma GCC system_header23# pragma GCC system_header
30#endif24#endif
3125
26#if _LIBCPP_STD_VER >= 20
27
32_LIBCPP_BEGIN_NAMESPACE_STD28_LIBCPP_BEGIN_NAMESPACE_STD
3329
34#if _LIBCPP_STD_VER >= 20
35# if _LIBCPP_HAS_THREADS30# if _LIBCPP_HAS_THREADS
3631
32_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
33
37# if !_LIBCPP_AVAILABILITY_HAS_NEW_SYNC34# if !_LIBCPP_AVAILABILITY_HAS_NEW_SYNC
3835
39// old dylib interface kept for backwards compatibility36// old dylib interface kept for backwards compatibility
...@@ -79,6 +76,8 @@ _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one...@@ -79,6 +76,8 @@ _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one
79template <std::size_t _Size>76template <std::size_t _Size>
80_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native(const void*) _NOEXCEPT;77_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native(const void*) _NOEXCEPT;
8178
79_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
80
82# if _LIBCPP_AVAILABILITY_HAS_NEW_SYNC81# if _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
8382
84template <class _AtomicWaitable, class _Poll>83template <class _AtomicWaitable, class _Poll>
...@@ -260,8 +259,8 @@ _LIBCPP_HIDE_FROM_ABI void __atomic_wait(_AtomicWaitable& __a, _Tp __val, memory...@@ -260,8 +259,8 @@ _LIBCPP_HIDE_FROM_ABI void __atomic_wait(_AtomicWaitable& __a, _Tp __val, memory
260 });259 });
261}260}
262261
263#endif // C++20
264
265_LIBCPP_END_NAMESPACE_STD262_LIBCPP_END_NAMESPACE_STD
266263
264#endif // _LIBCPP_STD_VER >= 20
265
267#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_H266#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_H
lib/libcxx/include/__atomic/atomic_sync_timed.h+9-14
...@@ -12,20 +12,12 @@...@@ -12,20 +12,12 @@
12#include <__atomic/atomic_waitable_traits.h>12#include <__atomic/atomic_waitable_traits.h>
13#include <__atomic/contention_t.h>13#include <__atomic/contention_t.h>
14#include <__atomic/memory_order.h>14#include <__atomic/memory_order.h>
15#include <__atomic/to_gcc_order.h>
16#include <__chrono/duration.h>15#include <__chrono/duration.h>
17#include <__config>16#include <__config>
18#include <__memory/addressof.h>17#include <__memory/addressof.h>
19#include <__thread/poll_with_backoff.h>18#include <__thread/poll_with_backoff.h>
20#include <__thread/timed_backoff_policy.h>19#include <__thread/timed_backoff_policy.h>
21#include <__type_traits/conjunction.h>
22#include <__type_traits/decay.h>20#include <__type_traits/decay.h>
23#include <__type_traits/has_unique_object_representation.h>
24#include <__type_traits/invoke.h>
25#include <__type_traits/is_same.h>
26#include <__type_traits/is_trivially_copyable.h>
27#include <__type_traits/void_t.h>
28#include <__utility/declval.h>
29#include <cstdint>21#include <cstdint>
30#include <cstring>22#include <cstring>
3123
...@@ -33,11 +25,13 @@...@@ -33,11 +25,13 @@
33# pragma GCC system_header25# pragma GCC system_header
34#endif26#endif
3527
28#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
29
36_LIBCPP_BEGIN_NAMESPACE_STD30_LIBCPP_BEGIN_NAMESPACE_STD
3731
38#if _LIBCPP_STD_VER >= 2032# if _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
39# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
4033
34_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
41_LIBCPP_AVAILABILITY_NEW_SYNC35_LIBCPP_AVAILABILITY_NEW_SYNC
42_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __address) _NOEXCEPT;36_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __address) _NOEXCEPT;
4337
...@@ -49,6 +43,7 @@ _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_globa...@@ -49,6 +43,7 @@ _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_globa
49template <std::size_t _Size>43template <std::size_t _Size>
50_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void44_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void
51__atomic_wait_native_with_timeout(void const* __address, void const* __old_value, uint64_t __timeout_ns) _NOEXCEPT;45__atomic_wait_native_with_timeout(void const* __address, void const* __old_value, uint64_t __timeout_ns) _NOEXCEPT;
46_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
5247
53template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>48template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>
54struct __atomic_wait_timed_backoff_impl {49struct __atomic_wait_timed_backoff_impl {
...@@ -116,7 +111,7 @@ _LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(...@@ -116,7 +111,7 @@ _LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(
116 return __poll_result == __poll_with_backoff_results::__poll_success;111 return __poll_result == __poll_with_backoff_results::__poll_success;
117}112}
118113
119# elif _LIBCPP_HAS_THREADS // _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC114# else // _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
120115
121template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>116template <class _AtomicWaitable, class _Poll, class _Rep, class _Period>
122_LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(117_LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(
...@@ -135,10 +130,10 @@ _LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(...@@ -135,10 +130,10 @@ _LIBCPP_HIDE_FROM_ABI bool __atomic_wait_unless_with_timeout(
135 return __res == __poll_with_backoff_results::__poll_success;130 return __res == __poll_with_backoff_results::__poll_success;
136}131}
137132
138# endif // _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC133# endif // _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
139
140#endif // C++20
141134
142_LIBCPP_END_NAMESPACE_STD135_LIBCPP_END_NAMESPACE_STD
143136
137#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
138
144#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_TIMED_H139#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_TIMED_H
lib/libcxx/include/__atomic/atomic_waitable_traits.h+4-6
...@@ -16,18 +16,16 @@...@@ -16,18 +16,16 @@
16#include <__type_traits/has_unique_object_representation.h>16#include <__type_traits/has_unique_object_representation.h>
17#include <__type_traits/is_same.h>17#include <__type_traits/is_same.h>
18#include <__type_traits/is_trivially_copyable.h>18#include <__type_traits/is_trivially_copyable.h>
19#include <__type_traits/void_t.h>
20#include <__utility/declval.h>
21#include <cstring>19#include <cstring>
2220
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24# pragma GCC system_header22# pragma GCC system_header
25#endif23#endif
2624
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 2025#if _LIBCPP_STD_VER >= 20
3026
27_LIBCPP_BEGIN_NAMESPACE_STD
28
31// The customisation points to enable the following functions:29// The customisation points to enable the following functions:
32// - __atomic_wait30// - __atomic_wait
33// - __atomic_wait_unless31// - __atomic_wait_unless
...@@ -96,8 +94,8 @@ concept __has_native_atomic_wait = is_same_v<_Tp, __cxx_contention_t>;...@@ -96,8 +94,8 @@ concept __has_native_atomic_wait = is_same_v<_Tp, __cxx_contention_t>;
9694
97# endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE95# endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
9896
99#endif // C++20
100
101_LIBCPP_END_NAMESPACE_STD97_LIBCPP_END_NAMESPACE_STD
10298
99#endif // _LIBCPP_STD_VER >= 20
100
103#endif // _LIBCPP___ATOMIC_ATOMIC_WAITABLE_TRAITS_H101#endif // _LIBCPP___ATOMIC_ATOMIC_WAITABLE_TRAITS_H
lib/libcxx/include/__atomic/contention_t.h+4-4
...@@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
25// instead.25// instead.
26#if defined(_LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE)26#if defined(_LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE)
2727
28# ifdef __linux__28# if defined(__linux__) || defined(__Fuchsia__)
29using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;29using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
30# elif defined(__APPLE__)30# elif defined(__APPLE__)
31using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;31using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
...@@ -37,15 +37,15 @@ using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;...@@ -37,15 +37,15 @@ using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
37using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;37using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
38# else38# else
39using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;39using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
40# endif // __linux__40# endif // __linux__ || __Fuchsia__
4141
42#else // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE42#else // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
4343
44# if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))44# if defined(__linux__) || defined(__Fuchsia__) || (defined(_AIX) && !defined(__64BIT__))
45using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;45using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
46# else46# else
47using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;47using __cxx_contention_t _LIBCPP_NODEBUG = int64_t;
48# endif // __linux__ || (_AIX && !__64BIT__)48# endif // __linux__ || __Fuchsia__ || (_AIX && !__64BIT__)
4949
50#endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE50#endif // _LIBCPP_ABI_ATOMIC_WAIT_NATIVE_BY_SIZE
5151
lib/libcxx/include/__atomic/floating_point_helper.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Tp>24template <class _Tp>
25_LIBCPP_HIDE_FROM_ABI constexpr bool __is_fp80_long_double() {25_LIBCPP_HIDE_FROM_ABI constexpr bool __is_fp80_long_double() {
26 // Only x87-fp80 long double has 64-bit mantissa26 // Only x87-fp80 long double has 64-bit mantissa
...@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __has_rmw_builtin() {...@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __has_rmw_builtin() {
48# endif48# endif
49}49}
5050
51#endif
52
53_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
5452
53#endif // _LIBCPP_STD_VER >= 20
54
55#endif // _LIBCPP___ATOMIC_FLOATING_POINT_HELPER_H55#endif // _LIBCPP___ATOMIC_FLOATING_POINT_HELPER_H
lib/libcxx/include/__atomic/support.h+2-2
...@@ -102,9 +102,9 @@...@@ -102,9 +102,9 @@
102// clang-format on102// clang-format on
103//103//
104104
105#if _LIBCPP_HAS_GCC_ATOMIC_IMP105#ifdef _LIBCPP_COMPILER_GCC
106# include <__atomic/support/gcc.h>106# include <__atomic/support/gcc.h>
107#elif _LIBCPP_HAS_C_ATOMIC_IMP107#else
108# include <__atomic/support/c11.h>108# include <__atomic/support/c11.h>
109#endif109#endif
110110
lib/libcxx/include/__bit/bit_cast.h+6-6
...@@ -17,18 +17,16 @@...@@ -17,18 +17,16 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#ifndef _LIBCPP_CXX03_LANG20#ifndef _LIBCPP_CXX03_LANG
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _ToType, class _FromType>24template <class _ToType, class _FromType>
25[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr _ToType __bit_cast(const _FromType& __from) noexcept {25[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr _ToType __bit_cast(const _FromType& __from) noexcept {
26 return __builtin_bit_cast(_ToType, __from);26 return __builtin_bit_cast(_ToType, __from);
27}27}
2828
29#endif // _LIBCPP_CXX03_LANG29# if _LIBCPP_STD_VER >= 20
30
31#if _LIBCPP_STD_VER >= 20
3230
33template <class _ToType, class _FromType>31template <class _ToType, class _FromType>
34 requires(sizeof(_ToType) == sizeof(_FromType) && is_trivially_copyable_v<_ToType> &&32 requires(sizeof(_ToType) == sizeof(_FromType) && is_trivially_copyable_v<_ToType> &&
...@@ -37,8 +35,10 @@ template <class _ToType, class _FromType>...@@ -37,8 +35,10 @@ template <class _ToType, class _FromType>
37 return __builtin_bit_cast(_ToType, __from);35 return __builtin_bit_cast(_ToType, __from);
38}36}
3937
40#endif // _LIBCPP_STD_VER >= 2038# endif // _LIBCPP_STD_VER >= 20
4139
42_LIBCPP_END_NAMESPACE_STD40_LIBCPP_END_NAMESPACE_STD
4341
42#endif // _LIBCPP_CXX03_LANG
43
44#endif // _LIBCPP___BIT_BIT_CAST_H44#endif // _LIBCPP___BIT_BIT_CAST_H
lib/libcxx/include/__bit/bit_ceil.h+4-3
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <class _Tp>26template <class _Tp>
27[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_ceil(_Tp __t) noexcept {27[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_ceil(_Tp __t) noexcept {
28 if (__t < 2)28 if (__t < 2)
...@@ -47,8 +47,9 @@ template <__unsigned_integer _Tp>...@@ -47,8 +47,9 @@ template <__unsigned_integer _Tp>
47}47}
4848
49# endif // _LIBCPP_STD_VER >= 2049# endif // _LIBCPP_STD_VER >= 20
50#endif // _LIBCPP_STD_VER >= 17
5150
52_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
5352
53#endif // _LIBCPP_STD_VER >= 17
54
54#endif // _LIBCPP___BIT_BIT_CEIL_H55#endif // _LIBCPP___BIT_BIT_CEIL_H
lib/libcxx/include/__bit/byteswap.h+25-6
...@@ -12,7 +12,11 @@...@@ -12,7 +12,11 @@
1212
13#include <__concepts/arithmetic.h>13#include <__concepts/arithmetic.h>
14#include <__config>14#include <__config>
15#include <__type_traits/is_same.h>
16#include <__type_traits/remove_cv.h>
17#include <climits>
15#include <cstdint>18#include <cstdint>
19#include <limits>
1620
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header22# pragma GCC system_header
...@@ -24,26 +28,41 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -24,26 +28,41 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2428
25template <integral _Tp>29template <integral _Tp>
26[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {30[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
31 // [bit.byteswap]/Mandates: T does not have padding bits.
32 // bool is grandfathered: every shipping implementation admits it and the
33 // size-1 identity path can't shuffle padding bits into value positions.
34 // LWG 4583 proposes relaxing this to allow byte-aligned padding (e.g.
35 // _BitInt(48) where 2 whole bytes are padding); revisit once it resolves.
36 static_assert(is_same_v<remove_cv_t<_Tp>, bool> ||
37 numeric_limits<_Tp>::digits + numeric_limits<_Tp>::is_signed == sizeof(_Tp) * CHAR_BIT,
38 "std::byteswap requires T to have no padding bits");
39
27 if constexpr (sizeof(_Tp) == 1) {40 if constexpr (sizeof(_Tp) == 1) {
28 return __val;41 return __val;
42# if __has_builtin(__builtin_bswapg)
43 } else {
44 return __builtin_bswapg(__val);
45 }
46# else
29 } else if constexpr (sizeof(_Tp) == 2) {47 } else if constexpr (sizeof(_Tp) == 2) {
30 return __builtin_bswap16(__val);48 return __builtin_bswap16(__val);
31 } else if constexpr (sizeof(_Tp) == 4) {49 } else if constexpr (sizeof(_Tp) == 4) {
32 return __builtin_bswap32(__val);50 return __builtin_bswap32(__val);
33 } else if constexpr (sizeof(_Tp) == 8) {51 } else if constexpr (sizeof(_Tp) == 8) {
34 return __builtin_bswap64(__val);52 return __builtin_bswap64(__val);
35# if _LIBCPP_HAS_INT12853# if _LIBCPP_HAS_INT128
36 } else if constexpr (sizeof(_Tp) == 16) {54 } else if constexpr (sizeof(_Tp) == 16) {
37# if __has_builtin(__builtin_bswap128)55# if __has_builtin(__builtin_bswap128)
38 return __builtin_bswap128(__val);56 return __builtin_bswap128(__val);
39# else57# else
40 return static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val))) << 64 |58 return (static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val))) << 64) |
41 static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val >> 64)));59 static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val >> 64)));
42# endif // __has_builtin(__builtin_bswap128)60# endif // __has_builtin(__builtin_bswap128)
43# endif // _LIBCPP_HAS_INT12861# endif // _LIBCPP_HAS_INT128
44 } else {62 } else {
45 static_assert(sizeof(_Tp) == 0, "byteswap is unimplemented for integral types of this size");63 static_assert(sizeof(_Tp) == 0, "byteswap is unimplemented for integral types of this size");
46 }64 }
65# endif // __has_builtin(__builtin_bswapg)
47}66}
4867
49#endif // _LIBCPP_STD_VER >= 2368#endif // _LIBCPP_STD_VER >= 23
lib/libcxx/include/__bit_reference+164-23
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16#include <__algorithm/copy_n.h>16#include <__algorithm/copy_n.h>
17#include <__algorithm/equal.h>17#include <__algorithm/equal.h>
18#include <__algorithm/fill_n.h>18#include <__algorithm/fill_n.h>
19#include <__algorithm/in_out_result.h>
19#include <__algorithm/min.h>20#include <__algorithm/min.h>
20#include <__algorithm/rotate.h>21#include <__algorithm/rotate.h>
21#include <__algorithm/specialized_algorithms.h>22#include <__algorithm/specialized_algorithms.h>
22#include <__algorithm/swap_ranges.h>
23#include <__assert>23#include <__assert>
24#include <__bit/countr.h>24#include <__bit/countr.h>
25#include <__compare/ordering.h>25#include <__compare/ordering.h>
...@@ -35,7 +35,6 @@...@@ -35,7 +35,6 @@
35#include <__type_traits/desugars_to.h>35#include <__type_traits/desugars_to.h>
36#include <__type_traits/enable_if.h>36#include <__type_traits/enable_if.h>
37#include <__type_traits/is_constant_evaluated.h>37#include <__type_traits/is_constant_evaluated.h>
38#include <__type_traits/is_same.h>
39#include <__type_traits/is_unsigned.h>38#include <__type_traits/is_unsigned.h>
40#include <__type_traits/void_t.h>39#include <__type_traits/void_t.h>
41#include <__utility/pair.h>40#include <__utility/pair.h>
...@@ -166,9 +165,6 @@ public:...@@ -166,9 +165,6 @@ public:
166 }165 }
167166
168 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void flip() _NOEXCEPT { *__seg_ ^= __mask_; }167 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void flip() _NOEXCEPT { *__seg_ ^= __mask_; }
169 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cp, false> operator&() const _NOEXCEPT {
170 return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(std::__countr_zero(__mask_)));
171 }
172168
173private:169private:
174 _LIBCPP_HIDE_FROM_ABI170 _LIBCPP_HIDE_FROM_ABI
...@@ -340,7 +336,7 @@ public:...@@ -340,7 +336,7 @@ public:
340 }336 }
341#endif337#endif
342338
343 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator*() const _NOEXCEPT {339 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator*() const _NOEXCEPT {
344 _LIBCPP_ASSERT_INTERNAL(__ctz_ < __bits_per_word, "Dereferencing an invalid __bit_iterator.");340 _LIBCPP_ASSERT_INTERNAL(__ctz_ < __bits_per_word, "Dereferencing an invalid __bit_iterator.");
345 return __conditional_t<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >(341 return __conditional_t<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >(
346 __seg_, __storage_type(1) << __ctz_);342 __seg_, __storage_type(1) << __ctz_);
...@@ -393,29 +389,32 @@ public:...@@ -393,29 +389,32 @@ public:
393 return *this += -__n;389 return *this += -__n;
394 }390 }
395391
396 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator operator+(difference_type __n) const {392 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator
393 operator+(difference_type __n) const {
397 __bit_iterator __t(*this);394 __bit_iterator __t(*this);
398 __t += __n;395 __t += __n;
399 return __t;396 return __t;
400 }397 }
401398
402 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator operator-(difference_type __n) const {399 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator
400 operator-(difference_type __n) const {
403 __bit_iterator __t(*this);401 __bit_iterator __t(*this);
404 __t -= __n;402 __t -= __n;
405 return __t;403 return __t;
406 }404 }
407405
408 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator406 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator
409 operator+(difference_type __n, const __bit_iterator& __it) {407 operator+(difference_type __n, const __bit_iterator& __it) {
410 return __it + __n;408 return __it + __n;
411 }409 }
412410
413 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend difference_type411 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 friend difference_type
414 operator-(const __bit_iterator& __x, const __bit_iterator& __y) {412 operator-(const __bit_iterator& __x, const __bit_iterator& __y) {
415 return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;413 return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;
416 }414 }
417415
418 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](difference_type __n) const {416 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference
417 operator[](difference_type __n) const {
419 return *(*this + __n);418 return *(*this + __n);
420 }419 }
421420
...@@ -487,15 +486,6 @@ private:...@@ -487,15 +486,6 @@ private:
487 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result);486 __bit_iterator<_Dp, _IC> __first, __bit_iterator<_Dp, _IC> __last, __bit_iterator<_Dp, false> __result);
488 template <class _AlgPolicy>487 template <class _AlgPolicy>
489 friend struct __copy_backward_impl;488 friend struct __copy_backward_impl;
490 template <class _Cl, class _Cr>
491 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Cr, false>
492 __swap_ranges_aligned(__bit_iterator<_Cl, false>, __bit_iterator<_Cl, false>, __bit_iterator<_Cr, false>);
493 template <class _Cl, class _Cr>
494 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Cr, false>
495 __swap_ranges_unaligned(__bit_iterator<_Cl, false>, __bit_iterator<_Cl, false>, __bit_iterator<_Cr, false>);
496 template <class, class _Cl, class _Cr>
497 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend pair<__bit_iterator<_Cl, false>, __bit_iterator<_Cr, false> >
498 __swap_ranges(__bit_iterator<_Cl, false>, __bit_iterator<_Cl, false>, __bit_iterator<_Cr, false>);
499 template <class, class _Dp>489 template <class, class _Dp>
500 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend pair<__bit_iterator<_Dp, false>, __bit_iterator<_Dp, false> >490 _LIBCPP_CONSTEXPR_SINCE_CXX20 friend pair<__bit_iterator<_Dp, false>, __bit_iterator<_Dp, false> >
501 __rotate(__bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>);491 __rotate(__bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>);
...@@ -718,13 +708,164 @@ struct __specialized_algorithm<_Algorithm::__copy,...@@ -718,13 +708,164 @@ struct __specialized_algorithm<_Algorithm::__copy,
718 }708 }
719709
720 _LIBCPP_HIDE_FROM_ABI710 _LIBCPP_HIDE_FROM_ABI
721 _LIBCPP_CONSTEXPR_SINCE_CXX20 static pair<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >711 _LIBCPP_CONSTEXPR_SINCE_CXX20 static __in_out_result<__bit_iterator<_Cp, _IsConst>, __bit_iterator<_Cp, false> >
722 operator()(__bit_iterator<_Cp, _IsConst> __first,712 operator()(__bit_iterator<_Cp, _IsConst> __first,
723 __bit_iterator<_Cp, _IsConst> __last,713 __bit_iterator<_Cp, _IsConst> __last,
724 __bit_iterator<_Cp, false> __result) {714 __bit_iterator<_Cp, false> __result) {
725 if (__first.__ctz_ == __result.__ctz_)715 if (__first.__ctz_ == __result.__ctz_)
726 return std::make_pair(__last, __aligned_impl(__first, __last, __result));716 return {__last, __aligned_impl(__first, __last, __result)};
727 return std::make_pair(__last, __unaligned_impl(__first, __last, __result));717 return {__last, __unaligned_impl(__first, __last, __result)};
718 }
719};
720
721template <class _Cl, class _Cr>
722struct __specialized_algorithm<_Algorithm::__swap_ranges,
723 __iterator_pair<__bit_iterator<_Cl, false>, __bit_iterator<_Cl, false> >,
724 __single_iterator<__bit_iterator<_Cr, false> > > {
725 static const bool __has_algorithm = true;
726
727 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cr, false> __aligned_impl(
728 __bit_iterator<_Cl, false> __first, __bit_iterator<_Cl, false> __last, __bit_iterator<_Cr, false> __result) {
729 using _I1 = __bit_iterator<_Cl, false>;
730 using difference_type = typename _I1::difference_type;
731 using __storage_type = typename _I1::__storage_type;
732
733 const int __bits_per_word = _I1::__bits_per_word;
734 difference_type __n = __last - __first;
735 if (__n > 0) {
736 // do first word
737 if (__first.__ctz_ != 0) {
738 unsigned __clz = __bits_per_word - __first.__ctz_;
739 difference_type __dn = std::min(static_cast<difference_type>(__clz), __n);
740 __n -= __dn;
741 __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
742 __storage_type __b1 = *__first.__seg_ & __m;
743 *__first.__seg_ &= ~__m;
744 __storage_type __b2 = *__result.__seg_ & __m;
745 *__result.__seg_ &= ~__m;
746 *__result.__seg_ |= __b1;
747 *__first.__seg_ |= __b2;
748 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
749 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
750 ++__first.__seg_;
751 // __first.__ctz_ = 0;
752 }
753 // __first.__ctz_ == 0;
754 // do middle words
755 for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_, ++__result.__seg_)
756 swap(*__first.__seg_, *__result.__seg_);
757 // do last word
758 if (__n > 0) {
759 __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
760 __storage_type __b1 = *__first.__seg_ & __m;
761 *__first.__seg_ &= ~__m;
762 __storage_type __b2 = *__result.__seg_ & __m;
763 *__result.__seg_ &= ~__m;
764 *__result.__seg_ |= __b1;
765 *__first.__seg_ |= __b2;
766 __result.__ctz_ = static_cast<unsigned>(__n);
767 }
768 }
769 return __result;
770 }
771
772 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator<_Cr, false> __unaligned_impl(
773 __bit_iterator<_Cl, false> __first, __bit_iterator<_Cl, false> __last, __bit_iterator<_Cr, false> __result) {
774 using _I1 = __bit_iterator<_Cl, false>;
775 using difference_type = typename _I1::difference_type;
776 using __storage_type = typename _I1::__storage_type;
777
778 const int __bits_per_word = _I1::__bits_per_word;
779 difference_type __n = __last - __first;
780 if (__n > 0) {
781 // do first word
782 if (__first.__ctz_ != 0) {
783 unsigned __clz_f = __bits_per_word - __first.__ctz_;
784 difference_type __dn = std::min(static_cast<difference_type>(__clz_f), __n);
785 __n -= __dn;
786 __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
787 __storage_type __b1 = *__first.__seg_ & __m;
788 *__first.__seg_ &= ~__m;
789 unsigned __clz_r = __bits_per_word - __result.__ctz_;
790 __storage_type __ddn = std::min<__storage_type>(__dn, __clz_r);
791 __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
792 __storage_type __b2 = *__result.__seg_ & __m;
793 *__result.__seg_ &= ~__m;
794 if (__result.__ctz_ > __first.__ctz_) {
795 unsigned __s = __result.__ctz_ - __first.__ctz_;
796 *__result.__seg_ |= __b1 << __s;
797 *__first.__seg_ |= __b2 >> __s;
798 } else {
799 unsigned __s = __first.__ctz_ - __result.__ctz_;
800 *__result.__seg_ |= __b1 >> __s;
801 *__first.__seg_ |= __b2 << __s;
802 }
803 __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word;
804 __result.__ctz_ = static_cast<unsigned>((__ddn + __result.__ctz_) % __bits_per_word);
805 __dn -= __ddn;
806 if (__dn > 0) {
807 __m = ~__storage_type(0) >> (__bits_per_word - __dn);
808 __b2 = *__result.__seg_ & __m;
809 *__result.__seg_ &= ~__m;
810 unsigned __s = __first.__ctz_ + __ddn;
811 *__result.__seg_ |= __b1 >> __s;
812 *__first.__seg_ |= __b2 << __s;
813 __result.__ctz_ = static_cast<unsigned>(__dn);
814 }
815 ++__first.__seg_;
816 // __first.__ctz_ = 0;
817 }
818 // __first.__ctz_ == 0;
819 // do middle words
820 __storage_type __m = ~__storage_type(0) << __result.__ctz_;
821 unsigned __clz_r = __bits_per_word - __result.__ctz_;
822 for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) {
823 __storage_type __b1 = *__first.__seg_;
824 __storage_type __b2 = *__result.__seg_ & __m;
825 *__result.__seg_ &= ~__m;
826 *__result.__seg_ |= __b1 << __result.__ctz_;
827 *__first.__seg_ = __b2 >> __result.__ctz_;
828 ++__result.__seg_;
829 __b2 = *__result.__seg_ & ~__m;
830 *__result.__seg_ &= __m;
831 *__result.__seg_ |= __b1 >> __clz_r;
832 *__first.__seg_ |= __b2 << __clz_r;
833 }
834 // do last word
835 if (__n > 0) {
836 __m = ~__storage_type(0) >> (__bits_per_word - __n);
837 __storage_type __b1 = *__first.__seg_ & __m;
838 *__first.__seg_ &= ~__m;
839 __storage_type __dn = std::min<__storage_type>(__n, __clz_r);
840 __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
841 __storage_type __b2 = *__result.__seg_ & __m;
842 *__result.__seg_ &= ~__m;
843 *__result.__seg_ |= __b1 << __result.__ctz_;
844 *__first.__seg_ |= __b2 >> __result.__ctz_;
845 __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word;
846 __result.__ctz_ = static_cast<unsigned>((__dn + __result.__ctz_) % __bits_per_word);
847 __n -= __dn;
848 if (__n > 0) {
849 __m = ~__storage_type(0) >> (__bits_per_word - __n);
850 __b2 = *__result.__seg_ & __m;
851 *__result.__seg_ &= ~__m;
852 *__result.__seg_ |= __b1 >> __dn;
853 *__first.__seg_ |= __b2 << __dn;
854 __result.__ctz_ = static_cast<unsigned>(__n);
855 }
856 }
857 }
858 return __result;
859 }
860
861 _LIBCPP_HIDE_FROM_ABI static
862 _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__bit_iterator<_Cl, false>, __bit_iterator<_Cr, false> >
863 operator()(__bit_iterator<_Cl, false> __first1,
864 __bit_iterator<_Cl, false> __last1,
865 __bit_iterator<_Cr, false> __first2) {
866 if (__first1.__ctz_ == __first2.__ctz_)
867 return std::make_pair(__last1, __aligned_impl(__first1, __last1, __first2));
868 return std::make_pair(__last1, __unaligned_impl(__first1, __last1, __first2));
728 }869 }
729};870};
730871
lib/libcxx/include/__charconv/from_chars_floating_point.h+2
...@@ -35,6 +35,7 @@ struct __from_chars_result {...@@ -35,6 +35,7 @@ struct __from_chars_result {
35 errc __ec;35 errc __ec;
36};36};
3737
38_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
38template <class _Fp>39template <class _Fp>
39_LIBCPP_EXPORTED_FROM_ABI __from_chars_result<_Fp> __from_chars_floating_point(40_LIBCPP_EXPORTED_FROM_ABI __from_chars_result<_Fp> __from_chars_floating_point(
40 _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);41 _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);
...@@ -44,6 +45,7 @@ extern template __from_chars_result<float> __from_chars_floating_point(...@@ -44,6 +45,7 @@ extern template __from_chars_result<float> __from_chars_floating_point(
4445
45extern template __from_chars_result<double> __from_chars_floating_point(46extern template __from_chars_result<double> __from_chars_floating_point(
46 _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);47 _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);
48_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
4749
48template <class _Fp>50template <class _Fp>
49_LIBCPP_HIDE_FROM_ABI from_chars_result51_LIBCPP_HIDE_FROM_ABI from_chars_result
lib/libcxx/include/__charconv/from_chars_integral.h+1-4
...@@ -10,12 +10,10 @@...@@ -10,12 +10,10 @@
10#ifndef _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H10#ifndef _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
11#define _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H11#define _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
1212
13#include <__algorithm/copy_n.h>
14#include <__assert>13#include <__assert>
15#include <__charconv/from_chars_result.h>14#include <__charconv/from_chars_result.h>
16#include <__charconv/traits.h>15#include <__charconv/traits.h>
17#include <__config>16#include <__config>
18#include <__memory/addressof.h>
19#include <__system_error/errc.h>17#include <__system_error/errc.h>
20#include <__type_traits/enable_if.h>18#include <__type_traits/enable_if.h>
21#include <__type_traits/is_integral.h>19#include <__type_traits/is_integral.h>
...@@ -56,8 +54,7 @@ __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)...@@ -56,8 +54,7 @@ __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
5654
57 if (__neg) {55 if (__neg) {
58 if (__x <= std::__complement(std::__to_unsigned_like(__tl::min()))) {56 if (__x <= std::__complement(std::__to_unsigned_like(__tl::min()))) {
59 __x = std::__complement(__x);57 __value = std::__complement(__x);
60 std::copy_n(std::addressof(__x), 1, std::addressof(__value));
61 return __r;58 return __r;
62 }59 }
63 } else {60 } else {
lib/libcxx/include/__charconv/to_chars.h-4
...@@ -18,8 +18,4 @@...@@ -18,8 +18,4 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23_LIBCPP_END_NAMESPACE_STD
24
25#endif // _LIBCPP___CHARCONV_TO_CHARS21#endif // _LIBCPP___CHARCONV_TO_CHARS
lib/libcxx/include/__charconv/to_chars_floating_point.h+2
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23#if _LIBCPP_STD_VER >= 1724#if _LIBCPP_STD_VER >= 17
2425
...@@ -50,6 +51,7 @@ _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_...@@ -50,6 +51,7 @@ _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_
50to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);51to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
51#endif // _LIBCPP_STD_VER >= 1752#endif // _LIBCPP_STD_VER >= 17
5253
54_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
53_LIBCPP_END_NAMESPACE_STD55_LIBCPP_END_NAMESPACE_STD
5456
55#endif // _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H57#endif // _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
lib/libcxx/include/__chrono/convert_to_tm.h+4-1
...@@ -127,7 +127,10 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(chrono::tai_time<_Duration> __tp) {...@@ -127,7 +127,10 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(chrono::tai_time<_Duration> __tp) {
127127
128template <class _Tm, class _Duration>128template <class _Tm, class _Duration>
129_LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(chrono::gps_time<_Duration> __tp) {129_LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(chrono::gps_time<_Duration> __tp) {
130 return std::__convert_to_tm<_Tm>(chrono::utc_clock::to_sys(chrono::gps_clock::to_utc(__tp)));130 using _Rp = common_type_t<_Duration, chrono::seconds>;
131 // The time between the GPS epoch (1980-01-06) and UNIX epoch (1970-01-01).
132 constexpr chrono::seconds __offset{3657 * 24 * 60 * 60};
133 return std::__convert_to_tm<_Tm>(chrono::sys_time<_Rp>{__tp.time_since_epoch() + __offset});
131}134}
132135
133# endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB136# endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/day.h+8-6
...@@ -55,7 +55,7 @@ public:...@@ -55,7 +55,7 @@ public:
55 _LIBCPP_HIDE_FROM_ABI constexpr day& operator+=(const days& __dd) noexcept;55 _LIBCPP_HIDE_FROM_ABI constexpr day& operator+=(const days& __dd) noexcept;
56 _LIBCPP_HIDE_FROM_ABI constexpr day& operator-=(const days& __dd) noexcept;56 _LIBCPP_HIDE_FROM_ABI constexpr day& operator-=(const days& __dd) noexcept;
57 _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d_; }57 _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d_; }
58 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d_ >= 1 && __d_ <= 31; }58 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d_ >= 1 && __d_ <= 31; }
59};59};
6060
61_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const day& __lhs, const day& __rhs) noexcept {61_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const day& __lhs, const day& __rhs) noexcept {
...@@ -66,19 +66,19 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(const day& __...@@ -66,19 +66,19 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(const day& __
66 return static_cast<unsigned>(__lhs) <=> static_cast<unsigned>(__rhs);66 return static_cast<unsigned>(__lhs) <=> static_cast<unsigned>(__rhs);
67}67}
6868
69_LIBCPP_HIDE_FROM_ABI inline constexpr day operator+(const day& __lhs, const days& __rhs) noexcept {69[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr day operator+(const day& __lhs, const days& __rhs) noexcept {
70 return day(static_cast<unsigned>(__lhs) + __rhs.count());70 return day(static_cast<unsigned>(__lhs) + __rhs.count());
71}71}
7272
73_LIBCPP_HIDE_FROM_ABI inline constexpr day operator+(const days& __lhs, const day& __rhs) noexcept {73[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr day operator+(const days& __lhs, const day& __rhs) noexcept {
74 return __rhs + __lhs;74 return __rhs + __lhs;
75}75}
7676
77_LIBCPP_HIDE_FROM_ABI inline constexpr day operator-(const day& __lhs, const days& __rhs) noexcept {77[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr day operator-(const day& __lhs, const days& __rhs) noexcept {
78 return __lhs + -__rhs;78 return __lhs + -__rhs;
79}79}
8080
81_LIBCPP_HIDE_FROM_ABI inline constexpr days operator-(const day& __lhs, const day& __rhs) noexcept {81[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr days operator-(const day& __lhs, const day& __rhs) noexcept {
82 return days(static_cast<int>(static_cast<unsigned>(__lhs)) - static_cast<int>(static_cast<unsigned>(__rhs)));82 return days(static_cast<int>(static_cast<unsigned>(__lhs)) - static_cast<int>(static_cast<unsigned>(__rhs)));
83}83}
8484
...@@ -98,7 +98,9 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr day& day::operator-=(const days& __dd) no...@@ -98,7 +98,9 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr day& day::operator-=(const days& __dd) no
9898
99template <>99template <>
100struct hash<chrono::day> {100struct hash<chrono::day> {
101 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::day& __d) noexcept { return static_cast<unsigned>(__d); }101 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::day& __d) noexcept {
102 return static_cast<unsigned>(__d);
103 }
102};104};
103105
104# endif // _LIBCPP_STD_VER >= 26106# endif // _LIBCPP_STD_VER >= 26
lib/libcxx/include/__chrono/duration.h+12-38
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#include <__type_traits/enable_if.h>19#include <__type_traits/enable_if.h>
20#include <__type_traits/is_convertible.h>20#include <__type_traits/is_convertible.h>
21#include <__type_traits/is_floating_point.h>21#include <__type_traits/is_floating_point.h>
22#include <__type_traits/is_unqualified.h>
22#include <limits>23#include <limits>
23#include <ratio>24#include <ratio>
2425
...@@ -164,6 +165,7 @@ template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duratio...@@ -164,6 +165,7 @@ template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duratio
164165
165template <class _Rep, class _Period>166template <class _Rep, class _Period>
166class duration {167class duration {
168 static_assert(__is_unqualified_v<_Rep>, "A duration representation cannot be qualified");
167 static_assert(!__is_duration_v<_Rep>, "A duration representation can not be a duration");169 static_assert(!__is_duration_v<_Rep>, "A duration representation can not be a duration");
168 static_assert(__is_ratio_v<_Period>, "Second template parameter of duration must be a std::ratio");170 static_assert(__is_ratio_v<_Period>, "Second template parameter of duration must be a std::ratio");
169 static_assert(_Period::num > 0, "duration period must be positive");171 static_assert(_Period::num > 0, "duration period must be positive");
...@@ -291,35 +293,21 @@ typedef duration<long long, nano> nanoseconds;...@@ -291,35 +293,21 @@ typedef duration<long long, nano> nanoseconds;
291typedef duration<long long, micro> microseconds;293typedef duration<long long, micro> microseconds;
292typedef duration<long long, milli> milliseconds;294typedef duration<long long, milli> milliseconds;
293typedef duration<long long > seconds;295typedef duration<long long > seconds;
294typedef duration< long, ratio< 60> > minutes;296typedef duration<long, ratio<60> > minutes;
295typedef duration< long, ratio<3600> > hours;297typedef duration<long, ratio<60 * 60> > hours;
296#if _LIBCPP_STD_VER >= 20298#if _LIBCPP_STD_VER >= 20
297typedef duration< int, ratio_multiply<ratio<24>, hours::period>> days;299typedef duration<int, ratio<60 * 60 * 24>> days;
298typedef duration< int, ratio_multiply<ratio<7>, days::period>> weeks;300typedef duration<int, ratio<60 * 60 * 24 * 7>> weeks;
299typedef duration< int, ratio_multiply<ratio<146097, 400>, days::period>> years;301typedef duration<int, ratio<static_cast<int>(365.2425 * 60 * 60 * 24)>> years;
300typedef duration< int, ratio_divide<years::period, ratio<12>>> months;302typedef duration<int, ratio<static_cast<int>(365.2425 * 60 * 60 * 24) / 12>> months;
301#endif303#endif
302// Duration ==304// Duration ==
303305
304template <class _LhsDuration, class _RhsDuration>
305struct __duration_eq {
306 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const {
307 typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
308 return _Ct(__lhs).count() == _Ct(__rhs).count();
309 }
310};
311
312template <class _LhsDuration>
313struct __duration_eq<_LhsDuration, _LhsDuration> {
314 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {
315 return __lhs.count() == __rhs.count();
316 }
317};
318
319template <class _Rep1, class _Period1, class _Rep2, class _Period2>306template <class _Rep1, class _Period1, class _Rep2, class _Period2>
320inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool307inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
321operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {308operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
322 return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);309 using _Ct = typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type;
310 return _Ct(__lhs).count() == _Ct(__rhs).count();
323}311}
324312
325#if _LIBCPP_STD_VER <= 17313#if _LIBCPP_STD_VER <= 17
...@@ -336,25 +324,11 @@ operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period...@@ -336,25 +324,11 @@ operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
336324
337// Duration <325// Duration <
338326
339template <class _LhsDuration, class _RhsDuration>
340struct __duration_lt {
341 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const {
342 typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
343 return _Ct(__lhs).count() < _Ct(__rhs).count();
344 }
345};
346
347template <class _LhsDuration>
348struct __duration_lt<_LhsDuration, _LhsDuration> {
349 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {
350 return __lhs.count() < __rhs.count();
351 }
352};
353
354template <class _Rep1, class _Period1, class _Rep2, class _Period2>327template <class _Rep1, class _Period1, class _Rep2, class _Period2>
355inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool328inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
356operator<(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {329operator<(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
357 return __duration_lt<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);330 using _Ct = typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type;
331 return _Ct(__lhs).count() < _Ct(__rhs).count();
358}332}
359333
360// Duration >334// Duration >
lib/libcxx/include/__chrono/exception.h+2
...@@ -31,6 +31,7 @@...@@ -31,6 +31,7 @@
31# endif31# endif
3232
33_LIBCPP_BEGIN_NAMESPACE_STD33_LIBCPP_BEGIN_NAMESPACE_STD
34_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3435
35# if _LIBCPP_STD_VER >= 2036# if _LIBCPP_STD_VER >= 20
3637
...@@ -128,6 +129,7 @@ template <class _Duration>...@@ -128,6 +129,7 @@ template <class _Duration>
128129
129# endif // _LIBCPP_STD_VER >= 20130# endif // _LIBCPP_STD_VER >= 20
130131
132_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
131_LIBCPP_END_NAMESPACE_STD133_LIBCPP_END_NAMESPACE_STD
132134
133#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB135#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/file_clock.h+4
...@@ -46,6 +46,8 @@ _LIBCPP_END_NAMESPACE_STD...@@ -46,6 +46,8 @@ _LIBCPP_END_NAMESPACE_STD
4646
47#ifndef _LIBCPP_CXX03_LANG47#ifndef _LIBCPP_CXX03_LANG
48_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM48_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
49_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
50
49struct _FilesystemClock {51struct _FilesystemClock {
50# if _LIBCPP_HAS_INT12852# if _LIBCPP_HAS_INT128
51 typedef __int128_t rep;53 typedef __int128_t rep;
...@@ -76,6 +78,8 @@ struct _FilesystemClock {...@@ -76,6 +78,8 @@ struct _FilesystemClock {
76 }78 }
77# endif // _LIBCPP_STD_VER >= 2079# endif // _LIBCPP_STD_VER >= 20
78};80};
81
82_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
79_LIBCPP_END_NAMESPACE_FILESYSTEM83_LIBCPP_END_NAMESPACE_FILESYSTEM
80#endif // !_LIBCPP_CXX03_LANG84#endif // !_LIBCPP_CXX03_LANG
8185
lib/libcxx/include/__chrono/gps_clock.h+4-4
...@@ -28,10 +28,10 @@...@@ -28,10 +28,10 @@
28_LIBCPP_PUSH_MACROS28_LIBCPP_PUSH_MACROS
29# include <__undef_macros>29# include <__undef_macros>
3030
31_LIBCPP_BEGIN_NAMESPACE_STD
32
33# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION31# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
3432
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35namespace chrono {35namespace chrono {
3636
37class gps_clock;37class gps_clock;
...@@ -78,11 +78,11 @@ public:...@@ -78,11 +78,11 @@ public:
7878
79} // namespace chrono79} // namespace chrono
8080
81_LIBCPP_END_NAMESPACE_STD
82
81# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&83# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
82 // _LIBCPP_HAS_LOCALIZATION84 // _LIBCPP_HAS_LOCALIZATION
8385
84_LIBCPP_END_NAMESPACE_STD
85
86_LIBCPP_POP_MACROS86_LIBCPP_POP_MACROS
8787
88#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB88#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/hh_mm_ss.h+10-10
...@@ -59,13 +59,13 @@ public:...@@ -59,13 +59,13 @@ public:
59 __s_(chrono::duration_cast<chrono::seconds>(chrono::abs(__d) - hours() - minutes())),59 __s_(chrono::duration_cast<chrono::seconds>(chrono::abs(__d) - hours() - minutes())),
60 __f_(chrono::duration_cast<precision>(chrono::abs(__d) - hours() - minutes() - seconds())) {}60 __f_(chrono::duration_cast<precision>(chrono::abs(__d) - hours() - minutes() - seconds())) {}
6161
62 _LIBCPP_HIDE_FROM_ABI constexpr bool is_negative() const noexcept { return __is_neg_; }62 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool is_negative() const noexcept { return __is_neg_; }
63 _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours() const noexcept { return __h_; }63 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours() const noexcept { return __h_; }
64 _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m_; }64 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m_; }
65 _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s_; }65 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s_; }
66 _LIBCPP_HIDE_FROM_ABI constexpr precision subseconds() const noexcept { return __f_; }66 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr precision subseconds() const noexcept { return __f_; }
6767
68 _LIBCPP_HIDE_FROM_ABI constexpr precision to_duration() const noexcept {68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr precision to_duration() const noexcept {
69 auto __dur = __h_ + __m_ + __s_ + __f_;69 auto __dur = __h_ + __m_ + __s_ + __f_;
70 return __is_neg_ ? -__dur : __dur;70 return __is_neg_ ? -__dur : __dur;
71 }71 }
...@@ -81,14 +81,14 @@ private:...@@ -81,14 +81,14 @@ private:
81};81};
82_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(hh_mm_ss);82_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(hh_mm_ss);
8383
84_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_am(const hours& __h) noexcept {84[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_am(const hours& __h) noexcept {
85 return __h >= hours(0) && __h < hours(12);85 return __h >= hours(0) && __h < hours(12);
86}86}
87_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_pm(const hours& __h) noexcept {87[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_pm(const hours& __h) noexcept {
88 return __h >= hours(12) && __h < hours(24);88 return __h >= hours(12) && __h < hours(24);
89}89}
9090
91_LIBCPP_HIDE_FROM_ABI inline constexpr hours make12(const hours& __h) noexcept {91[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr hours make12(const hours& __h) noexcept {
92 if (__h == hours(0))92 if (__h == hours(0))
93 return hours(12);93 return hours(12);
94 else if (__h <= hours(12))94 else if (__h <= hours(12))
...@@ -97,7 +97,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr hours make12(const hours& __h) noexcept {...@@ -97,7 +97,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr hours make12(const hours& __h) noexcept {
97 return __h - hours(12);97 return __h - hours(12);
98}98}
9999
100_LIBCPP_HIDE_FROM_ABI inline constexpr hours make24(const hours& __h, bool __is_pm) noexcept {100[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr hours make24(const hours& __h, bool __is_pm) noexcept {
101 if (__is_pm)101 if (__is_pm)
102 return __h == hours(12) ? __h : __h + hours(12);102 return __h == hours(12) ? __h : __h + hours(12);
103 else103 else
lib/libcxx/include/__chrono/literals.h+2-2
...@@ -24,11 +24,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -24,11 +24,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2424
25inline namespace literals {25inline namespace literals {
26inline namespace chrono_literals {26inline namespace chrono_literals {
27_LIBCPP_HIDE_FROM_ABI constexpr chrono::day operator""d(unsigned long long __d) noexcept {27[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::day operator""d(unsigned long long __d) noexcept {
28 return chrono::day(static_cast<unsigned>(__d));28 return chrono::day(static_cast<unsigned>(__d));
29}29}
3030
31_LIBCPP_HIDE_FROM_ABI constexpr chrono::year operator""y(unsigned long long __y) noexcept {31[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::year operator""y(unsigned long long __y) noexcept {
32 return chrono::year(static_cast<int>(__y));32 return chrono::year(static_cast<int>(__y));
33}33}
34} // namespace chrono_literals34} // namespace chrono_literals
lib/libcxx/include/__chrono/month.h+6-6
...@@ -55,7 +55,7 @@ public:...@@ -55,7 +55,7 @@ public:
55 _LIBCPP_HIDE_FROM_ABI constexpr month& operator+=(const months& __m1) noexcept;55 _LIBCPP_HIDE_FROM_ABI constexpr month& operator+=(const months& __m1) noexcept;
56 _LIBCPP_HIDE_FROM_ABI constexpr month& operator-=(const months& __m1) noexcept;56 _LIBCPP_HIDE_FROM_ABI constexpr month& operator-=(const months& __m1) noexcept;
57 _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m_; }57 _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m_; }
58 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_ >= 1 && __m_ <= 12; }58 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_ >= 1 && __m_ <= 12; }
59};59};
6060
61_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const month& __lhs, const month& __rhs) noexcept {61_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const month& __lhs, const month& __rhs) noexcept {
...@@ -66,21 +66,21 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(const month&...@@ -66,21 +66,21 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(const month&
66 return static_cast<unsigned>(__lhs) <=> static_cast<unsigned>(__rhs);66 return static_cast<unsigned>(__lhs) <=> static_cast<unsigned>(__rhs);
67}67}
6868
69_LIBCPP_HIDE_FROM_ABI inline constexpr month operator+(const month& __lhs, const months& __rhs) noexcept {69[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month operator+(const month& __lhs, const months& __rhs) noexcept {
70 auto const __mu = static_cast<long long>(static_cast<unsigned>(__lhs)) + (__rhs.count() - 1);70 auto const __mu = static_cast<long long>(static_cast<unsigned>(__lhs)) + (__rhs.count() - 1);
71 auto const __yr = (__mu >= 0 ? __mu : __mu - 11) / 12;71 auto const __yr = (__mu >= 0 ? __mu : __mu - 11) / 12;
72 return month{static_cast<unsigned>(__mu - __yr * 12 + 1)};72 return month{static_cast<unsigned>(__mu - __yr * 12 + 1)};
73}73}
7474
75_LIBCPP_HIDE_FROM_ABI inline constexpr month operator+(const months& __lhs, const month& __rhs) noexcept {75[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month operator+(const months& __lhs, const month& __rhs) noexcept {
76 return __rhs + __lhs;76 return __rhs + __lhs;
77}77}
7878
79_LIBCPP_HIDE_FROM_ABI inline constexpr month operator-(const month& __lhs, const months& __rhs) noexcept {79[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month operator-(const month& __lhs, const months& __rhs) noexcept {
80 return __lhs + -__rhs;80 return __lhs + -__rhs;
81}81}
8282
83_LIBCPP_HIDE_FROM_ABI inline constexpr months operator-(const month& __lhs, const month& __rhs) noexcept {83[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr months operator-(const month& __lhs, const month& __rhs) noexcept {
84 auto const __dm = static_cast<unsigned>(__lhs) - static_cast<unsigned>(__rhs);84 auto const __dm = static_cast<unsigned>(__lhs) - static_cast<unsigned>(__rhs);
85 return months(__dm <= 11 ? __dm : __dm + 12);85 return months(__dm <= 11 ? __dm : __dm + 12);
86}86}
...@@ -114,7 +114,7 @@ inline constexpr month December{12};...@@ -114,7 +114,7 @@ inline constexpr month December{12};
114114
115template <>115template <>
116struct hash<chrono::month> {116struct hash<chrono::month> {
117 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month& __m) noexcept {117 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month& __m) noexcept {
118 return static_cast<unsigned>(__m);118 return static_cast<unsigned>(__m);
119 }119 }
120};120};
lib/libcxx/include/__chrono/month_weekday.h+24-16
...@@ -35,9 +35,11 @@ public:...@@ -35,9 +35,11 @@ public:
35 _LIBCPP_HIDE_FROM_ABI constexpr month_weekday(const chrono::month& __mval,35 _LIBCPP_HIDE_FROM_ABI constexpr month_weekday(const chrono::month& __mval,
36 const chrono::weekday_indexed& __wdival) noexcept36 const chrono::weekday_indexed& __wdival) noexcept
37 : __m_{__mval}, __wdi_{__wdival} {}37 : __m_{__mval}, __wdi_{__wdival} {}
38 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }38 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
39 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi_; }39 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept {
40 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdi_.ok(); }40 return __wdi_;
41 }
42 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdi_.ok(); }
41};43};
4244
43_LIBCPP_HIDE_FROM_ABI inline constexpr bool45_LIBCPP_HIDE_FROM_ABI inline constexpr bool
...@@ -45,21 +47,23 @@ operator==(const month_weekday& __lhs, const month_weekday& __rhs) noexcept {...@@ -45,21 +47,23 @@ operator==(const month_weekday& __lhs, const month_weekday& __rhs) noexcept {
45 return __lhs.month() == __rhs.month() && __lhs.weekday_indexed() == __rhs.weekday_indexed();47 return __lhs.month() == __rhs.month() && __lhs.weekday_indexed() == __rhs.weekday_indexed();
46}48}
4749
48_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday50[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday
49operator/(const month& __lhs, const weekday_indexed& __rhs) noexcept {51operator/(const month& __lhs, const weekday_indexed& __rhs) noexcept {
50 return month_weekday{__lhs, __rhs};52 return month_weekday{__lhs, __rhs};
51}53}
5254
53_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday operator/(int __lhs, const weekday_indexed& __rhs) noexcept {55[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday
56operator/(int __lhs, const weekday_indexed& __rhs) noexcept {
54 return month_weekday{month(__lhs), __rhs};57 return month_weekday{month(__lhs), __rhs};
55}58}
5659
57_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday60[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday
58operator/(const weekday_indexed& __lhs, const month& __rhs) noexcept {61operator/(const weekday_indexed& __lhs, const month& __rhs) noexcept {
59 return month_weekday{__rhs, __lhs};62 return month_weekday{__rhs, __lhs};
60}63}
6164
62_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday operator/(const weekday_indexed& __lhs, int __rhs) noexcept {65[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday
66operator/(const weekday_indexed& __lhs, int __rhs) noexcept {
63 return month_weekday{month(__rhs), __lhs};67 return month_weekday{month(__rhs), __lhs};
64}68}
6569
...@@ -71,9 +75,11 @@ public:...@@ -71,9 +75,11 @@ public:
71 _LIBCPP_HIDE_FROM_ABI constexpr month_weekday_last(const chrono::month& __mval,75 _LIBCPP_HIDE_FROM_ABI constexpr month_weekday_last(const chrono::month& __mval,
72 const chrono::weekday_last& __wdlval) noexcept76 const chrono::weekday_last& __wdlval) noexcept
73 : __m_{__mval}, __wdl_{__wdlval} {}77 : __m_{__mval}, __wdl_{__wdlval} {}
74 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }78 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
75 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl_; }79 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept {
76 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdl_.ok(); }80 return __wdl_;
81 }
82 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdl_.ok(); }
77};83};
7884
79_LIBCPP_HIDE_FROM_ABI inline constexpr bool85_LIBCPP_HIDE_FROM_ABI inline constexpr bool
...@@ -81,21 +87,23 @@ operator==(const month_weekday_last& __lhs, const month_weekday_last& __rhs) noe...@@ -81,21 +87,23 @@ operator==(const month_weekday_last& __lhs, const month_weekday_last& __rhs) noe
81 return __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last();87 return __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last();
82}88}
8389
84_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last90[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last
85operator/(const month& __lhs, const weekday_last& __rhs) noexcept {91operator/(const month& __lhs, const weekday_last& __rhs) noexcept {
86 return month_weekday_last{__lhs, __rhs};92 return month_weekday_last{__lhs, __rhs};
87}93}
8894
89_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(int __lhs, const weekday_last& __rhs) noexcept {95[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last
96operator/(int __lhs, const weekday_last& __rhs) noexcept {
90 return month_weekday_last{month(__lhs), __rhs};97 return month_weekday_last{month(__lhs), __rhs};
91}98}
9299
93_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last100[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last
94operator/(const weekday_last& __lhs, const month& __rhs) noexcept {101operator/(const weekday_last& __lhs, const month& __rhs) noexcept {
95 return month_weekday_last{__rhs, __lhs};102 return month_weekday_last{__rhs, __lhs};
96}103}
97104
98_LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekday_last& __lhs, int __rhs) noexcept {105[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last
106operator/(const weekday_last& __lhs, int __rhs) noexcept {
99 return month_weekday_last{month(__rhs), __lhs};107 return month_weekday_last{month(__rhs), __lhs};
100}108}
101} // namespace chrono109} // namespace chrono
...@@ -104,7 +112,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekda...@@ -104,7 +112,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekda
104112
105template <>113template <>
106struct hash<chrono::month_weekday> {114struct hash<chrono::month_weekday> {
107 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday& __mw) noexcept {115 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday& __mw) noexcept {
108 return std::__hash_combine(116 return std::__hash_combine(
109 hash<chrono::month>{}(__mw.month()), hash<chrono::weekday_indexed>{}(__mw.weekday_indexed()));117 hash<chrono::month>{}(__mw.month()), hash<chrono::weekday_indexed>{}(__mw.weekday_indexed()));
110 }118 }
...@@ -112,7 +120,7 @@ struct hash<chrono::month_weekday> {...@@ -112,7 +120,7 @@ struct hash<chrono::month_weekday> {
112120
113template <>121template <>
114struct hash<chrono::month_weekday_last> {122struct hash<chrono::month_weekday_last> {
115 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday_last& __mwl) noexcept {123 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday_last& __mwl) noexcept {
116 return std::__hash_combine(124 return std::__hash_combine(
117 hash<chrono::month>{}(__mwl.month()), hash<chrono::weekday_last>{}(__mwl.weekday_last()));125 hash<chrono::month>{}(__mwl.month()), hash<chrono::weekday_last>{}(__mwl.weekday_last()));
118 }126 }
lib/libcxx/include/__chrono/monthday.h+18-16
...@@ -37,9 +37,9 @@ public:...@@ -37,9 +37,9 @@ public:
37 month_day() = default;37 month_day() = default;
38 _LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept38 _LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept
39 : __m_{__mval}, __d_{__dval} {}39 : __m_{__mval}, __d_{__dval} {}
40 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }40 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
41 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; }41 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; }
42 _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;42 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;
43};43};
4444
45_LIBCPP_HIDE_FROM_ABI inline constexpr bool month_day::ok() const noexcept {45_LIBCPP_HIDE_FROM_ABI inline constexpr bool month_day::ok() const noexcept {
...@@ -70,23 +70,25 @@ operator<=>(const month_day& __lhs, const month_day& __rhs) noexcept {...@@ -70,23 +70,25 @@ operator<=>(const month_day& __lhs, const month_day& __rhs) noexcept {
70 return __lhs.day() <=> __rhs.day();70 return __lhs.day() <=> __rhs.day();
71}71}
7272
73_LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(const month& __lhs, const day& __rhs) noexcept {73[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day
74operator/(const month& __lhs, const day& __rhs) noexcept {
74 return month_day{__lhs, __rhs};75 return month_day{__lhs, __rhs};
75}76}
7677
77_LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(const day& __lhs, const month& __rhs) noexcept {78[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day
79operator/(const day& __lhs, const month& __rhs) noexcept {
78 return __rhs / __lhs;80 return __rhs / __lhs;
79}81}
8082
81_LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(const month& __lhs, int __rhs) noexcept {83[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(const month& __lhs, int __rhs) noexcept {
82 return __lhs / day(__rhs);84 return __lhs / day(__rhs);
83}85}
8486
85_LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(int __lhs, const day& __rhs) noexcept {87[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(int __lhs, const day& __rhs) noexcept {
86 return month(__lhs) / __rhs;88 return month(__lhs) / __rhs;
87}89}
8890
89_LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(const day& __lhs, int __rhs) noexcept {91[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day operator/(const day& __lhs, int __rhs) noexcept {
90 return month(__rhs) / __lhs;92 return month(__rhs) / __lhs;
91}93}
9294
...@@ -96,8 +98,8 @@ private:...@@ -96,8 +98,8 @@ private:
9698
97public:99public:
98 _LIBCPP_HIDE_FROM_ABI explicit constexpr month_day_last(const chrono::month& __val) noexcept : __m_{__val} {}100 _LIBCPP_HIDE_FROM_ABI explicit constexpr month_day_last(const chrono::month& __val) noexcept : __m_{__val} {}
99 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }101 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
100 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok(); }102 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok(); }
101};103};
102104
103_LIBCPP_HIDE_FROM_ABI inline constexpr bool105_LIBCPP_HIDE_FROM_ABI inline constexpr bool
...@@ -110,19 +112,19 @@ operator<=>(const month_day_last& __lhs, const month_day_last& __rhs) noexcept {...@@ -110,19 +112,19 @@ operator<=>(const month_day_last& __lhs, const month_day_last& __rhs) noexcept {
110 return __lhs.month() <=> __rhs.month();112 return __lhs.month() <=> __rhs.month();
111}113}
112114
113_LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(const month& __lhs, last_spec) noexcept {115[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(const month& __lhs, last_spec) noexcept {
114 return month_day_last{__lhs};116 return month_day_last{__lhs};
115}117}
116118
117_LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, const month& __rhs) noexcept {119[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, const month& __rhs) noexcept {
118 return month_day_last{__rhs};120 return month_day_last{__rhs};
119}121}
120122
121_LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(int __lhs, last_spec) noexcept {123[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(int __lhs, last_spec) noexcept {
122 return month_day_last{month(__lhs)};124 return month_day_last{month(__lhs)};
123}125}
124126
125_LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int __rhs) noexcept {127[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int __rhs) noexcept {
126 return month_day_last{month(__rhs)};128 return month_day_last{month(__rhs)};
127}129}
128130
...@@ -132,14 +134,14 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int _...@@ -132,14 +134,14 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int _
132134
133template <>135template <>
134struct hash<chrono::month_day> {136struct hash<chrono::month_day> {
135 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day& __md) noexcept {137 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day& __md) noexcept {
136 return std::__hash_combine(hash<chrono::month>{}(__md.month()), hash<chrono::day>{}(__md.day()));138 return std::__hash_combine(hash<chrono::month>{}(__md.month()), hash<chrono::day>{}(__md.day()));
137 }139 }
138};140};
139141
140template <>142template <>
141struct hash<chrono::month_day_last> {143struct hash<chrono::month_day_last> {
142 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day_last& __mdl) noexcept {144 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day_last& __mdl) noexcept {
143 return hash<chrono::month>{}(__mdl.month());145 return hash<chrono::month>{}(__mdl.month());
144 }146 }
145};147};
lib/libcxx/include/__chrono/steady_clock.h+6-2
...@@ -18,11 +18,13 @@...@@ -18,11 +18,13 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21#if _LIBCPP_HAS_MONOTONIC_CLOCK
22
21_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
24_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2225
23namespace chrono {26namespace chrono {
2427
25#if _LIBCPP_HAS_MONOTONIC_CLOCK
26class _LIBCPP_EXPORTED_FROM_ABI steady_clock {28class _LIBCPP_EXPORTED_FROM_ABI steady_clock {
27public:29public:
28 typedef nanoseconds duration;30 typedef nanoseconds duration;
...@@ -33,10 +35,12 @@ public:...@@ -33,10 +35,12 @@ public:
3335
34 [[__nodiscard__]] static time_point now() _NOEXCEPT;36 [[__nodiscard__]] static time_point now() _NOEXCEPT;
35};37};
36#endif
3738
38} // namespace chrono39} // namespace chrono
3940
41_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
40_LIBCPP_END_NAMESPACE_STD42_LIBCPP_END_NAMESPACE_STD
4143
44#endif
45
42#endif // _LIBCPP___CHRONO_STEADY_CLOCK_H46#endif // _LIBCPP___CHRONO_STEADY_CLOCK_H
lib/libcxx/include/__chrono/system_clock.h+2
...@@ -20,6 +20,7 @@...@@ -20,6 +20,7 @@
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
23_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2324
24namespace chrono {25namespace chrono {
2526
...@@ -47,6 +48,7 @@ using sys_days = sys_time<days>;...@@ -47,6 +48,7 @@ using sys_days = sys_time<days>;
4748
48} // namespace chrono49} // namespace chrono
4950
51_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
50_LIBCPP_END_NAMESPACE_STD52_LIBCPP_END_NAMESPACE_STD
5153
52#endif // _LIBCPP___CHRONO_SYSTEM_CLOCK_H54#endif // _LIBCPP___CHRONO_SYSTEM_CLOCK_H
lib/libcxx/include/__chrono/tai_clock.h+4-4
...@@ -28,10 +28,10 @@...@@ -28,10 +28,10 @@
28_LIBCPP_PUSH_MACROS28_LIBCPP_PUSH_MACROS
29# include <__undef_macros>29# include <__undef_macros>
3030
31_LIBCPP_BEGIN_NAMESPACE_STD
32
33# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION31# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
3432
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35namespace chrono {35namespace chrono {
3636
37class tai_clock;37class tai_clock;
...@@ -96,11 +96,11 @@ public:...@@ -96,11 +96,11 @@ public:
9696
97} // namespace chrono97} // namespace chrono
9898
99_LIBCPP_END_NAMESPACE_STD
100
99# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&101# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
100 // _LIBCPP_HAS_LOCALIZATION102 // _LIBCPP_HAS_LOCALIZATION
101103
102_LIBCPP_END_NAMESPACE_STD
103
104_LIBCPP_POP_MACROS104_LIBCPP_POP_MACROS
105105
106#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB106#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/time_zone.h+6-4
...@@ -35,10 +35,11 @@...@@ -35,10 +35,11 @@
35_LIBCPP_PUSH_MACROS35_LIBCPP_PUSH_MACROS
36# include <__undef_macros>36# include <__undef_macros>
3737
38_LIBCPP_BEGIN_NAMESPACE_STD
39
40# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION38# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
4139
40_LIBCPP_BEGIN_NAMESPACE_STD
41_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
42
42namespace chrono {43namespace chrono {
4344
44enum class choose { earliest, latest };45enum class choose { earliest, latest };
...@@ -173,11 +174,12 @@ operator<=>(const time_zone& __x, const time_zone& __y) noexcept {...@@ -173,11 +174,12 @@ operator<=>(const time_zone& __x, const time_zone& __y) noexcept {
173174
174} // namespace chrono175} // namespace chrono
175176
177_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
178_LIBCPP_END_NAMESPACE_STD
179
176# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&180# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
177 // _LIBCPP_HAS_LOCALIZATION181 // _LIBCPP_HAS_LOCALIZATION
178182
179_LIBCPP_END_NAMESPACE_STD
180
181_LIBCPP_POP_MACROS183_LIBCPP_POP_MACROS
182184
183#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB185#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/time_zone_link.h+4-4
...@@ -29,10 +29,10 @@...@@ -29,10 +29,10 @@
29_LIBCPP_PUSH_MACROS29_LIBCPP_PUSH_MACROS
30# include <__undef_macros>30# include <__undef_macros>
3131
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION32# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
3533
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36namespace chrono {36namespace chrono {
3737
38class time_zone_link {38class time_zone_link {
...@@ -67,11 +67,11 @@ operator<=>(const time_zone_link& __x, const time_zone_link& __y) noexcept {...@@ -67,11 +67,11 @@ operator<=>(const time_zone_link& __x, const time_zone_link& __y) noexcept {
6767
68} // namespace chrono68} // namespace chrono
6969
70_LIBCPP_END_NAMESPACE_STD
71
70# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&72# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
71 // _LIBCPP_HAS_LOCALIZATION73 // _LIBCPP_HAS_LOCALIZATION
7274
73_LIBCPP_END_NAMESPACE_STD
74
75_LIBCPP_POP_MACROS75_LIBCPP_POP_MACROS
7676
77#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB77#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/tzdb.h+6-4
...@@ -34,10 +34,11 @@...@@ -34,10 +34,11 @@
34_LIBCPP_PUSH_MACROS34_LIBCPP_PUSH_MACROS
35# include <__undef_macros>35# include <__undef_macros>
3636
37_LIBCPP_BEGIN_NAMESPACE_STD
38
39# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION37# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
4038
39_LIBCPP_BEGIN_NAMESPACE_STD
40_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
41
41namespace chrono {42namespace chrono {
4243
43struct tzdb {44struct tzdb {
...@@ -84,11 +85,12 @@ private:...@@ -84,11 +85,12 @@ private:
8485
85} // namespace chrono86} // namespace chrono
8687
88_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
89_LIBCPP_END_NAMESPACE_STD
90
87# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&91# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
88 // _LIBCPP_HAS_LOCALIZATION92 // _LIBCPP_HAS_LOCALIZATION
8993
90_LIBCPP_END_NAMESPACE_STD
91
92_LIBCPP_POP_MACROS94_LIBCPP_POP_MACROS
9395
94#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB96#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__chrono/tzdb_list.h+6-4
...@@ -27,10 +27,11 @@...@@ -27,10 +27,11 @@
27# pragma GCC system_header27# pragma GCC system_header
28# endif28# endif
2929
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION30# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
3331
32_LIBCPP_BEGIN_NAMESPACE_STD
33_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
34
34namespace chrono {35namespace chrono {
3536
36// TODO TZDB37// TODO TZDB
...@@ -98,11 +99,12 @@ _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb();...@@ -98,11 +99,12 @@ _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb();
9899
99} // namespace chrono100} // namespace chrono
100101
102_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
103_LIBCPP_END_NAMESPACE_STD
104
101# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&105# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
102 // _LIBCPP_HAS_LOCALIZATION106 // _LIBCPP_HAS_LOCALIZATION
103107
104_LIBCPP_END_NAMESPACE_STD
105
106#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB108#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
107109
108#endif // _LIBCPP___CHRONO_TZDB_LIST_H110#endif // _LIBCPP___CHRONO_TZDB_LIST_H
lib/libcxx/include/__chrono/utc_clock.h+4-4
...@@ -27,10 +27,10 @@...@@ -27,10 +27,10 @@
27# pragma GCC system_header27# pragma GCC system_header
28# endif28# endif
2929
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION30# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
3331
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34namespace chrono {34namespace chrono {
3535
36class utc_clock;36class utc_clock;
...@@ -153,11 +153,11 @@ utc_clock::to_sys(const utc_time<_Duration>& __time) {...@@ -153,11 +153,11 @@ utc_clock::to_sys(const utc_time<_Duration>& __time) {
153153
154} // namespace chrono154} // namespace chrono
155155
156_LIBCPP_END_NAMESPACE_STD
157
156# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&158# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
157 // _LIBCPP_HAS_LOCALIZATION159 // _LIBCPP_HAS_LOCALIZATION
158160
159_LIBCPP_END_NAMESPACE_STD
160
161#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB161#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
162162
163#endif // _LIBCPP___CHRONO_UTC_CLOCK_H163#endif // _LIBCPP___CHRONO_UTC_CLOCK_H
lib/libcxx/include/__chrono/weekday.h+27-17
...@@ -65,11 +65,13 @@ public:...@@ -65,11 +65,13 @@ public:
65 }65 }
66 _LIBCPP_HIDE_FROM_ABI constexpr weekday& operator+=(const days& __dd) noexcept;66 _LIBCPP_HIDE_FROM_ABI constexpr weekday& operator+=(const days& __dd) noexcept;
67 _LIBCPP_HIDE_FROM_ABI constexpr weekday& operator-=(const days& __dd) noexcept;67 _LIBCPP_HIDE_FROM_ABI constexpr weekday& operator-=(const days& __dd) noexcept;
68 _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding() const noexcept { return __wd_; }68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding() const noexcept { return __wd_; }
69 _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd_ == 0u ? 7 : __wd_; }69 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept {
70 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_ <= 6; }70 return __wd_ == 0u ? 7 : __wd_;
71 _LIBCPP_HIDE_FROM_ABI constexpr weekday_indexed operator[](unsigned __index) const noexcept;71 }
72 _LIBCPP_HIDE_FROM_ABI constexpr weekday_last operator[](last_spec) const noexcept;72 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_ <= 6; }
73 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr weekday_indexed operator[](unsigned __index) const noexcept;
74 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr weekday_last operator[](last_spec) const noexcept;
73};75};
7476
75// https://howardhinnant.github.io/date_algorithms.html#weekday_from_days77// https://howardhinnant.github.io/date_algorithms.html#weekday_from_days
...@@ -81,21 +83,25 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday& __lhs, con...@@ -81,21 +83,25 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday& __lhs, con
81 return __lhs.c_encoding() == __rhs.c_encoding();83 return __lhs.c_encoding() == __rhs.c_encoding();
82}84}
8385
84_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator+(const weekday& __lhs, const days& __rhs) noexcept {86[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr weekday
87operator+(const weekday& __lhs, const days& __rhs) noexcept {
85 auto const __mu = static_cast<long long>(__lhs.c_encoding()) + __rhs.count();88 auto const __mu = static_cast<long long>(__lhs.c_encoding()) + __rhs.count();
86 auto const __yr = (__mu >= 0 ? __mu : __mu - 6) / 7;89 auto const __yr = (__mu >= 0 ? __mu : __mu - 6) / 7;
87 return weekday{static_cast<unsigned>(__mu - __yr * 7)};90 return weekday{static_cast<unsigned>(__mu - __yr * 7)};
88}91}
8992
90_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator+(const days& __lhs, const weekday& __rhs) noexcept {93[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr weekday
94operator+(const days& __lhs, const weekday& __rhs) noexcept {
91 return __rhs + __lhs;95 return __rhs + __lhs;
92}96}
9397
94_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator-(const weekday& __lhs, const days& __rhs) noexcept {98[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr weekday
99operator-(const weekday& __lhs, const days& __rhs) noexcept {
95 return __lhs + -__rhs;100 return __lhs + -__rhs;
96}101}
97102
98_LIBCPP_HIDE_FROM_ABI inline constexpr days operator-(const weekday& __lhs, const weekday& __rhs) noexcept {103[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr days
104operator-(const weekday& __lhs, const weekday& __rhs) noexcept {
99 const int __wdu = __lhs.c_encoding() - __rhs.c_encoding();105 const int __wdu = __lhs.c_encoding() - __rhs.c_encoding();
100 const int __wk = (__wdu >= 0 ? __wdu : __wdu - 6) / 7;106 const int __wk = (__wdu >= 0 ? __wdu : __wdu - 6) / 7;
101 return days{__wdu - __wk * 7};107 return days{__wdu - __wk * 7};
...@@ -120,9 +126,11 @@ public:...@@ -120,9 +126,11 @@ public:
120 weekday_indexed() = default;126 weekday_indexed() = default;
121 _LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept127 _LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept
122 : __wd_{__wdval}, __idx_(__idxval) {}128 : __wd_{__wdval}, __idx_(__idxval) {}
123 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd_; }129 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd_; }
124 _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __idx_; }130 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __idx_; }
125 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_.ok() && __idx_ >= 1 && __idx_ <= 5; }131 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept {
132 return __wd_.ok() && __idx_ >= 1 && __idx_ <= 5;
133 }
126};134};
127135
128_LIBCPP_HIDE_FROM_ABI inline constexpr bool136_LIBCPP_HIDE_FROM_ABI inline constexpr bool
...@@ -136,8 +144,8 @@ private:...@@ -136,8 +144,8 @@ private:
136144
137public:145public:
138 _LIBCPP_HIDE_FROM_ABI explicit constexpr weekday_last(const chrono::weekday& __val) noexcept : __wd_{__val} {}146 _LIBCPP_HIDE_FROM_ABI explicit constexpr weekday_last(const chrono::weekday& __val) noexcept : __wd_{__val} {}
139 _LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd_; }147 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd_; }
140 _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd_.ok(); }148 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd_.ok(); }
141};149};
142150
143_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday_last& __lhs, const weekday_last& __rhs) noexcept {151_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday_last& __lhs, const weekday_last& __rhs) noexcept {
...@@ -166,19 +174,21 @@ inline constexpr weekday Saturday{6};...@@ -166,19 +174,21 @@ inline constexpr weekday Saturday{6};
166174
167template <>175template <>
168struct hash<chrono::weekday> {176struct hash<chrono::weekday> {
169 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday& __w) noexcept { return __w.c_encoding(); }177 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday& __w) noexcept {
178 return __w.c_encoding();
179 }
170};180};
171181
172template <>182template <>
173struct hash<chrono::weekday_indexed> {183struct hash<chrono::weekday_indexed> {
174 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_indexed& __wi) noexcept {184 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_indexed& __wi) noexcept {
175 return std::__hash_combine(hash<chrono::weekday>{}(__wi.weekday()), __wi.index());185 return std::__hash_combine(hash<chrono::weekday>{}(__wi.weekday()), __wi.index());
176 }186 }
177};187};
178188
179template <>189template <>
180struct hash<chrono::weekday_last> {190struct hash<chrono::weekday_last> {
181 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_last& __wl) noexcept {191 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_last& __wl) noexcept {
182 return hash<chrono::weekday>{}(__wl.weekday());192 return hash<chrono::weekday>{}(__wl.weekday());
183 }193 }
184};194};
lib/libcxx/include/__chrono/year.h+13-11
...@@ -58,16 +58,16 @@ public:...@@ -58,16 +58,16 @@ public:
58 }58 }
59 _LIBCPP_HIDE_FROM_ABI constexpr year& operator+=(const years& __dy) noexcept;59 _LIBCPP_HIDE_FROM_ABI constexpr year& operator+=(const years& __dy) noexcept;
60 _LIBCPP_HIDE_FROM_ABI constexpr year& operator-=(const years& __dy) noexcept;60 _LIBCPP_HIDE_FROM_ABI constexpr year& operator-=(const years& __dy) noexcept;
61 _LIBCPP_HIDE_FROM_ABI inline constexpr year operator+() const noexcept { return *this; }61 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year operator+() const noexcept { return *this; }
62 _LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y_}; }62 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y_}; }
6363
64 _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept {64 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept {
65 return __y_ % 4 == 0 && (__y_ % 100 != 0 || __y_ % 400 == 0);65 return __y_ % 4 == 0 && (__y_ % 100 != 0 || __y_ % 400 == 0);
66 }66 }
67 _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y_; }67 _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y_; }
68 _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;
69 _LIBCPP_HIDE_FROM_ABI static inline constexpr year min() noexcept { return year{-32767}; }69 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static inline constexpr year min() noexcept { return year{-32767}; }
70 _LIBCPP_HIDE_FROM_ABI static inline constexpr year max() noexcept { return year{32767}; }70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static inline constexpr year max() noexcept { return year{32767}; }
71};71};
7272
73_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const year& __lhs, const year& __rhs) noexcept {73_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const year& __lhs, const year& __rhs) noexcept {
...@@ -78,19 +78,19 @@ _LIBCPP_HIDE_FROM_ABI constexpr strong_ordering operator<=>(const year& __lhs, c...@@ -78,19 +78,19 @@ _LIBCPP_HIDE_FROM_ABI constexpr strong_ordering operator<=>(const year& __lhs, c
78 return static_cast<int>(__lhs) <=> static_cast<int>(__rhs);78 return static_cast<int>(__lhs) <=> static_cast<int>(__rhs);
79}79}
8080
81_LIBCPP_HIDE_FROM_ABI inline constexpr year operator+(const year& __lhs, const years& __rhs) noexcept {81[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year operator+(const year& __lhs, const years& __rhs) noexcept {
82 return year(static_cast<int>(__lhs) + __rhs.count());82 return year(static_cast<int>(__lhs) + __rhs.count());
83}83}
8484
85_LIBCPP_HIDE_FROM_ABI inline constexpr year operator+(const years& __lhs, const year& __rhs) noexcept {85[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year operator+(const years& __lhs, const year& __rhs) noexcept {
86 return __rhs + __lhs;86 return __rhs + __lhs;
87}87}
8888
89_LIBCPP_HIDE_FROM_ABI inline constexpr year operator-(const year& __lhs, const years& __rhs) noexcept {89[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year operator-(const year& __lhs, const years& __rhs) noexcept {
90 return __lhs + -__rhs;90 return __lhs + -__rhs;
91}91}
9292
93_LIBCPP_HIDE_FROM_ABI inline constexpr years operator-(const year& __lhs, const year& __rhs) noexcept {93[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr years operator-(const year& __lhs, const year& __rhs) noexcept {
94 return years{static_cast<int>(__lhs) - static_cast<int>(__rhs)};94 return years{static_cast<int>(__lhs) - static_cast<int>(__rhs)};
95}95}
9696
...@@ -115,7 +115,9 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {...@@ -115,7 +115,9 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
115115
116template <>116template <>
117struct hash<chrono::year> {117struct hash<chrono::year> {
118 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year& __y) noexcept { return static_cast<int>(__y); }118 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year& __y) noexcept {
119 return static_cast<int>(__y);
120 }
119};121};
120122
121# endif // _LIBCPP_STD_VER >= 26123# endif // _LIBCPP_STD_VER >= 26
lib/libcxx/include/__chrono/year_month.h+20-13
...@@ -36,20 +36,20 @@ public:...@@ -36,20 +36,20 @@ public:
36 year_month() = default;36 year_month() = default;
37 _LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept37 _LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept
38 : __y_{__yval}, __m_{__mval} {}38 : __y_{__yval}, __m_{__mval} {}
39 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }39 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
40 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }40 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
41 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept;41 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept;
42 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept;42 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept;
43 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy) noexcept;43 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy) noexcept;
44 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy) noexcept;44 _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy) noexcept;
45 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok(); }45 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok(); }
46};46};
4747
48_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator/(const year& __y, const month& __m) noexcept {48[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator/(const year& __y, const month& __m) noexcept {
49 return year_month{__y, __m};49 return year_month{__y, __m};
50}50}
5151
52_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator/(const year& __y, int __m) noexcept {52[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator/(const year& __y, int __m) noexcept {
53 return year_month{__y, month(__m)};53 return year_month{__y, month(__m)};
54}54}
5555
...@@ -64,35 +64,42 @@ operator<=>(const year_month& __lhs, const year_month& __rhs) noexcept {...@@ -64,35 +64,42 @@ operator<=>(const year_month& __lhs, const year_month& __rhs) noexcept {
64 return __lhs.month() <=> __rhs.month();64 return __lhs.month() <=> __rhs.month();
65}65}
6666
67_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator+(const year_month& __lhs, const months& __rhs) noexcept {67[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month
68operator+(const year_month& __lhs, const months& __rhs) noexcept {
68 int __dmi = static_cast<int>(static_cast<unsigned>(__lhs.month())) - 1 + __rhs.count();69 int __dmi = static_cast<int>(static_cast<unsigned>(__lhs.month())) - 1 + __rhs.count();
69 const int __dy = (__dmi >= 0 ? __dmi : __dmi - 11) / 12;70 const int __dy = (__dmi >= 0 ? __dmi : __dmi - 11) / 12;
70 __dmi = __dmi - __dy * 12 + 1;71 __dmi = __dmi - __dy * 12 + 1;
71 return (__lhs.year() + years(__dy)) / month(static_cast<unsigned>(__dmi));72 return (__lhs.year() + years(__dy)) / month(static_cast<unsigned>(__dmi));
72}73}
7374
74_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator+(const months& __lhs, const year_month& __rhs) noexcept {75[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month
76operator+(const months& __lhs, const year_month& __rhs) noexcept {
75 return __rhs + __lhs;77 return __rhs + __lhs;
76}78}
7779
78_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator+(const year_month& __lhs, const years& __rhs) noexcept {80[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month
81operator+(const year_month& __lhs, const years& __rhs) noexcept {
79 return (__lhs.year() + __rhs) / __lhs.month();82 return (__lhs.year() + __rhs) / __lhs.month();
80}83}
8184
82_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator+(const years& __lhs, const year_month& __rhs) noexcept {85[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month
86operator+(const years& __lhs, const year_month& __rhs) noexcept {
83 return __rhs + __lhs;87 return __rhs + __lhs;
84}88}
8589
86_LIBCPP_HIDE_FROM_ABI inline constexpr months operator-(const year_month& __lhs, const year_month& __rhs) noexcept {90[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr months
91operator-(const year_month& __lhs, const year_month& __rhs) noexcept {
87 return (__lhs.year() - __rhs.year()) +92 return (__lhs.year() - __rhs.year()) +
88 months(static_cast<unsigned>(__lhs.month()) - static_cast<unsigned>(__rhs.month()));93 months(static_cast<unsigned>(__lhs.month()) - static_cast<unsigned>(__rhs.month()));
89}94}
9095
91_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator-(const year_month& __lhs, const months& __rhs) noexcept {96[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month
97operator-(const year_month& __lhs, const months& __rhs) noexcept {
92 return __lhs + -__rhs;98 return __lhs + -__rhs;
93}99}
94100
95_LIBCPP_HIDE_FROM_ABI inline constexpr year_month operator-(const year_month& __lhs, const years& __rhs) noexcept {101[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month
102operator-(const year_month& __lhs, const years& __rhs) noexcept {
96 return __lhs + -__rhs;103 return __lhs + -__rhs;
97}104}
98105
...@@ -122,7 +129,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& year_month::operator-=(const...@@ -122,7 +129,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& year_month::operator-=(const
122129
123template <>130template <>
124struct hash<chrono::year_month> {131struct hash<chrono::year_month> {
125 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month& __ym) noexcept {132 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month& __ym) noexcept {
126 return std::__hash_combine(hash<chrono::year>{}(__ym.year()), hash<chrono::month>{}(__ym.month()));133 return std::__hash_combine(hash<chrono::year>{}(__ym.year()), hash<chrono::month>{}(__ym.month()));
127 }134 }
128};135};
lib/libcxx/include/__chrono/year_month_day.h+45-34
...@@ -59,15 +59,15 @@ public:...@@ -59,15 +59,15 @@ public:
59 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator+=(const years& __dy) noexcept;59 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator+=(const years& __dy) noexcept;
60 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator-=(const years& __dy) noexcept;60 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator-=(const years& __dy) noexcept;
6161
62 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }62 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
63 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }63 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
64 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; }64 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; }
65 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }65 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }
66 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {66 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {
67 return local_days{__to_days()};67 return local_days{__to_days()};
68 }68 }
6969
70 _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;
7171
72 _LIBCPP_HIDE_FROM_ABI static constexpr year_month_day __from_days(days __d) noexcept;72 _LIBCPP_HIDE_FROM_ABI static constexpr year_month_day __from_days(days __d) noexcept;
73 _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;73 _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
...@@ -119,56 +119,62 @@ operator<=>(const year_month_day& __lhs, const year_month_day& __rhs) noexcept {...@@ -119,56 +119,62 @@ operator<=>(const year_month_day& __lhs, const year_month_day& __rhs) noexcept {
119 return __lhs.day() <=> __rhs.day();119 return __lhs.day() <=> __rhs.day();
120}120}
121121
122_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day operator/(const year_month& __lhs, const day& __rhs) noexcept {122[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
123operator/(const year_month& __lhs, const day& __rhs) noexcept {
123 return year_month_day{__lhs.year(), __lhs.month(), __rhs};124 return year_month_day{__lhs.year(), __lhs.month(), __rhs};
124}125}
125126
126_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day operator/(const year_month& __lhs, int __rhs) noexcept {127[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
128operator/(const year_month& __lhs, int __rhs) noexcept {
127 return __lhs / day(__rhs);129 return __lhs / day(__rhs);
128}130}
129131
130_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day operator/(const year& __lhs, const month_day& __rhs) noexcept {132[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
133operator/(const year& __lhs, const month_day& __rhs) noexcept {
131 return __lhs / __rhs.month() / __rhs.day();134 return __lhs / __rhs.month() / __rhs.day();
132}135}
133136
134_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day operator/(int __lhs, const month_day& __rhs) noexcept {137[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
138operator/(int __lhs, const month_day& __rhs) noexcept {
135 return year(__lhs) / __rhs;139 return year(__lhs) / __rhs;
136}140}
137141
138_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day operator/(const month_day& __lhs, const year& __rhs) noexcept {142[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
143operator/(const month_day& __lhs, const year& __rhs) noexcept {
139 return __rhs / __lhs;144 return __rhs / __lhs;
140}145}
141146
142_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day operator/(const month_day& __lhs, int __rhs) noexcept {147[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
148operator/(const month_day& __lhs, int __rhs) noexcept {
143 return year(__rhs) / __lhs;149 return year(__rhs) / __lhs;
144}150}
145151
146_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day152[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
147operator+(const year_month_day& __lhs, const months& __rhs) noexcept {153operator+(const year_month_day& __lhs, const months& __rhs) noexcept {
148 return (__lhs.year() / __lhs.month() + __rhs) / __lhs.day();154 return (__lhs.year() / __lhs.month() + __rhs) / __lhs.day();
149}155}
150156
151_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day157[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
152operator+(const months& __lhs, const year_month_day& __rhs) noexcept {158operator+(const months& __lhs, const year_month_day& __rhs) noexcept {
153 return __rhs + __lhs;159 return __rhs + __lhs;
154}160}
155161
156_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day162[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
157operator-(const year_month_day& __lhs, const months& __rhs) noexcept {163operator-(const year_month_day& __lhs, const months& __rhs) noexcept {
158 return __lhs + -__rhs;164 return __lhs + -__rhs;
159}165}
160166
161_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day167[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
162operator+(const year_month_day& __lhs, const years& __rhs) noexcept {168operator+(const year_month_day& __lhs, const years& __rhs) noexcept {
163 return (__lhs.year() + __rhs) / __lhs.month() / __lhs.day();169 return (__lhs.year() + __rhs) / __lhs.month() / __lhs.day();
164}170}
165171
166_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day172[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
167operator+(const years& __lhs, const year_month_day& __rhs) noexcept {173operator+(const years& __lhs, const year_month_day& __rhs) noexcept {
168 return __rhs + __lhs;174 return __rhs + __lhs;
169}175}
170176
171_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day177[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day
172operator-(const year_month_day& __lhs, const years& __rhs) noexcept {178operator-(const year_month_day& __lhs, const years& __rhs) noexcept {
173 return __lhs + -__rhs;179 return __lhs + -__rhs;
174}180}
...@@ -204,17 +210,19 @@ public:...@@ -204,17 +210,19 @@ public:
204 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const years& __y) noexcept;210 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const years& __y) noexcept;
205 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const years& __y) noexcept;211 _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const years& __y) noexcept;
206212
207 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }213 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
208 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __mdl_.month(); }214 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __mdl_.month(); }
209 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl_; }215 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept {
210 _LIBCPP_HIDE_FROM_ABI constexpr chrono::day day() const noexcept;216 return __mdl_;
217 }
218 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr chrono::day day() const noexcept;
211 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept {219 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept {
212 return sys_days{year() / month() / day()};220 return sys_days{year() / month() / day()};
213 }221 }
214 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {222 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {
215 return local_days{year() / month() / day()};223 return local_days{year() / month() / day()};
216 }224 }
217 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __mdl_.ok(); }225 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __mdl_.ok(); }
218};226};
219227
220_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day year_month_day_last::day() const noexcept {228_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day year_month_day_last::day() const noexcept {
...@@ -248,54 +256,57 @@ operator<=>(const year_month_day_last& __lhs, const year_month_day_last& __rhs)...@@ -248,54 +256,57 @@ operator<=>(const year_month_day_last& __lhs, const year_month_day_last& __rhs)
248 return __lhs.month_day_last() <=> __rhs.month_day_last();256 return __lhs.month_day_last() <=> __rhs.month_day_last();
249}257}
250258
251_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last operator/(const year_month& __lhs, last_spec) noexcept {259[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
260operator/(const year_month& __lhs, last_spec) noexcept {
252 return year_month_day_last{__lhs.year(), month_day_last{__lhs.month()}};261 return year_month_day_last{__lhs.year(), month_day_last{__lhs.month()}};
253}262}
254263
255_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last264[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
256operator/(const year& __lhs, const month_day_last& __rhs) noexcept {265operator/(const year& __lhs, const month_day_last& __rhs) noexcept {
257 return year_month_day_last{__lhs, __rhs};266 return year_month_day_last{__lhs, __rhs};
258}267}
259268
260_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last operator/(int __lhs, const month_day_last& __rhs) noexcept {269[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
270operator/(int __lhs, const month_day_last& __rhs) noexcept {
261 return year_month_day_last{year{__lhs}, __rhs};271 return year_month_day_last{year{__lhs}, __rhs};
262}272}
263273
264_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last274[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
265operator/(const month_day_last& __lhs, const year& __rhs) noexcept {275operator/(const month_day_last& __lhs, const year& __rhs) noexcept {
266 return __rhs / __lhs;276 return __rhs / __lhs;
267}277}
268278
269_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last operator/(const month_day_last& __lhs, int __rhs) noexcept {279[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
280operator/(const month_day_last& __lhs, int __rhs) noexcept {
270 return year{__rhs} / __lhs;281 return year{__rhs} / __lhs;
271}282}
272283
273_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last284[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
274operator+(const year_month_day_last& __lhs, const months& __rhs) noexcept {285operator+(const year_month_day_last& __lhs, const months& __rhs) noexcept {
275 return (__lhs.year() / __lhs.month() + __rhs) / last;286 return (__lhs.year() / __lhs.month() + __rhs) / last;
276}287}
277288
278_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last289[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
279operator+(const months& __lhs, const year_month_day_last& __rhs) noexcept {290operator+(const months& __lhs, const year_month_day_last& __rhs) noexcept {
280 return __rhs + __lhs;291 return __rhs + __lhs;
281}292}
282293
283_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last294[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
284operator-(const year_month_day_last& __lhs, const months& __rhs) noexcept {295operator-(const year_month_day_last& __lhs, const months& __rhs) noexcept {
285 return __lhs + (-__rhs);296 return __lhs + (-__rhs);
286}297}
287298
288_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last299[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
289operator+(const year_month_day_last& __lhs, const years& __rhs) noexcept {300operator+(const year_month_day_last& __lhs, const years& __rhs) noexcept {
290 return year_month_day_last{__lhs.year() + __rhs, __lhs.month_day_last()};301 return year_month_day_last{__lhs.year() + __rhs, __lhs.month_day_last()};
291}302}
292303
293_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last304[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
294operator+(const years& __lhs, const year_month_day_last& __rhs) noexcept {305operator+(const years& __lhs, const year_month_day_last& __rhs) noexcept {
295 return __rhs + __lhs;306 return __rhs + __lhs;
296}307}
297308
298_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last309[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
299operator-(const year_month_day_last& __lhs, const years& __rhs) noexcept {310operator-(const year_month_day_last& __lhs, const years& __rhs) noexcept {
300 return __lhs + (-__rhs);311 return __lhs + (-__rhs);
301}312}
...@@ -336,7 +347,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool year_month_day::ok() const noexcept...@@ -336,7 +347,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool year_month_day::ok() const noexcept
336347
337template <>348template <>
338struct hash<chrono::year_month_day> {349struct hash<chrono::year_month_day> {
339 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_day& __ymd) noexcept {350 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_day& __ymd) noexcept {
340 return std::__hash_combine(351 return std::__hash_combine(
341 hash<chrono::year>{}(__ymd.year()),352 hash<chrono::year>{}(__ymd.year()),
342 std::__hash_combine(hash<chrono::month>{}(__ymd.month()), hash<chrono::day>{}(__ymd.day())));353 std::__hash_combine(hash<chrono::month>{}(__ymd.month()), hash<chrono::day>{}(__ymd.day())));
...@@ -345,7 +356,7 @@ struct hash<chrono::year_month_day> {...@@ -345,7 +356,7 @@ struct hash<chrono::year_month_day> {
345356
346template <>357template <>
347struct hash<chrono::year_month_day_last> {358struct hash<chrono::year_month_day_last> {
348 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_day_last& __ymdl) noexcept {359 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_day_last& __ymdl) noexcept {
349 return std::__hash_combine(360 return std::__hash_combine(
350 hash<chrono::year>{}(__ymdl.year()), hash<chrono::month_day_last>{}(__ymdl.month_day_last()));361 hash<chrono::year>{}(__ymdl.year()), hash<chrono::month_day_last>{}(__ymdl.month_day_last()));
351 }362 }
lib/libcxx/include/__chrono/year_month_weekday.h+47-35
...@@ -54,17 +54,21 @@ public:...@@ -54,17 +54,21 @@ public:
54 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const years&) noexcept;54 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const years&) noexcept;
55 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const years&) noexcept;55 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const years&) noexcept;
5656
57 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }57 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
58 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }58 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
59 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdi_.weekday(); }59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept {
60 _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __wdi_.index(); }60 return __wdi_.weekday();
61 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi_; }61 }
62 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __wdi_.index(); }
63 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept {
64 return __wdi_;
65 }
6266
63 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }67 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }
64 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {68 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {
65 return local_days{__to_days()};69 return local_days{__to_days()};
66 }70 }
67 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept {71 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept {
68 if (!__y_.ok() || !__m_.ok() || !__wdi_.ok())72 if (!__y_.ok() || !__m_.ok() || !__wdi_.ok())
69 return false;73 return false;
70 if (__wdi_.index() <= 4)74 if (__wdi_.index() <= 4)
...@@ -96,55 +100,57 @@ operator==(const year_month_weekday& __lhs, const year_month_weekday& __rhs) noe...@@ -96,55 +100,57 @@ operator==(const year_month_weekday& __lhs, const year_month_weekday& __rhs) noe
96 __lhs.weekday_indexed() == __rhs.weekday_indexed();100 __lhs.weekday_indexed() == __rhs.weekday_indexed();
97}101}
98102
99_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday103[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
100operator/(const year_month& __lhs, const weekday_indexed& __rhs) noexcept {104operator/(const year_month& __lhs, const weekday_indexed& __rhs) noexcept {
101 return year_month_weekday{__lhs.year(), __lhs.month(), __rhs};105 return year_month_weekday{__lhs.year(), __lhs.month(), __rhs};
102}106}
103107
104_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday108[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
105operator/(const year& __lhs, const month_weekday& __rhs) noexcept {109operator/(const year& __lhs, const month_weekday& __rhs) noexcept {
106 return year_month_weekday{__lhs, __rhs.month(), __rhs.weekday_indexed()};110 return year_month_weekday{__lhs, __rhs.month(), __rhs.weekday_indexed()};
107}111}
108112
109_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday operator/(int __lhs, const month_weekday& __rhs) noexcept {113[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
114operator/(int __lhs, const month_weekday& __rhs) noexcept {
110 return year(__lhs) / __rhs;115 return year(__lhs) / __rhs;
111}116}
112117
113_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday118[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
114operator/(const month_weekday& __lhs, const year& __rhs) noexcept {119operator/(const month_weekday& __lhs, const year& __rhs) noexcept {
115 return __rhs / __lhs;120 return __rhs / __lhs;
116}121}
117122
118_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday operator/(const month_weekday& __lhs, int __rhs) noexcept {123[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
124operator/(const month_weekday& __lhs, int __rhs) noexcept {
119 return year(__rhs) / __lhs;125 return year(__rhs) / __lhs;
120}126}
121127
122_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday128[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
123operator+(const year_month_weekday& __lhs, const months& __rhs) noexcept {129operator+(const year_month_weekday& __lhs, const months& __rhs) noexcept {
124 return (__lhs.year() / __lhs.month() + __rhs) / __lhs.weekday_indexed();130 return (__lhs.year() / __lhs.month() + __rhs) / __lhs.weekday_indexed();
125}131}
126132
127_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday133[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
128operator+(const months& __lhs, const year_month_weekday& __rhs) noexcept {134operator+(const months& __lhs, const year_month_weekday& __rhs) noexcept {
129 return __rhs + __lhs;135 return __rhs + __lhs;
130}136}
131137
132_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday138[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
133operator-(const year_month_weekday& __lhs, const months& __rhs) noexcept {139operator-(const year_month_weekday& __lhs, const months& __rhs) noexcept {
134 return __lhs + (-__rhs);140 return __lhs + (-__rhs);
135}141}
136142
137_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday143[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
138operator+(const year_month_weekday& __lhs, const years& __rhs) noexcept {144operator+(const year_month_weekday& __lhs, const years& __rhs) noexcept {
139 return year_month_weekday{__lhs.year() + __rhs, __lhs.month(), __lhs.weekday_indexed()};145 return year_month_weekday{__lhs.year() + __rhs, __lhs.month(), __lhs.weekday_indexed()};
140}146}
141147
142_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday148[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
143operator+(const years& __lhs, const year_month_weekday& __rhs) noexcept {149operator+(const years& __lhs, const year_month_weekday& __rhs) noexcept {
144 return __rhs + __lhs;150 return __rhs + __lhs;
145}151}
146152
147_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday153[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday
148operator-(const year_month_weekday& __lhs, const years& __rhs) noexcept {154operator-(const year_month_weekday& __lhs, const years& __rhs) noexcept {
149 return __lhs + (-__rhs);155 return __lhs + (-__rhs);
150}156}
...@@ -181,15 +187,21 @@ public:...@@ -181,15 +187,21 @@ public:
181 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const years& __dy) noexcept;187 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const years& __dy) noexcept;
182 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const years& __dy) noexcept;188 _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const years& __dy) noexcept;
183189
184 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }190 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
185 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }191 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
186 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdl_.weekday(); }192 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept {
187 _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl_; }193 return __wdl_.weekday();
194 }
195 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept {
196 return __wdl_;
197 }
188 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }198 _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }
189 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {199 _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept {
190 return local_days{__to_days()};200 return local_days{__to_days()};
191 }201 }
192 _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok() && __wdl_.ok(); }202 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept {
203 return __y_.ok() && __m_.ok() && __wdl_.ok();
204 }
193205
194 _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;206 _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
195};207};
...@@ -204,57 +216,57 @@ operator==(const year_month_weekday_last& __lhs, const year_month_weekday_last&...@@ -204,57 +216,57 @@ operator==(const year_month_weekday_last& __lhs, const year_month_weekday_last&
204 return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last();216 return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last();
205}217}
206218
207_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last219[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
208operator/(const year_month& __lhs, const weekday_last& __rhs) noexcept {220operator/(const year_month& __lhs, const weekday_last& __rhs) noexcept {
209 return year_month_weekday_last{__lhs.year(), __lhs.month(), __rhs};221 return year_month_weekday_last{__lhs.year(), __lhs.month(), __rhs};
210}222}
211223
212_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last224[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
213operator/(const year& __lhs, const month_weekday_last& __rhs) noexcept {225operator/(const year& __lhs, const month_weekday_last& __rhs) noexcept {
214 return year_month_weekday_last{__lhs, __rhs.month(), __rhs.weekday_last()};226 return year_month_weekday_last{__lhs, __rhs.month(), __rhs.weekday_last()};
215}227}
216228
217_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last229[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
218operator/(int __lhs, const month_weekday_last& __rhs) noexcept {230operator/(int __lhs, const month_weekday_last& __rhs) noexcept {
219 return year(__lhs) / __rhs;231 return year(__lhs) / __rhs;
220}232}
221233
222_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last234[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
223operator/(const month_weekday_last& __lhs, const year& __rhs) noexcept {235operator/(const month_weekday_last& __lhs, const year& __rhs) noexcept {
224 return __rhs / __lhs;236 return __rhs / __lhs;
225}237}
226238
227_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last239[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
228operator/(const month_weekday_last& __lhs, int __rhs) noexcept {240operator/(const month_weekday_last& __lhs, int __rhs) noexcept {
229 return year(__rhs) / __lhs;241 return year(__rhs) / __lhs;
230}242}
231243
232_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last244[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
233operator+(const year_month_weekday_last& __lhs, const months& __rhs) noexcept {245operator+(const year_month_weekday_last& __lhs, const months& __rhs) noexcept {
234 return (__lhs.year() / __lhs.month() + __rhs) / __lhs.weekday_last();246 return (__lhs.year() / __lhs.month() + __rhs) / __lhs.weekday_last();
235}247}
236248
237_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last249[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
238operator+(const months& __lhs, const year_month_weekday_last& __rhs) noexcept {250operator+(const months& __lhs, const year_month_weekday_last& __rhs) noexcept {
239 return __rhs + __lhs;251 return __rhs + __lhs;
240}252}
241253
242_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last254[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
243operator-(const year_month_weekday_last& __lhs, const months& __rhs) noexcept {255operator-(const year_month_weekday_last& __lhs, const months& __rhs) noexcept {
244 return __lhs + (-__rhs);256 return __lhs + (-__rhs);
245}257}
246258
247_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last259[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
248operator+(const year_month_weekday_last& __lhs, const years& __rhs) noexcept {260operator+(const year_month_weekday_last& __lhs, const years& __rhs) noexcept {
249 return year_month_weekday_last{__lhs.year() + __rhs, __lhs.month(), __lhs.weekday_last()};261 return year_month_weekday_last{__lhs.year() + __rhs, __lhs.month(), __lhs.weekday_last()};
250}262}
251263
252_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last264[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
253operator+(const years& __lhs, const year_month_weekday_last& __rhs) noexcept {265operator+(const years& __lhs, const year_month_weekday_last& __rhs) noexcept {
254 return __rhs + __lhs;266 return __rhs + __lhs;
255}267}
256268
257_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last269[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last
258operator-(const year_month_weekday_last& __lhs, const years& __rhs) noexcept {270operator-(const year_month_weekday_last& __lhs, const years& __rhs) noexcept {
259 return __lhs + (-__rhs);271 return __lhs + (-__rhs);
260}272}
...@@ -286,7 +298,7 @@ year_month_weekday_last::operator-=(const years& __dy) noexcept {...@@ -286,7 +298,7 @@ year_month_weekday_last::operator-=(const years& __dy) noexcept {
286298
287template <>299template <>
288struct hash<chrono::year_month_weekday> {300struct hash<chrono::year_month_weekday> {
289 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_weekday& __ymw) noexcept {301 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_weekday& __ymw) noexcept {
290 return std::__hash_combine(302 return std::__hash_combine(
291 hash<chrono::year>{}(__ymw.year()),303 hash<chrono::year>{}(__ymw.year()),
292 std::__hash_combine(304 std::__hash_combine(
...@@ -296,7 +308,7 @@ struct hash<chrono::year_month_weekday> {...@@ -296,7 +308,7 @@ struct hash<chrono::year_month_weekday> {
296308
297template <>309template <>
298struct hash<chrono::year_month_weekday_last> {310struct hash<chrono::year_month_weekday_last> {
299 _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_weekday_last& __ymwl) noexcept {311 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year_month_weekday_last& __ymwl) noexcept {
300 return std::__hash_combine(312 return std::__hash_combine(
301 hash<chrono::year>{}(__ymwl.year()),313 hash<chrono::year>{}(__ymwl.year()),
302 std::__hash_combine(314 std::__hash_combine(
lib/libcxx/include/__chrono/zoned_time.h+4-4
...@@ -40,10 +40,10 @@...@@ -40,10 +40,10 @@
40_LIBCPP_PUSH_MACROS40_LIBCPP_PUSH_MACROS
41# include <__undef_macros>41# include <__undef_macros>
4242
43_LIBCPP_BEGIN_NAMESPACE_STD
44
45# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION43# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
4644
45_LIBCPP_BEGIN_NAMESPACE_STD
46
47namespace chrono {47namespace chrono {
4848
49template <class>49template <class>
...@@ -232,11 +232,11 @@ struct hash<chrono::zoned_time<_Duration, _TimeZonePtr>> {...@@ -232,11 +232,11 @@ struct hash<chrono::zoned_time<_Duration, _TimeZonePtr>> {
232232
233# endif // _LIBCPP_STD_VER >= 26233# endif // _LIBCPP_STD_VER >= 26
234234
235_LIBCPP_END_NAMESPACE_STD
236
235# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&237# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
236 // _LIBCPP_HAS_LOCALIZATION238 // _LIBCPP_HAS_LOCALIZATION
237239
238_LIBCPP_END_NAMESPACE_STD
239
240_LIBCPP_POP_MACROS240_LIBCPP_POP_MACROS
241241
242#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB242#endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
lib/libcxx/include/__compare/common_comparison_category.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25namespace __comp_detail {25namespace __comp_detail {
2626
27enum _ClassifyCompCategory : unsigned { _None, _PartialOrd, _WeakOrd, _StrongOrd, _CCC_Size };27enum _ClassifyCompCategory : unsigned { _None, _PartialOrd, _WeakOrd, _StrongOrd, _CCC_Size };
...@@ -79,8 +79,8 @@ struct common_comparison_category {...@@ -79,8 +79,8 @@ struct common_comparison_category {
79template <class... _Ts>79template <class... _Ts>
80using common_comparison_category_t = typename common_comparison_category<_Ts...>::type;80using common_comparison_category_t = typename common_comparison_category<_Ts...>::type;
8181
82#endif // _LIBCPP_STD_VER >= 20
83
84_LIBCPP_END_NAMESPACE_STD82_LIBCPP_END_NAMESPACE_STD
8583
84#endif // _LIBCPP_STD_VER >= 20
85
86#endif // _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H86#endif // _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H
lib/libcxx/include/__compare/compare_three_way.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25struct compare_three_way {25struct compare_three_way {
26 template <class _T1, class _T2>26 template <class _T1, class _T2>
27 requires three_way_comparable_with<_T1, _T2>27 requires three_way_comparable_with<_T1, _T2>
...@@ -33,8 +33,8 @@ struct compare_three_way {...@@ -33,8 +33,8 @@ struct compare_three_way {
33 using is_transparent = void;33 using is_transparent = void;
34};34};
3535
36#endif // _LIBCPP_STD_VER >= 20
37
38_LIBCPP_END_NAMESPACE_STD36_LIBCPP_END_NAMESPACE_STD
3937
38#endif // _LIBCPP_STD_VER >= 20
39
40#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_H40#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
lib/libcxx/include/__compare/compare_three_way_result.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class, class, class>24template <class, class, class>
25struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result {};25struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result {};
2626
...@@ -39,8 +39,8 @@ struct _LIBCPP_NO_SPECIALIZATIONS compare_three_way_result : __compare_three_way...@@ -39,8 +39,8 @@ struct _LIBCPP_NO_SPECIALIZATIONS compare_three_way_result : __compare_three_way
39template <class _Tp, class _Up = _Tp>39template <class _Tp, class _Up = _Tp>
40using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type;40using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type;
4141
42#endif // _LIBCPP_STD_VER >= 20
43
44_LIBCPP_END_NAMESPACE_STD42_LIBCPP_END_NAMESPACE_STD
4543
44#endif // _LIBCPP_STD_VER >= 20
45
46#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H46#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H
lib/libcxx/include/__compare/ordering.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// exposition only24// exposition only
25enum class _OrdResult : signed char { __less = -1, __equiv = 0, __greater = 1 };25enum class _OrdResult : signed char { __less = -1, __equiv = 0, __greater = 1 };
2626
...@@ -275,8 +275,8 @@ template <class _Tp>...@@ -275,8 +275,8 @@ template <class _Tp>
275concept __comparison_category =275concept __comparison_category =
276 is_same_v<_Tp, partial_ordering> || is_same_v<_Tp, weak_ordering> || is_same_v<_Tp, strong_ordering>;276 is_same_v<_Tp, partial_ordering> || is_same_v<_Tp, weak_ordering> || is_same_v<_Tp, strong_ordering>;
277277
278#endif // _LIBCPP_STD_VER >= 20
279
280_LIBCPP_END_NAMESPACE_STD278_LIBCPP_END_NAMESPACE_STD
281279
280#endif // _LIBCPP_STD_VER >= 20
281
282#endif // _LIBCPP___COMPARE_ORDERING_H282#endif // _LIBCPP___COMPARE_ORDERING_H
lib/libcxx/include/__compare/synth_three_way.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26// [expos.only.func]26// [expos.only.func]
2727
28_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way = []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)28_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way = []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
...@@ -46,8 +46,8 @@ template <class _Tp, class _Up = _Tp>...@@ -46,8 +46,8 @@ template <class _Tp, class _Up = _Tp>
46using __synth_three_way_result _LIBCPP_NODEBUG =46using __synth_three_way_result _LIBCPP_NODEBUG =
47 decltype(std::__synth_three_way(std::declval<_Tp&>(), std::declval<_Up&>()));47 decltype(std::__synth_three_way(std::declval<_Tp&>(), std::declval<_Up&>()));
4848
49#endif // _LIBCPP_STD_VER >= 20
50
51_LIBCPP_END_NAMESPACE_STD49_LIBCPP_END_NAMESPACE_STD
5250
51#endif // _LIBCPP_STD_VER >= 20
52
53#endif // _LIBCPP___COMPARE_SYNTH_THREE_WAY_H53#endif // _LIBCPP___COMPARE_SYNTH_THREE_WAY_H
lib/libcxx/include/__compare/three_way_comparable.h+4-4
...@@ -24,10 +24,10 @@...@@ -24,10 +24,10 @@
24# pragma GCC system_header24# pragma GCC system_header
25#endif25#endif
2626
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 2027#if _LIBCPP_STD_VER >= 20
3028
29_LIBCPP_BEGIN_NAMESPACE_STD
30
31template <class _Tp, class _Cat>31template <class _Tp, class _Cat>
32concept __compares_as = same_as<common_comparison_category_t<_Tp, _Cat>, _Cat>;32concept __compares_as = same_as<common_comparison_category_t<_Tp, _Cat>, _Cat>;
3333
...@@ -48,8 +48,8 @@ concept three_way_comparable_with =...@@ -48,8 +48,8 @@ concept three_way_comparable_with =
48 { __u <=> __t } -> __compares_as<_Cat>;48 { __u <=> __t } -> __compares_as<_Cat>;
49 };49 };
5050
51#endif // _LIBCPP_STD_VER >= 20
52
53_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
5452
53#endif // _LIBCPP_STD_VER >= 20
54
55#endif // _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H55#endif // _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H
lib/libcxx/include/__concepts/arithmetic.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// [concepts.arithmetic], arithmetic concepts25// [concepts.arithmetic], arithmetic concepts
2626
27template <class _Tp>27template <class _Tp>
...@@ -36,8 +36,8 @@ concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;...@@ -36,8 +36,8 @@ concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
36template <class _Tp>36template <class _Tp>
37concept floating_point = is_floating_point_v<_Tp>;37concept floating_point = is_floating_point_v<_Tp>;
3838
39#endif // _LIBCPP_STD_VER >= 20
40
41_LIBCPP_END_NAMESPACE_STD39_LIBCPP_END_NAMESPACE_STD
4240
41#endif // _LIBCPP_STD_VER >= 20
42
43#endif // _LIBCPP___CONCEPTS_ARITHMETIC_H43#endif // _LIBCPP___CONCEPTS_ARITHMETIC_H
lib/libcxx/include/__concepts/assignable.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2023#if _LIBCPP_STD_VER >= 20
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27// [concept.assignable]27// [concept.assignable]
2828
29template <class _Lhs, class _Rhs>29template <class _Lhs, class _Rhs>
...@@ -34,8 +34,8 @@ concept assignable_from =...@@ -34,8 +34,8 @@ concept assignable_from =
34 { __lhs = std::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;34 { __lhs = std::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
35 };35 };
3636
37#endif // _LIBCPP_STD_VER >= 20
38
39_LIBCPP_END_NAMESPACE_STD37_LIBCPP_END_NAMESPACE_STD
4038
39#endif // _LIBCPP_STD_VER >= 20
40
41#endif // _LIBCPP___CONCEPTS_ASSIGNABLE_H41#endif // _LIBCPP___CONCEPTS_ASSIGNABLE_H
lib/libcxx/include/__concepts/boolean_testable.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// [concepts.booleantestable]24// [concepts.booleantestable]
2525
26template <class _Tp>26template <class _Tp>
...@@ -31,8 +31,8 @@ concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t)...@@ -31,8 +31,8 @@ concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t)
31 { !std::forward<_Tp>(__t) } -> __boolean_testable_impl;31 { !std::forward<_Tp>(__t) } -> __boolean_testable_impl;
32};32};
3333
34#endif // _LIBCPP_STD_VER >= 20
35
36_LIBCPP_END_NAMESPACE_STD34_LIBCPP_END_NAMESPACE_STD
3735
36#endif // _LIBCPP_STD_VER >= 20
37
38#endif // _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H38#endif // _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H
lib/libcxx/include/__concepts/class_or_enum.h+4-4
...@@ -18,17 +18,17 @@...@@ -18,17 +18,17 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// Whether a type is a class type or enumeration type according to the Core wording.25// Whether a type is a class type or enumeration type according to the Core wording.
2626
27template <class _Tp>27template <class _Tp>
28concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;28concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
2929
30#endif // _LIBCPP_STD_VER >= 20
31
32_LIBCPP_END_NAMESPACE_STD30_LIBCPP_END_NAMESPACE_STD
3331
32#endif // _LIBCPP_STD_VER >= 20
33
34#endif // _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H34#endif // _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H
lib/libcxx/include/__concepts/common_reference_with.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// [concept.commonref]25// [concept.commonref]
2626
27template <class _Tp, class _Up>27template <class _Tp, class _Up>
...@@ -29,8 +29,8 @@ concept common_reference_with =...@@ -29,8 +29,8 @@ concept common_reference_with =
29 same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> &&29 same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> &&
30 convertible_to<_Tp, common_reference_t<_Tp, _Up>> && convertible_to<_Up, common_reference_t<_Tp, _Up>>;30 convertible_to<_Tp, common_reference_t<_Tp, _Up>> && convertible_to<_Up, common_reference_t<_Tp, _Up>>;
3131
32#endif // _LIBCPP_STD_VER >= 20
33
34_LIBCPP_END_NAMESPACE_STD32_LIBCPP_END_NAMESPACE_STD
3533
34#endif // _LIBCPP_STD_VER >= 20
35
36#endif // _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H36#endif // _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H
lib/libcxx/include/__concepts/comparison_common_type.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <class _Tp, class _Up, class _CommonRef = common_reference_t<const _Tp&, const _Up&>>26template <class _Tp, class _Up, class _CommonRef = common_reference_t<const _Tp&, const _Up&>>
27concept __comparison_common_type_with_impl =27concept __comparison_common_type_with_impl =
28 same_as<common_reference_t<const _Tp&, const _Up&>, common_reference_t<const _Up&, const _Tp&>> && requires {28 same_as<common_reference_t<const _Tp&, const _Up&>, common_reference_t<const _Up&, const _Tp&>> && requires {
...@@ -33,8 +33,8 @@ concept __comparison_common_type_with_impl =...@@ -33,8 +33,8 @@ concept __comparison_common_type_with_impl =
33template <class _Tp, class _Up>33template <class _Tp, class _Up>
34concept __comparison_common_type_with = __comparison_common_type_with_impl<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;34concept __comparison_common_type_with = __comparison_common_type_with_impl<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
3535
36#endif // _LIBCPP_STD_VER >= 20
37
38_LIBCPP_END_NAMESPACE_STD36_LIBCPP_END_NAMESPACE_STD
3937
38#endif // _LIBCPP_STD_VER >= 20
39
40#endif // _LIBCPP___CONCEPTS_COMPARISON_COMMON_TYPE_H40#endif // _LIBCPP___CONCEPTS_COMPARISON_COMMON_TYPE_H
lib/libcxx/include/__concepts/constructible.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// [concept.constructible]25// [concept.constructible]
26template <class _Tp, class... _Args>26template <class _Tp, class... _Args>
27concept constructible_from = destructible<_Tp> && is_constructible_v<_Tp, _Args...>;27concept constructible_from = destructible<_Tp> && is_constructible_v<_Tp, _Args...>;
...@@ -48,8 +48,8 @@ concept copy_constructible =...@@ -48,8 +48,8 @@ concept copy_constructible =
48 constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;48 constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
49// clang-format on49// clang-format on
5050
51#endif // _LIBCPP_STD_VER >= 20
52
53_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
5452
53#endif // _LIBCPP_STD_VER >= 20
54
55#endif // _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H55#endif // _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H
lib/libcxx/include/__concepts/convertible_to.h+4-4
...@@ -17,17 +17,17 @@...@@ -17,17 +17,17 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// [concept.convertible]24// [concept.convertible]
2525
26template <class _From, class _To>26template <class _From, class _To>
27concept convertible_to = is_convertible_v<_From, _To> && requires { static_cast<_To>(std::declval<_From>()); };27concept convertible_to = is_convertible_v<_From, _To> && requires { static_cast<_To>(std::declval<_From>()); };
2828
29#endif // _LIBCPP_STD_VER >= 20
30
31_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
3230
31#endif // _LIBCPP_STD_VER >= 20
32
33#endif // _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H33#endif // _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H
lib/libcxx/include/__concepts/copyable.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// [concepts.object]25// [concepts.object]
2626
27// clang-format off27// clang-format off
...@@ -34,8 +34,8 @@ concept copyable =...@@ -34,8 +34,8 @@ concept copyable =
34 assignable_from<_Tp&, const _Tp>;34 assignable_from<_Tp&, const _Tp>;
35// clang-format on35// clang-format on
3636
37#endif // _LIBCPP_STD_VER >= 20
38
39_LIBCPP_END_NAMESPACE_STD37_LIBCPP_END_NAMESPACE_STD
4038
39#endif // _LIBCPP_STD_VER >= 20
40
41#endif // _LIBCPP___CONCEPTS_COPYABLE_H41#endif // _LIBCPP___CONCEPTS_COPYABLE_H
lib/libcxx/include/__concepts/derived_from.h+4-4
...@@ -17,17 +17,17 @@...@@ -17,17 +17,17 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// [concept.derived]24// [concept.derived]
2525
26template <class _Dp, class _Bp>26template <class _Dp, class _Bp>
27concept derived_from = is_base_of_v<_Bp, _Dp> && is_convertible_v<const volatile _Dp*, const volatile _Bp*>;27concept derived_from = is_base_of_v<_Bp, _Dp> && is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
2828
29#endif // _LIBCPP_STD_VER >= 20
30
31_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
3230
31#endif // _LIBCPP_STD_VER >= 20
32
33#endif // _LIBCPP___CONCEPTS_DERIVED_FROM_H33#endif // _LIBCPP___CONCEPTS_DERIVED_FROM_H
lib/libcxx/include/__concepts/destructible.h+4-4
...@@ -16,17 +16,17 @@...@@ -16,17 +16,17 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2019#if _LIBCPP_STD_VER >= 20
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23// [concept.destructible]23// [concept.destructible]
2424
25template <class _Tp>25template <class _Tp>
26concept destructible = is_nothrow_destructible_v<_Tp>;26concept destructible = is_nothrow_destructible_v<_Tp>;
2727
28#endif // _LIBCPP_STD_VER >= 20
29
30_LIBCPP_END_NAMESPACE_STD28_LIBCPP_END_NAMESPACE_STD
3129
30#endif // _LIBCPP_STD_VER >= 20
31
32#endif // _LIBCPP___CONCEPTS_DESTRUCTIBLE_H32#endif // _LIBCPP___CONCEPTS_DESTRUCTIBLE_H
lib/libcxx/include/__concepts/different_from.h+4-4
...@@ -17,15 +17,15 @@...@@ -17,15 +17,15 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Tp, class _Up>24template <class _Tp, class _Up>
25concept __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;25concept __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
2626
27#endif // _LIBCPP_STD_VER >= 20
28
29_LIBCPP_END_NAMESPACE_STD27_LIBCPP_END_NAMESPACE_STD
3028
29#endif // _LIBCPP_STD_VER >= 20
30
31#endif // _LIBCPP___CONCEPTS_DIFFERENT_FROM_H31#endif // _LIBCPP___CONCEPTS_DIFFERENT_FROM_H
lib/libcxx/include/__concepts/equality_comparable.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2023#if _LIBCPP_STD_VER >= 20
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27// [concept.equalitycomparable]27// [concept.equalitycomparable]
2828
29template <class _Tp, class _Up>29template <class _Tp, class _Up>
...@@ -50,8 +50,8 @@ concept equality_comparable_with =...@@ -50,8 +50,8 @@ concept equality_comparable_with =
50 __weakly_equality_comparable_with<_Tp, _Up>;50 __weakly_equality_comparable_with<_Tp, _Up>;
51// clang-format on51// clang-format on
5252
53#endif // _LIBCPP_STD_VER >= 20
54
55_LIBCPP_END_NAMESPACE_STD53_LIBCPP_END_NAMESPACE_STD
5654
55#endif // _LIBCPP_STD_VER >= 20
56
57#endif // _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H57#endif // _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H
lib/libcxx/include/__concepts/invocable.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// [concept.invocable]24// [concept.invocable]
2525
26template <class _Fn, class... _Args>26template <class _Fn, class... _Args>
...@@ -33,8 +33,8 @@ concept invocable = requires(_Fn&& __fn, _Args&&... __args) {...@@ -33,8 +33,8 @@ concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
33template <class _Fn, class... _Args>33template <class _Fn, class... _Args>
34concept regular_invocable = invocable<_Fn, _Args...>;34concept regular_invocable = invocable<_Fn, _Args...>;
3535
36#endif // _LIBCPP_STD_VER >= 20
37
38_LIBCPP_END_NAMESPACE_STD36_LIBCPP_END_NAMESPACE_STD
3937
38#endif // _LIBCPP_STD_VER >= 20
39
40#endif // _LIBCPP___CONCEPTS_INVOCABLE_H40#endif // _LIBCPP___CONCEPTS_INVOCABLE_H
lib/libcxx/include/__concepts/movable.h+4-4
...@@ -19,17 +19,17 @@...@@ -19,17 +19,17 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26// [concepts.object]26// [concepts.object]
2727
28template <class _Tp>28template <class _Tp>
29concept movable = is_object_v<_Tp> && move_constructible<_Tp> && assignable_from<_Tp&, _Tp> && swappable<_Tp>;29concept movable = is_object_v<_Tp> && move_constructible<_Tp> && assignable_from<_Tp&, _Tp> && swappable<_Tp>;
3030
31#endif // _LIBCPP_STD_VER >= 20
32
33_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
3432
33#endif // _LIBCPP_STD_VER >= 20
34
35#endif // _LIBCPP___CONCEPTS_MOVABLE_H35#endif // _LIBCPP___CONCEPTS_MOVABLE_H
lib/libcxx/include/__concepts/predicate.h+4-4
...@@ -18,17 +18,17 @@...@@ -18,17 +18,17 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2021#if _LIBCPP_STD_VER >= 20
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// [concept.predicate]25// [concept.predicate]
2626
27template <class _Fn, class... _Args>27template <class _Fn, class... _Args>
28concept predicate = regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;28concept predicate = regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
2929
30#endif // _LIBCPP_STD_VER >= 20
31
32_LIBCPP_END_NAMESPACE_STD30_LIBCPP_END_NAMESPACE_STD
3331
32#endif // _LIBCPP_STD_VER >= 20
33
34#endif // _LIBCPP___CONCEPTS_PREDICATE_H34#endif // _LIBCPP___CONCEPTS_PREDICATE_H
lib/libcxx/include/__concepts/primary_template.h created+33
...@@ -0,0 +1,33 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
10#define _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
11
12#include <__config>
13#include <__type_traits/is_same.h>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19#if _LIBCPP_STD_VER >= 20
20
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class _Tp>
24concept __primary_template = requires {
25 typename _Tp::__primary_template;
26 requires _IsSame<typename _Tp::__primary_template, _Tp>::value;
27};
28
29_LIBCPP_END_NAMESPACE_STD
30
31#endif // _LIBCPP_STD_VER >= 20
32
33#endif // _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
lib/libcxx/include/__concepts/referenceable.h created+30
...@@ -0,0 +1,30 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
10#define _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
11
12#include <__config>
13#include <__type_traits/void_t.h>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19#if _LIBCPP_STD_VER >= 20
20
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class _Tp>
24concept __referenceable = requires { typename __void_t<_Tp&>; };
25
26_LIBCPP_END_NAMESPACE_STD
27
28#endif
29
30#endif // _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
lib/libcxx/include/__concepts/regular.h+4-4
...@@ -17,17 +17,17 @@...@@ -17,17 +17,17 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// [concept.object]24// [concept.object]
2525
26template <class _Tp>26template <class _Tp>
27concept regular = semiregular<_Tp> && equality_comparable<_Tp>;27concept regular = semiregular<_Tp> && equality_comparable<_Tp>;
2828
29#endif // _LIBCPP_STD_VER >= 20
30
31_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
3230
31#endif // _LIBCPP_STD_VER >= 20
32
33#endif // _LIBCPP___CONCEPTS_REGULAR_H33#endif // _LIBCPP___CONCEPTS_REGULAR_H
lib/libcxx/include/__concepts/relation.h+4-4
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2019#if _LIBCPP_STD_VER >= 20
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23// [concept.relation]23// [concept.relation]
2424
25template <class _Rp, class _Tp, class _Up>25template <class _Rp, class _Tp, class _Up>
...@@ -36,8 +36,8 @@ concept equivalence_relation = relation<_Rp, _Tp, _Up>;...@@ -36,8 +36,8 @@ concept equivalence_relation = relation<_Rp, _Tp, _Up>;
36template <class _Rp, class _Tp, class _Up>36template <class _Rp, class _Tp, class _Up>
37concept strict_weak_order = relation<_Rp, _Tp, _Up>;37concept strict_weak_order = relation<_Rp, _Tp, _Up>;
3838
39#endif // _LIBCPP_STD_VER >= 20
40
41_LIBCPP_END_NAMESPACE_STD39_LIBCPP_END_NAMESPACE_STD
4240
41#endif // _LIBCPP_STD_VER >= 20
42
43#endif // _LIBCPP___CONCEPTS_RELATION_H43#endif // _LIBCPP___CONCEPTS_RELATION_H
lib/libcxx/include/__concepts/same_as.h+4-4
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2019#if _LIBCPP_STD_VER >= 20
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23// [concept.same]23// [concept.same]
2424
25template <class _Tp, class _Up>25template <class _Tp, class _Up>
...@@ -28,8 +28,8 @@ concept __same_as_impl = _IsSame<_Tp, _Up>::value;...@@ -28,8 +28,8 @@ concept __same_as_impl = _IsSame<_Tp, _Up>::value;
28template <class _Tp, class _Up>28template <class _Tp, class _Up>
29concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;29concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
3030
31#endif // _LIBCPP_STD_VER >= 20
32
33_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
3432
33#endif // _LIBCPP_STD_VER >= 20
34
35#endif // _LIBCPP___CONCEPTS_SAME_AS_H35#endif // _LIBCPP___CONCEPTS_SAME_AS_H
lib/libcxx/include/__concepts/semiregular.h+4-4
...@@ -17,17 +17,17 @@...@@ -17,17 +17,17 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// [concept.object]24// [concept.object]
2525
26template <class _Tp>26template <class _Tp>
27concept semiregular = copyable<_Tp> && default_initializable<_Tp>;27concept semiregular = copyable<_Tp> && default_initializable<_Tp>;
2828
29#endif // _LIBCPP_STD_VER >= 20
30
31_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
3230
31#endif // _LIBCPP_STD_VER >= 20
32
33#endif // _LIBCPP___CONCEPTS_SEMIREGULAR_H33#endif // _LIBCPP___CONCEPTS_SEMIREGULAR_H
lib/libcxx/include/__concepts/swappable.h+4-4
...@@ -30,10 +30,10 @@...@@ -30,10 +30,10 @@
30_LIBCPP_PUSH_MACROS30_LIBCPP_PUSH_MACROS
31#include <__undef_macros>31#include <__undef_macros>
3232
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35#if _LIBCPP_STD_VER >= 2033#if _LIBCPP_STD_VER >= 20
3634
35_LIBCPP_BEGIN_NAMESPACE_STD
36
37// [concept.swappable]37// [concept.swappable]
3838
39namespace ranges {39namespace ranges {
...@@ -113,10 +113,10 @@ concept swappable_with = common_reference_with<_Tp, _Up> && requires(_Tp&& __t,...@@ -113,10 +113,10 @@ concept swappable_with = common_reference_with<_Tp, _Up> && requires(_Tp&& __t,
113 ranges::swap(std::forward<_Up>(__u), std::forward<_Tp>(__t));113 ranges::swap(std::forward<_Up>(__u), std::forward<_Tp>(__t));
114};114};
115115
116#endif // _LIBCPP_STD_VER >= 20
117
118_LIBCPP_END_NAMESPACE_STD116_LIBCPP_END_NAMESPACE_STD
119117
118#endif // _LIBCPP_STD_VER >= 20
119
120_LIBCPP_POP_MACROS120_LIBCPP_POP_MACROS
121121
122#endif // _LIBCPP___CONCEPTS_SWAPPABLE_H122#endif // _LIBCPP___CONCEPTS_SWAPPABLE_H
lib/libcxx/include/__concepts/totally_ordered.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26// [concept.totallyordered]26// [concept.totallyordered]
2727
28template <class _Tp, class _Up>28template <class _Tp, class _Up>
...@@ -52,8 +52,8 @@ concept totally_ordered_with =...@@ -52,8 +52,8 @@ concept totally_ordered_with =
52 __partially_ordered_with<_Tp, _Up>;52 __partially_ordered_with<_Tp, _Up>;
53// clang-format on53// clang-format on
5454
55#endif // _LIBCPP_STD_VER >= 20
56
57_LIBCPP_END_NAMESPACE_STD55_LIBCPP_END_NAMESPACE_STD
5856
57#endif // _LIBCPP_STD_VER >= 20
58
59#endif // _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H59#endif // _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
lib/libcxx/include/__condition_variable/condition_variable.h+6-4
...@@ -31,10 +31,11 @@...@@ -31,10 +31,11 @@
31_LIBCPP_PUSH_MACROS31_LIBCPP_PUSH_MACROS
32#include <__undef_macros>32#include <__undef_macros>
3333
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36#if _LIBCPP_HAS_THREADS34#if _LIBCPP_HAS_THREADS
3735
36_LIBCPP_BEGIN_NAMESPACE_STD
37_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
38
38// enum class cv_status39// enum class cv_status
39_LIBCPP_DECLARE_STRONG_ENUM(cv_status){no_timeout, timeout};40_LIBCPP_DECLARE_STRONG_ENUM(cv_status){no_timeout, timeout};
40_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)41_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
...@@ -223,10 +224,11 @@ inline void condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,...@@ -223,10 +224,11 @@ inline void condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
223 wait_for(__lk, __tp - _Clock::now());224 wait_for(__lk, __tp - _Clock::now());
224}225}
225226
226#endif // _LIBCPP_HAS_THREADS227_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
227
228_LIBCPP_END_NAMESPACE_STD228_LIBCPP_END_NAMESPACE_STD
229229
230#endif // _LIBCPP_HAS_THREADS
231
230_LIBCPP_POP_MACROS232_LIBCPP_POP_MACROS
231233
232#endif // _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H234#endif // _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H
lib/libcxx/include/__config+32-697
...@@ -25,61 +25,30 @@...@@ -25,61 +25,30 @@
2525
26#ifdef __cplusplus26#ifdef __cplusplus
2727
28# include <__configuration/abi.h>
29# include <__configuration/attributes.h>
30# include <__configuration/availability.h>
31# include <__configuration/compiler.h>
32# include <__configuration/diagnostic_suppression.h>
33# include <__configuration/experimental.h>
34# include <__configuration/hardening.h>
35# include <__configuration/language.h>
36# include <__configuration/namespace.h>
37# include <__configuration/platform.h>
38# include <__configuration/pstl.h>
39# include <__configuration/utility.h>
40
28// The attributes supported by clang are documented at https://clang.llvm.org/docs/AttributeReference.html41// The attributes supported by clang are documented at https://clang.llvm.org/docs/AttributeReference.html
2942
30// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.43// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
31// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is44// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is
32// defined to XXYYZZ.45// defined to XXYYZZ.
33# define _LIBCPP_VERSION 22010846# define _LIBCPP_VERSION 230100
34
35# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
36# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
37# define _LIBCPP_CONCAT3(X, Y, Z) _LIBCPP_CONCAT(X, _LIBCPP_CONCAT(Y, Z))
38
39# if __STDC_HOSTED__ == 0
40# define _LIBCPP_FREESTANDING
41# endif
42
43# define _LIBCPP_TOSTRING2(x) #x
44# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
45
46# ifndef __has_constexpr_builtin
47# define __has_constexpr_builtin(x) 0
48# endif
49
50// This checks wheter a Clang module is built
51# ifndef __building_module
52# define __building_module(...) 0
53# endif
54
55// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
56// the compiler and '1' otherwise.
57# ifndef __is_identifier
58# define __is_identifier(__x) 1
59# endif
60
61# ifndef __has_declspec_attribute
62# define __has_declspec_attribute(__x) 0
63# endif
64
65# define __has_keyword(__x) !(__is_identifier(__x))
66
67# ifndef __has_warning
68# define __has_warning(...) 0
69# endif
70
71# if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L
72# error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"
73# endif
7447
75# if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)48# if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
76# define _LIBCPP_ABI_VCRUNTIME49# define _LIBCPP_ABI_VCRUNTIME
77# endif50# endif
7851
79# if defined(__MVS__)
80# include <features.h> // for __NATIVE_ASCII_F
81# endif
82
83# if defined(_WIN32)52# if defined(_WIN32)
84# define _LIBCPP_WIN32API53# define _LIBCPP_WIN32API
85# define _LIBCPP_SHORT_WCHAR 154# define _LIBCPP_SHORT_WCHAR 1
...@@ -90,15 +59,9 @@...@@ -90,15 +59,9 @@
90# if defined(_MSC_VER) && !defined(__MINGW32__)59# if defined(_MSC_VER) && !defined(__MINGW32__)
91# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library60# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
92# endif61# endif
93# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
94# define _LIBCPP_HAS_BITSCAN64 1
95# else
96# define _LIBCPP_HAS_BITSCAN64 0
97# endif
98# define _LIBCPP_HAS_OPEN_WITH_WCHAR 162# define _LIBCPP_HAS_OPEN_WITH_WCHAR 1
99# else63# else
100# define _LIBCPP_HAS_OPEN_WITH_WCHAR 064# define _LIBCPP_HAS_OPEN_WITH_WCHAR 0
101# define _LIBCPP_HAS_BITSCAN64 0
102# endif // defined(_WIN32)65# endif // defined(_WIN32)
10366
104# if defined(_AIX) && !defined(__64BIT__)67# if defined(_AIX) && !defined(__64BIT__)
...@@ -184,259 +147,6 @@ typedef __char32_t char32_t;...@@ -184,259 +147,6 @@ typedef __char32_t char32_t;
184# define _LIBCPP_HAS_BLOCKS_RUNTIME 0147# define _LIBCPP_HAS_BLOCKS_RUNTIME 0
185# endif148# endif
186149
187# define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__))
188
189# if defined(_LIBCPP_OBJECT_FORMAT_COFF)
190
191# ifdef _DLL
192# define _LIBCPP_CRT_FUNC __declspec(dllimport)
193# else
194# define _LIBCPP_CRT_FUNC
195# endif
196
197# if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCPP_BUILDING_LIBRARY))
198# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
199# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
200# define _LIBCPP_OVERRIDABLE_FUNC_VIS
201# define _LIBCPP_EXPORTED_FROM_ABI
202# elif defined(_LIBCPP_BUILDING_LIBRARY)
203# if defined(__MINGW32__)
204# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __declspec(dllexport)
205# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
206# else
207# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
208# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __declspec(dllexport)
209# endif
210# define _LIBCPP_OVERRIDABLE_FUNC_VIS __declspec(dllexport)
211# define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllexport)
212# else
213# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __declspec(dllimport)
214# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
215# define _LIBCPP_OVERRIDABLE_FUNC_VIS
216# define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllimport)
217# endif
218
219# define _LIBCPP_HIDDEN
220# define _LIBCPP_TEMPLATE_DATA_VIS
221# define _LIBCPP_NAMESPACE_VISIBILITY
222
223# else
224
225# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
226# define _LIBCPP_VISIBILITY(vis) __attribute__((__visibility__(vis)))
227# else
228# define _LIBCPP_VISIBILITY(vis)
229# endif
230
231# define _LIBCPP_HIDDEN _LIBCPP_VISIBILITY("hidden")
232# define _LIBCPP_TEMPLATE_DATA_VIS _LIBCPP_VISIBILITY("default")
233# define _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_VISIBILITY("default")
234# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_VISIBILITY("default")
235# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
236
237// TODO: Make this a proper customization point or remove the option to override it.
238# ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS
239# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_VISIBILITY("default")
240# endif
241
242# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
243# define _LIBCPP_NAMESPACE_VISIBILITY __attribute__((__type_visibility__("default")))
244# elif !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
245# define _LIBCPP_NAMESPACE_VISIBILITY __attribute__((__visibility__("default")))
246# else
247# define _LIBCPP_NAMESPACE_VISIBILITY
248# endif
249
250# endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
251
252# if __has_attribute(exclude_from_explicit_instantiation)
253# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((__exclude_from_explicit_instantiation__))
254# else
255// Try to approximate the effect of exclude_from_explicit_instantiation
256// (which is that entities are not assumed to be provided by explicit
257// template instantiations in the dylib) by always inlining those entities.
258# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
259# endif
260
261# ifdef _LIBCPP_COMPILER_CLANG_BASED
262# define _LIBCPP_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
263# define _LIBCPP_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
264# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCPP_TOSTRING(clang diagnostic ignored str))
265# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
266# elif defined(_LIBCPP_COMPILER_GCC)
267# define _LIBCPP_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
268# define _LIBCPP_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
269# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str)
270# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCPP_TOSTRING(GCC diagnostic ignored str))
271# else
272# define _LIBCPP_DIAGNOSTIC_PUSH
273# define _LIBCPP_DIAGNOSTIC_POP
274# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str)
275# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
276# endif
277
278// Macros to enter and leave a state where deprecation warnings are suppressed.
279# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
280 _LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated") \
281 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
282# define _LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_DIAGNOSTIC_POP
283
284# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_FAST
285# define _LIBCPP_HARDENING_SIG f
286# elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE
287# define _LIBCPP_HARDENING_SIG s
288# elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
289# define _LIBCPP_HARDENING_SIG d
290# else
291# define _LIBCPP_HARDENING_SIG n // "none"
292# endif
293
294# if _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_OBSERVE
295# define _LIBCPP_ASSERTION_SEMANTIC_SIG o
296# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE
297# define _LIBCPP_ASSERTION_SEMANTIC_SIG q
298# elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
299# define _LIBCPP_ASSERTION_SEMANTIC_SIG e
300# else
301# define _LIBCPP_ASSERTION_SEMANTIC_SIG i // `ignore`
302# endif
303
304# if !_LIBCPP_HAS_EXCEPTIONS
305# define _LIBCPP_EXCEPTIONS_SIG n
306# else
307# define _LIBCPP_EXCEPTIONS_SIG e
308# endif
309
310# define _LIBCPP_ODR_SIGNATURE \
311 _LIBCPP_CONCAT( \
312 _LIBCPP_CONCAT(_LIBCPP_CONCAT(_LIBCPP_HARDENING_SIG, _LIBCPP_ASSERTION_SEMANTIC_SIG), _LIBCPP_EXCEPTIONS_SIG), \
313 _LIBCPP_VERSION)
314
315// This macro marks a symbol as being hidden from libc++'s ABI. This is achieved
316// on two levels:
317// 1. The symbol is given hidden visibility, which ensures that users won't start exporting
318// symbols from their dynamic library by means of using the libc++ headers. This ensures
319// that those symbols stay private to the dynamic library in which it is defined.
320//
321// 2. The symbol is given an ABI tag that encodes the ODR-relevant properties of the library.
322// This ensures that no ODR violation can arise from mixing two TUs compiled with different
323// versions or configurations of libc++ (such as exceptions vs no-exceptions). Indeed, if the
324// program contains two definitions of a function, the ODR requires them to be token-by-token
325// equivalent, and the linker is allowed to pick either definition and discard the other one.
326//
327// For example, if a program contains a copy of `vector::at()` compiled with exceptions enabled
328// *and* a copy of `vector::at()` compiled with exceptions disabled (by means of having two TUs
329// compiled with different settings), the two definitions are both visible by the linker and they
330// have the same name, but they have a meaningfully different implementation (one throws an exception
331// and the other aborts the program). This violates the ODR and makes the program ill-formed, and in
332// practice what will happen is that the linker will pick one of the definitions at random and will
333// discard the other one. This can quite clearly lead to incorrect program behavior.
334//
335// A similar reasoning holds for many other properties that are ODR-affecting. Essentially any
336// property that causes the code of a function to differ from the code in another configuration
337// can be considered ODR-affecting. In practice, we don't encode all such properties in the ABI
338// tag, but we encode the ones that we think are most important: library version, exceptions, and
339// hardening mode.
340//
341// Note that historically, solving this problem has been achieved in various ways, including
342// force-inlining all functions or giving internal linkage to all functions. Both these previous
343// solutions suffer from drawbacks that lead notably to code bloat.
344//
345// Note that we use _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION to ensure that we don't depend
346// on _LIBCPP_HIDE_FROM_ABI methods of classes explicitly instantiated in the dynamic library.
347//
348// Also note that the _LIBCPP_HIDE_FROM_ABI_VIRTUAL macro should be used on virtual functions
349// instead of _LIBCPP_HIDE_FROM_ABI. That macro does not use an ABI tag. Indeed, the mangled
350// name of a virtual function is part of its ABI, since some architectures like arm64e can sign
351// the virtual function pointer in the vtable based on the mangled name of the function. Since
352// we use an ABI tag that changes with each released version, the mangled name of the virtual
353// function would change, which is incorrect. Note that it doesn't make much sense to change
354// the implementation of a virtual function in an ABI-incompatible way in the first place,
355// since that would be an ABI break anyway. Hence, the lack of ABI tag should not be noticeable.
356//
357// The macro can be applied to record and enum types. When the tagged type is nested in
358// a record this "parent" record needs to have the macro too. Another use case for applying
359// this macro to records and unions is to apply an ABI tag to inline constexpr variables.
360// This can be useful for inline variables that are implementation details which are expected
361// to change in the future.
362//
363// TODO: We provide a escape hatch with _LIBCPP_NO_ABI_TAG for folks who want to avoid increasing
364// the length of symbols with an ABI tag. In practice, we should remove the escape hatch and
365// use compression mangling instead, see https://github.com/itanium-cxx-abi/cxx-abi/issues/70.
366# ifndef _LIBCPP_NO_ABI_TAG
367# define _LIBCPP_HIDE_FROM_ABI \
368 _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION \
369 __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
370# else
371# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
372# endif
373# define _LIBCPP_HIDE_FROM_ABI_VIRTUAL _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
374
375// Clang modules take a significant compile time hit when pushing and popping diagnostics.
376// Since all the headers are marked as system headers unless _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER is defined, we can
377// simply disable this pushing and popping when _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER isn't defined.
378# ifdef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
379# define _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS \
380 _LIBCPP_DIAGNOSTIC_PUSH \
381 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++11-extensions") \
382 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++14-extensions") \
383 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++17-extensions") \
384 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++20-extensions") \
385 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++23-extensions") \
386 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++14-extensions") \
387 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++17-extensions") \
388 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++20-extensions") \
389 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++23-extensions")
390# define _LIBCPP_POP_EXTENSION_DIAGNOSTICS _LIBCPP_DIAGNOSTIC_POP
391# else
392# define _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS
393# define _LIBCPP_POP_EXTENSION_DIAGNOSTICS
394# endif
395
396// clang-format off
397
398// The unversioned namespace is used when we want to be ABI compatible with other standard libraries in some way. There
399// are two main categories where that's the case:
400// - Historically, we have made exception types ABI compatible with libstdc++ to allow throwing them between libstdc++
401// and libc++. This is not used anymore for new exception types, since there is no use-case for it anymore.
402// - Types and functions which are used by the compiler are in the unversioned namespace, since the compiler has to know
403// their mangling without the appropriate declaration in some cases.
404// If it's not clear whether using the unversioned namespace is the correct thing to do, it's not. The versioned
405// namespace (_LIBCPP_BEGIN_NAMESPACE_STD) should almost always be used.
406# define _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD \
407 _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS namespace _LIBCPP_NAMESPACE_VISIBILITY std {
408
409# define _LIBCPP_END_UNVERSIONED_NAMESPACE_STD } _LIBCPP_POP_EXTENSION_DIAGNOSTICS
410
411# define _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD inline namespace _LIBCPP_ABI_NAMESPACE {
412# define _LIBCPP_END_NAMESPACE_STD } _LIBCPP_END_UNVERSIONED_NAMESPACE_STD
413
414// TODO: This should really be in the versioned namespace
415#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD namespace experimental {
416#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL } _LIBCPP_END_UNVERSIONED_NAMESPACE_STD
417
418#define _LIBCPP_BEGIN_NAMESPACE_LFTS _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
419#define _LIBCPP_END_NAMESPACE_LFTS } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
420
421#define _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v2 {
422#define _LIBCPP_END_NAMESPACE_LFTS_V2 } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
423
424#ifdef _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
425# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD namespace filesystem {
426# define _LIBCPP_END_NAMESPACE_FILESYSTEM } _LIBCPP_END_NAMESPACE_STD
427#else
428# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD \
429 inline namespace __fs { namespace filesystem {
430
431# define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD
432#endif
433
434// clang-format on
435
436# if __has_attribute(__enable_if__)
437# define _LIBCPP_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
438# endif
439
440# if !defined(__SIZEOF_INT128__) || defined(_MSC_VER)150# if !defined(__SIZEOF_INT128__) || defined(_MSC_VER)
441# define _LIBCPP_HAS_INT128 0151# define _LIBCPP_HAS_INT128 0
442# else152# else
...@@ -488,34 +198,14 @@ typedef __char32_t char32_t;...@@ -488,34 +198,14 @@ typedef __char32_t char32_t;
488# endif198# endif
489# endif199# endif
490200
491# if defined(__APPLE__) || defined(__FreeBSD__)201# if !_LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION || (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606)
492# define _LIBCPP_WCTYPE_IS_MASK202# define _LIBCPP_HAS_ALIGNED_ALLOCATION 0
493# endif
494
495# if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
496# define _LIBCPP_HAS_CHAR8_T 0
497# else203# else
498# define _LIBCPP_HAS_CHAR8_T 1204# define _LIBCPP_HAS_ALIGNED_ALLOCATION 1
499# endif205# endif
500206
501// Deprecation macros.207# if defined(__APPLE__) || defined(__FreeBSD__)
502//208# define _LIBCPP_WCTYPE_IS_MASK
503// Deprecations warnings are always enabled, except when users explicitly opt-out
504// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
505# if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
506# if __has_attribute(__deprecated__)
507# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
508# define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
509# elif _LIBCPP_STD_VER >= 14
510# define _LIBCPP_DEPRECATED [[deprecated]]
511# define _LIBCPP_DEPRECATED_(m) [[deprecated(m)]]
512# else
513# define _LIBCPP_DEPRECATED
514# define _LIBCPP_DEPRECATED_(m)
515# endif
516# else
517# define _LIBCPP_DEPRECATED
518# define _LIBCPP_DEPRECATED_(m)
519# endif209# endif
520210
521// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be211// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
...@@ -527,102 +217,13 @@ typedef __char32_t char32_t;...@@ -527,102 +217,13 @@ typedef __char32_t char32_t;
527# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0217# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0
528# endif218# endif
529219
530# if !defined(_LIBCPP_CXX03_LANG)
531# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
532# else
533# define _LIBCPP_DEPRECATED_IN_CXX11
534# endif
535
536# if _LIBCPP_STD_VER >= 14
537# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
538# else
539# define _LIBCPP_DEPRECATED_IN_CXX14
540# endif
541
542# if _LIBCPP_STD_VER >= 17
543# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
544# else
545# define _LIBCPP_DEPRECATED_IN_CXX17
546# endif
547
548# if _LIBCPP_STD_VER >= 20
549# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
550# else
551# define _LIBCPP_DEPRECATED_IN_CXX20
552# endif
553
554# if _LIBCPP_STD_VER >= 23
555# define _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_DEPRECATED
556# else
557# define _LIBCPP_DEPRECATED_IN_CXX23
558# endif
559
560# if _LIBCPP_STD_VER >= 26
561# define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
562# define _LIBCPP_DEPRECATED_IN_CXX26_(m) _LIBCPP_DEPRECATED_(m)
563# else
564# define _LIBCPP_DEPRECATED_IN_CXX26
565# define _LIBCPP_DEPRECATED_IN_CXX26_(m)
566# endif
567
568# if _LIBCPP_HAS_CHAR8_T
569# define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
570# else
571# define _LIBCPP_DEPRECATED_WITH_CHAR8_T
572# endif
573
574# if _LIBCPP_STD_VER <= 11
575# define _LIBCPP_EXPLICIT_SINCE_CXX14
576# else
577# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
578# endif
579
580# if _LIBCPP_STD_VER >= 23
581# define _LIBCPP_EXPLICIT_SINCE_CXX23 explicit
582# else
583# define _LIBCPP_EXPLICIT_SINCE_CXX23
584# endif
585
586# if _LIBCPP_STD_VER >= 14
587# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
588# else
589# define _LIBCPP_CONSTEXPR_SINCE_CXX14
590# endif
591
592# if _LIBCPP_STD_VER >= 17
593# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
594# else
595# define _LIBCPP_CONSTEXPR_SINCE_CXX17
596# endif
597
598# if _LIBCPP_STD_VER >= 20
599# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
600# else
601# define _LIBCPP_CONSTEXPR_SINCE_CXX20
602# endif
603
604# if _LIBCPP_STD_VER >= 23
605# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
606# else
607# define _LIBCPP_CONSTEXPR_SINCE_CXX23
608# endif
609
610# if _LIBCPP_STD_VER >= 26
611# define _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr
612# else
613# define _LIBCPP_CONSTEXPR_SINCE_CXX26
614# endif
615
616# ifndef _LIBCPP_WEAK
617# define _LIBCPP_WEAK __attribute__((__weak__))
618# endif
619
620// Thread API220// Thread API
621// clang-format off221// clang-format off
622# if _LIBCPP_HAS_THREADS && \222# if _LIBCPP_HAS_THREADS && \
623 !_LIBCPP_HAS_THREAD_API_PTHREAD && \223 !_LIBCPP_HAS_THREAD_API_PTHREAD && \
624 !_LIBCPP_HAS_THREAD_API_WIN32 && \224 !_LIBCPP_HAS_THREAD_API_WIN32 && \
625 !_LIBCPP_HAS_THREAD_API_EXTERNAL225 !_LIBCPP_HAS_THREAD_API_EXTERNAL && \
226 !_LIBCPP_HAS_THREAD_API_C11
626227
627# if defined(__FreeBSD__) || \228# if defined(__FreeBSD__) || \
628 defined(__wasi__) || \229 defined(__wasi__) || \
...@@ -634,7 +235,11 @@ typedef __char32_t char32_t;...@@ -634,7 +235,11 @@ typedef __char32_t char32_t;
634 defined(__APPLE__) || \235 defined(__APPLE__) || \
635 defined(__MVS__) || \236 defined(__MVS__) || \
636 defined(_AIX) || \237 defined(_AIX) || \
637 defined(__EMSCRIPTEN__)238 defined(__EMSCRIPTEN__) || \
239 defined(__HAIKU__) || \
240 defined(__serenity__)
241// zig patch: haiku support
242// zig patch: serenity support
638// clang-format on243// clang-format on
639# undef _LIBCPP_HAS_THREAD_API_PTHREAD244# undef _LIBCPP_HAS_THREAD_API_PTHREAD
640# define _LIBCPP_HAS_THREAD_API_PTHREAD 1245# define _LIBCPP_HAS_THREAD_API_PTHREAD 1
...@@ -666,6 +271,10 @@ typedef __char32_t char32_t;...@@ -666,6 +271,10 @@ typedef __char32_t char32_t;
666# error _LIBCPP_HAS_THREAD_API_EXTERNAL may only be true when _LIBCPP_HAS_THREADS is true.271# error _LIBCPP_HAS_THREAD_API_EXTERNAL may only be true when _LIBCPP_HAS_THREADS is true.
667# endif272# endif
668273
274# if !_LIBCPP_HAS_THREADS && _LIBCPP_HAS_THREAD_API_C11
275# error _LIBCPP_HAS_THREAD_API_C11 may only be true when _LIBCPP_HAS_THREADS is true.
276# endif
277
669# if !_LIBCPP_HAS_MONOTONIC_CLOCK && _LIBCPP_HAS_THREADS278# if !_LIBCPP_HAS_MONOTONIC_CLOCK && _LIBCPP_HAS_THREADS
670# error _LIBCPP_HAS_MONOTONIC_CLOCK may only be false when _LIBCPP_HAS_THREADS is false.279# error _LIBCPP_HAS_MONOTONIC_CLOCK may only be false when _LIBCPP_HAS_THREADS is false.
671# endif280# endif
...@@ -708,61 +317,12 @@ typedef __char32_t char32_t;...@@ -708,61 +317,12 @@ typedef __char32_t char32_t;
708# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION 0317# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION 0
709# endif318# endif
710319
320// zig patch: serenity support
711# if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \321# if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \
712 _LIBCPP_HAS_MUSL_LIBC || defined(__OpenBSD__) || defined(__LLVM_LIBC__)322 _LIBCPP_HAS_MUSL_LIBC || defined(__OpenBSD__) || _LIBCPP_LIBC_LLVM_LIBC || defined(__serenity__)
713# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE323# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
714# endif324# endif
715325
716# if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
717# define _LIBCPP_HAS_C_ATOMIC_IMP 1
718# define _LIBCPP_HAS_GCC_ATOMIC_IMP 0
719# define _LIBCPP_HAS_EXTERNAL_ATOMIC_IMP 0
720# elif defined(_LIBCPP_COMPILER_GCC)
721# define _LIBCPP_HAS_C_ATOMIC_IMP 0
722# define _LIBCPP_HAS_GCC_ATOMIC_IMP 1
723# define _LIBCPP_HAS_EXTERNAL_ATOMIC_IMP 0
724# endif
725
726# if !_LIBCPP_HAS_C_ATOMIC_IMP && !_LIBCPP_HAS_GCC_ATOMIC_IMP && !_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP
727# define _LIBCPP_HAS_ATOMIC_HEADER 0
728# else
729# define _LIBCPP_HAS_ATOMIC_HEADER 1
730# ifndef _LIBCPP_ATOMIC_FLAG_TYPE
731# define _LIBCPP_ATOMIC_FLAG_TYPE bool
732# endif
733# endif
734
735# if __has_cpp_attribute(_Clang::__no_thread_safety_analysis__)
736# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS [[_Clang::__no_thread_safety_analysis__]]
737# else
738# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
739# endif
740
741# if _LIBCPP_STD_VER >= 20
742# define _LIBCPP_CONSTINIT constinit
743# elif __has_attribute(__require_constant_initialization__)
744# define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
745# else
746# define _LIBCPP_CONSTINIT
747# endif
748
749# if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
750// The CUDA SDK contains an unfortunate definition for the __noinline__ macro,
751// which breaks the regular __attribute__((__noinline__)) syntax. Therefore,
752// when compiling for CUDA we use the non-underscored version of the noinline
753// attribute.
754//
755// This is a temporary workaround and we still expect the CUDA SDK team to solve
756// this issue properly in the SDK headers.
757//
758// See https://github.com/llvm/llvm-project/pull/73838 for more details.
759# define _LIBCPP_NOINLINE __attribute__((noinline))
760# elif __has_attribute(__noinline__)
761# define _LIBCPP_NOINLINE __attribute__((__noinline__))
762# else
763# define _LIBCPP_NOINLINE
764# endif
765
766// We often repeat things just for handling wide characters in the library.326// We often repeat things just for handling wide characters in the library.
767// When wide characters are disabled, it can be useful to have a quick way of327// When wide characters are disabled, it can be useful to have a quick way of
768// disabling it without having to resort to #if-#endif, which has a larger328// disabling it without having to resort to #if-#endif, which has a larger
...@@ -788,27 +348,6 @@ typedef __char32_t char32_t;...@@ -788,27 +348,6 @@ typedef __char32_t char32_t;
788# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)348# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
789# endif // _LIBCPP_NO_AUTO_LINK349# endif // _LIBCPP_NO_AUTO_LINK
790350
791// Configures the fopen close-on-exec mode character, if any. This string will
792// be appended to any mode string used by fstream for fopen/fdopen.
793//
794// Not all platforms support this, but it helps avoid fd-leaks on platforms that
795// do.
796# if defined(__BIONIC__)
797# define _LIBCPP_FOPEN_CLOEXEC_MODE "e"
798# else
799# define _LIBCPP_FOPEN_CLOEXEC_MODE
800# endif
801
802# if __has_cpp_attribute(msvc::no_unique_address)
803// MSVC implements [[no_unique_address]] as a silent no-op currently.
804// (If/when MSVC breaks its C++ ABI, it will be changed to work as intended.)
805// However, MSVC implements [[msvc::no_unique_address]] which does what
806// [[no_unique_address]] is supposed to do, in general.
807# define _LIBCPP_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
808# else
809# define _LIBCPP_NO_UNIQUE_ADDRESS [[__no_unique_address__]]
810# endif
811
812// c8rtomb() and mbrtoc8() were added in C++20 and C23. Support for these351// c8rtomb() and mbrtoc8() were added in C++20 and C23. Support for these
813// functions is gradually being added to existing C libraries. The conditions352// functions is gradually being added to existing C libraries. The conditions
814// below check for known C library versions and conditions under which these353// below check for known C library versions and conditions under which these
...@@ -844,210 +383,6 @@ typedef __char32_t char32_t;...@@ -844,210 +383,6 @@ typedef __char32_t char32_t;
844# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")383# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
845# endif384# endif
846385
847# if defined(__OBJC__) && defined(_LIBCPP_APPLE_CLANG_VER)
848# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
849# endif
850
851# define _PSTL_PRAGMA(x) _Pragma(#x)
852
853// Enable SIMD for compilers that support OpenMP 4.0
854# if (defined(_OPENMP) && _OPENMP >= 201307)
855
856# define _PSTL_UDR_PRESENT
857# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
858# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
859# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
860# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
861# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
862# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
863
864// Declaration of reduction functor, where
865// NAME - the name of the functor
866// OP - type of the callable object with the reduction operation
867// omp_in - refers to the local partial result
868// omp_out - refers to the final value of the combiner operator
869// omp_priv - refers to the private copy of the initial value
870// omp_orig - refers to the original variable to be reduced
871# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \
872 _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
873
874# elif defined(_LIBCPP_COMPILER_CLANG_BASED)
875
876# define _PSTL_PRAGMA_SIMD _Pragma("clang loop vectorize(enable) interleave(enable)")
877# define _PSTL_PRAGMA_DECLARE_SIMD
878# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _Pragma("clang loop vectorize(enable) interleave(enable)")
879# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _Pragma("clang loop vectorize(enable) interleave(enable)")
880# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
881# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
882# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
883
884# else // (defined(_OPENMP) && _OPENMP >= 201307)
885
886# define _PSTL_PRAGMA_SIMD
887# define _PSTL_PRAGMA_DECLARE_SIMD
888# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM)
889# define _PSTL_PRAGMA_SIMD_SCAN(PRM)
890# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
891# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
892# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
893
894# endif // (defined(_OPENMP) && _OPENMP >= 201307)
895
896# define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
897
898// Optional attributes - these are useful for a better QoI, but not required to be available
899
900# define _LIBCPP_NOALIAS __attribute__((__malloc__))
901# define _LIBCPP_NODEBUG [[__gnu__::__nodebug__]]
902# define _LIBCPP_NO_SANITIZE(...) __attribute__((__no_sanitize__(__VA_ARGS__)))
903# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((__init_priority__(100)))
904# define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) \
905 __attribute__((__format__(archetype, format_string_index, first_format_arg_index)))
906# define _LIBCPP_PACKED __attribute__((__packed__))
907
908# if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
909# define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
910# else
911# define _LIBCPP_NO_CFI
912# endif
913
914# if __has_attribute(__using_if_exists__)
915# define _LIBCPP_USING_IF_EXISTS __attribute__((__using_if_exists__))
916# else
917# define _LIBCPP_USING_IF_EXISTS
918# endif
919
920# if __has_cpp_attribute(_Clang::__no_destroy__)
921# define _LIBCPP_NO_DESTROY [[_Clang::__no_destroy__]]
922# else
923# define _LIBCPP_NO_DESTROY
924# endif
925
926# if __has_attribute(__diagnose_if__)
927# define _LIBCPP_DIAGNOSE_WARNING(...) __attribute__((__diagnose_if__(__VA_ARGS__, "warning")))
928# else
929# define _LIBCPP_DIAGNOSE_WARNING(...)
930# endif
931
932# if __has_attribute(__diagnose_if__) && !defined(_LIBCPP_APPLE_CLANG_VER) && \
933 (!defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER >= 2001)
934# define _LIBCPP_DIAGNOSE_IF(...) __attribute__((__diagnose_if__(__VA_ARGS__)))
935# else
936# define _LIBCPP_DIAGNOSE_IF(...)
937# endif
938
939# define _LIBCPP_DIAGNOSE_NULLPTR_IF(condition, condition_description) \
940 _LIBCPP_DIAGNOSE_IF( \
941 condition, \
942 "null passed to callee that requires a non-null argument" condition_description, \
943 "warning", \
944 "nonnull")
945
946# if __has_cpp_attribute(_Clang::__lifetimebound__)
947# define _LIBCPP_LIFETIMEBOUND [[_Clang::__lifetimebound__]]
948# else
949# define _LIBCPP_LIFETIMEBOUND
950# endif
951
952// This is to work around https://llvm.org/PR156809
953# ifndef _LIBCPP_CXX03_LANG
954# define _LIBCPP_CTOR_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND
955# else
956# define _LIBCPP_CTOR_LIFETIMEBOUND
957# endif
958
959# if __has_cpp_attribute(_Clang::__noescape__)
960# define _LIBCPP_NOESCAPE [[_Clang::__noescape__]]
961# else
962# define _LIBCPP_NOESCAPE
963# endif
964
965# if __has_cpp_attribute(_Clang::__no_specializations__)
966# define _LIBCPP_NO_SPECIALIZATIONS \
967 [[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]]
968# else
969# define _LIBCPP_NO_SPECIALIZATIONS
970# endif
971
972# if __has_cpp_attribute(_Clang::__preferred_name__)
973# define _LIBCPP_PREFERRED_NAME(x) [[_Clang::__preferred_name__(x)]]
974# else
975# define _LIBCPP_PREFERRED_NAME(x)
976# endif
977
978# if __has_cpp_attribute(_Clang::__scoped_lockable__)
979# define _LIBCPP_SCOPED_LOCKABLE [[_Clang::__scoped_lockable__]]
980# else
981# define _LIBCPP_SCOPED_LOCKABLE
982# endif
983
984# if __has_cpp_attribute(_Clang::__capability__)
985# define _LIBCPP_CAPABILITY(...) [[_Clang::__capability__(__VA_ARGS__)]]
986# else
987# define _LIBCPP_CAPABILITY(...)
988# endif
989
990# if __has_attribute(__acquire_capability__)
991# define _LIBCPP_ACQUIRE_CAPABILITY(...) __attribute__((__acquire_capability__(__VA_ARGS__)))
992# else
993# define _LIBCPP_ACQUIRE_CAPABILITY(...)
994# endif
995
996# if __has_cpp_attribute(_Clang::__try_acquire_capability__)
997# define _LIBCPP_TRY_ACQUIRE_CAPABILITY(...) [[_Clang::__try_acquire_capability__(__VA_ARGS__)]]
998# else
999# define _LIBCPP_TRY_ACQUIRE_CAPABILITY(...)
1000# endif
1001
1002# if __has_cpp_attribute(_Clang::__acquire_shared_capability__)
1003# define _LIBCPP_ACQUIRE_SHARED_CAPABILITY [[_Clang::__acquire_shared_capability__]]
1004# else
1005# define _LIBCPP_ACQUIRE_SHARED_CAPABILITY
1006# endif
1007
1008# if __has_cpp_attribute(_Clang::__try_acquire_shared_capability__)
1009# define _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(...) [[_Clang::__try_acquire_shared_capability__(__VA_ARGS__)]]
1010# else
1011# define _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(...)
1012# endif
1013
1014# if __has_cpp_attribute(_Clang::__release_capability__)
1015# define _LIBCPP_RELEASE_CAPABILITY [[_Clang::__release_capability__]]
1016# else
1017# define _LIBCPP_RELEASE_CAPABILITY
1018# endif
1019
1020# if __has_cpp_attribute(_Clang::__release_shared_capability__)
1021# define _LIBCPP_RELEASE_SHARED_CAPABILITY [[_Clang::__release_shared_capability__]]
1022# else
1023# define _LIBCPP_RELEASE_SHARED_CAPABILITY
1024# endif
1025
1026# if __has_attribute(__requires_capability__)
1027# define _LIBCPP_REQUIRES_CAPABILITY(...) __attribute__((__requires_capability__(__VA_ARGS__)))
1028# else
1029# define _LIBCPP_REQUIRES_CAPABILITY(...)
1030# endif
1031
1032# if defined(_LIBCPP_ABI_MICROSOFT) && __has_declspec_attribute(empty_bases)
1033# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
1034# else
1035# define _LIBCPP_DECLSPEC_EMPTY_BASES
1036# endif
1037
1038// Allow for build-time disabling of unsigned integer sanitization
1039# if __has_attribute(no_sanitize) && !defined(_LIBCPP_COMPILER_GCC)
1040# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
1041# else
1042# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
1043# endif
1044
1045# if __has_feature(nullability)
1046# define _LIBCPP_DIAGNOSE_NULLPTR _Nonnull
1047# else
1048# define _LIBCPP_DIAGNOSE_NULLPTR
1049# endif
1050
1051#endif // __cplusplus386#endif // __cplusplus
1052387
1053#endif // _LIBCPP___CONFIG388#endif // _LIBCPP___CONFIG
lib/libcxx/include/__configuration/abi.h+4-16
...@@ -52,12 +52,6 @@...@@ -52,12 +52,6 @@
52#if _LIBCPP_ABI_VERSION >= 252#if _LIBCPP_ABI_VERSION >= 2
53// TODO: Move the description of the remaining ABI flags to ABIGuarantees.rst or remove them.53// TODO: Move the description of the remaining ABI flags to ABIGuarantees.rst or remove them.
5454
55// Override the default return value of exception::what() for bad_function_call::what()
56// with a string that is specific to bad_function_call (see http://wg21.link/LWG2233).
57// This is an ABI break on platforms that sign and authenticate vtable function pointers
58// because it changes the mangling of the virtual function located in the vtable, which
59// changes how it gets signed.
60# define _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
61// According to the Standard, `bitset::operator[] const` returns bool55// According to the Standard, `bitset::operator[] const` returns bool
62# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL56# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
6357
...@@ -77,11 +71,14 @@...@@ -77,11 +71,14 @@
77# define _LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER71# define _LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER
78# define _LIBCPP_ABI_OPTIMIZED_FUNCTION72# define _LIBCPP_ABI_OPTIMIZED_FUNCTION
79# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO73# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
74# define _LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED
80# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION75# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
81# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY76# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY
82# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW77# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
83# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION78# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
84# define _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR79# define _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR
80# define _LIBCPP_ABI_USE_SMALL_DEQUE_BLOCK_SIZE
81# define _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
8582
86#elif _LIBCPP_ABI_VERSION == 183#elif _LIBCPP_ABI_VERSION == 1
87// Feature macros for disabling pre ABI v1 features. All of these options84// Feature macros for disabling pre ABI v1 features. All of these options
...@@ -91,15 +88,6 @@...@@ -91,15 +88,6 @@
91# endif88# endif
92#endif89#endif
9390
94// TODO(LLVM 22): Remove this check
95#if defined(_LIBCPP_ABI_NO_ITERATOR_BASES) && !defined(_LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER)
96# ifndef _LIBCPP_ONLY_NO_ITERATOR_BASES
97# error "You probably want to define _LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER. This has been split out from" \
98 " _LIBCPP_ABI_NO_ITERATOR_BASES to allow only removing the second iterator member, since they aren't really related." \
99 "If you actually want this ABI configuration, please define _LIBCPP_ONLY_NO_ITERATOR_BASES instead."
100# endif
101#endif
102
103// We had some bugs where we use [[no_unique_address]] together with construct_at,91// We had some bugs where we use [[no_unique_address]] together with construct_at,
104// which causes UB as the call on construct_at could write to overlapping subobjects92// which causes UB as the call on construct_at could write to overlapping subobjects
105//93//
...@@ -108,7 +96,7 @@...@@ -108,7 +96,7 @@
108//96//
109// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions.97// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions.
110// The macro below is used for all classes whose ABI have changed as part of fixing these bugs.98// The macro below is used for all classes whose ABI have changed as part of fixing these bugs.
111#define _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS __attribute__((__abi_tag__("llvm18_nua")))99#define _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG __attribute__((__abi_tag__("llvm18_nua")))
112100
113// [[msvc::no_unique_address]] seems to mostly affect empty classes, so the padding scheme for Itanium doesn't work.101// [[msvc::no_unique_address]] seems to mostly affect empty classes, so the padding scheme for Itanium doesn't work.
114#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING)102#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING)
lib/libcxx/include/__configuration/attributes.h created+476
...@@ -0,0 +1,476 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___CONFIGURATION_ATTRIBUTES_H
10#define _LIBCPP___CONFIGURATION_ATTRIBUTES_H
11
12/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
13#include <__configuration/hardening.h>
14#include <__configuration/language.h>
15#include <__configuration/utility.h>
16
17#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
18# pragma GCC system_header
19#endif
20
21#ifndef __has_declspec_attribute
22# define __has_declspec_attribute(__x) 0
23#endif
24
25// Attributes relevant for layout ABI
26// ----------------------------------
27
28#if __has_cpp_attribute(msvc::no_unique_address)
29// MSVC implements [[no_unique_address]] as a silent no-op currently.
30// (If/when MSVC breaks its C++ ABI, it will be changed to work as intended.)
31// However, MSVC implements [[msvc::no_unique_address]] which does what
32// [[no_unique_address]] is supposed to do, in general.
33# define _LIBCPP_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
34#else
35# define _LIBCPP_NO_UNIQUE_ADDRESS [[__no_unique_address__]]
36#endif
37
38#define _LIBCPP_PACKED __attribute__((__packed__))
39
40// Attributes affecting overload resolution
41// ----------------------------------------
42
43#if __has_attribute(__enable_if__)
44# define _LIBCPP_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
45#endif
46
47// Visibility attributes
48// ---------------------
49
50#if defined(_LIBCPP_OBJECT_FORMAT_COFF)
51
52# ifdef _DLL
53# define _LIBCPP_CRT_FUNC __declspec(dllimport)
54# else
55# define _LIBCPP_CRT_FUNC
56# endif
57
58# if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCPP_BUILDING_LIBRARY))
59# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
60# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
61# define _LIBCPP_OVERRIDABLE_FUNC_VIS
62# define _LIBCPP_EXPORTED_FROM_ABI
63# elif defined(_LIBCPP_BUILDING_LIBRARY)
64# if defined(__MINGW32__)
65# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __declspec(dllexport)
66# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
67# else
68# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
69# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __declspec(dllexport)
70# endif
71# define _LIBCPP_OVERRIDABLE_FUNC_VIS __declspec(dllexport)
72# define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllexport)
73# else
74# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __declspec(dllimport)
75# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
76# define _LIBCPP_OVERRIDABLE_FUNC_VIS
77# define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllimport)
78# endif
79
80# define _LIBCPP_HIDDEN
81# define _LIBCPP_TEMPLATE_DATA_VIS
82# define _LIBCPP_NAMESPACE_VISIBILITY
83
84#else
85
86# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
87# define _LIBCPP_VISIBILITY(vis) __attribute__((__visibility__(vis)))
88# else
89# define _LIBCPP_VISIBILITY(vis)
90# endif
91
92# define _LIBCPP_HIDDEN _LIBCPP_VISIBILITY("hidden")
93# define _LIBCPP_TEMPLATE_DATA_VIS _LIBCPP_VISIBILITY("default")
94# define _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_VISIBILITY("default")
95# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_VISIBILITY("default")
96# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
97
98// TODO: Make this a proper customization point or remove the option to override it.
99# ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS
100# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_VISIBILITY("default")
101# endif
102
103# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
104# define _LIBCPP_NAMESPACE_VISIBILITY __attribute__((__type_visibility__("default")))
105# elif !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
106# define _LIBCPP_NAMESPACE_VISIBILITY __attribute__((__visibility__("default")))
107# else
108# define _LIBCPP_NAMESPACE_VISIBILITY
109# endif
110
111#endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
112
113// hide_from_abi
114// -------------
115
116#define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__))
117
118#if __has_attribute(exclude_from_explicit_instantiation)
119# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((__exclude_from_explicit_instantiation__))
120#else
121// Try to approximate the effect of exclude_from_explicit_instantiation
122// (which is that entities are not assumed to be provided by explicit
123// template instantiations in the dylib) by always inlining those entities.
124# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
125#endif
126
127#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_FAST
128# define _LIBCPP_HARDENING_SIG f
129#elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE
130# define _LIBCPP_HARDENING_SIG s
131#elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
132# define _LIBCPP_HARDENING_SIG d
133#else
134# define _LIBCPP_HARDENING_SIG n // "none"
135#endif
136
137#if _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_OBSERVE
138# define _LIBCPP_ASSERTION_SEMANTIC_SIG o
139#elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE
140# define _LIBCPP_ASSERTION_SEMANTIC_SIG q
141#elif _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
142# define _LIBCPP_ASSERTION_SEMANTIC_SIG e
143#else
144# define _LIBCPP_ASSERTION_SEMANTIC_SIG i // `ignore`
145#endif
146
147#if !_LIBCPP_HAS_EXCEPTIONS
148# define _LIBCPP_EXCEPTIONS_SIG n
149#else
150# define _LIBCPP_EXCEPTIONS_SIG e
151#endif
152
153#define _LIBCPP_ODR_SIGNATURE \
154 _LIBCPP_CONCAT( \
155 _LIBCPP_CONCAT(_LIBCPP_CONCAT(_LIBCPP_HARDENING_SIG, _LIBCPP_ASSERTION_SEMANTIC_SIG), _LIBCPP_EXCEPTIONS_SIG), \
156 _LIBCPP_VERSION)
157
158// This macro marks a symbol as being hidden from libc++'s ABI. This is achieved
159// on two levels:
160// 1. The symbol is given hidden visibility, which ensures that users won't start exporting
161// symbols from their dynamic library by means of using the libc++ headers. This ensures
162// that those symbols stay private to the dynamic library in which it is defined.
163//
164// 2. The symbol is given an ABI tag that encodes the ODR-relevant properties of the library.
165// This ensures that no ODR violation can arise from mixing two TUs compiled with different
166// versions or configurations of libc++ (such as exceptions vs no-exceptions). Indeed, if the
167// program contains two definitions of a function, the ODR requires them to be token-by-token
168// equivalent, and the linker is allowed to pick either definition and discard the other one.
169//
170// For example, if a program contains a copy of `vector::at()` compiled with exceptions enabled
171// *and* a copy of `vector::at()` compiled with exceptions disabled (by means of having two TUs
172// compiled with different settings), the two definitions are both visible by the linker and they
173// have the same name, but they have a meaningfully different implementation (one throws an exception
174// and the other aborts the program). This violates the ODR and makes the program ill-formed, and in
175// practice what will happen is that the linker will pick one of the definitions at random and will
176// discard the other one. This can quite clearly lead to incorrect program behavior.
177//
178// A similar reasoning holds for many other properties that are ODR-affecting. Essentially any
179// property that causes the code of a function to differ from the code in another configuration
180// can be considered ODR-affecting. In practice, we don't encode all such properties in the ABI
181// tag, but we encode the ones that we think are most important: library version, exceptions, and
182// hardening mode.
183//
184// Note that historically, solving this problem has been achieved in various ways, including
185// force-inlining all functions or giving internal linkage to all functions. Both these previous
186// solutions suffer from drawbacks that lead notably to code bloat.
187//
188// Note that we use _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION to ensure that we don't depend
189// on _LIBCPP_HIDE_FROM_ABI methods of classes explicitly instantiated in the dynamic library.
190//
191// Also note that the _LIBCPP_HIDE_FROM_ABI_VIRTUAL macro should be used on virtual functions
192// instead of _LIBCPP_HIDE_FROM_ABI. That macro does not use an ABI tag. Indeed, the mangled
193// name of a virtual function is part of its ABI, since some architectures like arm64e can sign
194// the virtual function pointer in the vtable based on the mangled name of the function. Since
195// we use an ABI tag that changes with each released version, the mangled name of the virtual
196// function would change, which is incorrect. Note that it doesn't make much sense to change
197// the implementation of a virtual function in an ABI-incompatible way in the first place,
198// since that would be an ABI break anyway. Hence, the lack of ABI tag should not be noticeable.
199//
200// The macro can be applied to record and enum types. When the tagged type is nested in
201// a record this "parent" record needs to have the macro too. Another use case for applying
202// this macro to records and unions is to apply an ABI tag to inline constexpr variables.
203// This can be useful for inline variables that are implementation details which are expected
204// to change in the future.
205//
206// TODO: We provide a escape hatch with _LIBCPP_NO_ABI_TAG for folks who want to avoid increasing
207// the length of symbols with an ABI tag. In practice, we should remove the escape hatch and
208// use compression mangling instead, see https://github.com/itanium-cxx-abi/cxx-abi/issues/70.
209#ifndef _LIBCPP_NO_ABI_TAG
210# define _LIBCPP_HIDE_FROM_ABI \
211 _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION \
212 __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
213#else
214# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
215#endif
216#define _LIBCPP_HIDE_FROM_ABI_VIRTUAL _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
217
218// This macro makes sure that private classes which aren't necessarily part of the ABI change their name every release.
219// The intention is _not_ to put it on every private class, but only on classes where type name stability implies ABI
220// stability. This is essentially the case for classes that are only accessed through the vtable after instantiation,
221// for example the control blocks of `shared_ptr`. These classes can change in ABI breaking ways as long as their name
222// (and hence their vtable symbol) changes too. Note that the vtable and RTTI are not marked with
223// [[gnu::visibility("hidden")]], since the vtable and RTTI should still be deduplicated across dylibs with the same
224// instatiations.
225#define _LIBCPP_HIDE_STRUCT_FROM_ABI [[__gnu__::__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))]]
226
227// Optional attributes
228// -------------------
229
230// these are useful for a better QoI, but not required to be available
231
232#define _LIBCPP_NOALIAS __attribute__((__malloc__))
233#define _LIBCPP_NODEBUG [[__gnu__::__nodebug__]]
234#define _LIBCPP_NO_SANITIZE(...) __attribute__((__no_sanitize__(__VA_ARGS__)))
235#define _LIBCPP_INIT_PRIORITY_MAX __attribute__((__init_priority__(100)))
236#define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) \
237 __attribute__((__format__(archetype, format_string_index, first_format_arg_index)))
238
239#if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
240# define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
241#else
242# define _LIBCPP_NO_CFI
243#endif
244
245#if __has_attribute(__using_if_exists__)
246# define _LIBCPP_USING_IF_EXISTS __attribute__((__using_if_exists__))
247#else
248# define _LIBCPP_USING_IF_EXISTS
249#endif
250
251#if __has_cpp_attribute(_Clang::__no_destroy__)
252# define _LIBCPP_NO_DESTROY [[_Clang::__no_destroy__]]
253#else
254# define _LIBCPP_NO_DESTROY
255#endif
256
257#if __has_attribute(__diagnose_if__)
258# define _LIBCPP_DIAGNOSE_WARNING(...) __attribute__((__diagnose_if__(__VA_ARGS__, "warning")))
259#else
260# define _LIBCPP_DIAGNOSE_WARNING(...)
261#endif
262
263#if __has_attribute(__diagnose_if__) && !defined(_LIBCPP_APPLE_CLANG_VER) && \
264 (!defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER >= 2001)
265# define _LIBCPP_DIAGNOSE_IF(...) __attribute__((__diagnose_if__(__VA_ARGS__)))
266#else
267# define _LIBCPP_DIAGNOSE_IF(...)
268#endif
269
270#define _LIBCPP_DIAGNOSE_NULLPTR_IF(condition, condition_description) \
271 _LIBCPP_DIAGNOSE_IF( \
272 condition, \
273 "null passed to callee that requires a non-null argument" condition_description, \
274 "warning", \
275 "nonnull")
276
277#if __has_cpp_attribute(_Clang::__lifetimebound__)
278# define _LIBCPP_LIFETIMEBOUND [[_Clang::__lifetimebound__]]
279#else
280# define _LIBCPP_LIFETIMEBOUND
281#endif
282
283// This is to work around https://llvm.org/PR156809
284#ifndef _LIBCPP_CXX03_LANG
285# define _LIBCPP_CTOR_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND
286#else
287# define _LIBCPP_CTOR_LIFETIMEBOUND
288#endif
289
290#if __has_cpp_attribute(_Clang::__noescape__)
291# define _LIBCPP_NOESCAPE [[_Clang::__noescape__]]
292#else
293# define _LIBCPP_NOESCAPE
294#endif
295
296#if __has_cpp_attribute(_Clang::__no_specializations__)
297# define _LIBCPP_NO_SPECIALIZATIONS \
298 [[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]]
299#else
300# define _LIBCPP_NO_SPECIALIZATIONS
301#endif
302
303#if __has_cpp_attribute(_Clang::__preferred_name__)
304# define _LIBCPP_PREFERRED_NAME(x) [[_Clang::__preferred_name__(x)]]
305#else
306# define _LIBCPP_PREFERRED_NAME(x)
307#endif
308
309#if __has_cpp_attribute(_Clang::__scoped_lockable__)
310# define _LIBCPP_SCOPED_LOCKABLE [[_Clang::__scoped_lockable__]]
311#else
312# define _LIBCPP_SCOPED_LOCKABLE
313#endif
314
315#if __has_cpp_attribute(_Clang::__capability__)
316# define _LIBCPP_CAPABILITY(...) [[_Clang::__capability__(__VA_ARGS__)]]
317#else
318# define _LIBCPP_CAPABILITY(...)
319#endif
320
321#if __has_attribute(__acquire_capability__)
322# define _LIBCPP_ACQUIRE_CAPABILITY(...) __attribute__((__acquire_capability__(__VA_ARGS__)))
323#else
324# define _LIBCPP_ACQUIRE_CAPABILITY(...)
325#endif
326
327#if __has_cpp_attribute(_Clang::__try_acquire_capability__)
328# define _LIBCPP_TRY_ACQUIRE_CAPABILITY(...) [[_Clang::__try_acquire_capability__(__VA_ARGS__)]]
329#else
330# define _LIBCPP_TRY_ACQUIRE_CAPABILITY(...)
331#endif
332
333#if __has_cpp_attribute(_Clang::__acquire_shared_capability__)
334# define _LIBCPP_ACQUIRE_SHARED_CAPABILITY [[_Clang::__acquire_shared_capability__]]
335#else
336# define _LIBCPP_ACQUIRE_SHARED_CAPABILITY
337#endif
338
339#if __has_cpp_attribute(_Clang::__try_acquire_shared_capability__)
340# define _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(...) [[_Clang::__try_acquire_shared_capability__(__VA_ARGS__)]]
341#else
342# define _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(...)
343#endif
344
345#if __has_attribute(__release_capability__)
346# define _LIBCPP_RELEASE_CAPABILITY(...) __attribute__((__release_capability__(__VA_ARGS__)))
347#else
348# define _LIBCPP_RELEASE_CAPABILITY(...)
349#endif
350
351#if __has_cpp_attribute(_Clang::__release_shared_capability__)
352# define _LIBCPP_RELEASE_SHARED_CAPABILITY [[_Clang::__release_shared_capability__]]
353#else
354# define _LIBCPP_RELEASE_SHARED_CAPABILITY
355#endif
356
357#if __has_attribute(__requires_capability__)
358# define _LIBCPP_REQUIRES_CAPABILITY(...) __attribute__((__requires_capability__(__VA_ARGS__)))
359#else
360# define _LIBCPP_REQUIRES_CAPABILITY(...)
361#endif
362
363#if __has_cpp_attribute(_Clang::__no_thread_safety_analysis__)
364# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS [[_Clang::__no_thread_safety_analysis__]]
365#else
366# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
367#endif
368
369#if defined(_LIBCPP_ABI_MICROSOFT) && __has_declspec_attribute(empty_bases)
370# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
371#else
372# define _LIBCPP_DECLSPEC_EMPTY_BASES
373#endif
374
375// Allow for build-time disabling of unsigned integer sanitization
376#if __has_attribute(no_sanitize) && !defined(_LIBCPP_COMPILER_GCC)
377# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
378#else
379# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
380#endif
381
382#if __has_feature(nullability)
383# define _LIBCPP_DIAGNOSE_NULLPTR _Nonnull
384#else
385# define _LIBCPP_DIAGNOSE_NULLPTR
386#endif
387
388#if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
389// The CUDA SDK contains an unfortunate definition for the __noinline__ macro,
390// which breaks the regular __attribute__((__noinline__)) syntax. Therefore,
391// when compiling for CUDA we use the non-underscored version of the noinline
392// attribute.
393//
394// This is a temporary workaround and we still expect the CUDA SDK team to solve
395// this issue properly in the SDK headers.
396//
397// See https://github.com/llvm/llvm-project/pull/73838 for more details.
398# define _LIBCPP_NOINLINE __attribute__((noinline))
399#elif __has_attribute(__noinline__)
400# define _LIBCPP_NOINLINE __attribute__((__noinline__))
401#else
402# define _LIBCPP_NOINLINE
403#endif
404
405// Deprecation macros
406// ------------------
407
408// Deprecations warnings are always enabled, except when users explicitly opt-out
409// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
410#if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
411# if __has_attribute(__deprecated__)
412# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
413# define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
414# elif _LIBCPP_STD_VER >= 14
415# define _LIBCPP_DEPRECATED [[deprecated]]
416# define _LIBCPP_DEPRECATED_(m) [[deprecated(m)]]
417# else
418# define _LIBCPP_DEPRECATED
419# define _LIBCPP_DEPRECATED_(m)
420# endif
421#else
422# define _LIBCPP_DEPRECATED
423# define _LIBCPP_DEPRECATED_(m)
424#endif
425
426#if !defined(_LIBCPP_CXX03_LANG)
427# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
428#else
429# define _LIBCPP_DEPRECATED_IN_CXX11
430#endif
431
432#if _LIBCPP_STD_VER >= 14
433# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
434#else
435# define _LIBCPP_DEPRECATED_IN_CXX14
436#endif
437
438#if _LIBCPP_STD_VER >= 17
439# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
440#else
441# define _LIBCPP_DEPRECATED_IN_CXX17
442#endif
443
444#if _LIBCPP_STD_VER >= 20
445# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
446#else
447# define _LIBCPP_DEPRECATED_IN_CXX20
448#endif
449
450#if _LIBCPP_STD_VER >= 23
451# define _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_DEPRECATED
452#else
453# define _LIBCPP_DEPRECATED_IN_CXX23
454#endif
455
456#if _LIBCPP_STD_VER >= 26
457# define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
458# define _LIBCPP_DEPRECATED_IN_CXX26_(m) _LIBCPP_DEPRECATED_(m)
459#else
460# define _LIBCPP_DEPRECATED_IN_CXX26
461# define _LIBCPP_DEPRECATED_IN_CXX26_(m)
462#endif
463
464#if _LIBCPP_HAS_CHAR8_T
465# define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
466#else
467# define _LIBCPP_DEPRECATED_WITH_CHAR8_T
468#endif
469
470#if __has_cpp_attribute(_Clang::__no_field_protection__)
471# define _LIBCPP_DISABLE_POINTER_FIELD_PROTECTION [[_Clang::__no_field_protection__]]
472#else
473# define _LIBCPP_DISABLE_POINTER_FIELD_PROTECTION
474#endif
475
476#endif // _LIBCPP___CONFIGURATION_ATTRIBUTES_H
lib/libcxx/include/__configuration/availability.h+93-68
...@@ -38,6 +38,11 @@...@@ -38,6 +38,11 @@
38// When availability annotations are disabled, we take for granted that features introduced38// When availability annotations are disabled, we take for granted that features introduced
39// in all versions of the library are available.39// in all versions of the library are available.
40#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS40#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
41# define _LIBCPP_INTRODUCED_IN_LLVM_23 1
42# define _LIBCPP_INTRODUCED_IN_LLVM_23_ATTRIBUTE /* nothing */
43
44# define _LIBCPP_INTRODUCED_IN_LLVM_23 1
45# define _LIBCPP_INTRODUCED_IN_LLVM_23_ATTRIBUTE /* nothing */
4146
42# define _LIBCPP_INTRODUCED_IN_LLVM_22 147# define _LIBCPP_INTRODUCED_IN_LLVM_22 1
43# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE /* nothing */48# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE /* nothing */
...@@ -70,15 +75,34 @@...@@ -70,15 +75,34 @@
7075
71// clang-format off76// clang-format off
7277
78// LLVM 23
79// TODO: Fill this in
80# define _LIBCPP_INTRODUCED_IN_LLVM_23 0
81# define _LIBCPP_INTRODUCED_IN_LLVM_23_ATTRIBUTE __attribute__((unavailable))
82
73// LLVM 2283// LLVM 22
74// TODO: Fill this in84// TODO: Fill this in
75# define _LIBCPP_INTRODUCED_IN_LLVM_22 085# define _LIBCPP_INTRODUCED_IN_LLVM_22 0
76# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE __attribute__((unavailable))86# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE __attribute__((unavailable))
7787
78// LLVM 2188// LLVM 21
79// TODO: Fill this in89# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 260400) || \
80# define _LIBCPP_INTRODUCED_IN_LLVM_21 090 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 260400) || \
81# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE __attribute__((unavailable))91 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 260400) || \
92 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 260400) || \
93 (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 100400) || \
94 (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 250400)
95# define _LIBCPP_INTRODUCED_IN_LLVM_21 0
96# else
97# define _LIBCPP_INTRODUCED_IN_LLVM_21 1
98# endif
99# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE \
100 __attribute__((availability(macos, strict, introduced = 26.4))) \
101 __attribute__((availability(ios, strict, introduced = 26.4))) \
102 __attribute__((availability(tvos, strict, introduced = 26.4))) \
103 __attribute__((availability(watchos, strict, introduced = 26.4))) \
104 __attribute__((availability(bridgeos, strict, introduced = 10.4))) \
105 __attribute__((availability(driverkit, strict, introduced = 25.4)))
82106
83// LLVM 20107// LLVM 20
84//108//
...@@ -87,7 +111,8 @@...@@ -87,7 +111,8 @@
87 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 260000) || \111 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 260000) || \
88 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 260000) || \112 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 260000) || \
89 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 260000) || \113 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 260000) || \
90 (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 100000)114 (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
115 (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 250000)
91# define _LIBCPP_INTRODUCED_IN_LLVM_20 0116# define _LIBCPP_INTRODUCED_IN_LLVM_20 0
92# else117# else
93# define _LIBCPP_INTRODUCED_IN_LLVM_20 1118# define _LIBCPP_INTRODUCED_IN_LLVM_20 1
...@@ -97,14 +122,16 @@...@@ -97,14 +122,16 @@
97 __attribute__((availability(ios, strict, introduced = 26.0))) \122 __attribute__((availability(ios, strict, introduced = 26.0))) \
98 __attribute__((availability(tvos, strict, introduced = 26.0))) \123 __attribute__((availability(tvos, strict, introduced = 26.0))) \
99 __attribute__((availability(watchos, strict, introduced = 26.0))) \124 __attribute__((availability(watchos, strict, introduced = 26.0))) \
100 __attribute__((availability(bridgeos, strict, introduced = 10.0)))125 __attribute__((availability(bridgeos, strict, introduced = 10.0))) \
126 __attribute__((availability(driverkit, strict, introduced = 25.0)))
101127
102// LLVM 19128// LLVM 19
103# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150400) || \129# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150400) || \
104 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 180400) || \130 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 180400) || \
105 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 180400) || \131 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 180400) || \
106 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 110400) || \132 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 110400) || \
107 (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 90400)133 (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 90400) || \
134 (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 240400)
108# define _LIBCPP_INTRODUCED_IN_LLVM_19 0135# define _LIBCPP_INTRODUCED_IN_LLVM_19 0
109# else136# else
110# define _LIBCPP_INTRODUCED_IN_LLVM_19 1137# define _LIBCPP_INTRODUCED_IN_LLVM_19 1
...@@ -114,7 +141,8 @@...@@ -114,7 +141,8 @@
114 __attribute__((availability(ios, strict, introduced = 18.4))) \141 __attribute__((availability(ios, strict, introduced = 18.4))) \
115 __attribute__((availability(tvos, strict, introduced = 18.4))) \142 __attribute__((availability(tvos, strict, introduced = 18.4))) \
116 __attribute__((availability(watchos, strict, introduced = 11.4))) \143 __attribute__((availability(watchos, strict, introduced = 11.4))) \
117 __attribute__((availability(bridgeos, strict, introduced = 9.4)))144 __attribute__((availability(bridgeos, strict, introduced = 9.4))) \
145 __attribute__((availability(driverkit, strict, introduced = 24.4)))
118146
119// LLVM 18147// LLVM 18
120# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) || \148# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) || \
...@@ -220,51 +248,28 @@...@@ -220,51 +248,28 @@
220#define _LIBCPP_AVAILABILITY_HAS_NEW_SYNC _LIBCPP_INTRODUCED_IN_LLVM_22248#define _LIBCPP_AVAILABILITY_HAS_NEW_SYNC _LIBCPP_INTRODUCED_IN_LLVM_22
221#define _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE249#define _LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE
222250
223// Enable additional explicit instantiations of iostreams components. This251// This controls whether `std::__hash_memory` is available in the dylib, which
224// reduces the number of weak definitions generated in programs that use252// is used for some `std::hash` specializations.
225// iostreams by providing a single strong definition in the shared library.253#define _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY _LIBCPP_INTRODUCED_IN_LLVM_21
226//254// No attribute, since we've had hash in the headers before
227// TODO: Enable additional explicit instantiations on GCC once it supports exclude_from_explicit_instantiation,
228// or once libc++ doesn't use the attribute anymore.
229// TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed.
230#if !defined(_LIBCPP_COMPILER_GCC) && !defined(_WIN32)
231# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 _LIBCPP_INTRODUCED_IN_LLVM_12
232#else
233# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0
234#endif
235
236// This controls the availability of floating-point std::to_chars functions.
237// These overloads were added later than the integer overloads.
238#define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14
239#define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE
240
241// This controls whether the library claims to provide a default verbose
242// termination function, and consequently whether the headers will try
243// to use it when the mechanism isn't overriden at compile-time.
244#define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15
245#define _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE
246255
247// This controls the availability of the C++17 std::pmr library,256// This controls whether we provide a message for `bad_function_call::what()` that specific to `std::bad_function_call`.
248// which is implemented in large part in the built library.257// See https://wg21.link/LWG2233. This requires `std::bad_function_call::what()` to be available in the dylib.
249//258#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE _LIBCPP_INTRODUCED_IN_LLVM_21
250// TODO: Enable std::pmr markup once https://llvm.org/PR40340 has been fixed259// No attribute, since we've had bad_function_call::what() in the headers before
251// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support
252// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we
253// use availability annotations until that bug has been fixed.
254#define _LIBCPP_AVAILABILITY_HAS_PMR _LIBCPP_INTRODUCED_IN_LLVM_16
255#define _LIBCPP_AVAILABILITY_PMR
256260
257// These macros controls the availability of __cxa_init_primary_exception261// This determines whether we assume that the internal std::__bad_variant_access_with_msg class
258// in the built library, which std::make_exception_ptr might use262// (which carries a message describing the cause of the failure in bad_variant_access::what())
259// (see libcxx/include/__exception/exception_ptr.h).263// provides a key function in the dylib. This allows centralizing its vtable and typeinfo instead
260#define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18264// of having all TUs provide a weak definition that then gets deduplicated. When it is not available
261#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE265// in the dylib, what() is defined inline instead, so the descriptive message is provided regardless.
266#define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS_WITH_MSG_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_23
267// No attribute, since we've had bad_variant_access in the headers before
262268
263// This controls the availability of C++23 <print>, which269// This controls the availability of floating-point std::from_chars functions.
264// has a dependency on the built library (it needs access to270// These overloads were added later than the integer overloads.
265// the underlying buffer types of std::cout, std::cerr, and std::clog.271#define _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_20
266#define _LIBCPP_AVAILABILITY_HAS_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18272#define _LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_20_ATTRIBUTE
267#define _LIBCPP_AVAILABILITY_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE
268273
269// This controls the availability of the C++20 time zone database.274// This controls the availability of the C++20 time zone database.
270// The parser code is built in the library.275// The parser code is built in the library.
...@@ -280,30 +285,50 @@...@@ -280,30 +285,50 @@
280#define _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19285#define _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19
281#define _LIBCPP_AVAILABILITY_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE286#define _LIBCPP_AVAILABILITY_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE
282287
283// This controls the availability of floating-point std::from_chars functions.288// These macros controls the availability of __cxa_init_primary_exception
284// These overloads were added later than the integer overloads.289// in the built library, which std::make_exception_ptr might use
285#define _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_20290// (see libcxx/include/__exception/exception_ptr.h).
286#define _LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_20_ATTRIBUTE291#define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18
292#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE
287293
288// This controls whether `std::__hash_memory` is available in the dylib, which294// This controls the availability of the C++17 std::pmr library,
289// is used for some `std::hash` specializations.295// which is implemented in large part in the built library.
290#define _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY _LIBCPP_INTRODUCED_IN_LLVM_21296//
291// No attribute, since we've had hash in the headers before297// TODO: Enable std::pmr markup once https://llvm.org/PR40340 has been fixed
298// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support
299// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we
300// use availability annotations until that bug has been fixed.
301#define _LIBCPP_AVAILABILITY_HAS_PMR _LIBCPP_INTRODUCED_IN_LLVM_16
302#define _LIBCPP_AVAILABILITY_PMR
292303
293// This controls whether we provide a message for `bad_function_call::what()` that specific to `std::bad_function_call`.304// This controls whether the library claims to provide a default verbose
294// See https://wg21.link/LWG2233. This requires `std::bad_function_call::what()` to be available in the dylib.305// termination function, and consequently whether the headers will try
295#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE _LIBCPP_INTRODUCED_IN_LLVM_21306// to use it when the mechanism isn't overriden at compile-time.
296// No attribute, since we've had bad_function_call::what() in the headers before307#define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15
308#define _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE
309
310// This controls the availability of floating-point std::to_chars functions.
311// These overloads were added later than the integer overloads.
312#define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14
313#define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE
297314
298// Define availability attributes that depend on both315// Enable additional explicit instantiations of iostreams components. This
299// _LIBCPP_HAS_EXCEPTIONS and _LIBCPP_HAS_RTTI.316// reduces the number of weak definitions generated in programs that use
300#if !_LIBCPP_HAS_EXCEPTIONS || !_LIBCPP_HAS_RTTI317// iostreams by providing a single strong definition in the shared library.
301# undef _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION318//
302# undef _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION319// TODO: Enable additional explicit instantiations on GCC once it supports exclude_from_explicit_instantiation,
303# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0320// or once libc++ doesn't use the attribute anymore.
304# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION321// TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed.
322#if !defined(_LIBCPP_COMPILER_GCC) && !defined(_WIN32)
323# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 _LIBCPP_INTRODUCED_IN_LLVM_12
324#else
325# define _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 0
305#endif326#endif
306327
328// Controls whether the implementation for text_encoding::environment() is available
329#define _LIBCPP_AVAILABILITY_HAS_TEXT_ENCODING_ENVIRONMENT _LIBCPP_INTRODUCED_IN_LLVM_23
330#define _LIBCPP_AVAILABILITY_TEXT_ENCODING_ENVIRONMENT _LIBCPP_INTRODUCED_IN_LLVM_23_ATTRIBUTE
331
307// Only define a bunch of symbols in the dylib if we need to be compatible with LLVM 7 headers or older332// Only define a bunch of symbols in the dylib if we need to be compatible with LLVM 7 headers or older
308# if defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 8333# if defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 8
309# define _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8334# define _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8
lib/libcxx/include/__configuration/compiler.h+29-4
...@@ -33,12 +33,12 @@...@@ -33,12 +33,12 @@
33// Warn if a compiler version is used that is not supported anymore33// Warn if a compiler version is used that is not supported anymore
34// LLVM RELEASE Update the minimum compiler versions34// LLVM RELEASE Update the minimum compiler versions
35# if defined(_LIBCPP_CLANG_VER)35# if defined(_LIBCPP_CLANG_VER)
36# if _LIBCPP_CLANG_VER < 200136# if _LIBCPP_CLANG_VER < 2101
37# warning "Libc++ only supports Clang 20 and later"37# warning "Libc++ only supports Clang 21 and later"
38# endif38# endif
39# elif defined(_LIBCPP_APPLE_CLANG_VER)39# elif defined(_LIBCPP_APPLE_CLANG_VER)
40# if _LIBCPP_APPLE_CLANG_VER < 170040# if _LIBCPP_APPLE_CLANG_VER < 2100
41# warning "Libc++ only supports AppleClang 26 and later"41# warning "Libc++ only supports AppleClang 26.4 and later"
42# endif42# endif
43# elif defined(_LIBCPP_GCC_VER)43# elif defined(_LIBCPP_GCC_VER)
44# if _LIBCPP_GCC_VER < 150044# if _LIBCPP_GCC_VER < 1500
...@@ -46,6 +46,31 @@...@@ -46,6 +46,31 @@
46# endif46# endif
47# endif47# endif
4848
49# ifndef __has_constexpr_builtin
50# define __has_constexpr_builtin(x) 0
51# endif
52
53// This checks wheter a Clang module is built
54# ifndef __building_module
55# define __building_module(...) 0
56# endif
57
58// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
59// the compiler and '1' otherwise.
60# ifndef __is_identifier
61# define __is_identifier(__x) 1
62# endif
63
64# define __has_keyword(__x) !(__is_identifier(__x))
65
66# ifndef __has_warning
67# define __has_warning(...) 0
68# endif
69
70# if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L
71# error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"
72# endif
73
49#endif74#endif
5075
51#endif // _LIBCPP___CONFIGURATION_COMPILER_H76#endif // _LIBCPP___CONFIGURATION_COMPILER_H
lib/libcxx/include/__configuration/diagnostic_suppression.h created+44
...@@ -0,0 +1,44 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CONFIGURATION_DIAGNOSTIC_SUPPRESSION_H
11#define _LIBCPP___CONFIGURATION_DIAGNOSTIC_SUPPRESSION_H
12
13/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
14#include <__configuration/compiler.h>
15#include <__configuration/utility.h>
16
17#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
18# pragma GCC system_header
19#endif
20
21#ifdef _LIBCPP_COMPILER_CLANG_BASED
22# define _LIBCPP_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
23# define _LIBCPP_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
24# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCPP_TOSTRING(clang diagnostic ignored str))
25# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
26#elif defined(_LIBCPP_COMPILER_GCC)
27# define _LIBCPP_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
28# define _LIBCPP_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
29# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str)
30# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCPP_TOSTRING(GCC diagnostic ignored str))
31#else
32# define _LIBCPP_DIAGNOSTIC_PUSH
33# define _LIBCPP_DIAGNOSTIC_POP
34# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str)
35# define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
36#endif
37
38// Macros to enter and leave a state where deprecation warnings are suppressed.
39#define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
40 _LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated") \
41 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
42#define _LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_DIAGNOSTIC_POP
43
44#endif // _LIBCPP___CONFIGURATION_DIAGNOSTIC_SUPPRESSION_H
lib/libcxx/include/__configuration/hardening.h-17
...@@ -17,23 +17,6 @@...@@ -17,23 +17,6 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20// TODO(LLVM 23): Remove this. We're making these an error to catch folks who might not have migrated.
21// Since hardening went through several changes (many of which impacted user-facing macros),
22// we're keeping these checks around for a bit longer than usual. Failure to properly configure
23// hardening results in checks being dropped silently, which is a pretty big deal.
24#if defined(_LIBCPP_ENABLE_ASSERTIONS)
25# error "_LIBCPP_ENABLE_ASSERTIONS has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
26#endif
27#if defined(_LIBCPP_ENABLE_HARDENED_MODE)
28# error "_LIBCPP_ENABLE_HARDENED_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
29#endif
30#if defined(_LIBCPP_ENABLE_SAFE_MODE)
31# error "_LIBCPP_ENABLE_SAFE_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
32#endif
33#if defined(_LIBCPP_ENABLE_DEBUG_MODE)
34# error "_LIBCPP_ENABLE_DEBUG_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
35#endif
36
37// The library provides the macro `_LIBCPP_HARDENING_MODE` which can be set to one of the following values:20// The library provides the macro `_LIBCPP_HARDENING_MODE` which can be set to one of the following values:
38//21//
39// - `_LIBCPP_HARDENING_MODE_NONE`;22// - `_LIBCPP_HARDENING_MODE_NONE`;
lib/libcxx/include/__configuration/language.h+42
...@@ -50,4 +50,46 @@...@@ -50,4 +50,46 @@
50# define _LIBCPP_HAS_EXCEPTIONS 050# define _LIBCPP_HAS_EXCEPTIONS 0
51#endif51#endif
5252
53#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
54# define _LIBCPP_HAS_CHAR8_T 0
55#else
56# define _LIBCPP_HAS_CHAR8_T 1
57#endif
58
59#if _LIBCPP_STD_VER <= 11
60# define _LIBCPP_EXPLICIT_SINCE_CXX14
61#else
62# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
63#endif
64
65#if _LIBCPP_STD_VER >= 14
66# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
67#else
68# define _LIBCPP_CONSTEXPR_SINCE_CXX14
69#endif
70
71#if _LIBCPP_STD_VER >= 17
72# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
73#else
74# define _LIBCPP_CONSTEXPR_SINCE_CXX17
75#endif
76
77#if _LIBCPP_STD_VER >= 20
78# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
79#else
80# define _LIBCPP_CONSTEXPR_SINCE_CXX20
81#endif
82
83#if _LIBCPP_STD_VER >= 23
84# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
85#else
86# define _LIBCPP_CONSTEXPR_SINCE_CXX23
87#endif
88
89#if _LIBCPP_STD_VER >= 26
90# define _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr
91#else
92# define _LIBCPP_CONSTEXPR_SINCE_CXX26
93#endif
94
53#endif // _LIBCPP___CONFIGURATION_LANGUAGE_H95#endif // _LIBCPP___CONFIGURATION_LANGUAGE_H
lib/libcxx/include/__configuration/namespace.h created+99
...@@ -0,0 +1,99 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CONFIGURATION_NAMESPACE_H
11#define _LIBCPP___CONFIGURATION_NAMESPACE_H
12
13/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
14#include <__configuration/attributes.h>
15#include <__configuration/diagnostic_suppression.h>
16#include <__configuration/utility.h>
17
18#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
19# pragma GCC system_header
20#endif
21
22// Clang modules take a significant compile time hit when pushing and popping diagnostics.
23// Since all the headers are marked as system headers unless _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER is defined, we can
24// simply disable this pushing and popping when _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER isn't defined.
25#ifdef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
26# define _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS \
27 _LIBCPP_DIAGNOSTIC_PUSH \
28 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++11-extensions") \
29 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++14-extensions") \
30 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++17-extensions") \
31 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++20-extensions") \
32 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++23-extensions") \
33 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++14-extensions") \
34 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++17-extensions") \
35 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++20-extensions") \
36 _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++23-extensions")
37# define _LIBCPP_POP_EXTENSION_DIAGNOSTICS _LIBCPP_DIAGNOSTIC_POP
38# define _LIBCPP_PUSH_ABI_PRAGMA_DIAGNOSTICS \
39 _LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpragma-clang-attribute") \
40 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wignored-attributes")
41# define _LIBCPP_POP_ABI_PRAGMA_DIAGNOSTICS _LIBCPP_DIAGNOSTIC_POP
42#else
43# define _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS
44# define _LIBCPP_POP_EXTENSION_DIAGNOSTICS
45# define _LIBCPP_PUSH_ABI_PRAGMA_DIAGNOSTICS
46# define _LIBCPP_POP_ABI_PRAGMA_DIAGNOSTICS
47#endif
48
49#define _LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS \
50 _LIBCPP_PUSH_ABI_PRAGMA_DIAGNOSTICS \
51 _Pragma(_LIBCPP_TOSTRING(clang attribute _LibcxxExplicitABIAnnotations.push( \
52 __attribute__((__exclude_from_explicit_instantiation__, \
53 __visibility__("hidden"), \
54 __abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE)))), \
55 apply_to = function))) _LIBCPP_POP_ABI_PRAGMA_DIAGNOSTICS
56
57#define _LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS _Pragma("clang attribute _LibcxxExplicitABIAnnotations.pop")
58
59// clang-format off
60
61// The unversioned namespace is used when we want to be ABI compatible with other standard libraries in some way. There
62// are two main categories where that's the case:
63// - Historically, we have made exception types ABI compatible with libstdc++ to allow throwing them between libstdc++
64// and libc++. This is not used anymore for new exception types, since there is no use-case for it anymore.
65// - Types and functions which are used by the compiler are in the unversioned namespace, since the compiler has to know
66// their mangling without the appropriate declaration in some cases.
67// If it's not clear whether using the unversioned namespace is the correct thing to do, it's not. The versioned
68// namespace (_LIBCPP_BEGIN_NAMESPACE_STD) should almost always be used.
69# define _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD \
70 _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS _LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS namespace _LIBCPP_NAMESPACE_VISIBILITY std {
71
72# define _LIBCPP_END_UNVERSIONED_NAMESPACE_STD } _LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS _LIBCPP_POP_EXTENSION_DIAGNOSTICS
73
74# define _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD inline namespace _LIBCPP_ABI_NAMESPACE {
75# define _LIBCPP_END_NAMESPACE_STD } _LIBCPP_END_UNVERSIONED_NAMESPACE_STD
76
77// TODO: This should really be in the versioned namespace
78#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD namespace experimental {
79#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL } _LIBCPP_END_UNVERSIONED_NAMESPACE_STD
80
81#define _LIBCPP_BEGIN_NAMESPACE_LFTS _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
82#define _LIBCPP_END_NAMESPACE_LFTS } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
83
84#define _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v2 {
85#define _LIBCPP_END_NAMESPACE_LFTS_V2 } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
86
87#ifdef _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
88# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD namespace filesystem {
89# define _LIBCPP_END_NAMESPACE_FILESYSTEM } _LIBCPP_END_NAMESPACE_STD
90#else
91# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD \
92 inline namespace __fs { namespace filesystem {
93
94# define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD
95#endif
96
97// clang-format on
98
99#endif // _LIBCPP___CONFIGURATION_NAMESPACE_H
lib/libcxx/include/__configuration/platform.h+4
...@@ -30,6 +30,10 @@...@@ -30,6 +30,10 @@
30// ... add new file formats here ...30// ... add new file formats here ...
31#endif31#endif
3232
33#if defined(__MVS__)
34# include <features.h> // for __NATIVE_ASCII_F
35#endif
36
33// Need to detect which libc we're using if we're on Linux.37// Need to detect which libc we're using if we're on Linux.
34#if (defined(__linux__) || defined(__AMDGPU__) || defined(__NVPTX__)) && __has_include(<features.h>)38#if (defined(__linux__) || defined(__AMDGPU__) || defined(__NVPTX__)) && __has_include(<features.h>)
35# include <features.h>39# include <features.h>
lib/libcxx/include/__configuration/pstl.h created+66
...@@ -0,0 +1,66 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CONFIGURATION_PSTL_H
11#define _LIBCPP___CONFIGURATION_PSTL_H
12
13/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
14
15#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
16# pragma GCC system_header
17#endif
18
19#define _PSTL_PRAGMA(x) _Pragma(#x)
20
21// Enable SIMD for compilers that support OpenMP 4.0
22#if (defined(_OPENMP) && _OPENMP >= 201307)
23
24# define _PSTL_UDR_PRESENT
25# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
26# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
27# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
28# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
29# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
30# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
31
32// Declaration of reduction functor, where
33// NAME - the name of the functor
34// OP - type of the callable object with the reduction operation
35// omp_in - refers to the local partial result
36// omp_out - refers to the final value of the combiner operator
37// omp_priv - refers to the private copy of the initial value
38// omp_orig - refers to the original variable to be reduced
39# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \
40 _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
41
42#elif defined(_LIBCPP_COMPILER_CLANG_BASED)
43
44# define _PSTL_PRAGMA_SIMD _Pragma("clang loop vectorize(enable) interleave(enable)")
45# define _PSTL_PRAGMA_DECLARE_SIMD
46# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _Pragma("clang loop vectorize(enable) interleave(enable)")
47# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _Pragma("clang loop vectorize(enable) interleave(enable)")
48# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
49# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
50# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
51
52#else // (defined(_OPENMP) && _OPENMP >= 201307)
53
54# define _PSTL_PRAGMA_SIMD
55# define _PSTL_PRAGMA_DECLARE_SIMD
56# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM)
57# define _PSTL_PRAGMA_SIMD_SCAN(PRM)
58# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
59# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
60# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
61
62#endif // (defined(_OPENMP) && _OPENMP >= 201307)
63
64#define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
65
66#endif // _LIBCPP___CONFIGURATION_PSTL_H
lib/libcxx/include/__configuration/utility.h created+26
...@@ -0,0 +1,26 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CONFIGURATION_UTILITY_H
11#define _LIBCPP___CONFIGURATION_UTILITY_H
12
13/* zig patch: instead of including __config_site, zig adds -D flags when compiling */
14
15#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
16# pragma GCC system_header
17#endif
18
19#define _LIBCPP_TOSTRING2(x) #x
20#define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
21
22#define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
23#define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
24#define _LIBCPP_CONCAT3(X, Y, Z) _LIBCPP_CONCAT(X, _LIBCPP_CONCAT(Y, Z))
25
26#endif // _LIBCPP___CONFIGURATION_UTILITY_H
lib/libcxx/include/__cstddef/byte.h+6-6
...@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD...@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
2323
24enum class byte : unsigned char {};24enum class byte : unsigned char {};
2525
26_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator|(byte __lhs, byte __rhs) noexcept {26[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr byte operator|(byte __lhs, byte __rhs) noexcept {
27 return static_cast<byte>(27 return static_cast<byte>(
28 static_cast<unsigned char>(static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)));28 static_cast<unsigned char>(static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)));
29}29}
...@@ -32,7 +32,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator|=(byte& __lhs, byte __rhs)...@@ -32,7 +32,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator|=(byte& __lhs, byte __rhs)
32 return __lhs = __lhs | __rhs;32 return __lhs = __lhs | __rhs;
33}33}
3434
35_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator&(byte __lhs, byte __rhs) noexcept {35[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr byte operator&(byte __lhs, byte __rhs) noexcept {
36 return static_cast<byte>(36 return static_cast<byte>(
37 static_cast<unsigned char>(static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)));37 static_cast<unsigned char>(static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)));
38}38}
...@@ -41,7 +41,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator&=(byte& __lhs, byte __rhs)...@@ -41,7 +41,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator&=(byte& __lhs, byte __rhs)
41 return __lhs = __lhs & __rhs;41 return __lhs = __lhs & __rhs;
42}42}
4343
44_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator^(byte __lhs, byte __rhs) noexcept {44[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr byte operator^(byte __lhs, byte __rhs) noexcept {
45 return static_cast<byte>(45 return static_cast<byte>(
46 static_cast<unsigned char>(static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)));46 static_cast<unsigned char>(static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)));
47}47}
...@@ -50,7 +50,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator^=(byte& __lhs, byte __rhs)...@@ -50,7 +50,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator^=(byte& __lhs, byte __rhs)
50 return __lhs = __lhs ^ __rhs;50 return __lhs = __lhs ^ __rhs;
51}51}
5252
53_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator~(byte __b) noexcept {53[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr byte operator~(byte __b) noexcept {
54 return static_cast<byte>(static_cast<unsigned char>(~static_cast<unsigned int>(__b)));54 return static_cast<byte>(static_cast<unsigned char>(~static_cast<unsigned int>(__b)));
55}55}
5656
...@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr byte& operator<<=(byte& __lhs, _Integer __shift)...@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr byte& operator<<=(byte& __lhs, _Integer __shift)
60}60}
6161
62template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>62template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
63_LIBCPP_HIDE_FROM_ABI constexpr byte operator<<(byte __lhs, _Integer __shift) noexcept {63[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr byte operator<<(byte __lhs, _Integer __shift) noexcept {
64 return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) << __shift));64 return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) << __shift));
65}65}
6666
...@@ -70,7 +70,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr byte& operator>>=(byte& __lhs, _Integer __shift)...@@ -70,7 +70,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr byte& operator>>=(byte& __lhs, _Integer __shift)
70}70}
7171
72template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>72template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
73_LIBCPP_HIDE_FROM_ABI constexpr byte operator>>(byte __lhs, _Integer __shift) noexcept {73[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr byte operator>>(byte __lhs, _Integer __shift) noexcept {
74 return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift));74 return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift));
75}75}
7676
lib/libcxx/include/__cstddef/max_align_t.h+4-2
...@@ -16,12 +16,14 @@...@@ -16,12 +16,14 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19#if !defined(_LIBCPP_CXX03_LANG)
20
19_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2022
21#if !defined(_LIBCPP_CXX03_LANG)
22using ::max_align_t _LIBCPP_USING_IF_EXISTS;23using ::max_align_t _LIBCPP_USING_IF_EXISTS;
23#endif
2424
25_LIBCPP_END_NAMESPACE_STD25_LIBCPP_END_NAMESPACE_STD
2626
27#endif
28
27#endif // _LIBCPP___CSTDDEF_MAX_ALIGN_T_H29#endif // _LIBCPP___CSTDDEF_MAX_ALIGN_T_H
lib/libcxx/include/__debug_utils/sanitizers.h+30-5
...@@ -17,7 +17,32 @@...@@ -17,7 +17,32 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20#if __has_feature(address_sanitizer)20// Within libc++, _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS determines whether the containers should
21// provide ASAN container overflow checks. That setting attempts to honour ASAN's documented option
22// __SANITIZER_DISABLE_CONTAINER_OVERFLOW__ which can be defined by users to disable container overflow
23// checks.
24//
25// However, since parts of some containers (e.g. std::string) are compiled separately into the built
26// library, there are caveats:
27// - __SANITIZER_DISABLE_CONTAINER_OVERFLOW__ can't always be honoured, i.e. if the built library
28// was compiled with ASAN container checks, it's impossible to turn them off afterwards. We diagnose
29// this with an error to avoid the proliferation of invalid configurations that appear to work.
30//
31// - The container overflow checks themselves are not always available even when the user is compiling
32// with -fsanitize=address. If a container is compiled separately like std::string, it can't provide
33// container checks unless the separately compiled code was built with container checks enabled. These
34// containers need to also conditionalize whether they provide overflow checks on `_LIBCPP_INSTRUMENTED_WITH_ASAN`.
35#if __has_feature(address_sanitizer) && !defined(__SANITIZER_DISABLE_CONTAINER_OVERFLOW__)
36# define _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS 1
37#else
38# define _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS 0
39#endif
40
41#if _LIBCPP_INSTRUMENTED_WITH_ASAN && !_LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
42# error "We can't disable ASAN container checks when libc++ has been built with ASAN container checks enabled"
43#endif
44
45#if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
2146
22extern "C" {47extern "C" {
23_LIBCPP_EXPORTED_FROM_ABI void48_LIBCPP_EXPORTED_FROM_ABI void
...@@ -28,12 +53,12 @@ _LIBCPP_EXPORTED_FROM_ABI int...@@ -28,12 +53,12 @@ _LIBCPP_EXPORTED_FROM_ABI int
28__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);53__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);
29}54}
3055
31#endif // __has_feature(address_sanitizer)56#endif // _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
3257
33_LIBCPP_BEGIN_NAMESPACE_STD58_LIBCPP_BEGIN_NAMESPACE_STD
3459
35// ASan choices60// ASan choices
36#if __has_feature(address_sanitizer)61#if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
37# define _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS 162# define _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS 1
38#endif63#endif
3964
...@@ -57,7 +82,7 @@ _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(...@@ -57,7 +82,7 @@ _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
57 const void* __last_old_contained,82 const void* __last_old_contained,
58 const void* __first_new_contained,83 const void* __first_new_contained,
59 const void* __last_new_contained) {84 const void* __last_new_contained) {
60#if !__has_feature(address_sanitizer)85#if !_LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
61 (void)__first_storage;86 (void)__first_storage;
62 (void)__last_storage;87 (void)__last_storage;
63 (void)__first_old_contained;88 (void)__first_old_contained;
...@@ -86,7 +111,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __annotate_contiguous_c...@@ -86,7 +111,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __annotate_contiguous_c
86 const void* __last_storage,111 const void* __last_storage,
87 const void* __old_last_contained,112 const void* __old_last_contained,
88 const void* __new_last_contained) {113 const void* __new_last_contained) {
89#if !__has_feature(address_sanitizer)114#if !_LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
90 (void)__first_storage;115 (void)__first_storage;
91 (void)__last_storage;116 (void)__last_storage;
92 (void)__old_last_contained;117 (void)__old_last_contained;
lib/libcxx/include/__exception/exception.h+2
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22#endif22#endif
2323
24_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD24_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2526
26#if defined(_LIBCPP_ABI_VCRUNTIME) && (!defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS != 0)27#if defined(_LIBCPP_ABI_VCRUNTIME) && (!defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS != 0)
27// The std::exception class was already included above, but we're explicit about this condition here for clarity.28// The std::exception class was already included above, but we're explicit about this condition here for clarity.
...@@ -91,6 +92,7 @@ public:...@@ -91,6 +92,7 @@ public:
91};92};
92#endif // !_LIBCPP_ABI_VCRUNTIME93#endif // !_LIBCPP_ABI_VCRUNTIME
9394
95_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
94_LIBCPP_END_UNVERSIONED_NAMESPACE_STD96_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
9597
96#endif // _LIBCPP___EXCEPTION_EXCEPTION_H98#endif // _LIBCPP___EXCEPTION_EXCEPTION_H
lib/libcxx/include/__exception/exception_ptr.h+15-37
...@@ -31,7 +31,7 @@ _LIBCPP_PUSH_MACROS...@@ -31,7 +31,7 @@ _LIBCPP_PUSH_MACROS
3131
32#ifndef _LIBCPP_ABI_MICROSOFT32#ifndef _LIBCPP_ABI_MICROSOFT
3333
34# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION34# if _LIBCPP_HAS_EXCEPTIONS && _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
3535
36namespace __cxxabiv1 {36namespace __cxxabiv1 {
3737
...@@ -55,13 +55,12 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(...@@ -55,13 +55,12 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
5555
56} // namespace __cxxabiv156} // namespace __cxxabiv1
5757
58# endif58# endif // _LIBCPP_HAS_EXCEPTIONS && _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
5959
60#endif60#endif // !defined(_LIBCPP_ABI_MICROSOFT)
6161
62_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD62_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
6363_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
64#ifndef _LIBCPP_ABI_MICROSOFT
6564
66inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT;65inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT;
6766
...@@ -73,6 +72,8 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {...@@ -73,6 +72,8 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
73 template <class _Ep>72 template <class _Ep>
74 friend _LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep&) _NOEXCEPT;73 friend _LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep&) _NOEXCEPT;
7574
75 friend _LIBCPP_EXPORTED_FROM_ABI exception_ptr __copy_exception_ptr(void*, const void*);
76
76public:77public:
77 // exception_ptr is basically a COW string so it is trivially relocatable.78 // exception_ptr is basically a COW string so it is trivially relocatable.
78 using __trivially_relocatable _LIBCPP_NODEBUG = exception_ptr;79 using __trivially_relocatable _LIBCPP_NODEBUG = exception_ptr;
...@@ -112,8 +113,10 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _...@@ -112,8 +113,10 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _
112 std::swap(__x.__ptr_, __y.__ptr_);113 std::swap(__x.__ptr_, __y.__ptr_);
113}114}
114115
116#ifndef _LIBCPP_ABI_MICROSOFT
117
115# if _LIBCPP_HAS_EXCEPTIONS118# if _LIBCPP_HAS_EXCEPTIONS
116# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION119# if _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
117template <class _Ep>120template <class _Ep>
118_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep& __e) _NOEXCEPT {121_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep& __e) _NOEXCEPT {
119 using _Ep2 = __decay_t<_Ep>;122 using _Ep2 = __decay_t<_Ep>;
...@@ -136,7 +139,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep& __e) _NOE...@@ -136,7 +139,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep& __e) _NOE
136 return current_exception();139 return current_exception();
137 }140 }
138}141}
139# endif142# endif // _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
140143
141template <class _Ep>144template <class _Ep>
142_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_via_throw(_Ep& __e) _NOEXCEPT {145_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_via_throw(_Ep& __e) _NOEXCEPT {
...@@ -164,7 +167,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {...@@ -164,7 +167,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
164 return std::__make_exception_ptr_via_throw(__e);167 return std::__make_exception_ptr_via_throw(__e);
165 }168 }
166169
167# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION && !defined(_LIBCPP_CXX03_LANG)170# if _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION && !defined(_LIBCPP_CXX03_LANG)
168 return std::__make_exception_ptr_explicit(__e);171 return std::__make_exception_ptr_explicit(__e);
169# else172# else
170 return std::__make_exception_ptr_via_throw(__e);173 return std::__make_exception_ptr_via_throw(__e);
...@@ -177,36 +180,9 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT {...@@ -177,36 +180,9 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT {
177}180}
178# endif // _LIBCPP_HAS_EXCEPTIONS181# endif // _LIBCPP_HAS_EXCEPTIONS
179182
180#else // _LIBCPP_ABI_MICROSOFT183#else // defined(_LIBCPP_ABI_MICROSOFT)
181
182class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
183 _LIBCPP_DIAGNOSTIC_PUSH
184 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
185 void* __ptr1_;
186 void* __ptr2_;
187 _LIBCPP_DIAGNOSTIC_POP
188
189public:
190 exception_ptr() _NOEXCEPT;
191 exception_ptr(nullptr_t) _NOEXCEPT;
192 exception_ptr(const exception_ptr& __other) _NOEXCEPT;
193 exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
194 exception_ptr& operator=(nullptr_t) _NOEXCEPT;
195 ~exception_ptr() _NOEXCEPT;
196 explicit operator bool() const _NOEXCEPT;
197};
198
199_LIBCPP_EXPORTED_FROM_ABI bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
200
201inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
202 return !(__x == __y);
203}
204
205_LIBCPP_EXPORTED_FROM_ABI void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
206184
207_LIBCPP_EXPORTED_FROM_ABI exception_ptr __copy_exception_ptr(void* __except, const void* __ptr);185_LIBCPP_EXPORTED_FROM_ABI exception_ptr __copy_exception_ptr(void* __except, const void* __ptr);
208_LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
209[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
210186
211// This is a built-in template function which automagically extracts the required187// This is a built-in template function which automagically extracts the required
212// information.188// information.
...@@ -218,7 +194,9 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {...@@ -218,7 +194,9 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
218 return __copy_exception_ptr(std::addressof(__e), __GetExceptionInfo(__e));194 return __copy_exception_ptr(std::addressof(__e), __GetExceptionInfo(__e));
219}195}
220196
221#endif // _LIBCPP_ABI_MICROSOFT197#endif // defined(_LIBCPP_ABI_MICROSOFT)
198
199_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
222_LIBCPP_END_UNVERSIONED_NAMESPACE_STD200_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
223201
224_LIBCPP_POP_MACROS202_LIBCPP_POP_MACROS
lib/libcxx/include/__exception/nested_exception.h+6-6
...@@ -14,7 +14,6 @@...@@ -14,7 +14,6 @@
14#include <__memory/addressof.h>14#include <__memory/addressof.h>
15#include <__type_traits/decay.h>15#include <__type_traits/decay.h>
16#include <__type_traits/enable_if.h>16#include <__type_traits/enable_if.h>
17#include <__type_traits/integral_constant.h>
18#include <__type_traits/is_base_of.h>17#include <__type_traits/is_base_of.h>
19#include <__type_traits/is_class.h>18#include <__type_traits/is_class.h>
20#include <__type_traits/is_constructible.h>19#include <__type_traits/is_constructible.h>
...@@ -28,6 +27,7 @@...@@ -28,6 +27,7 @@
28#endif27#endif
2928
30_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD29_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
30_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3131
32class _LIBCPP_EXPORTED_FROM_ABI nested_exception {32class _LIBCPP_EXPORTED_FROM_ABI nested_exception {
33 exception_ptr __ptr_;33 exception_ptr __ptr_;
...@@ -81,20 +81,20 @@ template <class _Tp>...@@ -81,20 +81,20 @@ template <class _Tp>
81}81}
8282
83template <class _From, class _To>83template <class _From, class _To>
84struct __can_dynamic_cast84inline const bool __can_dynamic_cast_v =
85 : _BoolConstant< is_polymorphic<_From>::value &&85 is_polymorphic<_From>::value && (!is_base_of<_To, _From>::value || is_convertible<const _From*, const _To*>::value);
86 (!is_base_of<_To, _From>::value || is_convertible<const _From*, const _To*>::value)> {};
8786
88template <class _Ep, __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value, int> = 0>87template <class _Ep, __enable_if_t<__can_dynamic_cast_v<_Ep, nested_exception>, int> = 0>
89inline _LIBCPP_HIDE_FROM_ABI void rethrow_if_nested(const _Ep& __e) {88inline _LIBCPP_HIDE_FROM_ABI void rethrow_if_nested(const _Ep& __e) {
90 const nested_exception* __nep = dynamic_cast<const nested_exception*>(std::addressof(__e));89 const nested_exception* __nep = dynamic_cast<const nested_exception*>(std::addressof(__e));
91 if (__nep)90 if (__nep)
92 __nep->rethrow_nested();91 __nep->rethrow_nested();
93}92}
9493
95template <class _Ep, __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value, int> = 0>94template <class _Ep, __enable_if_t<!__can_dynamic_cast_v<_Ep, nested_exception>, int> = 0>
96inline _LIBCPP_HIDE_FROM_ABI void rethrow_if_nested(const _Ep&) {}95inline _LIBCPP_HIDE_FROM_ABI void rethrow_if_nested(const _Ep&) {}
9796
97_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
98_LIBCPP_END_UNVERSIONED_NAMESPACE_STD98_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
9999
100#endif // _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H100#endif // _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H
lib/libcxx/include/__exception/operations.h+4
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16#endif16#endif
1717
18_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD18_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
19_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
20
19#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \21#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
20 defined(_LIBCPP_BUILDING_LIBRARY)22 defined(_LIBCPP_BUILDING_LIBRARY)
21using unexpected_handler = void (*)();23using unexpected_handler = void (*)();
...@@ -37,6 +39,8 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;...@@ -37,6 +39,8 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;
3739
38[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;40[[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
39[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);41[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
42
43_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
40_LIBCPP_END_UNVERSIONED_NAMESPACE_STD44_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
4145
42#endif // _LIBCPP___EXCEPTION_OPERATIONS_H46#endif // _LIBCPP___EXCEPTION_OPERATIONS_H
lib/libcxx/include/__exception/terminate.h+4
...@@ -16,7 +16,11 @@...@@ -16,7 +16,11 @@
16#endif16#endif
1717
18_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD18_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
19_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
20
19[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void terminate() _NOEXCEPT;21[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void terminate() _NOEXCEPT;
22
23_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
20_LIBCPP_END_UNVERSIONED_NAMESPACE_STD24_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
2125
22#endif // _LIBCPP___EXCEPTION_TERMINATE_H26#endif // _LIBCPP___EXCEPTION_TERMINATE_H
lib/libcxx/include/__expected/bad_expected_access.h+2
...@@ -23,6 +23,7 @@ _LIBCPP_PUSH_MACROS...@@ -23,6 +23,7 @@ _LIBCPP_PUSH_MACROS
23#if _LIBCPP_STD_VER >= 2323#if _LIBCPP_STD_VER >= 23
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
26_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2627
27template <class _Err>28template <class _Err>
28class bad_expected_access;29class bad_expected_access;
...@@ -66,6 +67,7 @@ private:...@@ -66,6 +67,7 @@ private:
66 _Err __unex_;67 _Err __unex_;
67};68};
6869
70_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
69_LIBCPP_END_NAMESPACE_STD71_LIBCPP_END_NAMESPACE_STD
7072
71#endif // _LIBCPP_STD_VER >= 2373#endif // _LIBCPP_STD_VER >= 23
lib/libcxx/include/__expected/expected.h+19-13
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#define _LIBCPP___EXPECTED_EXPECTED_H10#define _LIBCPP___EXPECTED_EXPECTED_H
1111
12#include <__assert>12#include <__assert>
13#include <__concepts/same_as.h>
13#include <__config>14#include <__config>
14#include <__expected/bad_expected_access.h>15#include <__expected/bad_expected_access.h>
15#include <__expected/unexpect.h>16#include <__expected/unexpect.h>
...@@ -36,7 +37,6 @@...@@ -36,7 +37,6 @@
36#include <__type_traits/is_trivially_destructible.h>37#include <__type_traits/is_trivially_destructible.h>
37#include <__type_traits/is_trivially_relocatable.h>38#include <__type_traits/is_trivially_relocatable.h>
38#include <__type_traits/is_void.h>39#include <__type_traits/is_void.h>
39#include <__type_traits/lazy.h>
40#include <__type_traits/negation.h>40#include <__type_traits/negation.h>
41#include <__type_traits/remove_cv.h>41#include <__type_traits/remove_cv.h>
42#include <__type_traits/remove_cvref.h>42#include <__type_traits/remove_cvref.h>
...@@ -446,6 +446,10 @@ private:...@@ -446,6 +446,10 @@ private:
446 _LIBCPP_NO_UNIQUE_ADDRESS __conditional_no_unique_address<__allow_reusing_expected_tail_padding, __repr> __repr_;446 _LIBCPP_NO_UNIQUE_ADDRESS __conditional_no_unique_address<__allow_reusing_expected_tail_padding, __repr> __repr_;
447};447};
448448
449// Helper to handle comparisons that produce a value whose type is not bool,
450// but allows only implicit (and not explicit) conversions to bool.
451constexpr bool __into_bool(bool __b) noexcept { return __b; }
452
449template <class _Tp, class _Err>453template <class _Tp, class _Err>
450class expected : private __expected_base<_Tp, _Err> {454class expected : private __expected_base<_Tp, _Err> {
451 static_assert(!is_reference_v<_Tp> && !is_function_v<_Tp> && !is_same_v<remove_cv_t<_Tp>, in_place_t> &&455 static_assert(!is_reference_v<_Tp> && !is_function_v<_Tp> && !is_same_v<remove_cv_t<_Tp>, in_place_t> &&
...@@ -684,12 +688,11 @@ public:...@@ -684,12 +688,11 @@ public:
684private:688private:
685 template <class _OtherErrQual>689 template <class _OtherErrQual>
686 static constexpr bool __can_assign_from_unexpected =690 static constexpr bool __can_assign_from_unexpected =
687 _And< is_constructible<_Err, _OtherErrQual>,691 _And<is_constructible<_Err, _OtherErrQual>,
688 is_assignable<_Err&, _OtherErrQual>,692 is_assignable<_Err&, _OtherErrQual>,
689 _Lazy<_Or,693 _Or<is_nothrow_constructible<_Err, _OtherErrQual>,
690 is_nothrow_constructible<_Err, _OtherErrQual>,694 is_nothrow_move_constructible<_Tp>,
691 is_nothrow_move_constructible<_Tp>,695 is_nothrow_move_constructible<_Err>>>::value;
692 is_nothrow_move_constructible<_Err>> >::value;
693696
694public:697public:
695 template <class _OtherErr>698 template <class _OtherErr>
...@@ -1161,15 +1164,18 @@ public:...@@ -1161,15 +1164,18 @@ public:
1161 }1164 }
1162 }1165 }
11631166
1164 template <class _T2>1167 // The unusual signature avoids constraint recursion via ADL through
1165 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const expected& __x, const _T2& __v)1168 // std::expected, see https://llvm.org/PR160431. Note that this only
1169 // triggers with compilers that implement https://wg21.link/CWG2369.
1170 template <class _T2, same_as<_Tp> _Tp2>
1171 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const expected<_Tp2, _Err>& __x, const _T2& __v)
1166# if _LIBCPP_STD_VER >= 261172# if _LIBCPP_STD_VER >= 26
1167 requires(!__is_std_expected<_T2>::value) && requires {1173 requires(!__is_std_expected<_T2>::value) && requires {
1168 { *__x == __v } -> __core_convertible_to<bool>;1174 { *__x == __v } -> __core_convertible_to<bool>;
1169 }1175 }
1170# endif1176# endif
1171 {1177 {
1172 return __x.__has_val() && static_cast<bool>(__x.__val() == __v);1178 return __x.__has_val() && std::__into_bool(__x.__val() == __v);
1173 }1179 }
11741180
1175 template <class _E2>1181 template <class _E2>
...@@ -1180,7 +1186,7 @@ public:...@@ -1180,7 +1186,7 @@ public:
1180 }1186 }
1181# endif1187# endif
1182 {1188 {
1183 return !__x.__has_val() && static_cast<bool>(__x.__unex() == __e.error());1189 return !__x.__has_val() && std::__into_bool(__x.__unex() == __e.error());
1184 }1190 }
1185};1191};
11861192
...@@ -1882,7 +1888,7 @@ public:...@@ -1882,7 +1888,7 @@ public:
1882 if (__x.__has_val() != __y.__has_val()) {1888 if (__x.__has_val() != __y.__has_val()) {
1883 return false;1889 return false;
1884 } else {1890 } else {
1885 return __x.__has_val() || static_cast<bool>(__x.__unex() == __y.__unex());1891 return __x.__has_val() || std::__into_bool(__x.__unex() == __y.__unex());
1886 }1892 }
1887 }1893 }
18881894
...@@ -1894,7 +1900,7 @@ public:...@@ -1894,7 +1900,7 @@ public:
1894 }1900 }
1895# endif1901# endif
1896 {1902 {
1897 return !__x.__has_val() && static_cast<bool>(__x.__unex() == __y.error());1903 return !__x.__has_val() && std::__into_bool(__x.__unex() == __y.error());
1898 }1904 }
1899};1905};
19001906
lib/libcxx/include/__filesystem/directory_entry.h+2
...@@ -39,6 +39,7 @@ _LIBCPP_PUSH_MACROS...@@ -39,6 +39,7 @@ _LIBCPP_PUSH_MACROS
39#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM39#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
4040
41_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM41_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
42_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4243
43class directory_entry {44class directory_entry {
44 typedef filesystem::path _Path;45 typedef filesystem::path _Path;
...@@ -465,6 +466,7 @@ private:...@@ -465,6 +466,7 @@ private:
465 directory_entry __elem_;466 directory_entry __elem_;
466};467};
467468
469_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
468_LIBCPP_END_NAMESPACE_FILESYSTEM470_LIBCPP_END_NAMESPACE_FILESYSTEM
469471
470#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM472#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
lib/libcxx/include/__filesystem/directory_iterator.h+2
...@@ -33,6 +33,7 @@ _LIBCPP_PUSH_MACROS...@@ -33,6 +33,7 @@ _LIBCPP_PUSH_MACROS
33#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM33#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
3434
35_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM35_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
36_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3637
37class _LIBCPP_HIDDEN __dir_stream;38class _LIBCPP_HIDDEN __dir_stream;
38class directory_iterator {39class directory_iterator {
...@@ -129,6 +130,7 @@ operator!=(const directory_iterator& __lhs, const directory_iterator& __rhs) noe...@@ -129,6 +130,7 @@ operator!=(const directory_iterator& __lhs, const directory_iterator& __rhs) noe
129 return directory_iterator();130 return directory_iterator();
130}131}
131132
133_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
132_LIBCPP_END_NAMESPACE_FILESYSTEM134_LIBCPP_END_NAMESPACE_FILESYSTEM
133135
134# if _LIBCPP_STD_VER >= 20136# if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__filesystem/filesystem_error.h+2
...@@ -26,6 +26,7 @@...@@ -26,6 +26,7 @@
26#if _LIBCPP_STD_VER >= 1726#if _LIBCPP_STD_VER >= 17
2727
28_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM28_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
29_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2930
30class _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {31class _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {
31public:32public:
...@@ -80,6 +81,7 @@ template <class... _Args>...@@ -80,6 +81,7 @@ template <class... _Args>
80}81}
81# endif82# endif
8283
84_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
83_LIBCPP_END_NAMESPACE_FILESYSTEM85_LIBCPP_END_NAMESPACE_FILESYSTEM
8486
85#endif // _LIBCPP_STD_VER >= 1787#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__filesystem/operations.h+2
...@@ -31,6 +31,7 @@...@@ -31,6 +31,7 @@
3131
32_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM32_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
3333
34_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
34_LIBCPP_EXPORTED_FROM_ABI path __absolute(const path&, error_code* __ec = nullptr);35_LIBCPP_EXPORTED_FROM_ABI path __absolute(const path&, error_code* __ec = nullptr);
35_LIBCPP_EXPORTED_FROM_ABI path __canonical(const path&, error_code* __ec = nullptr);36_LIBCPP_EXPORTED_FROM_ABI path __canonical(const path&, error_code* __ec = nullptr);
36_LIBCPP_EXPORTED_FROM_ABI bool37_LIBCPP_EXPORTED_FROM_ABI bool
...@@ -67,6 +68,7 @@ _LIBCPP_EXPORTED_FROM_ABI path __temp_directory_path(error_code* __ec = nullptr)...@@ -67,6 +68,7 @@ _LIBCPP_EXPORTED_FROM_ABI path __temp_directory_path(error_code* __ec = nullptr)
67_LIBCPP_EXPORTED_FROM_ABI bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);68_LIBCPP_EXPORTED_FROM_ABI bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);
68_LIBCPP_EXPORTED_FROM_ABI void __permissions(const path&, perms, perm_options, error_code* = nullptr);69_LIBCPP_EXPORTED_FROM_ABI void __permissions(const path&, perms, perm_options, error_code* = nullptr);
69_LIBCPP_EXPORTED_FROM_ABI space_info __space(const path&, error_code* __ec = nullptr);70_LIBCPP_EXPORTED_FROM_ABI space_info __space(const path&, error_code* __ec = nullptr);
71_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
7072
71[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }73[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }
72[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) {74[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) {
lib/libcxx/include/__filesystem/path.h+37-52
...@@ -23,6 +23,7 @@...@@ -23,6 +23,7 @@
23#include <__type_traits/is_pointer.h>23#include <__type_traits/is_pointer.h>
24#include <__type_traits/remove_const.h>24#include <__type_traits/remove_const.h>
25#include <__type_traits/remove_pointer.h>25#include <__type_traits/remove_pointer.h>
26#include <__type_traits/void_t.h>
26#include <__utility/move.h>27#include <__utility/move.h>
27#include <string>28#include <string>
28#include <string_view>29#include <string_view>
...@@ -41,6 +42,7 @@ _LIBCPP_PUSH_MACROS...@@ -41,6 +42,7 @@ _LIBCPP_PUSH_MACROS
41#if _LIBCPP_STD_VER >= 1742#if _LIBCPP_STD_VER >= 17
4243
43_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM44_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
45_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4446
45template <class _Tp>47template <class _Tp>
46struct __can_convert_char {48struct __can_convert_char {
...@@ -93,15 +95,12 @@ typedef string __u8_string;...@@ -93,15 +95,12 @@ typedef string __u8_string;
9395
94struct _NullSentinel {};96struct _NullSentinel {};
9597
96template <class _Tp>
97using _Void _LIBCPP_NODEBUG = void;
98
99template <class _Tp, class = void>98template <class _Tp, class = void>
100struct __is_pathable_string : public false_type {};99struct __is_pathable_string : public false_type {};
101100
102template <class _ECharT, class _Traits, class _Alloc>101template <class _ECharT, class _Traits, class _Alloc>
103struct __is_pathable_string< basic_string<_ECharT, _Traits, _Alloc>,102struct __is_pathable_string< basic_string<_ECharT, _Traits, _Alloc>,
104 _Void<typename __can_convert_char<_ECharT>::__char_type> >103 void_t<typename __can_convert_char<_ECharT>::__char_type> >
105 : public __can_convert_char<_ECharT> {104 : public __can_convert_char<_ECharT> {
106 using _Str _LIBCPP_NODEBUG = basic_string<_ECharT, _Traits, _Alloc>;105 using _Str _LIBCPP_NODEBUG = basic_string<_ECharT, _Traits, _Alloc>;
107106
...@@ -114,7 +113,7 @@ struct __is_pathable_string< basic_string<_ECharT, _Traits, _Alloc>,...@@ -114,7 +113,7 @@ struct __is_pathable_string< basic_string<_ECharT, _Traits, _Alloc>,
114113
115template <class _ECharT, class _Traits>114template <class _ECharT, class _Traits>
116struct __is_pathable_string< basic_string_view<_ECharT, _Traits>,115struct __is_pathable_string< basic_string_view<_ECharT, _Traits>,
117 _Void<typename __can_convert_char<_ECharT>::__char_type> >116 void_t<typename __can_convert_char<_ECharT>::__char_type> >
118 : public __can_convert_char<_ECharT> {117 : public __can_convert_char<_ECharT> {
119 using _Str _LIBCPP_NODEBUG = basic_string_view<_ECharT, _Traits>;118 using _Str _LIBCPP_NODEBUG = basic_string_view<_ECharT, _Traits>;
120119
...@@ -154,7 +153,7 @@ template <class _Iter>...@@ -154,7 +153,7 @@ template <class _Iter>
154struct __is_pathable_iter<153struct __is_pathable_iter<
155 _Iter,154 _Iter,
156 true,155 true,
157 _Void<typename __can_convert_char< typename iterator_traits<_Iter>::value_type>::__char_type> >156 void_t<typename __can_convert_char< typename iterator_traits<_Iter>::value_type>::__char_type> >
158 : __can_convert_char<typename iterator_traits<_Iter>::value_type> {157 : __can_convert_char<typename iterator_traits<_Iter>::value_type> {
159 using _ECharT _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::value_type;158 using _ECharT _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::value_type;
160159
...@@ -261,15 +260,14 @@ struct _PathCVT {...@@ -261,15 +260,14 @@ struct _PathCVT {
261260
262template <>261template <>
263struct _PathCVT<__path_value> {262struct _PathCVT<__path_value> {
264 template <class _Iter, __enable_if_t<__has_exactly_input_iterator_category<_Iter>::value, int> = 0>263 template <class _Iter>
265 _LIBCPP_HIDE_FROM_ABI static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
266 for (; __b != __e; ++__b)
267 __dest.push_back(*__b);
268 }
269
270 template <class _Iter, __enable_if_t<__has_forward_iterator_category<_Iter>::value, int> = 0>
271 _LIBCPP_HIDE_FROM_ABI static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {264 _LIBCPP_HIDE_FROM_ABI static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
272 __dest.append(__b, __e);265 if constexpr (__has_forward_iterator_category<_Iter>::value) {
266 __dest.append(__b, __e);
267 } else {
268 for (; __b != __e; ++__b)
269 __dest.push_back(*__b);
270 }
273 }271 }
274272
275 template <class _Iter>273 template <class _Iter>
...@@ -296,13 +294,7 @@ struct _PathCVT<char> {...@@ -296,13 +294,7 @@ struct _PathCVT<char> {
296 __char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, __size);294 __char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, __size);
297 }295 }
298296
299 template <class _Iter, __enable_if_t<__has_exactly_input_iterator_category<_Iter>::value, int> = 0>297 template <class _Iter>
300 _LIBCPP_HIDE_FROM_ABI static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
301 basic_string<char> __tmp(__b, __e);
302 __append_string(__dest, __tmp);
303 }
304
305 template <class _Iter, __enable_if_t<__has_forward_iterator_category<_Iter>::value, int> = 0>
306 _LIBCPP_HIDE_FROM_ABI static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {298 _LIBCPP_HIDE_FROM_ABI static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
307 basic_string<char> __tmp(__b, __e);299 basic_string<char> __tmp(__b, __e);
308 __append_string(__dest, __tmp);300 __append_string(__dest, __tmp);
...@@ -449,7 +441,7 @@ public:...@@ -449,7 +441,7 @@ public:
449 return *this;441 return *this;
450 }442 }
451443
452 _LIBCPP_HIDE_FROM_ABI path& assign(string_type&& __s) noexcept {444 _LIBCPP_HIDE_FROM_ABI path& assign(string_type&& __s) noexcept _LIBCPP_LIFETIMEBOUND {
453 __pn_ = std::move(__s);445 __pn_ = std::move(__s);
454 return *this;446 return *this;
455 }447 }
...@@ -460,14 +452,14 @@ public:...@@ -460,14 +452,14 @@ public:
460 }452 }
461453
462 template <class _Source>454 template <class _Source>
463 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> assign(const _Source& __src) {455 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> assign(const _Source& __src) _LIBCPP_LIFETIMEBOUND {
464 __pn_.clear();456 __pn_.clear();
465 _SourceCVT<_Source>::__append_source(__pn_, __src);457 _SourceCVT<_Source>::__append_source(__pn_, __src);
466 return *this;458 return *this;
467 }459 }
468460
469 template <class _InputIt>461 template <class _InputIt>
470 _LIBCPP_HIDE_FROM_ABI path& assign(_InputIt __first, _InputIt __last) {462 _LIBCPP_HIDE_FROM_ABI path& assign(_InputIt __first, _InputIt __last) _LIBCPP_LIFETIMEBOUND {
471 typedef typename iterator_traits<_InputIt>::value_type _ItVal;463 typedef typename iterator_traits<_InputIt>::value_type _ItVal;
472 __pn_.clear();464 __pn_.clear();
473 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);465 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
...@@ -501,12 +493,12 @@ public:...@@ -501,12 +493,12 @@ public:
501 }493 }
502494
503 template <class _Source>495 template <class _Source>
504 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> append(const _Source& __src) {496 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> append(const _Source& __src) _LIBCPP_LIFETIMEBOUND {
505 return operator/=(path(__src));497 return operator/=(path(__src));
506 }498 }
507499
508 template <class _InputIt>500 template <class _InputIt>
509 _LIBCPP_HIDE_FROM_ABI path& append(_InputIt __first, _InputIt __last) {501 _LIBCPP_HIDE_FROM_ABI path& append(_InputIt __first, _InputIt __last) _LIBCPP_LIFETIMEBOUND {
510 return operator/=(path(__first, __last));502 return operator/=(path(__first, __last));
511 }503 }
512# else504# else
...@@ -530,7 +522,7 @@ public:...@@ -530,7 +522,7 @@ public:
530 }522 }
531523
532 template <class _Source>524 template <class _Source>
533 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> append(const _Source& __src) {525 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> append(const _Source& __src) _LIBCPP_LIFETIMEBOUND {
534 using _Traits = __is_pathable<_Source>;526 using _Traits = __is_pathable<_Source>;
535 using _CVT = _PathCVT<_SourceChar<_Source> >;527 using _CVT = _PathCVT<_SourceChar<_Source> >;
536 bool __source_is_absolute = filesystem::__is_separator(_Traits::__first_or_null(__src));528 bool __source_is_absolute = filesystem::__is_separator(_Traits::__first_or_null(__src));
...@@ -543,7 +535,7 @@ public:...@@ -543,7 +535,7 @@ public:
543 }535 }
544536
545 template <class _InputIt>537 template <class _InputIt>
546 _LIBCPP_HIDE_FROM_ABI path& append(_InputIt __first, _InputIt __last) {538 _LIBCPP_HIDE_FROM_ABI path& append(_InputIt __first, _InputIt __last) _LIBCPP_LIFETIMEBOUND {
547 typedef typename iterator_traits<_InputIt>::value_type _ItVal;539 typedef typename iterator_traits<_InputIt>::value_type _ItVal;
548 static_assert(__can_convert_char<_ItVal>::value, "Must convertible");540 static_assert(__can_convert_char<_ItVal>::value, "Must convertible");
549 using _CVT = _PathCVT<_ItVal>;541 using _CVT = _PathCVT<_ItVal>;
...@@ -594,13 +586,13 @@ public:...@@ -594,13 +586,13 @@ public:
594 }586 }
595587
596 template <class _Source>588 template <class _Source>
597 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> concat(const _Source& __x) {589 _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source> concat(const _Source& __x) _LIBCPP_LIFETIMEBOUND {
598 _SourceCVT<_Source>::__append_source(__pn_, __x);590 _SourceCVT<_Source>::__append_source(__pn_, __x);
599 return *this;591 return *this;
600 }592 }
601593
602 template <class _InputIt>594 template <class _InputIt>
603 _LIBCPP_HIDE_FROM_ABI path& concat(_InputIt __first, _InputIt __last) {595 _LIBCPP_HIDE_FROM_ABI path& concat(_InputIt __first, _InputIt __last) _LIBCPP_LIFETIMEBOUND {
604 typedef typename iterator_traits<_InputIt>::value_type _ItVal;596 typedef typename iterator_traits<_InputIt>::value_type _ItVal;
605 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);597 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
606 return *this;598 return *this;
...@@ -609,26 +601,26 @@ public:...@@ -609,26 +601,26 @@ public:
609 // modifiers601 // modifiers
610 _LIBCPP_HIDE_FROM_ABI void clear() noexcept { __pn_.clear(); }602 _LIBCPP_HIDE_FROM_ABI void clear() noexcept { __pn_.clear(); }
611603
612 _LIBCPP_HIDE_FROM_ABI path& make_preferred() {604 _LIBCPP_HIDE_FROM_ABI path& make_preferred() _LIBCPP_LIFETIMEBOUND {
613# if defined(_LIBCPP_WIN32API)605# if defined(_LIBCPP_WIN32API)
614 std::replace(__pn_.begin(), __pn_.end(), L'/', L'\\');606 std::replace(__pn_.begin(), __pn_.end(), L'/', L'\\');
615# endif607# endif
616 return *this;608 return *this;
617 }609 }
618610
619 _LIBCPP_HIDE_FROM_ABI path& remove_filename() {611 _LIBCPP_HIDE_FROM_ABI path& remove_filename() _LIBCPP_LIFETIMEBOUND {
620 auto __fname = __filename();612 auto __fname = __filename();
621 if (!__fname.empty())613 if (!__fname.empty())
622 __pn_.erase(__fname.data() - __pn_.data());614 __pn_.erase(__fname.data() - __pn_.data());
623 return *this;615 return *this;
624 }616 }
625617
626 _LIBCPP_HIDE_FROM_ABI path& replace_filename(const path& __replacement) {618 _LIBCPP_HIDE_FROM_ABI path& replace_filename(const path& __replacement) _LIBCPP_LIFETIMEBOUND {
627 remove_filename();619 remove_filename();
628 return (*this /= __replacement);620 return (*this /= __replacement);
629 }621 }
630622
631 path& replace_extension(const path& __replacement = path());623 path& replace_extension(const path& __replacement = path()) _LIBCPP_LIFETIMEBOUND;
632624
633 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const path& __lhs, const path& __rhs) noexcept {625 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const path& __lhs, const path& __rhs) noexcept {
634 return __lhs.__compare(__rhs.__pn_) == 0;626 return __lhs.__compare(__rhs.__pn_) == 0;
...@@ -667,9 +659,11 @@ public:...@@ -667,9 +659,11 @@ public:
667 _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __s) { __pn_.reserve(__s); }659 _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __s) { __pn_.reserve(__s); }
668660
669 // native format observers661 // native format observers
670 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const string_type& native() const noexcept { return __pn_; }662 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const string_type& native() const noexcept _LIBCPP_LIFETIMEBOUND { return __pn_; }
671663
672 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const value_type* c_str() const noexcept { return __pn_.c_str(); }664 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const value_type* c_str() const noexcept _LIBCPP_LIFETIMEBOUND {
665 return __pn_.c_str();
666 }
673667
674 _LIBCPP_HIDE_FROM_ABI operator string_type() const { return __pn_; }668 _LIBCPP_HIDE_FROM_ABI operator string_type() const { return __pn_; }
675669
...@@ -874,23 +868,13 @@ public:...@@ -874,23 +868,13 @@ public:
874 [[nodiscard]] iterator end() const;868 [[nodiscard]] iterator end() const;
875869
876# if _LIBCPP_HAS_LOCALIZATION870# if _LIBCPP_HAS_LOCALIZATION
877 template <871 template <class _CharT, class _Traits>
878 class _CharT,
879 class _Traits,
880 __enable_if_t<is_same<_CharT, value_type>::value && is_same<_Traits, char_traits<value_type> >::value, int> = 0>
881 _LIBCPP_HIDE_FROM_ABI friend basic_ostream<_CharT, _Traits>&
882 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
883 __os << std::__quoted(__p.native());
884 return __os;
885 }
886
887 template <
888 class _CharT,
889 class _Traits,
890 __enable_if_t<!is_same<_CharT, value_type>::value || !is_same<_Traits, char_traits<value_type> >::value, int> = 0>
891 _LIBCPP_HIDE_FROM_ABI friend basic_ostream<_CharT, _Traits>&872 _LIBCPP_HIDE_FROM_ABI friend basic_ostream<_CharT, _Traits>&
892 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {873 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
893 __os << std::__quoted(__p.string<_CharT, _Traits>());874 if constexpr (is_same<_CharT, value_type>::value && is_same<_Traits, char_traits<value_type> >::value)
875 __os << std::quoted(__p.native());
876 else
877 __os << std::quoted(__p.string<_CharT, _Traits>());
894 return __os;878 return __os;
895 }879 }
896880
...@@ -898,7 +882,7 @@ public:...@@ -898,7 +882,7 @@ public:
898 _LIBCPP_HIDE_FROM_ABI friend basic_istream<_CharT, _Traits>&882 _LIBCPP_HIDE_FROM_ABI friend basic_istream<_CharT, _Traits>&
899 operator>>(basic_istream<_CharT, _Traits>& __is, path& __p) {883 operator>>(basic_istream<_CharT, _Traits>& __is, path& __p) {
900 basic_string<_CharT, _Traits> __tmp;884 basic_string<_CharT, _Traits> __tmp;
901 __is >> std::__quoted(__tmp);885 __is >> std::quoted(__tmp);
902 __p = __tmp;886 __p = __tmp;
903 return __is;887 return __is;
904 }888 }
...@@ -916,6 +900,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept { __lh...@@ -916,6 +900,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept { __lh
916900
917[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept;901[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept;
918902
903_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
919_LIBCPP_END_NAMESPACE_FILESYSTEM904_LIBCPP_END_NAMESPACE_FILESYSTEM
920905
921_LIBCPP_BEGIN_NAMESPACE_STD906_LIBCPP_BEGIN_NAMESPACE_STD
lib/libcxx/include/__filesystem/path_iterator.h+2
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2323
24_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM24_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2526
26class _LIBCPP_EXPORTED_FROM_ABI path::iterator {27class _LIBCPP_EXPORTED_FROM_ABI path::iterator {
27public:28public:
...@@ -103,6 +104,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const path::iterator& __lhs, const...@@ -103,6 +104,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const path::iterator& __lhs, const
103 return !(__lhs == __rhs);104 return !(__lhs == __rhs);
104}105}
105106
107_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
106_LIBCPP_END_NAMESPACE_FILESYSTEM108_LIBCPP_END_NAMESPACE_FILESYSTEM
107109
108#endif // _LIBCPP_STD_VER >= 17110#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__filesystem/recursive_directory_iterator.h+2
...@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS...@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS
32#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM32#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
3333
34_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM34_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
35_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3536
36class recursive_directory_iterator {37class recursive_directory_iterator {
37public:38public:
...@@ -139,6 +140,7 @@ begin(recursive_directory_iterator __iter) noexcept {...@@ -139,6 +140,7 @@ begin(recursive_directory_iterator __iter) noexcept {
139 return recursive_directory_iterator();140 return recursive_directory_iterator();
140}141}
141142
143_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
142_LIBCPP_END_NAMESPACE_FILESYSTEM144_LIBCPP_END_NAMESPACE_FILESYSTEM
143145
144# if _LIBCPP_STD_VER >= 20146# if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__flat_map/flat_multimap.h-9
...@@ -934,15 +934,6 @@ private:...@@ -934,15 +934,6 @@ private:
934934
935 containers __containers_;935 containers __containers_;
936 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;936 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;
937
938 struct __key_equiv {
939 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __key_equiv(key_compare __c) : __comp_(__c) {}
940 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
941 operator()(const_reference __x, const_reference __y) const {
942 return !__comp_(std::get<0>(__x), std::get<0>(__y)) && !__comp_(std::get<0>(__y), std::get<0>(__x));
943 }
944 key_compare __comp_;
945 };
946};937};
947938
948template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>939template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
lib/libcxx/include/__flat_set/flat_multiset.h-9
...@@ -745,15 +745,6 @@ private:...@@ -745,15 +745,6 @@ private:
745745
746 _KeyContainer __keys_;746 _KeyContainer __keys_;
747 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;747 _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;
748
749 struct __key_equiv {
750 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __key_equiv(key_compare __c) : __comp_(__c) {}
751 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
752 operator()(const_reference __x, const_reference __y) const {
753 return !__comp_(std::get<0>(__x), std::get<0>(__y)) && !__comp_(std::get<0>(__y), std::get<0>(__x));
754 }
755 key_compare __comp_;
756 };
757};748};
758749
759template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>750template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
lib/libcxx/include/__format/container_adaptor.h+4-4
...@@ -24,10 +24,10 @@...@@ -24,10 +24,10 @@
24#include <__type_traits/is_const.h>24#include <__type_traits/is_const.h>
25#include <__type_traits/maybe_const.h>25#include <__type_traits/maybe_const.h>
2626
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 2327#if _LIBCPP_STD_VER >= 23
3028
29_LIBCPP_BEGIN_NAMESPACE_STD
30
31// [container.adaptors.format] only specifies the library should provide the31// [container.adaptors.format] only specifies the library should provide the
32// formatter specializations, not which header should provide them.32// formatter specializations, not which header should provide them.
33// Since <format> includes a lot of headers, add these headers here instead of33// Since <format> includes a lot of headers, add these headers here instead of
...@@ -66,8 +66,8 @@ template <class _CharT, class _Tp, formattable<_CharT> _Container>...@@ -66,8 +66,8 @@ template <class _CharT, class _Tp, formattable<_CharT> _Container>
66struct formatter<stack<_Tp, _Container>, _CharT>66struct formatter<stack<_Tp, _Container>, _CharT>
67 : public __formatter_container_adaptor<stack<_Tp, _Container>, _CharT> {};67 : public __formatter_container_adaptor<stack<_Tp, _Container>, _CharT> {};
6868
69#endif // _LIBCPP_STD_VER >= 23
70
71_LIBCPP_END_NAMESPACE_STD69_LIBCPP_END_NAMESPACE_STD
7270
71#endif // _LIBCPP_STD_VER >= 23
72
73#endif // _LIBCPP___FORMAT_CONTAINER_ADAPTOR_H73#endif // _LIBCPP___FORMAT_CONTAINER_ADAPTOR_H
lib/libcxx/include/__format/enable_insertable.h+4-4
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2019#if _LIBCPP_STD_VER >= 20
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23namespace __format {23namespace __format {
2424
25/// Opt-in to enable \ref __insertable for a \a _Container.25/// Opt-in to enable \ref __insertable for a \a _Container.
...@@ -28,8 +28,8 @@ inline constexpr bool __enable_insertable = false;...@@ -28,8 +28,8 @@ inline constexpr bool __enable_insertable = false;
2828
29} // namespace __format29} // namespace __format
3030
31#endif // _LIBCPP_STD_VER >= 20
32
33_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
3432
33#endif // _LIBCPP_STD_VER >= 20
34
35#endif // _LIBCPP___FORMAT_ENABLE_INSERTABLE_H35#endif // _LIBCPP___FORMAT_ENABLE_INSERTABLE_H
lib/libcxx/include/__format/escaped_output_table.h+7-6
...@@ -61,19 +61,20 @@...@@ -61,19 +61,20 @@
61#ifndef _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H61#ifndef _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H
62#define _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H62#define _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H
6363
64#include <__algorithm/ranges_upper_bound.h>64#include <__algorithm/upper_bound.h>
65#include <__config>65#include <__config>
66#include <__cstddef/ptrdiff_t.h>66#include <__cstddef/ptrdiff_t.h>
67#include <__iterator/access.h>
67#include <cstdint>68#include <cstdint>
6869
69#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)70#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
70# pragma GCC system_header71# pragma GCC system_header
71#endif72#endif
7273
73_LIBCPP_BEGIN_NAMESPACE_STD
74
75#if _LIBCPP_STD_VER >= 2374#if _LIBCPP_STD_VER >= 23
7675
76_LIBCPP_BEGIN_NAMESPACE_STD
77
77namespace __escaped_output_table {78namespace __escaped_output_table {
78// clang-format off79// clang-format off
7980
...@@ -868,7 +869,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[735] = {...@@ -868,7 +869,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[735] = {
868 if (__code_point >= 0x000323b0)869 if (__code_point >= 0x000323b0)
869 return true;870 return true;
870871
871 ptrdiff_t __i = std::ranges::upper_bound(__entries, (__code_point << 14) | 0x3fffu) - __entries;872 ptrdiff_t __i = std::upper_bound(std::begin(__entries), std::end(__entries), (__code_point << 14) | 0x3fffu) - __entries;
872 if (__i == 0)873 if (__i == 0)
873 return false;874 return false;
874875
...@@ -880,8 +881,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[735] = {...@@ -880,8 +881,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr uint32_t __entries[735] = {
880// clang-format on881// clang-format on
881} // namespace __escaped_output_table882} // namespace __escaped_output_table
882883
883#endif // _LIBCPP_STD_VER >= 23
884
885_LIBCPP_END_NAMESPACE_STD884_LIBCPP_END_NAMESPACE_STD
886885
886#endif // _LIBCPP_STD_VER >= 23
887
887#endif // _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H888#endif // _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H
lib/libcxx/include/__format/fmt_pair_like.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2323#if _LIBCPP_STD_VER >= 23
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27// [tuple.like] defines a tuple-like exposition only concept. This concept is not related to that. Therefore it uses a27// [tuple.like] defines a tuple-like exposition only concept. This concept is not related to that. Therefore it uses a
28// different name for the concept.28// different name for the concept.
29//29//
...@@ -35,8 +35,8 @@ template <class _Tp>...@@ -35,8 +35,8 @@ template <class _Tp>
35concept __fmt_pair_like =35concept __fmt_pair_like =
36 __is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);36 __is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
3737
38#endif // _LIBCPP_STD_VER >= 23
39
40_LIBCPP_END_NAMESPACE_STD38_LIBCPP_END_NAMESPACE_STD
4139
40#endif // _LIBCPP_STD_VER >= 23
41
42#endif // _LIBCPP___FORMAT_FMT_PAIR_LIKE_H42#endif // _LIBCPP___FORMAT_FMT_PAIR_LIKE_H
lib/libcxx/include/__format/format_context.h+4-7
...@@ -40,10 +40,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -40,10 +40,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4040
41#if _LIBCPP_STD_VER >= 2041#if _LIBCPP_STD_VER >= 20
4242
43template <class _OutIt, class _CharT>
44 requires output_iterator<_OutIt, const _CharT&>
45class basic_format_context;
46
47# if _LIBCPP_HAS_LOCALIZATION43# if _LIBCPP_HAS_LOCALIZATION
48/**44/**
49 * Helper to create a basic_format_context.45 * Helper to create a basic_format_context.
...@@ -71,15 +67,16 @@ using wformat_context = basic_format_context< back_insert_iterator<__format::__o...@@ -71,15 +67,16 @@ using wformat_context = basic_format_context< back_insert_iterator<__format::__o
71# endif67# endif
7268
73template <class _OutIt, class _CharT>69template <class _OutIt, class _CharT>
74 requires output_iterator<_OutIt, const _CharT&>70class _LIBCPP_PREFERRED_NAME(format_context) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wformat_context))
75class _LIBCPP_PREFERRED_NAME(format_context)71 basic_format_context {
76 _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wformat_context)) basic_format_context {
77public:72public:
78 using iterator = _OutIt;73 using iterator = _OutIt;
79 using char_type = _CharT;74 using char_type = _CharT;
80 template <class _Tp>75 template <class _Tp>
81 using formatter_type = formatter<_Tp, _CharT>;76 using formatter_type = formatter<_Tp, _CharT>;
8277
78 static_assert(output_iterator<_OutIt, const _CharT&>, "[format.context]/p3 requires OutIt to be an output_iterator");
79
83 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> arg(size_t __id) const noexcept {80 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> arg(size_t __id) const noexcept {
84 return __args_.get(__id);81 return __args_.get(__id);
85 }82 }
lib/libcxx/include/__format/format_error.h+2
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23#if _LIBCPP_STD_VER >= 2024#if _LIBCPP_STD_VER >= 20
2425
...@@ -45,6 +46,7 @@ _LIBCPP_DIAGNOSTIC_POP...@@ -45,6 +46,7 @@ _LIBCPP_DIAGNOSTIC_POP
4546
46#endif // _LIBCPP_STD_VER >= 2047#endif // _LIBCPP_STD_VER >= 20
4748
49_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
48_LIBCPP_END_NAMESPACE_STD50_LIBCPP_END_NAMESPACE_STD
4951
50#endif // _LIBCPP___FORMAT_FORMAT_ERROR_H52#endif // _LIBCPP___FORMAT_FORMAT_ERROR_H
lib/libcxx/include/__format/format_functions.h+15-11
...@@ -11,7 +11,7 @@...@@ -11,7 +11,7 @@
11#define _LIBCPP___FORMAT_FORMAT_FUNCTIONS11#define _LIBCPP___FORMAT_FORMAT_FUNCTIONS
1212
13#include <__algorithm/clamp.h>13#include <__algorithm/clamp.h>
14#include <__algorithm/ranges_find_first_of.h>14#include <__algorithm/find_first_of.h>
15#include <__chrono/statically_widen.h>15#include <__chrono/statically_widen.h>
16#include <__concepts/convertible_to.h>16#include <__concepts/convertible_to.h>
17#include <__concepts/same_as.h>17#include <__concepts/same_as.h>
...@@ -26,7 +26,7 @@...@@ -26,7 +26,7 @@
26#include <__format/format_string.h>26#include <__format/format_string.h>
27#include <__format/format_to_n_result.h>27#include <__format/format_to_n_result.h>
28#include <__format/formatter.h>28#include <__format/formatter.h>
29#include <__format/formatter_bool.h>29#include <__format/formatter_bool_impl.h>
30#include <__format/formatter_char.h>30#include <__format/formatter_char.h>
31#include <__format/formatter_floating_point.h>31#include <__format/formatter_floating_point.h>
32#include <__format/formatter_integer.h>32#include <__format/formatter_integer.h>
...@@ -342,7 +342,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr typename _Ctx::iterator __vformat_to(_ParseCtx&&...@@ -342,7 +342,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr typename _Ctx::iterator __vformat_to(_ParseCtx&&
342342
343# if _LIBCPP_STD_VER >= 26343# if _LIBCPP_STD_VER >= 26
344template <class _CharT>344template <class _CharT>
345struct __runtime_format_string {345struct __dynamic_format_string {
346private:346private:
347 basic_string_view<_CharT> __str_;347 basic_string_view<_CharT> __str_;
348348
...@@ -350,15 +350,15 @@ private:...@@ -350,15 +350,15 @@ private:
350 friend struct basic_format_string;350 friend struct basic_format_string;
351351
352public:352public:
353 _LIBCPP_HIDE_FROM_ABI __runtime_format_string(basic_string_view<_CharT> __s) noexcept : __str_(__s) {}353 _LIBCPP_HIDE_FROM_ABI __dynamic_format_string(basic_string_view<_CharT> __s) noexcept : __str_(__s) {}
354354
355 __runtime_format_string(const __runtime_format_string&) = delete;355 __dynamic_format_string(const __dynamic_format_string&) = delete;
356 __runtime_format_string& operator=(const __runtime_format_string&) = delete;356 __dynamic_format_string& operator=(const __dynamic_format_string&) = delete;
357};357};
358358
359_LIBCPP_HIDE_FROM_ABI inline __runtime_format_string<char> runtime_format(string_view __fmt) noexcept { return __fmt; }359_LIBCPP_HIDE_FROM_ABI inline __dynamic_format_string<char> dynamic_format(string_view __fmt) noexcept { return __fmt; }
360# if _LIBCPP_HAS_WIDE_CHARACTERS360# if _LIBCPP_HAS_WIDE_CHARACTERS
361_LIBCPP_HIDE_FROM_ABI inline __runtime_format_string<wchar_t> runtime_format(wstring_view __fmt) noexcept {361_LIBCPP_HIDE_FROM_ABI inline __dynamic_format_string<wchar_t> dynamic_format(wstring_view __fmt) noexcept {
362 return __fmt;362 return __fmt;
363}363}
364# endif364# endif
...@@ -375,7 +375,7 @@ struct basic_format_string {...@@ -375,7 +375,7 @@ struct basic_format_string {
375375
376 _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<_CharT> get() const noexcept { return __str_; }376 _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<_CharT> get() const noexcept { return __str_; }
377# if _LIBCPP_STD_VER >= 26377# if _LIBCPP_STD_VER >= 26
378 _LIBCPP_HIDE_FROM_ABI basic_format_string(__runtime_format_string<_CharT> __s) noexcept : __str_(__s.__str_) {}378 _LIBCPP_HIDE_FROM_ABI basic_format_string(__dynamic_format_string<_CharT> __s) noexcept : __str_(__s.__str_) {}
379# endif379# endif
380380
381private:381private:
...@@ -459,8 +459,12 @@ template <class _CharT>...@@ -459,8 +459,12 @@ template <class _CharT>
459 basic_string_view<_CharT> __fmt,459 basic_string_view<_CharT> __fmt,
460 basic_format_args<basic_format_context<back_insert_iterator<__format::__output_buffer<_CharT>>, _CharT>> __args) {460 basic_format_args<basic_format_context<back_insert_iterator<__format::__output_buffer<_CharT>>, _CharT>> __args) {
461 // Fold strings not containing '{' or '}' to just return the string461 // Fold strings not containing '{' or '}' to just return the string
462 if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated462 if (bool __is_identity =
463 { return std::ranges::find_first_of(__fmt, array{'{', '}'}) == __fmt.end(); }();463 [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
464 {
465 char __vals[] = {'{', '}'};
466 return std::find_first_of(__fmt.begin(), __fmt.end(), std::begin(__vals), std::end(__vals)) == __fmt.end();
467 }();
464 __builtin_constant_p(__is_identity) && __is_identity)468 __builtin_constant_p(__is_identity) && __is_identity)
465 return basic_string<_CharT>{__fmt};469 return basic_string<_CharT>{__fmt};
466470
lib/libcxx/include/__format/formatter_bool.h+5-30
...@@ -10,19 +10,10 @@...@@ -10,19 +10,10 @@
10#ifndef _LIBCPP___FORMAT_FORMATTER_BOOL_H10#ifndef _LIBCPP___FORMAT_FORMATTER_BOOL_H
11#define _LIBCPP___FORMAT_FORMATTER_BOOL_H11#define _LIBCPP___FORMAT_FORMATTER_BOOL_H
1212
13#include <__algorithm/copy.h>
14#include <__assert>
15#include <__config>13#include <__config>
16#include <__format/concepts.h>14#include <__format/concepts.h>
17#include <__format/format_parse_context.h>
18#include <__format/formatter.h>15#include <__format/formatter.h>
19#include <__format/formatter_integral.h>
20#include <__format/parser_std_format_spec.h>16#include <__format/parser_std_format_spec.h>
21#include <__utility/unreachable.h>
22
23#if _LIBCPP_HAS_LOCALIZATION
24# include <__locale>
25#endif
2617
27#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28# pragma GCC system_header19# pragma GCC system_header
...@@ -32,9 +23,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -32,9 +23,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3223
33#if _LIBCPP_STD_VER >= 2024#if _LIBCPP_STD_VER >= 20
3425
26template <__fmt_char_type _CharT, class _FormatContext>
27_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
28__formatter_bool_format(bool __value, __format_spec::__parser<_CharT>, _FormatContext&);
29
35template <__fmt_char_type _CharT>30template <__fmt_char_type _CharT>
36struct formatter<bool, _CharT> {31struct formatter<bool, _CharT> {
37public:
38 template <class _ParseContext>32 template <class _ParseContext>
39 _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {33 _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
40 typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);34 typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);
...@@ -44,26 +38,7 @@ public:...@@ -44,26 +38,7 @@ public:
4438
45 template <class _FormatContext>39 template <class _FormatContext>
46 _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(bool __value, _FormatContext& __ctx) const {40 _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(bool __value, _FormatContext& __ctx) const {
47 switch (__parser_.__type_) {41 return std::__formatter_bool_format(__value, __parser_, __ctx);
48 case __format_spec::__type::__default:
49 case __format_spec::__type::__string:
50 return __formatter::__format_bool(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
51
52 case __format_spec::__type::__binary_lower_case:
53 case __format_spec::__type::__binary_upper_case:
54 case __format_spec::__type::__octal:
55 case __format_spec::__type::__decimal:
56 case __format_spec::__type::__hexadecimal_lower_case:
57 case __format_spec::__type::__hexadecimal_upper_case:
58 // Promotes bool to an integral type. This reduces the number of
59 // instantiations of __format_integer reducing code size.
60 return __formatter::__format_integer(
61 static_cast<unsigned>(__value), __ctx, __parser_.__get_parsed_std_specifications(__ctx));
62
63 default:
64 _LIBCPP_ASSERT_INTERNAL(false, "The parse function should have validated the type");
65 __libcpp_unreachable();
66 }
67 }42 }
6843
69 __format_spec::__parser<_CharT> __parser_;44 __format_spec::__parser<_CharT> __parser_;
lib/libcxx/include/__format/formatter_bool_impl.h created+60
...@@ -0,0 +1,60 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___FORMAT_FORMATTER_BOOL_IMPL_H
11#define _LIBCPP___FORMAT_FORMATTER_BOOL_IMPL_H
12
13#include <__assert>
14#include <__config>
15#include <__format/concepts.h>
16#include <__format/formatter_bool.h>
17#include <__format/formatter_integral.h>
18#include <__format/parser_std_format_spec.h>
19#include <__utility/unreachable.h>
20
21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
22# pragma GCC system_header
23#endif
24
25#if _LIBCPP_STD_VER >= 20
26
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29// This function is separated from formatter<bool> to avoid pulling in a bunch of code from <format> that we aren't
30// required to provide in other headers where we need formatter<bool> itself to be complete.
31template <__fmt_char_type _CharT, class _FormatContext>
32_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
33__formatter_bool_format(bool __value, __format_spec::__parser<_CharT> __parser, _FormatContext& __ctx) {
34 switch (__parser.__type_) {
35 case __format_spec::__type::__default:
36 case __format_spec::__type::__string:
37 return __formatter::__format_bool(__value, __ctx, __parser.__get_parsed_std_specifications(__ctx));
38
39 case __format_spec::__type::__binary_lower_case:
40 case __format_spec::__type::__binary_upper_case:
41 case __format_spec::__type::__octal:
42 case __format_spec::__type::__decimal:
43 case __format_spec::__type::__hexadecimal_lower_case:
44 case __format_spec::__type::__hexadecimal_upper_case:
45 // Promotes bool to an integral type. This reduces the number of
46 // instantiations of __format_integer reducing code size.
47 return __formatter::__format_integer(
48 static_cast<unsigned>(__value), __ctx, __parser.__get_parsed_std_specifications(__ctx));
49
50 default:
51 _LIBCPP_ASSERT_INTERNAL(false, "The parse function should have validated the type");
52 __libcpp_unreachable();
53 }
54}
55
56_LIBCPP_END_NAMESPACE_STD
57
58#endif // _LIBCPP_STD_VER >= 20
59
60#endif // _LIBCPP___FORMAT_FORMATTER_BOOL_IMPL_H
lib/libcxx/include/__format/formatter_floating_point.h+4-4
...@@ -32,12 +32,12 @@...@@ -32,12 +32,12 @@
32#include <__format/formatter_output.h>32#include <__format/formatter_output.h>
33#include <__format/parser_std_format_spec.h>33#include <__format/parser_std_format_spec.h>
34#include <__iterator/concepts.h>34#include <__iterator/concepts.h>
35#include <__math/traits.h>
35#include <__memory/allocator.h>36#include <__memory/allocator.h>
36#include <__system_error/errc.h>37#include <__system_error/errc.h>
37#include <__type_traits/conditional.h>38#include <__type_traits/conditional.h>
38#include <__utility/move.h>39#include <__utility/move.h>
39#include <__utility/unreachable.h>40#include <__utility/unreachable.h>
40#include <cmath>
4141
42#if _LIBCPP_HAS_LOCALIZATION42#if _LIBCPP_HAS_LOCALIZATION
43# include <__locale>43# include <__locale>
...@@ -637,10 +637,10 @@ _LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(...@@ -637,10 +637,10 @@ _LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(
637template <floating_point _Tp, class _CharT, class _FormatContext>637template <floating_point _Tp, class _CharT, class _FormatContext>
638_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator638_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
639__format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {639__format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {
640 bool __negative = std::signbit(__value);640 bool __negative = __math::signbit(__value);
641641
642 if (!std::isfinite(__value)) [[unlikely]]642 if (!__math::isfinite(__value)) [[unlikely]]
643 return __formatter::__format_floating_point_non_finite(__ctx.out(), __specs, __negative, std::isnan(__value));643 return __formatter::__format_floating_point_non_finite(__ctx.out(), __specs, __negative, __math::isnan(__value));
644644
645 // Depending on the std-format-spec string the sign and the value645 // Depending on the std-format-spec string the sign and the value
646 // might not be outputted together:646 // might not be outputted together:
lib/libcxx/include/__format/formatter_tuple.h+4-4
...@@ -31,10 +31,10 @@...@@ -31,10 +31,10 @@
31# pragma GCC system_header31# pragma GCC system_header
32#endif32#endif
3333
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36#if _LIBCPP_STD_VER >= 2334#if _LIBCPP_STD_VER >= 23
3735
36_LIBCPP_BEGIN_NAMESPACE_STD
37
38template <__fmt_char_type _CharT, class _Tuple, formattable<_CharT>... _Args>38template <__fmt_char_type _CharT, class _Tuple, formattable<_CharT>... _Args>
39struct __formatter_tuple {39struct __formatter_tuple {
40 _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {40 _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
...@@ -141,8 +141,8 @@ struct formatter<pair<_Args...>, _CharT> : public __formatter_tuple<_CharT, pair...@@ -141,8 +141,8 @@ struct formatter<pair<_Args...>, _CharT> : public __formatter_tuple<_CharT, pair
141template <__fmt_char_type _CharT, formattable<_CharT>... _Args>141template <__fmt_char_type _CharT, formattable<_CharT>... _Args>
142struct formatter<tuple<_Args...>, _CharT> : public __formatter_tuple<_CharT, tuple<_Args...>, _Args...> {};142struct formatter<tuple<_Args...>, _CharT> : public __formatter_tuple<_CharT, tuple<_Args...>, _Args...> {};
143143
144#endif // _LIBCPP_STD_VER >= 23
145
146_LIBCPP_END_NAMESPACE_STD144_LIBCPP_END_NAMESPACE_STD
147145
146#endif // _LIBCPP_STD_VER >= 23
147
148#endif // _LIBCPP___FORMAT_FORMATTER_TUPLE_H148#endif // _LIBCPP___FORMAT_FORMATTER_TUPLE_H
lib/libcxx/include/__format/range_default_formatter.h+5-4
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22#include <__format/formatter.h>22#include <__format/formatter.h>
23#include <__format/range_format.h>23#include <__format/range_format.h>
24#include <__format/range_formatter.h>24#include <__format/range_formatter.h>
25#include <__fwd/format.h>
25#include <__iterator/back_insert_iterator.h>26#include <__iterator/back_insert_iterator.h>
26#include <__ranges/concepts.h>27#include <__ranges/concepts.h>
27#include <__ranges/data.h>28#include <__ranges/data.h>
...@@ -32,10 +33,10 @@...@@ -32,10 +33,10 @@
32#include <__utility/pair.h>33#include <__utility/pair.h>
33#include <string_view>34#include <string_view>
3435
35_LIBCPP_BEGIN_NAMESPACE_STD
36
37#if _LIBCPP_STD_VER >= 2336#if _LIBCPP_STD_VER >= 23
3837
38_LIBCPP_BEGIN_NAMESPACE_STD
39
39template <class _Rp, class _CharT>40template <class _Rp, class _CharT>
40concept __const_formattable_range =41concept __const_formattable_range =
41 ranges::input_range<const _Rp> && formattable<ranges::range_reference_t<const _Rp>, _CharT>;42 ranges::input_range<const _Rp> && formattable<ranges::range_reference_t<const _Rp>, _CharT>;
...@@ -168,8 +169,8 @@ template <ranges::input_range _Rp, class _CharT>...@@ -168,8 +169,8 @@ template <ranges::input_range _Rp, class _CharT>
168 requires(format_kind<_Rp> != range_format::disabled && formattable<ranges::range_reference_t<_Rp>, _CharT>)169 requires(format_kind<_Rp> != range_format::disabled && formattable<ranges::range_reference_t<_Rp>, _CharT>)
169struct formatter<_Rp, _CharT> : __range_default_formatter<format_kind<_Rp>, _Rp, _CharT> {};170struct formatter<_Rp, _CharT> : __range_default_formatter<format_kind<_Rp>, _Rp, _CharT> {};
170171
171#endif // _LIBCPP_STD_VER >= 23
172
173_LIBCPP_END_NAMESPACE_STD172_LIBCPP_END_NAMESPACE_STD
174173
174#endif // _LIBCPP_STD_VER >= 23
175
175#endif // _LIBCPP___FORMAT_RANGE_DEFAULT_FORMATTER_H176#endif // _LIBCPP___FORMAT_RANGE_DEFAULT_FORMATTER_H
lib/libcxx/include/__format/range_format.h+4-18
...@@ -17,27 +17,13 @@...@@ -17,27 +17,13 @@
17#include <__concepts/same_as.h>17#include <__concepts/same_as.h>
18#include <__config>18#include <__config>
19#include <__format/fmt_pair_like.h>19#include <__format/fmt_pair_like.h>
20#include <__fwd/format.h>
20#include <__ranges/concepts.h>21#include <__ranges/concepts.h>
21#include <__type_traits/remove_cvref.h>22#include <__type_traits/remove_cvref.h>
2223
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2324#if _LIBCPP_STD_VER >= 23
2625
27_LIBCPP_DIAGNOSTIC_PUSH26_LIBCPP_BEGIN_NAMESPACE_STD
28_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wshadow")
29_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshadow")
30// This shadows map, set, and string.
31enum class range_format { disabled, map, set, sequence, string, debug_string };
32_LIBCPP_DIAGNOSTIC_POP
33
34template <class _Rp>
35constexpr range_format format_kind = [] {
36 // [format.range.fmtkind]/1
37 // A program that instantiates the primary template of format_kind is ill-formed.
38 static_assert(sizeof(_Rp) != sizeof(_Rp), "create a template specialization of format_kind for your type");
39 return range_format::disabled;
40}();
4127
42template <ranges::input_range _Rp>28template <ranges::input_range _Rp>
43 requires same_as<_Rp, remove_cvref_t<_Rp>>29 requires same_as<_Rp, remove_cvref_t<_Rp>>
...@@ -64,8 +50,8 @@ inline constexpr range_format format_kind<_Rp> = [] {...@@ -64,8 +50,8 @@ inline constexpr range_format format_kind<_Rp> = [] {
64 return range_format::sequence;50 return range_format::sequence;
65}();51}();
6652
67#endif // _LIBCPP_STD_VER >= 23
68
69_LIBCPP_END_NAMESPACE_STD53_LIBCPP_END_NAMESPACE_STD
7054
55#endif // _LIBCPP_STD_VER >= 23
56
71#endif57#endif
lib/libcxx/include/__format/range_formatter.h+6-4
...@@ -34,10 +34,10 @@...@@ -34,10 +34,10 @@
34#include <__type_traits/remove_cvref.h>34#include <__type_traits/remove_cvref.h>
35#include <string_view>35#include <string_view>
3636
37_LIBCPP_BEGIN_NAMESPACE_STD
38
39#if _LIBCPP_STD_VER >= 2337#if _LIBCPP_STD_VER >= 23
4038
39_LIBCPP_BEGIN_NAMESPACE_STD
40
41template <class _Tp, class _CharT = char>41template <class _Tp, class _CharT = char>
42 requires same_as<remove_cvref_t<_Tp>, _Tp> && formattable<_Tp, _CharT>42 requires same_as<remove_cvref_t<_Tp>, _Tp> && formattable<_Tp, _CharT>
43struct range_formatter {43struct range_formatter {
...@@ -215,6 +215,8 @@ private:...@@ -215,6 +215,8 @@ private:
215 switch (*__begin) {215 switch (*__begin) {
216 case _CharT('m'):216 case _CharT('m'):
217 if constexpr (__fmt_pair_like<_Tp>) {217 if constexpr (__fmt_pair_like<_Tp>) {
218 __underlying_.set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ": "));
219 __underlying_.set_brackets({}, {});
218 set_brackets(_LIBCPP_STATICALLY_WIDEN(_CharT, "{"), _LIBCPP_STATICALLY_WIDEN(_CharT, "}"));220 set_brackets(_LIBCPP_STATICALLY_WIDEN(_CharT, "{"), _LIBCPP_STATICALLY_WIDEN(_CharT, "}"));
219 set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ", "));221 set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ", "));
220 ++__begin;222 ++__begin;
...@@ -258,8 +260,8 @@ private:...@@ -258,8 +260,8 @@ private:
258 basic_string_view<_CharT> __closing_bracket_ = _LIBCPP_STATICALLY_WIDEN(_CharT, "]");260 basic_string_view<_CharT> __closing_bracket_ = _LIBCPP_STATICALLY_WIDEN(_CharT, "]");
259};261};
260262
261#endif // _LIBCPP_STD_VER >= 23
262
263_LIBCPP_END_NAMESPACE_STD263_LIBCPP_END_NAMESPACE_STD
264264
265#endif // _LIBCPP_STD_VER >= 23
266
265#endif // _LIBCPP___FORMAT_RANGE_FORMATTER_H267#endif // _LIBCPP___FORMAT_RANGE_FORMATTER_H
lib/libcxx/include/__format/unicode.h+1-1
...@@ -101,7 +101,7 @@ inline constexpr __consume_result __consume_result_error{__replacement_character...@@ -101,7 +101,7 @@ inline constexpr __consume_result __consume_result_error{__replacement_character
101 return __unicode::__is_code_point(__value) && !__unicode::__is_surrogate(__value);101 return __unicode::__is_code_point(__value) && !__unicode::__is_surrogate(__value);
102}102}
103103
104template <contiguous_iterator _Iterator>104template <class _Iterator>
105 requires same_as<iter_value_t<_Iterator>, char>105 requires same_as<iter_value_t<_Iterator>, char>
106_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(_Iterator __char, int __count) {106_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(_Iterator __char, int __count) {
107 do {107 do {
lib/libcxx/include/__functional/binary_negate.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)20#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Predicate>24template <class _Predicate>
25class _LIBCPP_DEPRECATED_IN_CXX17 binary_negate25class _LIBCPP_DEPRECATED_IN_CXX17 binary_negate
26 : public __binary_function<typename _Predicate::first_argument_type,26 : public __binary_function<typename _Predicate::first_argument_type,
...@@ -44,8 +44,8 @@ not2(const _Predicate& __pred) {...@@ -44,8 +44,8 @@ not2(const _Predicate& __pred) {
44 return binary_negate<_Predicate>(__pred);44 return binary_negate<_Predicate>(__pred);
45}45}
4646
47#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
48
49_LIBCPP_END_NAMESPACE_STD47_LIBCPP_END_NAMESPACE_STD
5048
49#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
50
51#endif // _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H51#endif // _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
lib/libcxx/include/__functional/bind_front.h+49
...@@ -17,6 +17,8 @@...@@ -17,6 +17,8 @@
17#include <__type_traits/decay.h>17#include <__type_traits/decay.h>
18#include <__type_traits/enable_if.h>18#include <__type_traits/enable_if.h>
19#include <__type_traits/is_constructible.h>19#include <__type_traits/is_constructible.h>
20#include <__type_traits/is_member_pointer.h>
21#include <__type_traits/is_pointer.h>
20#include <__utility/forward.h>22#include <__utility/forward.h>
2123
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -49,6 +51,53 @@ template <class _Fn, class... _Args>...@@ -49,6 +51,53 @@ template <class _Fn, class... _Args>
4951
50#endif // _LIBCPP_STD_VER >= 2052#endif // _LIBCPP_STD_VER >= 20
5153
54#if _LIBCPP_STD_VER >= 26
55
56template <auto _Fn, class _Indices, class... _BoundArgs>
57struct __nttp_bind_front_t;
58
59template <auto _Fn, size_t... _Indices, class... _BoundArgs>
60struct __nttp_bind_front_t<_Fn, index_sequence<_Indices...>, _BoundArgs...> {
61 tuple<_BoundArgs...> __bound_args_;
62
63 template <class _Self, class... _Args>
64 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(this _Self&& __self, _Args&&... __args) noexcept(noexcept(std::invoke(
65 _Fn, std::get<_Indices>(std::forward<_Self>(__self).__bound_args_)..., std::forward<_Args>(__args)...)))
66 -> decltype(std::invoke(
67 _Fn, std::get<_Indices>(std::forward<_Self>(__self).__bound_args_)..., std::forward<_Args>(__args)...)) {
68 return std::invoke(
69 _Fn, std::get<_Indices>(std::forward<_Self>(__self).__bound_args_)..., std::forward<_Args>(__args)...);
70 }
71};
72
73template <auto _Fn>
74struct __nttp_bind_without_bound_args_t {
75 template <class... _Args>
76 _LIBCPP_HIDE_FROM_ABI static constexpr auto
77 operator()(_Args&&... __args) noexcept(noexcept(std::invoke(_Fn, std::forward<_Args>(__args)...)))
78 -> decltype(std::invoke(_Fn, std::forward<_Args>(__args)...)) {
79 return std::invoke(_Fn, std::forward<_Args>(__args)...);
80 }
81};
82
83template <auto _Fn, class... _Args>
84[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto bind_front(_Args&&... __args) {
85 static_assert((is_constructible_v<decay_t<_Args>, _Args> && ...),
86 "bind_front requires all decay_t<Args> to be constructible from respective Args");
87 static_assert((is_move_constructible_v<decay_t<_Args>> && ...),
88 "bind_front requires all decay_t<Args> to be move constructible");
89 if constexpr (using _Ty = decltype(_Fn); is_pointer_v<_Ty> || is_member_pointer_v<_Ty>)
90 static_assert(_Fn != nullptr, "bind_front: f cannot be equal to nullptr");
91
92 if constexpr (sizeof...(_Args) == 0)
93 return __nttp_bind_without_bound_args_t<_Fn>{};
94 else
95 return __nttp_bind_front_t<_Fn, index_sequence_for<_Args...>, decay_t<_Args>...>{
96 .__bound_args_{std::forward<_Args>(__args)...}};
97}
98
99#endif // _LIBCPP_STD_VER >= 26
100
52_LIBCPP_END_NAMESPACE_STD101_LIBCPP_END_NAMESPACE_STD
53102
54#endif // _LIBCPP___FUNCTIONAL_BIND_FRONT_H103#endif // _LIBCPP___FUNCTIONAL_BIND_FRONT_H
lib/libcxx/include/__functional/binder1st.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)20#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Operation>24template <class _Operation>
25class _LIBCPP_DEPRECATED_IN_CXX11 binder1st25class _LIBCPP_DEPRECATED_IN_CXX11 binder1st
26 : public __unary_function<typename _Operation::second_argument_type, typename _Operation::result_type> {26 : public __unary_function<typename _Operation::second_argument_type, typename _Operation::result_type> {
...@@ -47,8 +47,8 @@ bind1st(const _Operation& __op, const _Tp& __x) {...@@ -47,8 +47,8 @@ bind1st(const _Operation& __op, const _Tp& __x) {
47 return binder1st<_Operation>(__op, __x);47 return binder1st<_Operation>(__op, __x);
48}48}
4949
50#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
51
52_LIBCPP_END_NAMESPACE_STD50_LIBCPP_END_NAMESPACE_STD
5351
52#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
53
54#endif // _LIBCPP___FUNCTIONAL_BINDER1ST_H54#endif // _LIBCPP___FUNCTIONAL_BINDER1ST_H
lib/libcxx/include/__functional/binder2nd.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)20#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Operation>24template <class _Operation>
25class _LIBCPP_DEPRECATED_IN_CXX11 binder2nd25class _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
26 : public __unary_function<typename _Operation::first_argument_type, typename _Operation::result_type> {26 : public __unary_function<typename _Operation::first_argument_type, typename _Operation::result_type> {
...@@ -47,8 +47,8 @@ bind2nd(const _Operation& __op, const _Tp& __x) {...@@ -47,8 +47,8 @@ bind2nd(const _Operation& __op, const _Tp& __x) {
47 return binder2nd<_Operation>(__op, __x);47 return binder2nd<_Operation>(__op, __x);
48}48}
4949
50#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
51
52_LIBCPP_END_NAMESPACE_STD50_LIBCPP_END_NAMESPACE_STD
5351
52#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
53
54#endif // _LIBCPP___FUNCTIONAL_BINDER2ND_H54#endif // _LIBCPP___FUNCTIONAL_BINDER2ND_H
lib/libcxx/include/__functional/compose.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2023#if _LIBCPP_STD_VER >= 20
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27struct __compose_op {27struct __compose_op {
28 template <class _Fn1, class _Fn2, class... _Args>28 template <class _Fn1, class _Fn2, class... _Args>
29 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn1&& __f1, _Fn2&& __f2, _Args&&... __args) const noexcept(noexcept(29 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn1&& __f1, _Fn2&& __f2, _Args&&... __args) const noexcept(noexcept(
...@@ -46,8 +46,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __compose(_Fn1&& __f1, _Fn2&& __f2) noexcep...@@ -46,8 +46,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __compose(_Fn1&& __f1, _Fn2&& __f2) noexcep
46 return __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(std::forward<_Fn1>(__f1), std::forward<_Fn2>(__f2));46 return __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(std::forward<_Fn1>(__f1), std::forward<_Fn2>(__f2));
47}47}
4848
49#endif // _LIBCPP_STD_VER >= 20
50
51_LIBCPP_END_NAMESPACE_STD49_LIBCPP_END_NAMESPACE_STD
5250
51#endif // _LIBCPP_STD_VER >= 20
52
53#endif // _LIBCPP___FUNCTIONAL_COMPOSE_H53#endif // _LIBCPP___FUNCTIONAL_COMPOSE_H
lib/libcxx/include/__functional/function.h+12-3
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include <__functional/binary_function.h>17#include <__functional/binary_function.h>
18#include <__functional/unary_function.h>18#include <__functional/unary_function.h>
19#include <__memory/addressof.h>19#include <__memory/addressof.h>
20#include <__new/placement_new_delete.h>
20#include <__type_traits/aligned_storage.h>21#include <__type_traits/aligned_storage.h>
21#include <__type_traits/decay.h>22#include <__type_traits/decay.h>
22#include <__type_traits/invoke.h>23#include <__type_traits/invoke.h>
...@@ -44,6 +45,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -44,6 +45,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
44// bad_function_call45// bad_function_call
4546
46_LIBCPP_DIAGNOSTIC_PUSH47_LIBCPP_DIAGNOSTIC_PUSH
48_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
47# if !_LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION49# if !_LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION
48_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")50_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
49# endif51# endif
...@@ -65,6 +67,7 @@ public:...@@ -65,6 +67,7 @@ public:
65 const char* what() const _NOEXCEPT override;67 const char* what() const _NOEXCEPT override;
66# endif68# endif
67};69};
70_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
68_LIBCPP_DIAGNOSTIC_POP71_LIBCPP_DIAGNOSTIC_POP
6972
70[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_function_call() {73[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_function_call() {
...@@ -128,6 +131,7 @@ namespace __function {...@@ -128,6 +131,7 @@ namespace __function {
128template <class _Fp>131template <class _Fp>
129class __base;132class __base;
130133
134_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
131template <class _Rp, class... _ArgTypes>135template <class _Rp, class... _ArgTypes>
132class __base<_Rp(_ArgTypes...)> {136class __base<_Rp(_ArgTypes...)> {
133public:137public:
...@@ -146,6 +150,7 @@ public:...@@ -146,6 +150,7 @@ public:
146 virtual const std::type_info& target_type() const _NOEXCEPT = 0;150 virtual const std::type_info& target_type() const _NOEXCEPT = 0;
147# endif // _LIBCPP_HAS_RTTI151# endif // _LIBCPP_HAS_RTTI
148};152};
153_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
149154
150// __func implements __base for a given functor type.155// __func implements __base for a given functor type.
151156
...@@ -527,9 +532,13 @@ public:...@@ -527,9 +532,13 @@ public:
527532
528# if _LIBCPP_HAS_BLOCKS_RUNTIME533# if _LIBCPP_HAS_BLOCKS_RUNTIME
529534
535_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
536
530extern "C" void* _Block_copy(const void*);537extern "C" void* _Block_copy(const void*);
531extern "C" void _Block_release(const void*);538extern "C" void _Block_release(const void*);
532539
540_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
541
533template <class _Rp1, class... _ArgTypes1, class _Rp, class... _ArgTypes>542template <class _Rp1, class... _ArgTypes1, class _Rp, class... _ArgTypes>
534class __func<_Rp1 (^)(_ArgTypes1...), _Rp(_ArgTypes...)> : public __base<_Rp(_ArgTypes...)> {543class __func<_Rp1 (^)(_ArgTypes1...), _Rp(_ArgTypes...)> : public __base<_Rp(_ArgTypes...)> {
535 typedef _Rp1 (^__block_type)(_ArgTypes1...);544 typedef _Rp1 (^__block_type)(_ArgTypes1...);
...@@ -540,7 +549,7 @@ public:...@@ -540,7 +549,7 @@ public:
540# if __has_feature(objc_arc)549# if __has_feature(objc_arc)
541 : __f_(__f)550 : __f_(__f)
542# else551# else
543 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))552 : __f_(reinterpret_cast<__block_type>(__f ? __function::_Block_copy(__f) : nullptr))
544# endif553# endif
545 {554 {
546 }555 }
...@@ -563,7 +572,7 @@ public:...@@ -563,7 +572,7 @@ public:
563 _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy() _NOEXCEPT {572 _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy() _NOEXCEPT {
564# if !__has_feature(objc_arc)573# if !__has_feature(objc_arc)
565 if (__f_)574 if (__f_)
566 _Block_release(__f_);575 __function::_Block_release(__f_);
567# endif576# endif
568 __f_ = 0;577 __f_ = 0;
569 }578 }
...@@ -684,7 +693,7 @@ public:...@@ -684,7 +693,7 @@ public:
684template <class _Rp, class... _Ap>693template <class _Rp, class... _Ap>
685function(_Rp (*)(_Ap...)) -> function<_Rp(_Ap...)>;694function(_Rp (*)(_Ap...)) -> function<_Rp(_Ap...)>;
686695
687template <class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>696template <class _Fp, class _Stripped = __strip_signature_t<decltype(&_Fp::operator())>>
688function(_Fp) -> function<_Stripped>;697function(_Fp) -> function<_Stripped>;
689# endif // _LIBCPP_STD_VER >= 17698# endif // _LIBCPP_STD_VER >= 17
690699
lib/libcxx/include/__functional/hash.h+16-12
...@@ -23,7 +23,6 @@...@@ -23,7 +23,6 @@
23#include <__type_traits/is_integral.h>23#include <__type_traits/is_integral.h>
24#include <__type_traits/is_unqualified.h>24#include <__type_traits/is_unqualified.h>
25#include <__type_traits/underlying_type.h>25#include <__type_traits/underlying_type.h>
26#include <__utility/pair.h>
27#include <__utility/swap.h>26#include <__utility/swap.h>
28#include <cstdint>27#include <cstdint>
29#include <cstring>28#include <cstring>
...@@ -41,6 +40,11 @@ inline _LIBCPP_HIDE_FROM_ABI _Size __loadword(const void* __p) {...@@ -41,6 +40,11 @@ inline _LIBCPP_HIDE_FROM_ABI _Size __loadword(const void* __p) {
41 return __r;40 return __r;
42}41}
4342
43struct _PairT {
44 size_t first;
45 size_t second;
46};
47
44// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t48// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
45// is 64 bits. This is because cityhash64 uses 64bit x 64bit49// is 64 bits. This is because cityhash64 uses 64bit x 64bit
46// multiplication, which can be very slow on 32-bit systems.50// multiplication, which can be very slow on 32-bit systems.
...@@ -104,9 +108,9 @@ struct __murmur2_or_cityhash<_Size, 64> {...@@ -104,9 +108,9 @@ struct __murmur2_or_cityhash<_Size, 64> {
104 _Size __y = std::__loadword<_Size>(__s + __len - 16) + std::__loadword<_Size>(__s + __len - 56);108 _Size __y = std::__loadword<_Size>(__s + __len - 16) + std::__loadword<_Size>(__s + __len - 56);
105 _Size __z =109 _Size __z =
106 __hash_len_16(std::__loadword<_Size>(__s + __len - 48) + __len, std::__loadword<_Size>(__s + __len - 24));110 __hash_len_16(std::__loadword<_Size>(__s + __len - 48) + __len, std::__loadword<_Size>(__s + __len - 24));
107 pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);111 _PairT __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
108 pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);112 _PairT __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
109 __x = __x * __k1 + std::__loadword<_Size>(__s);113 __x = __x * __k1 + std::__loadword<_Size>(__s);
110114
111 // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.115 // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
112 __len = (__len - 1) & ~static_cast<_Size>(63);116 __len = (__len - 1) & ~static_cast<_Size>(63);
...@@ -192,7 +196,7 @@ private:...@@ -192,7 +196,7 @@ private:
192196
193 // Return a 16-byte hash for 48 bytes. Quick and dirty.197 // Return a 16-byte hash for 48 bytes. Quick and dirty.
194 // Callers do best to use "random-looking" values for a and b.198 // Callers do best to use "random-looking" values for a and b.
195 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK static pair<_Size, _Size>199 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK static _PairT
196 __weak_hash_len_32_with_seeds(_Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) {200 __weak_hash_len_32_with_seeds(_Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) {
197 __a += __w;201 __a += __w;
198 __b = __rotate(__b + __a + __z, 21);202 __b = __rotate(__b + __a + __z, 21);
...@@ -200,11 +204,14 @@ private:...@@ -200,11 +204,14 @@ private:
200 __a += __x;204 __a += __x;
201 __a += __y;205 __a += __y;
202 __b += __rotate(__a, 44);206 __b += __rotate(__a, 44);
203 return pair<_Size, _Size>(__a + __z, __b + __c);207 _PairT __ret;
208 __ret.first = __a + __z;
209 __ret.second = __b + __c;
210 return __ret;
204 }211 }
205212
206 // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.213 // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
207 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK static pair<_Size, _Size>214 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK static _PairT
208 __weak_hash_len_32_with_seeds(const char* __s, _Size __a, _Size __b) {215 __weak_hash_len_32_with_seeds(const char* __s, _Size __a, _Size __b) {
209 return __weak_hash_len_32_with_seeds(216 return __weak_hash_len_32_with_seeds(
210 std::__loadword<_Size>(__s),217 std::__loadword<_Size>(__s),
...@@ -242,7 +249,9 @@ private:...@@ -242,7 +249,9 @@ private:
242};249};
243250
244#if _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY251#if _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY
252_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
245[[__gnu__::__pure__]] _LIBCPP_EXPORTED_FROM_ABI size_t __hash_memory(_LIBCPP_NOESCAPE const void*, size_t) _NOEXCEPT;253[[__gnu__::__pure__]] _LIBCPP_EXPORTED_FROM_ABI size_t __hash_memory(_LIBCPP_NOESCAPE const void*, size_t) _NOEXCEPT;
254_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
246#else255#else
247_LIBCPP_HIDE_FROM_ABI inline size_t __hash_memory(const void* __ptr, size_t __size) _NOEXCEPT {256_LIBCPP_HIDE_FROM_ABI inline size_t __hash_memory(const void* __ptr, size_t __size) _NOEXCEPT {
248 return __murmur2_or_cityhash<size_t>()(__ptr, __size);257 return __murmur2_or_cityhash<size_t>()(__ptr, __size);
...@@ -325,11 +334,6 @@ struct __scalar_hash<_Tp, 4> : public __unary_function<_Tp, size_t> {...@@ -325,11 +334,6 @@ struct __scalar_hash<_Tp, 4> : public __unary_function<_Tp, size_t> {
325 }334 }
326};335};
327336
328struct _PairT {
329 size_t first;
330 size_t second;
331};
332
333_LIBCPP_HIDE_FROM_ABI inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {337_LIBCPP_HIDE_FROM_ABI inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
334 typedef __scalar_hash<_PairT> _HashT;338 typedef __scalar_hash<_PairT> _HashT;
335 const _PairT __p = {__lhs, __rhs};339 const _PairT __p = {__lhs, __rhs};
lib/libcxx/include/__functional/invoke.h+6-6
...@@ -19,19 +19,17 @@...@@ -19,19 +19,17 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <class _Fn, class... _Args>26template <class _Fn, class... _Args>
27_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 invoke_result_t<_Fn, _Args...>27_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 invoke_result_t<_Fn, _Args...>
28invoke(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_v<_Fn, _Args...>) {28invoke(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_v<_Fn, _Args...>) {
29 return std::__invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);29 return std::__invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
30}30}
3131
32#endif // _LIBCPP_STD_VER >= 1732# if _LIBCPP_STD_VER >= 23
33
34#if _LIBCPP_STD_VER >= 23
35template <class _Result, class _Fn, class... _Args>33template <class _Result, class _Fn, class... _Args>
36 requires is_invocable_r_v<_Result, _Fn, _Args...>34 requires is_invocable_r_v<_Result, _Fn, _Args...>
37_LIBCPP_HIDE_FROM_ABI constexpr _Result35_LIBCPP_HIDE_FROM_ABI constexpr _Result
...@@ -48,8 +46,10 @@ invoke_r(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_r_v<_Result...@@ -48,8 +46,10 @@ invoke_r(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_r_v<_Result
48 return std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);46 return std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
49 }47 }
50}48}
51#endif49# endif
5250
53_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
5452
53#endif // _LIBCPP_STD_VER >= 17
54
55#endif // _LIBCPP___FUNCTIONAL_INVOKE_H55#endif // _LIBCPP___FUNCTIONAL_INVOKE_H
lib/libcxx/include/__functional/is_transparent.h+3-3
...@@ -21,11 +21,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -21,11 +21,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121
22#if _LIBCPP_STD_VER >= 1422#if _LIBCPP_STD_VER >= 14
2323
24template <class _Tp, class _Key = void, class = void>24template <class _Comparator, class = void>
25inline const bool __is_transparent_v = false;25inline const bool __is_transparent_v = false;
2626
27template <class _Tp, class _Key>27template <class _Comparator>
28inline const bool __is_transparent_v<_Tp, _Key, __void_t<typename _Tp::is_transparent> > = true;28inline const bool __is_transparent_v<_Comparator, __void_t<typename _Comparator::is_transparent> > = true;
2929
30#endif30#endif
3131
lib/libcxx/include/__functional/mem_fun_ref.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)21#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25template <class _Sp, class _Tp>25template <class _Sp, class _Tp>
26class _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t : public __unary_function<_Tp*, _Sp> {26class _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t : public __unary_function<_Tp*, _Sp> {
27 _Sp (_Tp::*__p_)();27 _Sp (_Tp::*__p_)();
...@@ -138,8 +138,8 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const) {...@@ -138,8 +138,8 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const) {
138 return const_mem_fun1_ref_t<_Sp, _Tp, _Ap>(__f);138 return const_mem_fun1_ref_t<_Sp, _Tp, _Ap>(__f);
139}139}
140140
141#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
142
143_LIBCPP_END_NAMESPACE_STD141_LIBCPP_END_NAMESPACE_STD
144142
143#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
144
145#endif // _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H145#endif // _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
lib/libcxx/include/__functional/operations.h+4-4
...@@ -379,8 +379,8 @@ struct less<void> {...@@ -379,8 +379,8 @@ struct less<void> {
379 typedef void is_transparent;379 typedef void is_transparent;
380};380};
381381
382template <class _Tp>382template <class _ArgumentType>
383struct __make_transparent<_Tp, less<_Tp> > {383struct __make_transparent<_ArgumentType, less<_ArgumentType> > {
384 using type _LIBCPP_NODEBUG = less<>;384 using type _LIBCPP_NODEBUG = less<>;
385};385};
386386
...@@ -477,8 +477,8 @@ struct greater<void> {...@@ -477,8 +477,8 @@ struct greater<void> {
477template <class _Tp, class _Up>477template <class _Tp, class _Up>
478inline const bool __desugars_to_v<__greater_tag, greater<>, _Tp, _Up> = true;478inline const bool __desugars_to_v<__greater_tag, greater<>, _Tp, _Up> = true;
479479
480template <class _Tp>480template <class _ArgumentType>
481struct __make_transparent<_Tp, greater<_Tp>> {481struct __make_transparent<_ArgumentType, greater<_ArgumentType>> {
482 using type _LIBCPP_NODEBUG = greater<>;482 using type _LIBCPP_NODEBUG = greater<>;
483};483};
484484
lib/libcxx/include/__functional/perfect_forward.h+4-4
...@@ -28,10 +28,10 @@...@@ -28,10 +28,10 @@
28_LIBCPP_PUSH_MACROS28_LIBCPP_PUSH_MACROS
29#include <__undef_macros>29#include <__undef_macros>
3030
31_LIBCPP_BEGIN_NAMESPACE_STD
32
33#if _LIBCPP_STD_VER >= 1731#if _LIBCPP_STD_VER >= 17
3432
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35template <class _Op, class _Indices, class... _BoundArgs>35template <class _Op, class _Indices, class... _BoundArgs>
36struct __perfect_forward_impl;36struct __perfect_forward_impl;
3737
...@@ -96,10 +96,10 @@ public:...@@ -96,10 +96,10 @@ public:
96template <class _Op, class... _Args>96template <class _Op, class... _Args>
97using __perfect_forward _LIBCPP_NODEBUG = __perfect_forward_impl<_Op, index_sequence_for<_Args...>, _Args...>;97using __perfect_forward _LIBCPP_NODEBUG = __perfect_forward_impl<_Op, index_sequence_for<_Args...>, _Args...>;
9898
99#endif // _LIBCPP_STD_VER >= 17
100
101_LIBCPP_END_NAMESPACE_STD99_LIBCPP_END_NAMESPACE_STD
102100
101#endif // _LIBCPP_STD_VER >= 17
102
103_LIBCPP_POP_MACROS103_LIBCPP_POP_MACROS
104104
105#endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H105#endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
lib/libcxx/include/__functional/pointer_to_binary_function.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)20#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Arg1, class _Arg2, class _Result>24template <class _Arg1, class _Arg2, class _Result>
25class _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function : public __binary_function<_Arg1, _Arg2, _Result> {25class _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function : public __binary_function<_Arg1, _Arg2, _Result> {
26 _Result (*__f_)(_Arg1, _Arg2);26 _Result (*__f_)(_Arg1, _Arg2);
...@@ -36,8 +36,8 @@ ptr_fun(_Result (*__f)(_Arg1, _Arg2)) {...@@ -36,8 +36,8 @@ ptr_fun(_Result (*__f)(_Arg1, _Arg2)) {
36 return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__f);36 return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__f);
37}37}
3838
39#endif
40
41_LIBCPP_END_NAMESPACE_STD39_LIBCPP_END_NAMESPACE_STD
4240
41#endif
42
43#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H43#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
lib/libcxx/include/__functional/pointer_to_unary_function.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)20#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Arg, class _Result>24template <class _Arg, class _Result>
25class _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function : public __unary_function<_Arg, _Result> {25class _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function : public __unary_function<_Arg, _Result> {
26 _Result (*__f_)(_Arg);26 _Result (*__f_)(_Arg);
...@@ -36,8 +36,8 @@ ptr_fun(_Result (*__f)(_Arg)) {...@@ -36,8 +36,8 @@ ptr_fun(_Result (*__f)(_Arg)) {
36 return pointer_to_unary_function<_Arg, _Result>(__f);36 return pointer_to_unary_function<_Arg, _Result>(__f);
37}37}
3838
39#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
40
41_LIBCPP_END_NAMESPACE_STD39_LIBCPP_END_NAMESPACE_STD
4240
41#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
42
43#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H43#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
lib/libcxx/include/__functional/ranges_operations.h+4-4
...@@ -21,10 +21,10 @@...@@ -21,10 +21,10 @@
21# pragma GCC system_header21# pragma GCC system_header
22#endif22#endif
2323
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26#if _LIBCPP_STD_VER >= 2024#if _LIBCPP_STD_VER >= 20
2725
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28namespace ranges {28namespace ranges {
2929
30struct equal_to {30struct equal_to {
...@@ -115,8 +115,8 @@ inline const bool __is_generic_transparent_comparator_v<ranges::less> = true;...@@ -115,8 +115,8 @@ inline const bool __is_generic_transparent_comparator_v<ranges::less> = true;
115template <>115template <>
116inline const bool __is_generic_transparent_comparator_v<ranges::greater> = true;116inline const bool __is_generic_transparent_comparator_v<ranges::greater> = true;
117117
118#endif // _LIBCPP_STD_VER >= 20
119
120_LIBCPP_END_NAMESPACE_STD118_LIBCPP_END_NAMESPACE_STD
121119
120#endif // _LIBCPP_STD_VER >= 20
121
122#endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H122#endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
lib/libcxx/include/__functional/unary_negate.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)20#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Predicate>24template <class _Predicate>
25class _LIBCPP_DEPRECATED_IN_CXX17 unary_negate : public __unary_function<typename _Predicate::argument_type, bool> {25class _LIBCPP_DEPRECATED_IN_CXX17 unary_negate : public __unary_function<typename _Predicate::argument_type, bool> {
26 _Predicate __pred_;26 _Predicate __pred_;
...@@ -40,8 +40,8 @@ not1(const _Predicate& __pred) {...@@ -40,8 +40,8 @@ not1(const _Predicate& __pred) {
40 return unary_negate<_Predicate>(__pred);40 return unary_negate<_Predicate>(__pred);
41}41}
4242
43#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
44
45_LIBCPP_END_NAMESPACE_STD43_LIBCPP_END_NAMESPACE_STD
4644
45#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
46
47#endif // _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H47#endif // _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
lib/libcxx/include/__fwd/format.h+22-5
...@@ -11,28 +11,45 @@...@@ -11,28 +11,45 @@
11#define _LIBCPP___FWD_FORMAT_H11#define _LIBCPP___FWD_FORMAT_H
1212
13#include <__config>13#include <__config>
14#include <__iterator/concepts.h>
1514
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header16# pragma GCC system_header
18#endif17#endif
1918
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2019#if _LIBCPP_STD_VER >= 20
2320
21_LIBCPP_BEGIN_NAMESPACE_STD
22
24template <class _Context>23template <class _Context>
25class basic_format_arg;24class basic_format_arg;
2625
27template <class _OutIt, class _CharT>26template <class _OutIt, class _CharT>
28 requires output_iterator<_OutIt, const _CharT&>
29class basic_format_context;27class basic_format_context;
3028
31template <class _Tp, class _CharT = char>29template <class _Tp, class _CharT = char>
32struct formatter;30struct formatter;
3331
34#endif // _LIBCPP_STD_VER >= 2032# if _LIBCPP_STD_VER >= 23
33
34_LIBCPP_DIAGNOSTIC_PUSH
35_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wshadow")
36_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshadow")
37// This shadows map, set, and string.
38enum class range_format { disabled, map, set, sequence, string, debug_string };
39_LIBCPP_DIAGNOSTIC_POP
40
41template <class _Rp>
42constexpr range_format format_kind = [] {
43 // [format.range.fmtkind]/1
44 // A program that instantiates the primary template of format_kind is ill-formed.
45 static_assert(sizeof(_Rp) != sizeof(_Rp), "create a template specialization of format_kind for your type");
46 return range_format::disabled;
47}();
48
49# endif // _LIBCPP_STD_VER >= 23
3550
36_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
3752
53#endif // _LIBCPP_STD_VER >= 20
54
38#endif // _LIBCPP___FWD_FORMAT_H55#endif // _LIBCPP___FWD_FORMAT_H
lib/libcxx/include/__fwd/map.h deleted-31
...@@ -1,31 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___FWD_MAP_H
10#define _LIBCPP___FWD_MAP_H
11
12#include <__config>
13#include <__fwd/functional.h>
14#include <__fwd/memory.h>
15#include <__fwd/pair.h>
16
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header
19#endif
20
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
24class map;
25
26template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
27class multimap;
28
29_LIBCPP_END_NAMESPACE_STD
30
31#endif // _LIBCPP___FWD_MAP_H
lib/libcxx/include/__fwd/set.h deleted-30
...@@ -1,30 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___FWD_SET_H
10#define _LIBCPP___FWD_SET_H
11
12#include <__config>
13#include <__fwd/functional.h>
14#include <__fwd/memory.h>
15
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header
18#endif
19
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22template <class _Key, class _Compare = less<_Key>, class _Allocator = allocator<_Key> >
23class set;
24
25template <class _Key, class _Compare = less<_Key>, class _Allocator = allocator<_Key> >
26class multiset;
27
28_LIBCPP_END_NAMESPACE_STD
29
30#endif // _LIBCPP___FWD_SET_H
lib/libcxx/include/__fwd/span.h+4-4
...@@ -21,18 +21,18 @@...@@ -21,18 +21,18 @@
21_LIBCPP_PUSH_MACROS21_LIBCPP_PUSH_MACROS
22#include <__undef_macros>22#include <__undef_macros>
2323
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26#if _LIBCPP_STD_VER >= 2024#if _LIBCPP_STD_VER >= 20
2725
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();28inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
29template <typename _Tp, size_t _Extent = dynamic_extent>29template <typename _Tp, size_t _Extent = dynamic_extent>
30class span;30class span;
3131
32#endif
33
34_LIBCPP_END_NAMESPACE_STD32_LIBCPP_END_NAMESPACE_STD
3533
34#endif
35
36_LIBCPP_POP_MACROS36_LIBCPP_POP_MACROS
3737
38#endif // _LIBCPP___FWD_SPAN_H38#endif // _LIBCPP___FWD_SPAN_H
lib/libcxx/include/__fwd/variant.h+4-4
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 1719#if _LIBCPP_STD_VER >= 17
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class... _Types>23template <class... _Types>
24class variant;24class variant;
2525
...@@ -61,8 +61,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& get(const variant<_Types...>&);...@@ -61,8 +61,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& get(const variant<_Types...>&);
61template <class _Tp, class... _Types>61template <class _Tp, class... _Types>
62_LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& get(const variant<_Types...>&&);62_LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& get(const variant<_Types...>&&);
6363
64#endif // _LIBCPP_STD_VER >= 17
65
66_LIBCPP_END_NAMESPACE_STD64_LIBCPP_END_NAMESPACE_STD
6765
66#endif // _LIBCPP_STD_VER >= 17
67
68#endif // _LIBCPP___FWD_VARIANT_H68#endif // _LIBCPP___FWD_VARIANT_H
lib/libcxx/include/__hash_table+18-4
...@@ -41,6 +41,8 @@...@@ -41,6 +41,8 @@
41#include <__type_traits/is_swappable.h>41#include <__type_traits/is_swappable.h>
42#include <__type_traits/remove_const.h>42#include <__type_traits/remove_const.h>
43#include <__type_traits/remove_cvref.h>43#include <__type_traits/remove_cvref.h>
44#include <__utility/exception_guard.h>
45#include <__utility/exchange.h>
44#include <__utility/forward.h>46#include <__utility/forward.h>
45#include <__utility/move.h>47#include <__utility/move.h>
46#include <__utility/pair.h>48#include <__utility/pair.h>
...@@ -73,7 +75,9 @@ struct __is_hash_value_type : false_type {};...@@ -73,7 +75,9 @@ struct __is_hash_value_type : false_type {};
73template <class _One>75template <class _One>
74struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};76struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};
7577
78_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
76_LIBCPP_EXPORTED_FROM_ABI size_t __next_prime(size_t __n);79_LIBCPP_EXPORTED_FROM_ABI size_t __next_prime(size_t __n);
80_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
7781
78template <class _NodePtr>82template <class _NodePtr>
79struct __hash_node_base {83struct __hash_node_base {
...@@ -524,9 +528,7 @@ public:...@@ -524,9 +528,7 @@ public:
524528
525 _LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator(__bucket_list_deallocator&& __x)529 _LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator(__bucket_list_deallocator&& __x)
526 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)530 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
527 : __size_(std::move(__x.__size_)), __alloc_(std::move(__x.__alloc_)) {531 : __size_(std::__exchange(__x.__size_, 0)), __alloc_(std::move(__x.__alloc_)) {}
528 __x.size() = 0;
529 }
530532
531 _LIBCPP_HIDE_FROM_ABI size_type& size() _NOEXCEPT { return __size_; }533 _LIBCPP_HIDE_FROM_ABI size_type& size() _NOEXCEPT { return __size_; }
532 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }534 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }
...@@ -696,6 +698,17 @@ private:...@@ -696,6 +698,17 @@ private:
696698
697 _LIBCPP_HIDE_FROM_ABI void __copy_construct(__next_pointer __other_iter) {699 _LIBCPP_HIDE_FROM_ABI void __copy_construct(__next_pointer __other_iter) {
698 __next_pointer __own_iter = __first_node_.__ptr();700 __next_pointer __own_iter = __first_node_.__ptr();
701 // If copying a node throws, the nodes that have already been constructed and linked into the
702 // list have to be deallocated. When this is called from the copy constructor the enclosing
703 // __hash_table is not fully constructed yet, so its destructor would not run to release them.
704 // This is also reached from operator= when assigning into an empty table; there the table
705 // stays alive, so we must leave it in a valid empty state: besides releasing the nodes we
706 // clear the bucket pointers, which were made to point into the now-deallocated node list.
707 auto __guard = std::__make_exception_guard([&] {
708 __deallocate_node_list(__first_node_.__next_);
709 __first_node_.__next_ = nullptr;
710 std::fill_n(__bucket_list_.get(), bucket_count(), nullptr);
711 });
699 {712 {
700 __node_holder __new_node = __construct_node_hash(__other_iter->__hash(), __other_iter->__upcast()->__get_value());713 __node_holder __new_node = __construct_node_hash(__other_iter->__hash(), __other_iter->__upcast()->__get_value());
701 __own_iter->__next_ = static_cast<__next_pointer>(__new_node.release());714 __own_iter->__next_ = static_cast<__next_pointer>(__new_node.release());
...@@ -706,6 +719,7 @@ private:...@@ -706,6 +719,7 @@ private:
706 __other_iter = __other_iter->__next_;719 __other_iter = __other_iter->__next_;
707 __own_iter = __own_iter->__next_;720 __own_iter = __own_iter->__next_;
708 __copy_construct(__other_iter, __own_iter, __current_chash);721 __copy_construct(__other_iter, __own_iter, __current_chash);
722 __guard.__complete();
709 }723 }
710724
711public:725public:
...@@ -774,7 +788,7 @@ public:...@@ -774,7 +788,7 @@ public:
774788
775 template <class... _Args>789 template <class... _Args>
776 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {790 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {
777 return std::__try_key_extraction<key_type>(791 return std::__try_key_extraction<key_type, value_type>(
778 [this](const key_type& __key, _Args&&... __args2) {792 [this](const key_type& __key, _Args&&... __args2) {
779 size_t __hash = hash_function()(__key);793 size_t __hash = hash_function()(__key);
780 size_type __bc = bucket_count();794 size_type __bc = bucket_count();
lib/libcxx/include/__iterator/access.h+15-13
...@@ -20,47 +20,49 @@...@@ -20,47 +20,49 @@
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2121
22template <class _Tp, size_t _Np>22template <class _Tp, size_t _Np>
23_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* begin(_Tp (&__array)[_Np]) _NOEXCEPT {23[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* begin(_Tp (&__array)[_Np]) _NOEXCEPT {
24 return __array;24 return __array;
25}25}
2626
27template <class _Tp, size_t _Np>27template <class _Tp, size_t _Np>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* end(_Tp (&__array)[_Np]) _NOEXCEPT {28[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* end(_Tp (&__array)[_Np]) _NOEXCEPT {
29 return __array + _Np;29 return __array + _Np;
30}30}
3131
32#if !defined(_LIBCPP_CXX03_LANG)32#if !defined(_LIBCPP_CXX03_LANG)
3333
34template <class _Cp>34template <class _Cp>
35_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto begin(_Cp& __c) -> decltype(__c.begin()) {35[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto begin(_Cp& __c) -> decltype(__c.begin()) {
36 return __c.begin();36 return __c.begin();
37}37}
3838
39template <class _Cp>39template <class _Cp>
40_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto begin(const _Cp& __c) -> decltype(__c.begin()) {40[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto begin(const _Cp& __c)
41 -> decltype(__c.begin()) {
41 return __c.begin();42 return __c.begin();
42}43}
4344
44template <class _Cp>45template <class _Cp>
45_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(_Cp& __c) -> decltype(__c.end()) {46[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(_Cp& __c) -> decltype(__c.end()) {
46 return __c.end();47 return __c.end();
47}48}
4849
49template <class _Cp>50template <class _Cp>
50_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(const _Cp& __c) -> decltype(__c.end()) {51[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto end(const _Cp& __c) -> decltype(__c.end()) {
51 return __c.end();52 return __c.end();
52}53}
5354
54# if _LIBCPP_STD_VER >= 1455# if _LIBCPP_STD_VER >= 14
5556
56template <class _Cp>57template <class _Cp>
57_LIBCPP_HIDE_FROM_ABI constexpr auto58[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr auto cbegin(const _Cp& __c) noexcept(noexcept(std::begin(__c)))
58cbegin(const _Cp& __c) noexcept(noexcept(std::begin(__c))) -> decltype(std::begin(__c)) {59 -> decltype(std::begin(__c)) {
59 return std::begin(__c);60 return std::begin(__c);
60}61}
6162
62template <class _Cp>63template <class _Cp>
63_LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std::end(__c))) -> decltype(std::end(__c)) {64[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std::end(__c)))
65 -> decltype(std::end(__c)) {
64 return std::end(__c);66 return std::end(__c);
65}67}
6668
...@@ -69,22 +71,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std:...@@ -69,22 +71,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std:
69#else // defined(_LIBCPP_CXX03_LANG)71#else // defined(_LIBCPP_CXX03_LANG)
7072
71template <class _Cp>73template <class _Cp>
72_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) {74[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) {
73 return __c.begin();75 return __c.begin();
74}76}
7577
76template <class _Cp>78template <class _Cp>
77_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator begin(const _Cp& __c) {79[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator begin(const _Cp& __c) {
78 return __c.begin();80 return __c.begin();
79}81}
8082
81template <class _Cp>83template <class _Cp>
82_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator end(_Cp& __c) {84[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI typename _Cp::iterator end(_Cp& __c) {
83 return __c.end();85 return __c.end();
84}86}
8587
86template <class _Cp>88template <class _Cp>
87_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) {89[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) {
88 return __c.end();90 return __c.end();
89}91}
9092
lib/libcxx/include/__iterator/back_insert_iterator.h+3-1
...@@ -58,7 +58,9 @@ public:...@@ -58,7 +58,9 @@ public:
58 return *this;58 return *this;
59 }59 }
60#endif // _LIBCPP_CXX03_LANG60#endif // _LIBCPP_CXX03_LANG
61 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator& operator*() { return *this; }61 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator& operator*() {
62 return *this;
63 }
62 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator& operator++() { return *this; }64 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator& operator++() { return *this; }
63 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator operator++(int) { return *this; }65 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 back_insert_iterator operator++(int) { return *this; }
6466
lib/libcxx/include/__iterator/bounded_iter.h+7-9
...@@ -53,9 +53,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -53,9 +53,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
53// optimizations deleting non-redundant bounds checks.53// optimizations deleting non-redundant bounds checks.
54template <class _Iterator>54template <class _Iterator>
55struct __bounded_iter {55struct __bounded_iter {
56 static_assert(__libcpp_is_contiguous_iterator<_Iterator>::value,
57 "Only contiguous iterators can be adapted by __bounded_iter.");
58
59 using value_type = typename iterator_traits<_Iterator>::value_type;56 using value_type = typename iterator_traits<_Iterator>::value_type;
60 using difference_type = typename iterator_traits<_Iterator>::difference_type;57 using difference_type = typename iterator_traits<_Iterator>::difference_type;
61 using pointer = typename iterator_traits<_Iterator>::pointer;58 using pointer = typename iterator_traits<_Iterator>::pointer;
...@@ -117,7 +114,7 @@ public:...@@ -117,7 +114,7 @@ public:
117 // that the iterator is always within `[begin, end]`, we only need to check it's not pointing to114 // that the iterator is always within `[begin, end]`, we only need to check it's not pointing to
118 // `end`. This is easier for the optimizer because it aligns with the `iter != container.end()`115 // `end`. This is easier for the optimizer because it aligns with the `iter != container.end()`
119 // checks that typical callers already use (see https://llvm.org/PR78829).116 // checks that typical callers already use (see https://llvm.org/PR78829).
120 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {117 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {
121 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(118 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
122 __current_ != __end_, "__bounded_iter::operator*: Attempt to dereference an iterator at the end");119 __current_ != __end_, "__bounded_iter::operator*: Attempt to dereference an iterator at the end");
123 return *__current_;120 return *__current_;
...@@ -129,7 +126,8 @@ public:...@@ -129,7 +126,8 @@ public:
129 return std::__to_address(__current_);126 return std::__to_address(__current_);
130 }127 }
131128
132 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {129 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference
130 operator[](difference_type __n) const _NOEXCEPT {
133 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(131 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
134 __n >= __begin_ - __current_, "__bounded_iter::operator[]: Attempt to index an iterator past the start");132 __n >= __begin_ - __current_, "__bounded_iter::operator[]: Attempt to index an iterator past the start");
135 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(133 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
...@@ -172,13 +170,13 @@ public:...@@ -172,13 +170,13 @@ public:
172 __current_ += __n;170 __current_ += __n;
173 return *this;171 return *this;
174 }172 }
175 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __bounded_iter173 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __bounded_iter
176 operator+(__bounded_iter const& __self, difference_type __n) _NOEXCEPT {174 operator+(__bounded_iter const& __self, difference_type __n) _NOEXCEPT {
177 __bounded_iter __tmp(__self);175 __bounded_iter __tmp(__self);
178 __tmp += __n;176 __tmp += __n;
179 return __tmp;177 return __tmp;
180 }178 }
181 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __bounded_iter179 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __bounded_iter
182 operator+(difference_type __n, __bounded_iter const& __self) _NOEXCEPT {180 operator+(difference_type __n, __bounded_iter const& __self) _NOEXCEPT {
183 __bounded_iter __tmp(__self);181 __bounded_iter __tmp(__self);
184 __tmp += __n;182 __tmp += __n;
...@@ -193,13 +191,13 @@ public:...@@ -193,13 +191,13 @@ public:
193 __current_ -= __n;191 __current_ -= __n;
194 return *this;192 return *this;
195 }193 }
196 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __bounded_iter194 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __bounded_iter
197 operator-(__bounded_iter const& __self, difference_type __n) _NOEXCEPT {195 operator-(__bounded_iter const& __self, difference_type __n) _NOEXCEPT {
198 __bounded_iter __tmp(__self);196 __bounded_iter __tmp(__self);
199 __tmp -= __n;197 __tmp -= __n;
200 return __tmp;198 return __tmp;
201 }199 }
202 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend difference_type200 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend difference_type
203 operator-(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {201 operator-(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
204 return __x.__current_ - __y.__current_;202 return __x.__current_ - __y.__current_;
205 }203 }
lib/libcxx/include/__iterator/capacity_aware_iterator.h created+186
...@@ -0,0 +1,186 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CAPACITY_AWARE_ITERATOR_H
11#define _LIBCPP___CAPACITY_AWARE_ITERATOR_H
12
13#include <__assert>
14#include <__compare/ordering.h>
15#include <__compare/three_way_comparable.h>
16#include <__config>
17#include <__cstddef/size_t.h>
18#include <__iterator/concepts.h>
19#include <__iterator/incrementable_traits.h>
20#include <__iterator/iterator_traits.h>
21#include <__memory/pointer_traits.h>
22#include <__type_traits/is_constructible.h>
23#include <__type_traits/is_convertible.h>
24#include <__utility/move.h>
25
26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
27# pragma GCC system_header
28#endif
29
30_LIBCPP_PUSH_MACROS
31#include <__undef_macros>
32
33#if _LIBCPP_STD_VER >= 26
34
35_LIBCPP_BEGIN_NAMESPACE_STD
36
37// __capacity_aware_iterator is an iterator that wraps a contiguous iterator and encodes the maximum number of
38// elements that can appear in a range of such iterators. That maximum number of elements must be known at compile-time.
39// As of writing, the only standard library containers which fulfill these requirements are inplace_vector and optional.
40//
41// It also embeds a tag type to prevent mixing iterators from e.g. different containers. This also allows for some
42// algorithms to detect this iterator and perform optimizations based on the added semantic information.
43
44template <class _Iter, class _Tag, size_t _RangeMaxElements>
45class __capacity_aware_iterator {
46private:
47 _Iter __iter_;
48
49 template <class, class, size_t>
50 friend class __capacity_aware_iterator;
51
52public:
53 static_assert(contiguous_iterator<_Iter>, "__capacity_aware_iterator can only be used with contiguous iterators");
54
55 using iterator_category = iterator_traits<_Iter>::iterator_category;
56 using iterator_concept = contiguous_iterator_tag;
57 using difference_type = iter_difference_t<_Iter>;
58 using pointer = iterator_traits<_Iter>::pointer;
59 using reference = iter_reference_t<_Iter>;
60 using value_type = iter_value_t<_Iter>;
61
62 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator()
63 requires is_default_constructible_v<_Iter>
64 = default;
65
66 template <typename _Iter2>
67 requires is_convertible_v<_Iter2, _Iter>
68 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator(
69 const __capacity_aware_iterator<_Iter2, _Tag, _RangeMaxElements>& __y) noexcept
70 : __iter_(__y.__iter_) {}
71
72 template <class _It, class _Tag2, size_t _RangeMaxElems2>
73 _LIBCPP_HIDE_FROM_ABI friend constexpr auto __make_capacity_aware_iterator(_It __iter) noexcept;
74
75private:
76 _LIBCPP_HIDE_FROM_ABI constexpr explicit __capacity_aware_iterator(_Iter __iter) : __iter_(std::move(__iter)) {}
77
78public:
79 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const noexcept { return *__iter_; }
80 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator->() const noexcept { return std::__to_address(__iter_); }
81
82 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator& operator++() noexcept {
83 ++__iter_;
84 return *this;
85 }
86
87 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator operator++(int) noexcept {
88 __capacity_aware_iterator __tmp(*this);
89 ++*this;
90 return __tmp;
91 }
92
93 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator& operator--() noexcept {
94 --__iter_;
95 return *this;
96 }
97
98 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator operator--(int) noexcept {
99 __capacity_aware_iterator __tmp(*this);
100 --*this;
101 return __tmp;
102 }
103
104 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator& operator+=(difference_type __n) noexcept {
105 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
106 static_cast<size_t>(__n >= 0 ? __n : -__n) <= _RangeMaxElements,
107 "__capacity_aware_iterator::operator+=: Attempting to move iterator past its container's possible range");
108
109 __iter_ += __n;
110 return *this;
111 }
112
113 _LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator& operator-=(difference_type __n) noexcept {
114 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
115 static_cast<size_t>(__n >= 0 ? __n : -__n) <= _RangeMaxElements,
116 "__capacity_aware_iterator::operator-=: Attempting to move iterator past its container's possible range");
117
118 __iter_ -= __n;
119 return *this;
120 }
121
122 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const noexcept {
123 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
124 static_cast<size_t>(__n >= 0 ? __n : -__n) < _RangeMaxElements,
125 "__capacity_aware_iterator::operator[]: Attempting to index iterator past its container's possible range");
126 return *(*this + __n);
127 }
128
129 _LIBCPP_HIDE_FROM_ABI friend constexpr bool
130 operator==(const __capacity_aware_iterator& __x, const __capacity_aware_iterator& __y) noexcept {
131 return __x.__iter_ == __y.__iter_;
132 }
133
134 _LIBCPP_HIDE_FROM_ABI friend constexpr auto
135 operator<=>(const __capacity_aware_iterator& __x, const __capacity_aware_iterator& __y) noexcept {
136 if constexpr (three_way_comparable_with<_Iter, _Iter, strong_ordering>) {
137 return __x.__iter_ <=> __y.__iter_;
138 } else {
139 if (__x.__iter_ < __y.__iter_) {
140 return strong_ordering::less;
141 } else if (__x.__iter_ == __y.__iter_) {
142 return strong_ordering::equal;
143 }
144 return strong_ordering::greater;
145 }
146 }
147
148 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __capacity_aware_iterator
149 operator+(const __capacity_aware_iterator& __i, difference_type __n) noexcept {
150 auto __tmp = __i;
151 __tmp += __n;
152 return __tmp;
153 }
154
155 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __capacity_aware_iterator
156 operator+(difference_type __n, const __capacity_aware_iterator& __i) noexcept {
157 auto __tmp = __i;
158 __tmp += __n;
159 return __tmp;
160 }
161
162 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __capacity_aware_iterator
163 operator-(const __capacity_aware_iterator& __i, difference_type __n) noexcept {
164 auto __tmp = __i;
165 __tmp -= __n;
166 return __tmp;
167 }
168
169 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
170 operator-(const __capacity_aware_iterator& __x, const __capacity_aware_iterator& __y) noexcept {
171 return difference_type(__x.__iter_ - __y.__iter_);
172 }
173};
174
175template <class _It, class _Tag2, size_t _RangeMaxElems2>
176_LIBCPP_HIDE_FROM_ABI constexpr auto __make_capacity_aware_iterator(_It __iter) noexcept {
177 return __capacity_aware_iterator<_It, _Tag2, _RangeMaxElems2>(__iter);
178}
179
180_LIBCPP_END_NAMESPACE_STD
181
182#endif // _LIBCPP_STD_VER >= 26
183
184_LIBCPP_POP_MACROS
185
186#endif // _LIBCPP___CAPACITY_AWARE_ITERATOR_H
lib/libcxx/include/__iterator/common_iterator.h+3-3
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include <__concepts/copyable.h>17#include <__concepts/copyable.h>
18#include <__concepts/derived_from.h>18#include <__concepts/derived_from.h>
19#include <__concepts/equality_comparable.h>19#include <__concepts/equality_comparable.h>
20#include <__concepts/referenceable.h>
20#include <__concepts/same_as.h>21#include <__concepts/same_as.h>
21#include <__config>22#include <__config>
22#include <__iterator/concepts.h>23#include <__iterator/concepts.h>
...@@ -28,7 +29,6 @@...@@ -28,7 +29,6 @@
28#include <__memory/addressof.h>29#include <__memory/addressof.h>
29#include <__type_traits/conditional.h>30#include <__type_traits/conditional.h>
30#include <__type_traits/is_pointer.h>31#include <__type_traits/is_pointer.h>
31#include <__type_traits/is_referenceable.h>
32#include <__utility/declval.h>32#include <__utility/declval.h>
33#include <variant>33#include <variant>
3434
...@@ -111,7 +111,7 @@ public:...@@ -111,7 +111,7 @@ public:
111 return *this;111 return *this;
112 }112 }
113113
114 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() {114 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() {
115 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(115 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
116 std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");116 std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
117 return *std::__unchecked_get<_Iter>(__hold_);117 return *std::__unchecked_get<_Iter>(__hold_);
...@@ -237,7 +237,7 @@ public:...@@ -237,7 +237,7 @@ public:
237 return std::__unchecked_get<_Sent>(__x.__hold_) - std::__unchecked_get<_I2>(__y.__hold_);237 return std::__unchecked_get<_Sent>(__x.__hold_) - std::__unchecked_get<_I2>(__y.__hold_);
238 }238 }
239239
240 _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)240 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
241 iter_move(const common_iterator& __i) noexcept(noexcept(ranges::iter_move(std::declval<const _Iter&>())))241 iter_move(const common_iterator& __i) noexcept(noexcept(ranges::iter_move(std::declval<const _Iter&>())))
242 requires input_iterator<_Iter>242 requires input_iterator<_Iter>
243 {243 {
lib/libcxx/include/__iterator/concepts.h+8-9
...@@ -20,6 +20,8 @@...@@ -20,6 +20,8 @@
20#include <__concepts/invocable.h>20#include <__concepts/invocable.h>
21#include <__concepts/movable.h>21#include <__concepts/movable.h>
22#include <__concepts/predicate.h>22#include <__concepts/predicate.h>
23#include <__concepts/primary_template.h>
24#include <__concepts/referenceable.h>
23#include <__concepts/regular.h>25#include <__concepts/regular.h>
24#include <__concepts/relation.h>26#include <__concepts/relation.h>
25#include <__concepts/same_as.h>27#include <__concepts/same_as.h>
...@@ -38,10 +40,7 @@...@@ -38,10 +40,7 @@
38#include <__type_traits/integral_constant.h>40#include <__type_traits/integral_constant.h>
39#include <__type_traits/invoke.h>41#include <__type_traits/invoke.h>
40#include <__type_traits/is_pointer.h>42#include <__type_traits/is_pointer.h>
41#include <__type_traits/is_primary_template.h>
42#include <__type_traits/is_reference.h>43#include <__type_traits/is_reference.h>
43#include <__type_traits/is_referenceable.h>
44#include <__type_traits/is_valid_expansion.h>
45#include <__type_traits/remove_cv.h>44#include <__type_traits/remove_cv.h>
46#include <__type_traits/remove_cvref.h>45#include <__type_traits/remove_cvref.h>
47#include <__utility/forward.h>46#include <__utility/forward.h>
...@@ -80,7 +79,7 @@ template <class _Tp>...@@ -80,7 +79,7 @@ template <class _Tp>
80concept __specialization_of_projected = requires {79concept __specialization_of_projected = requires {
81 typename __projected_iterator_t<_Tp>;80 typename __projected_iterator_t<_Tp>;
82 typename __projected_projection_t<_Tp>;81 typename __projected_projection_t<_Tp>;
83} && __is_primary_template<_Tp>::value;82} && __primary_template<_Tp>;
8483
85template <class _Tp>84template <class _Tp>
86struct __indirect_value_t_impl {85struct __indirect_value_t_impl {
...@@ -153,8 +152,7 @@ concept sized_sentinel_for =...@@ -153,8 +152,7 @@ concept sized_sentinel_for =
153152
154template <class _Iter>153template <class _Iter>
155struct __iter_traits_cache {154struct __iter_traits_cache {
156 using type _LIBCPP_NODEBUG =155 using type _LIBCPP_NODEBUG = _If<__primary_template<iterator_traits<_Iter> >, _Iter, iterator_traits<_Iter> >;
157 _If<__is_primary_template<iterator_traits<_Iter> >::value, _Iter, iterator_traits<_Iter> >;
158};156};
159template <class _Iter>157template <class _Iter>
160using _ITER_TRAITS _LIBCPP_NODEBUG = typename __iter_traits_cache<_Iter>::type;158using _ITER_TRAITS _LIBCPP_NODEBUG = typename __iter_traits_cache<_Iter>::type;
...@@ -169,12 +167,13 @@ struct __iter_concept_category_test {...@@ -169,12 +167,13 @@ struct __iter_concept_category_test {
169};167};
170struct __iter_concept_random_fallback {168struct __iter_concept_random_fallback {
171 template <class _Iter>169 template <class _Iter>
172 using _Apply _LIBCPP_NODEBUG =170 using _Apply _LIBCPP_NODEBUG = __enable_if_t<__primary_template<iterator_traits<_Iter> >, random_access_iterator_tag>;
173 __enable_if_t<__is_primary_template<iterator_traits<_Iter> >::value, random_access_iterator_tag>;
174};171};
175172
176template <class _Iter, class _Tester>173template <class _Iter, class _Tester>
177struct __test_iter_concept : _IsValidExpansion<_Tester::template _Apply, _Iter>, _Tester {};174 struct __test_iter_concept : bool_constant < requires {
175 typename _Tester::template _Apply<_Iter>;
176} >, _Tester{};
178177
179template <class _Iter>178template <class _Iter>
180struct __iter_concept_cache {179struct __iter_concept_cache {
lib/libcxx/include/__iterator/counted_iterator.h+13-13
...@@ -98,18 +98,18 @@ public:...@@ -98,18 +98,18 @@ public:
98 return *this;98 return *this;
99 }99 }
100100
101 _LIBCPP_HIDE_FROM_ABI constexpr const _Iter& base() const& noexcept { return __current_; }101 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Iter& base() const& noexcept { return __current_; }
102102
103 _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }
104104
105 _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> count() const noexcept { return __count_; }105 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> count() const noexcept { return __count_; }
106106
107 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() {107 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() {
108 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count_ > 0, "Iterator is equal to or past end.");108 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count_ > 0, "Iterator is equal to or past end.");
109 return *__current_;109 return *__current_;
110 }110 }
111111
112 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const112 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
113 requires __dereferenceable<const _Iter>113 requires __dereferenceable<const _Iter>
114 {114 {
115 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count_ > 0, "Iterator is equal to or past end.");115 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__count_ > 0, "Iterator is equal to or past end.");
...@@ -169,13 +169,13 @@ public:...@@ -169,13 +169,13 @@ public:
169 return __tmp;169 return __tmp;
170 }170 }
171171
172 _LIBCPP_HIDE_FROM_ABI constexpr counted_iterator operator+(iter_difference_t<_Iter> __n) const172 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr counted_iterator operator+(iter_difference_t<_Iter> __n) const
173 requires random_access_iterator<_Iter>173 requires random_access_iterator<_Iter>
174 {174 {
175 return counted_iterator(__current_ + __n, __count_ - __n);175 return counted_iterator(__current_ + __n, __count_ - __n);
176 }176 }
177177
178 _LIBCPP_HIDE_FROM_ABI friend constexpr counted_iterator178 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr counted_iterator
179 operator+(iter_difference_t<_Iter> __n, const counted_iterator& __x)179 operator+(iter_difference_t<_Iter> __n, const counted_iterator& __x)
180 requires random_access_iterator<_Iter>180 requires random_access_iterator<_Iter>
181 {181 {
...@@ -191,24 +191,24 @@ public:...@@ -191,24 +191,24 @@ public:
191 return *this;191 return *this;
192 }192 }
193193
194 _LIBCPP_HIDE_FROM_ABI constexpr counted_iterator operator-(iter_difference_t<_Iter> __n) const194 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr counted_iterator operator-(iter_difference_t<_Iter> __n) const
195 requires random_access_iterator<_Iter>195 requires random_access_iterator<_Iter>
196 {196 {
197 return counted_iterator(__current_ - __n, __count_ + __n);197 return counted_iterator(__current_ - __n, __count_ + __n);
198 }198 }
199199
200 template <common_with<_Iter> _I2>200 template <common_with<_Iter> _I2>
201 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_I2>201 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_I2>
202 operator-(const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs) {202 operator-(const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs) {
203 return __rhs.__count_ - __lhs.__count_;203 return __rhs.__count_ - __lhs.__count_;
204 }204 }
205205
206 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Iter>206 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Iter>
207 operator-(const counted_iterator& __lhs, default_sentinel_t) {207 operator-(const counted_iterator& __lhs, default_sentinel_t) {
208 return -__lhs.__count_;208 return -__lhs.__count_;
209 }209 }
210210
211 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Iter>211 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_Iter>
212 operator-(default_sentinel_t, const counted_iterator& __rhs) {212 operator-(default_sentinel_t, const counted_iterator& __rhs) {
213 return __rhs.__count_;213 return __rhs.__count_;
214 }214 }
...@@ -226,7 +226,7 @@ public:...@@ -226,7 +226,7 @@ public:
226 return *this;226 return *this;
227 }227 }
228228
229 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](iter_difference_t<_Iter> __n) const229 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](iter_difference_t<_Iter> __n) const
230 requires random_access_iterator<_Iter>230 requires random_access_iterator<_Iter>
231 {231 {
232 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < __count_, "Subscript argument must be less than size.");232 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < __count_, "Subscript argument must be less than size.");
...@@ -249,7 +249,7 @@ public:...@@ -249,7 +249,7 @@ public:
249 return __rhs.__count_ <=> __lhs.__count_;249 return __rhs.__count_ <=> __lhs.__count_;
250 }250 }
251251
252 _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)252 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
253 iter_move(const counted_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__current_)))253 iter_move(const counted_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__current_)))
254 requires input_iterator<_Iter>254 requires input_iterator<_Iter>
255 {255 {
lib/libcxx/include/__iterator/data.h+10-8
...@@ -17,32 +17,34 @@...@@ -17,32 +17,34 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 1720#if _LIBCPP_STD_VER >= 17
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Cont>24template <class _Cont>
25constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {25[[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) noexcept(noexcept(__c.data()))
26 -> decltype(__c.data()) {
26 return __c.data();27 return __c.data();
27}28}
2829
29template <class _Cont>30template <class _Cont>
30constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {31[[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) noexcept(noexcept(__c.data()))
32 -> decltype(__c.data()) {
31 return __c.data();33 return __c.data();
32}34}
3335
34template <class _Tp, size_t _Sz>36template <class _Tp, size_t _Sz>
35_LIBCPP_HIDE_FROM_ABI constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept {37[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept {
36 return __array;38 return __array;
37}39}
3840
39template <class _Ep>41template <class _Ep>
40_LIBCPP_HIDE_FROM_ABI constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept {42[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept {
41 return __il.begin();43 return __il.begin();
42}44}
4345
44#endif
45
46_LIBCPP_END_NAMESPACE_STD46_LIBCPP_END_NAMESPACE_STD
4747
48#endif // _LIBCPP_STD_VER >= 17
49
48#endif // _LIBCPP___ITERATOR_DATA_H50#endif // _LIBCPP___ITERATOR_DATA_H
lib/libcxx/include/__iterator/default_sentinel.h+4-4
...@@ -16,15 +16,15 @@...@@ -16,15 +16,15 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2019#if _LIBCPP_STD_VER >= 20
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23struct default_sentinel_t {};23struct default_sentinel_t {};
24inline constexpr default_sentinel_t default_sentinel{};24inline constexpr default_sentinel_t default_sentinel{};
2525
26#endif // _LIBCPP_STD_VER >= 20
27
28_LIBCPP_END_NAMESPACE_STD26_LIBCPP_END_NAMESPACE_STD
2927
28#endif // _LIBCPP_STD_VER >= 20
29
30#endif // _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H30#endif // _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
lib/libcxx/include/__iterator/distance.h+5-4
...@@ -67,7 +67,8 @@ __distance(_InputIter __first, _Sent __last) {...@@ -67,7 +67,8 @@ __distance(_InputIter __first, _Sent __last) {
67}67}
6868
69template <class _InputIter>69template <class _InputIter>
70inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 typename iterator_traits<_InputIter>::difference_type70[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
71typename iterator_traits<_InputIter>::difference_type
71distance(_InputIter __first, _InputIter __last) {72distance(_InputIter __first, _InputIter __last) {
72 return std::__distance(__first, __last);73 return std::__distance(__first, __last);
73}74}
...@@ -80,12 +81,12 @@ namespace ranges {...@@ -80,12 +81,12 @@ namespace ranges {
80struct __distance {81struct __distance {
81 template <class _Ip, sentinel_for<_Ip> _Sp>82 template <class _Ip, sentinel_for<_Ip> _Sp>
82 requires(!sized_sentinel_for<_Sp, _Ip>)83 requires(!sized_sentinel_for<_Sp, _Ip>)
83 _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const {84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const {
84 return std::__distance(std::move(__first), std::move(__last));85 return std::__distance(std::move(__first), std::move(__last));
85 }86 }
8687
87 template <class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>88 template <class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
88 _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {89 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {
89 if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) {90 if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) {
90 return __last - __first;91 return __last - __first;
91 } else {92 } else {
...@@ -94,7 +95,7 @@ struct __distance {...@@ -94,7 +95,7 @@ struct __distance {
94 }95 }
9596
96 template <range _Rp>97 template <range _Rp>
97 _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Rp> operator()(_Rp&& __r) const {98 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_Rp> operator()(_Rp&& __r) const {
98 if constexpr (sized_range<_Rp>) {99 if constexpr (sized_range<_Rp>) {
99 return static_cast<range_difference_t<_Rp>>(ranges::size(__r));100 return static_cast<range_difference_t<_Rp>>(ranges::size(__r));
100 } else {101 } else {
lib/libcxx/include/__iterator/empty.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 1720#if _LIBCPP_STD_VER >= 17
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Cont>24template <class _Cont>
25[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto25[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto
26empty(const _Cont& __c) noexcept(noexcept(__c.empty())) -> decltype(__c.empty()) {26empty(const _Cont& __c) noexcept(noexcept(__c.empty())) -> decltype(__c.empty()) {
...@@ -37,8 +37,8 @@ template <class _Ep>...@@ -37,8 +37,8 @@ template <class _Ep>
37 return __il.size() == 0;37 return __il.size() == 0;
38}38}
3939
40#endif // _LIBCPP_STD_VER >= 17
41
42_LIBCPP_END_NAMESPACE_STD40_LIBCPP_END_NAMESPACE_STD
4341
42#endif // _LIBCPP_STD_VER >= 17
43
44#endif // _LIBCPP___ITERATOR_EMPTY_H44#endif // _LIBCPP___ITERATOR_EMPTY_H
lib/libcxx/include/__iterator/erase_if_container.h+2-1
...@@ -22,7 +22,8 @@ _LIBCPP_PUSH_MACROS...@@ -22,7 +22,8 @@ _LIBCPP_PUSH_MACROS
22_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
2323
24template <class _Container, class _Predicate>24template <class _Container, class _Predicate>
25_LIBCPP_HIDE_FROM_ABI typename _Container::size_type __libcpp_erase_if_container(_Container& __c, _Predicate& __pred) {25_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename _Container::size_type
26__libcpp_erase_if_container(_Container& __c, _Predicate& __pred) {
26 typename _Container::size_type __old_size = __c.size();27 typename _Container::size_type __old_size = __c.size();
2728
28 const typename _Container::iterator __last = __c.end();29 const typename _Container::iterator __last = __c.end();
lib/libcxx/include/__iterator/front_insert_iterator.h+4-2
...@@ -58,14 +58,16 @@ public:...@@ -58,14 +58,16 @@ public:
58 return *this;58 return *this;
59 }59 }
60#endif // _LIBCPP_CXX03_LANG60#endif // _LIBCPP_CXX03_LANG
61 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator& operator*() { return *this; }61 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator& operator*() {
62 return *this;
63 }
62 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator& operator++() { return *this; }64 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator& operator++() { return *this; }
63 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator operator++(int) { return *this; }65 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator operator++(int) { return *this; }
64};66};
65_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(front_insert_iterator);67_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(front_insert_iterator);
6668
67template <class _Container>69template <class _Container>
68inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator<_Container>70[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 front_insert_iterator<_Container>
69front_inserter(_Container& __x) {71front_inserter(_Container& __x) {
70 return front_insert_iterator<_Container>(__x);72 return front_insert_iterator<_Container>(__x);
71}73}
lib/libcxx/include/__iterator/incrementable_traits.h+6-6
...@@ -11,11 +11,11 @@...@@ -11,11 +11,11 @@
11#define _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H11#define _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
1212
13#include <__concepts/arithmetic.h>13#include <__concepts/arithmetic.h>
14#include <__concepts/primary_template.h>
14#include <__config>15#include <__config>
15#include <__cstddef/ptrdiff_t.h>16#include <__cstddef/ptrdiff_t.h>
16#include <__type_traits/conditional.h>17#include <__type_traits/conditional.h>
17#include <__type_traits/is_object.h>18#include <__type_traits/is_object.h>
18#include <__type_traits/is_primary_template.h>
19#include <__type_traits/make_signed.h>19#include <__type_traits/make_signed.h>
20#include <__type_traits/remove_cvref.h>20#include <__type_traits/remove_cvref.h>
21#include <__utility/declval.h>21#include <__utility/declval.h>
...@@ -24,10 +24,10 @@...@@ -24,10 +24,10 @@
24# pragma GCC system_header24# pragma GCC system_header
25#endif25#endif
2626
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 2027#if _LIBCPP_STD_VER >= 20
3028
29_LIBCPP_BEGIN_NAMESPACE_STD
30
31// [incrementable.traits]31// [incrementable.traits]
32template <class>32template <class>
33struct incrementable_traits {};33struct incrementable_traits {};
...@@ -68,12 +68,12 @@ struct iterator_traits;...@@ -68,12 +68,12 @@ struct iterator_traits;
68// generated from the primary template, and `iterator_traits<RI>::difference_type` otherwise.68// generated from the primary template, and `iterator_traits<RI>::difference_type` otherwise.
69template <class _Ip>69template <class _Ip>
70using iter_difference_t =70using iter_difference_t =
71 typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,71 typename conditional_t<__primary_template<iterator_traits<remove_cvref_t<_Ip> > >,
72 incrementable_traits<remove_cvref_t<_Ip> >,72 incrementable_traits<remove_cvref_t<_Ip> >,
73 iterator_traits<remove_cvref_t<_Ip> > >::difference_type;73 iterator_traits<remove_cvref_t<_Ip> > >::difference_type;
7474
75#endif // _LIBCPP_STD_VER >= 20
76
77_LIBCPP_END_NAMESPACE_STD75_LIBCPP_END_NAMESPACE_STD
7876
77#endif // _LIBCPP_STD_VER >= 20
78
79#endif // _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H79#endif // _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
lib/libcxx/include/__iterator/insert_iterator.h+2-2
...@@ -71,13 +71,13 @@ public:...@@ -71,13 +71,13 @@ public:
71 return *this;71 return *this;
72 }72 }
73#endif // _LIBCPP_CXX03_LANG73#endif // _LIBCPP_CXX03_LANG
74 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator*() { return *this; }74 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator*() { return *this; }
75 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator++() { return *this; }75 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator++() { return *this; }
76 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator++(int) { return *this; }76 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator& operator++(int) { return *this; }
77};77};
7878
79template <class _Container>79template <class _Container>
80inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator<_Container>80[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert_iterator<_Container>
81inserter(_Container& __x, __insert_iterator_iter_t<_Container> __i) {81inserter(_Container& __x, __insert_iterator_iter_t<_Container> __i) {
82 return insert_iterator<_Container>(__x, __i);82 return insert_iterator<_Container>(__x, __i);
83}83}
lib/libcxx/include/__iterator/istream_iterator.h+1-1
...@@ -60,7 +60,7 @@ public:...@@ -60,7 +60,7 @@ public:
60 // LWG3600 Changed the wording of the copy constructor. In libc++ this constructor60 // LWG3600 Changed the wording of the copy constructor. In libc++ this constructor
61 // can still be trivial after this change.61 // can still be trivial after this change.
6262
63 _LIBCPP_HIDE_FROM_ABI const _Tp& operator*() const { return __value_; }63 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Tp& operator*() const { return __value_; }
64 _LIBCPP_HIDE_FROM_ABI const _Tp* operator->() const { return std::addressof((operator*())); }64 _LIBCPP_HIDE_FROM_ABI const _Tp* operator->() const { return std::addressof((operator*())); }
65 _LIBCPP_HIDE_FROM_ABI istream_iterator& operator++() {65 _LIBCPP_HIDE_FROM_ABI istream_iterator& operator++() {
66 if (!(*__in_stream_ >> __value_))66 if (!(*__in_stream_ >> __value_))
lib/libcxx/include/__iterator/istreambuf_iterator.h+4-2
...@@ -73,14 +73,16 @@ public:...@@ -73,14 +73,16 @@ public:
73 _LIBCPP_HIDE_FROM_ABI istreambuf_iterator(streambuf_type* __s) _NOEXCEPT : __sbuf_(__s) {}73 _LIBCPP_HIDE_FROM_ABI istreambuf_iterator(streambuf_type* __s) _NOEXCEPT : __sbuf_(__s) {}
74 _LIBCPP_HIDE_FROM_ABI istreambuf_iterator(const __proxy& __p) _NOEXCEPT : __sbuf_(__p.__sbuf_) {}74 _LIBCPP_HIDE_FROM_ABI istreambuf_iterator(const __proxy& __p) _NOEXCEPT : __sbuf_(__p.__sbuf_) {}
7575
76 _LIBCPP_HIDE_FROM_ABI char_type operator*() const { return static_cast<char_type>(__sbuf_->sgetc()); }76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type operator*() const {
77 return static_cast<char_type>(__sbuf_->sgetc());
78 }
77 _LIBCPP_HIDE_FROM_ABI istreambuf_iterator& operator++() {79 _LIBCPP_HIDE_FROM_ABI istreambuf_iterator& operator++() {
78 __sbuf_->sbumpc();80 __sbuf_->sbumpc();
79 return *this;81 return *this;
80 }82 }
81 _LIBCPP_HIDE_FROM_ABI __proxy operator++(int) { return __proxy(__sbuf_->sbumpc(), __sbuf_); }83 _LIBCPP_HIDE_FROM_ABI __proxy operator++(int) { return __proxy(__sbuf_->sbumpc(), __sbuf_); }
8284
83 _LIBCPP_HIDE_FROM_ABI bool equal(const istreambuf_iterator& __b) const {85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool equal(const istreambuf_iterator& __b) const {
84 return __test_for_eof() == __b.__test_for_eof();86 return __test_for_eof() == __b.__test_for_eof();
85 }87 }
8688
lib/libcxx/include/__iterator/iter_move.h+5-5
...@@ -11,10 +11,10 @@...@@ -11,10 +11,10 @@
11#define _LIBCPP___ITERATOR_ITER_MOVE_H11#define _LIBCPP___ITERATOR_ITER_MOVE_H
1212
13#include <__concepts/class_or_enum.h>13#include <__concepts/class_or_enum.h>
14#include <__concepts/referenceable.h>
14#include <__config>15#include <__config>
15#include <__iterator/iterator_traits.h>16#include <__iterator/iterator_traits.h>
16#include <__type_traits/is_reference.h>17#include <__type_traits/is_reference.h>
17#include <__type_traits/is_referenceable.h>
18#include <__type_traits/remove_cvref.h>18#include <__type_traits/remove_cvref.h>
19#include <__utility/declval.h>19#include <__utility/declval.h>
20#include <__utility/forward.h>20#include <__utility/forward.h>
...@@ -27,10 +27,10 @@...@@ -27,10 +27,10 @@
27_LIBCPP_PUSH_MACROS27_LIBCPP_PUSH_MACROS
28#include <__undef_macros>28#include <__undef_macros>
2929
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32#if _LIBCPP_STD_VER >= 2030#if _LIBCPP_STD_VER >= 20
3331
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34// [iterator.cust.move]34// [iterator.cust.move]
3535
36namespace ranges {36namespace ranges {
...@@ -95,10 +95,10 @@ template <__dereferenceable _Tp>...@@ -95,10 +95,10 @@ template <__dereferenceable _Tp>
95 }95 }
96using iter_rvalue_reference_t = decltype(ranges::iter_move(std::declval<_Tp&>()));96using iter_rvalue_reference_t = decltype(ranges::iter_move(std::declval<_Tp&>()));
9797
98#endif // _LIBCPP_STD_VER >= 20
99
100_LIBCPP_END_NAMESPACE_STD98_LIBCPP_END_NAMESPACE_STD
10199
100#endif // _LIBCPP_STD_VER >= 20
101
102_LIBCPP_POP_MACROS102_LIBCPP_POP_MACROS
103103
104#endif // _LIBCPP___ITERATOR_ITER_MOVE_H104#endif // _LIBCPP___ITERATOR_ITER_MOVE_H
lib/libcxx/include/__iterator/iter_swap.h+4-4
...@@ -29,10 +29,10 @@...@@ -29,10 +29,10 @@
29_LIBCPP_PUSH_MACROS29_LIBCPP_PUSH_MACROS
30#include <__undef_macros>30#include <__undef_macros>
3131
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34#if _LIBCPP_STD_VER >= 2032#if _LIBCPP_STD_VER >= 20
3533
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36// [iter.cust.swap]36// [iter.cust.swap]
3737
38namespace ranges {38namespace ranges {
...@@ -99,10 +99,10 @@ concept indirectly_swappable =...@@ -99,10 +99,10 @@ concept indirectly_swappable =
99 ranges::iter_swap(__i2, __i1);99 ranges::iter_swap(__i2, __i1);
100 };100 };
101101
102#endif // _LIBCPP_STD_VER >= 20
103
104_LIBCPP_END_NAMESPACE_STD102_LIBCPP_END_NAMESPACE_STD
105103
104#endif // _LIBCPP_STD_VER >= 20
105
106_LIBCPP_POP_MACROS106_LIBCPP_POP_MACROS
107107
108#endif // _LIBCPP___ITERATOR_ITER_SWAP_H108#endif // _LIBCPP___ITERATOR_ITER_SWAP_H
lib/libcxx/include/__iterator/iterator_traits.h+3-3
...@@ -15,6 +15,8 @@...@@ -15,6 +15,8 @@
15#include <__concepts/convertible_to.h>15#include <__concepts/convertible_to.h>
16#include <__concepts/copyable.h>16#include <__concepts/copyable.h>
17#include <__concepts/equality_comparable.h>17#include <__concepts/equality_comparable.h>
18#include <__concepts/primary_template.h>
19#include <__concepts/referenceable.h>
18#include <__concepts/same_as.h>20#include <__concepts/same_as.h>
19#include <__concepts/totally_ordered.h>21#include <__concepts/totally_ordered.h>
20#include <__config>22#include <__config>
...@@ -30,9 +32,7 @@...@@ -30,9 +32,7 @@
30#include <__type_traits/integral_constant.h>32#include <__type_traits/integral_constant.h>
31#include <__type_traits/is_convertible.h>33#include <__type_traits/is_convertible.h>
32#include <__type_traits/is_object.h>34#include <__type_traits/is_object.h>
33#include <__type_traits/is_primary_template.h>
34#include <__type_traits/is_reference.h>35#include <__type_traits/is_reference.h>
35#include <__type_traits/is_referenceable.h>
36#include <__type_traits/nat.h>36#include <__type_traits/nat.h>
37#include <__type_traits/remove_const.h>37#include <__type_traits/remove_const.h>
38#include <__type_traits/remove_cv.h>38#include <__type_traits/remove_cv.h>
...@@ -468,7 +468,7 @@ using __iterator_reference _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::re...@@ -468,7 +468,7 @@ using __iterator_reference _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::re
468// This has to be in this file and not readable_traits.h to break the include cycle between the two.468// This has to be in this file and not readable_traits.h to break the include cycle between the two.
469template <class _Ip>469template <class _Ip>
470using iter_value_t =470using iter_value_t =
471 typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value,471 typename conditional_t<__primary_template<iterator_traits<remove_cvref_t<_Ip> > >,
472 indirectly_readable_traits<remove_cvref_t<_Ip> >,472 indirectly_readable_traits<remove_cvref_t<_Ip> >,
473 iterator_traits<remove_cvref_t<_Ip> > >::value_type;473 iterator_traits<remove_cvref_t<_Ip> > >::value_type;
474474
lib/libcxx/include/__iterator/move_iterator.h+25-20
...@@ -13,6 +13,7 @@...@@ -13,6 +13,7 @@
13#include <__compare/compare_three_way_result.h>13#include <__compare/compare_three_way_result.h>
14#include <__compare/three_way_comparable.h>14#include <__compare/three_way_comparable.h>
15#include <__concepts/assignable.h>15#include <__concepts/assignable.h>
16#include <__concepts/constructible.h>
16#include <__concepts/convertible_to.h>17#include <__concepts/convertible_to.h>
17#include <__concepts/derived_from.h>18#include <__concepts/derived_from.h>
18#include <__concepts/same_as.h>19#include <__concepts/same_as.h>
...@@ -27,7 +28,6 @@...@@ -27,7 +28,6 @@
27#include <__type_traits/conditional.h>28#include <__type_traits/conditional.h>
28#include <__type_traits/enable_if.h>29#include <__type_traits/enable_if.h>
29#include <__type_traits/is_assignable.h>30#include <__type_traits/is_assignable.h>
30#include <__type_traits/is_constructible.h>
31#include <__type_traits/is_convertible.h>31#include <__type_traits/is_convertible.h>
32#include <__type_traits/is_reference.h>32#include <__type_traits/is_reference.h>
33#include <__type_traits/is_same.h>33#include <__type_traits/is_same.h>
...@@ -122,7 +122,7 @@ public:...@@ -122,7 +122,7 @@ public:
122122
123#if _LIBCPP_STD_VER >= 20123#if _LIBCPP_STD_VER >= 20
124 _LIBCPP_HIDE_FROM_ABI constexpr move_iterator()124 _LIBCPP_HIDE_FROM_ABI constexpr move_iterator()
125 requires is_constructible_v<_Iter>125 requires default_initializable<_Iter>
126 : __current_() {}126 : __current_() {}
127127
128 template <class _Up>128 template <class _Up>
...@@ -136,11 +136,11 @@ public:...@@ -136,11 +136,11 @@ public:
136 return *this;136 return *this;
137 }137 }
138138
139 _LIBCPP_HIDE_FROM_ABI constexpr const _Iter& base() const& noexcept { return __current_; }139 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Iter& base() const& noexcept { return __current_; }
140 _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }140 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }
141141
142 _LIBCPP_HIDE_FROM_ABI constexpr reference operator*() const { return ranges::iter_move(__current_); }142 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator*() const { return ranges::iter_move(__current_); }
143 _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const {143 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const {
144 return ranges::iter_move(__current_ + __n);144 return ranges::iter_move(__current_ + __n);
145 }145 }
146146
...@@ -169,12 +169,13 @@ public:...@@ -169,12 +169,13 @@ public:
169 return *this;169 return *this;
170 }170 }
171171
172 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Iter base() const { return __current_; }172 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Iter base() const { return __current_; }
173173
174 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator*() const {174 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator*() const {
175 return static_cast<reference>(*__current_);175 return static_cast<reference>(*__current_);
176 }176 }
177 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {177 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference
178 operator[](difference_type __n) const {
178 return static_cast<reference>(__current_[__n]);179 return static_cast<reference>(__current_[__n]);
179 }180 }
180181
...@@ -194,14 +195,16 @@ public:...@@ -194,14 +195,16 @@ public:
194 --__current_;195 --__current_;
195 return __tmp;196 return __tmp;
196 }197 }
197 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator operator+(difference_type __n) const {198 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator
199 operator+(difference_type __n) const {
198 return move_iterator(__current_ + __n);200 return move_iterator(__current_ + __n);
199 }201 }
200 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator& operator+=(difference_type __n) {202 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator& operator+=(difference_type __n) {
201 __current_ += __n;203 __current_ += __n;
202 return *this;204 return *this;
203 }205 }
204 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator operator-(difference_type __n) const {206 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator
207 operator-(difference_type __n) const {
205 return move_iterator(__current_ - __n);208 return move_iterator(__current_ - __n);
206 }209 }
207 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator& operator-=(difference_type __n) {210 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator& operator-=(difference_type __n) {
...@@ -218,18 +221,18 @@ public:...@@ -218,18 +221,18 @@ public:
218 }221 }
219222
220 template <sized_sentinel_for<_Iter> _Sent>223 template <sized_sentinel_for<_Iter> _Sent>
221 friend _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>224 [[nodiscard]] friend _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
222 operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y) {225 operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y) {
223 return __x.base() - __y.base();226 return __x.base() - __y.base();
224 }227 }
225228
226 template <sized_sentinel_for<_Iter> _Sent>229 template <sized_sentinel_for<_Iter> _Sent>
227 friend _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>230 [[nodiscard]] friend _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Iter>
228 operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y) {231 operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y) {
229 return __x.base() - __y.base();232 return __x.base() - __y.base();
230 }233 }
231234
232 friend _LIBCPP_HIDE_FROM_ABI constexpr iter_rvalue_reference_t<_Iter>235 [[nodiscard]] friend _LIBCPP_HIDE_FROM_ABI constexpr iter_rvalue_reference_t<_Iter>
233 iter_move(const move_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__current_))) {236 iter_move(const move_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__current_))) {
234 return ranges::iter_move(__i.__current_);237 return ranges::iter_move(__i.__current_);
235 }238 }
...@@ -299,13 +302,14 @@ operator<=>(const move_iterator<_Iter1>& __x,...@@ -299,13 +302,14 @@ operator<=>(const move_iterator<_Iter1>& __x,
299302
300#ifndef _LIBCPP_CXX03_LANG303#ifndef _LIBCPP_CXX03_LANG
301template <class _Iter1, class _Iter2>304template <class _Iter1, class _Iter2>
302inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto305[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
303operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) -> decltype(__x.base() - __y.base()) {306_LIBCPP_CONSTEXPR_SINCE_CXX17 auto operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
307 -> decltype(__x.base() - __y.base()) {
304 return __x.base() - __y.base();308 return __x.base() - __y.base();
305}309}
306#else310#else
307template <class _Iter1, class _Iter2>311template <class _Iter1, class _Iter2>
308inline _LIBCPP_HIDE_FROM_ABI typename move_iterator<_Iter1>::difference_type312[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI typename move_iterator<_Iter1>::difference_type
309operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {313operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {
310 return __x.base() - __y.base();314 return __x.base() - __y.base();
311}315}
...@@ -313,7 +317,7 @@ operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {...@@ -313,7 +317,7 @@ operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) {
313317
314#if _LIBCPP_STD_VER >= 20318#if _LIBCPP_STD_VER >= 20
315template <class _Iter>319template <class _Iter>
316inline _LIBCPP_HIDE_FROM_ABI constexpr move_iterator<_Iter>320[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr move_iterator<_Iter>
317operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)321operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)
318 requires requires {322 requires requires {
319 { __x.base() + __n } -> same_as<_Iter>;323 { __x.base() + __n } -> same_as<_Iter>;
...@@ -323,7 +327,7 @@ operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)...@@ -323,7 +327,7 @@ operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)
323}327}
324#else328#else
325template <class _Iter>329template <class _Iter>
326inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter>330[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter>
327operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x) {331operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x) {
328 return move_iterator<_Iter>(__x.base() + __n);332 return move_iterator<_Iter>(__x.base() + __n);
329}333}
...@@ -336,7 +340,8 @@ inline constexpr bool disable_sized_sentinel_for<move_iterator<_Iter1>, move_ite...@@ -336,7 +340,8 @@ inline constexpr bool disable_sized_sentinel_for<move_iterator<_Iter1>, move_ite
336#endif // _LIBCPP_STD_VER >= 20340#endif // _LIBCPP_STD_VER >= 20
337341
338template <class _Iter>342template <class _Iter>
339inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter> make_move_iterator(_Iter __i) {343[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
344_LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator<_Iter> make_move_iterator(_Iter __i) {
340 return move_iterator<_Iter>(std::move(__i));345 return move_iterator<_Iter>(std::move(__i));
341}346}
342347
lib/libcxx/include/__iterator/move_sentinel.h+5-5
...@@ -22,10 +22,10 @@...@@ -22,10 +22,10 @@
22_LIBCPP_PUSH_MACROS22_LIBCPP_PUSH_MACROS
23#include <__undef_macros>23#include <__undef_macros>
2424
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27#if _LIBCPP_STD_VER >= 2025#if _LIBCPP_STD_VER >= 20
2826
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29template <semiregular _Sent>29template <semiregular _Sent>
30class move_sentinel {30class move_sentinel {
31public:31public:
...@@ -44,7 +44,7 @@ public:...@@ -44,7 +44,7 @@ public:
44 return *this;44 return *this;
45 }45 }
4646
47 _LIBCPP_HIDE_FROM_ABI constexpr _Sent base() const { return __last_; }47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Sent base() const { return __last_; }
4848
49private:49private:
50 _Sent __last_ = _Sent();50 _Sent __last_ = _Sent();
...@@ -52,10 +52,10 @@ private:...@@ -52,10 +52,10 @@ private:
5252
53_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(move_sentinel);53_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(move_sentinel);
5454
55#endif // _LIBCPP_STD_VER >= 20
56
57_LIBCPP_END_NAMESPACE_STD55_LIBCPP_END_NAMESPACE_STD
5856
57#endif // _LIBCPP_STD_VER >= 20
58
59_LIBCPP_POP_MACROS59_LIBCPP_POP_MACROS
6060
61#endif // _LIBCPP___ITERATOR_MOVE_SENTINEL_H61#endif // _LIBCPP___ITERATOR_MOVE_SENTINEL_H
lib/libcxx/include/__iterator/ostream_iterator.h+1-1
...@@ -59,7 +59,7 @@ public:...@@ -59,7 +59,7 @@ public:
59 return *this;59 return *this;
60 }60 }
6161
62 _LIBCPP_HIDE_FROM_ABI ostream_iterator& operator*() { return *this; }62 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI ostream_iterator& operator*() { return *this; }
63 _LIBCPP_HIDE_FROM_ABI ostream_iterator& operator++() { return *this; }63 _LIBCPP_HIDE_FROM_ABI ostream_iterator& operator++() { return *this; }
64 _LIBCPP_HIDE_FROM_ABI ostream_iterator& operator++(int) { return *this; }64 _LIBCPP_HIDE_FROM_ABI ostream_iterator& operator++(int) { return *this; }
65};65};
lib/libcxx/include/__iterator/ostreambuf_iterator.h+25-2
...@@ -10,6 +10,8 @@...@@ -10,6 +10,8 @@
10#ifndef _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H10#ifndef _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
11#define _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H11#define _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
1212
13#include <__algorithm/in_out_result.h>
14#include <__algorithm/specialized_algorithms.h>
13#include <__config>15#include <__config>
14#include <__cstddef/ptrdiff_t.h>16#include <__cstddef/ptrdiff_t.h>
15#include <__fwd/ios.h>17#include <__fwd/ios.h>
...@@ -17,6 +19,7 @@...@@ -17,6 +19,7 @@
17#include <__fwd/streambuf.h>19#include <__fwd/streambuf.h>
18#include <__iterator/iterator.h>20#include <__iterator/iterator.h>
19#include <__iterator/iterator_traits.h>21#include <__iterator/iterator_traits.h>
22#include <__type_traits/is_same.h>
20#include <iosfwd> // for forward declaration of ostreambuf_iterator23#include <iosfwd> // for forward declaration of ostreambuf_iterator
2124
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)25#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -54,16 +57,36 @@ public:...@@ -54,16 +57,36 @@ public:
54 __sbuf_ = nullptr;57 __sbuf_ = nullptr;
55 return *this;58 return *this;
56 }59 }
57 _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator*() { return *this; }60 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator*() { return *this; }
58 _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator++() { return *this; }61 _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator++() { return *this; }
59 _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator++(int) { return *this; }62 _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator++(int) { return *this; }
60 _LIBCPP_HIDE_FROM_ABI bool failed() const _NOEXCEPT { return __sbuf_ == nullptr; }63 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool failed() const _NOEXCEPT { return __sbuf_ == nullptr; }
6164
62#if _LIBCPP_HAS_LOCALIZATION65#if _LIBCPP_HAS_LOCALIZATION
63 template <class _Ch, class _Tr>66 template <class _Ch, class _Tr>
64 friend _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_Ch, _Tr> __pad_and_output(67 friend _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_Ch, _Tr> __pad_and_output(
65 ostreambuf_iterator<_Ch, _Tr> __s, const _Ch* __ob, const _Ch* __op, const _Ch* __oe, ios_base& __iob, _Ch __fl);68 ostreambuf_iterator<_Ch, _Tr> __s, const _Ch* __ob, const _Ch* __op, const _Ch* __oe, ios_base& __iob, _Ch __fl);
66#endif // _LIBCPP_HAS_LOCALIZATION69#endif // _LIBCPP_HAS_LOCALIZATION
70
71 template <class, class...>
72 friend struct __specialized_algorithm;
73};
74
75template <class _InCharT, class _CharT, class _Traits>
76struct __specialized_algorithm<_Algorithm::__copy,
77 __iterator_pair<_InCharT*, _InCharT*>,
78 __single_iterator<ostreambuf_iterator<_CharT, _Traits> > > {
79 static const bool __has_algorithm = is_same<const _CharT, const _InCharT>::value;
80
81 _LIBCPP_HIDE_FROM_ABI static __in_out_result<_InCharT*, ostreambuf_iterator<_CharT, _Traits> >
82 operator()(_InCharT* __first, _InCharT* __last, ostreambuf_iterator<_CharT, _Traits> __result) {
83 auto __size = __last - __first;
84 if (__result.__sbuf_ && __size > 0) {
85 if (__result.__sbuf_->sputn(__first, __last - __first) != __size)
86 __result.__sbuf_ = nullptr;
87 }
88 return {__last, __result};
89 }
67};90};
6891
69_LIBCPP_END_NAMESPACE_STD92_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__iterator/ranges_iterator_traits.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2322#if _LIBCPP_STD_VER >= 23
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <ranges::input_range _Range>26template <ranges::input_range _Range>
27using __range_key_type _LIBCPP_NODEBUG = __remove_const_t<typename ranges::range_value_t<_Range>::first_type>;27using __range_key_type _LIBCPP_NODEBUG = __remove_const_t<typename ranges::range_value_t<_Range>::first_type>;
2828
...@@ -33,8 +33,8 @@ template <ranges::input_range _Range>...@@ -33,8 +33,8 @@ template <ranges::input_range _Range>
33using __range_to_alloc_type _LIBCPP_NODEBUG =33using __range_to_alloc_type _LIBCPP_NODEBUG =
34 pair<const typename ranges::range_value_t<_Range>::first_type, typename ranges::range_value_t<_Range>::second_type>;34 pair<const typename ranges::range_value_t<_Range>::first_type, typename ranges::range_value_t<_Range>::second_type>;
3535
36#endif
37
38_LIBCPP_END_NAMESPACE_STD36_LIBCPP_END_NAMESPACE_STD
3937
38#endif
39
40#endif // _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H40#endif // _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
lib/libcxx/include/__iterator/readable_traits.h+5-5
...@@ -10,12 +10,12 @@...@@ -10,12 +10,12 @@
10#ifndef _LIBCPP___ITERATOR_READABLE_TRAITS_H10#ifndef _LIBCPP___ITERATOR_READABLE_TRAITS_H
11#define _LIBCPP___ITERATOR_READABLE_TRAITS_H11#define _LIBCPP___ITERATOR_READABLE_TRAITS_H
1212
13#include <__concepts/primary_template.h>
13#include <__concepts/same_as.h>14#include <__concepts/same_as.h>
14#include <__config>15#include <__config>
15#include <__type_traits/conditional.h>16#include <__type_traits/conditional.h>
16#include <__type_traits/is_array.h>17#include <__type_traits/is_array.h>
17#include <__type_traits/is_object.h>18#include <__type_traits/is_object.h>
18#include <__type_traits/is_primary_template.h>
19#include <__type_traits/remove_cv.h>19#include <__type_traits/remove_cv.h>
20#include <__type_traits/remove_cvref.h>20#include <__type_traits/remove_cvref.h>
21#include <__type_traits/remove_extent.h>21#include <__type_traits/remove_extent.h>
...@@ -24,10 +24,10 @@...@@ -24,10 +24,10 @@
24# pragma GCC system_header24# pragma GCC system_header
25#endif25#endif
2626
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 2027#if _LIBCPP_STD_VER >= 20
3028
29_LIBCPP_BEGIN_NAMESPACE_STD
30
31// [readable.traits]31// [readable.traits]
32template <class>32template <class>
33struct __cond_value_type {};33struct __cond_value_type {};
...@@ -74,8 +74,8 @@ template <__has_member_value_type _Tp>...@@ -74,8 +74,8 @@ template <__has_member_value_type _Tp>
74 same_as<remove_cv_t<typename _Tp::element_type>, remove_cv_t<typename _Tp::value_type>>74 same_as<remove_cv_t<typename _Tp::element_type>, remove_cv_t<typename _Tp::value_type>>
75struct indirectly_readable_traits<_Tp> : __cond_value_type<typename _Tp::value_type> {};75struct indirectly_readable_traits<_Tp> : __cond_value_type<typename _Tp::value_type> {};
7676
77#endif // _LIBCPP_STD_VER >= 20
78
79_LIBCPP_END_NAMESPACE_STD77_LIBCPP_END_NAMESPACE_STD
8078
79#endif // _LIBCPP_STD_VER >= 20
80
81#endif // _LIBCPP___ITERATOR_READABLE_TRAITS_H81#endif // _LIBCPP___ITERATOR_READABLE_TRAITS_H
lib/libcxx/include/__iterator/reverse_access.h+21-14
...@@ -18,62 +18,69 @@...@@ -18,62 +18,69 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 1421#if _LIBCPP_STD_VER >= 14
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25template <class _Tp, size_t _Np>25template <class _Tp, size_t _Np>
26_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) {26[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
27_LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) {
27 return reverse_iterator<_Tp*>(__array + _Np);28 return reverse_iterator<_Tp*>(__array + _Np);
28}29}
2930
30template <class _Tp, size_t _Np>31template <class _Tp, size_t _Np>
31_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) {32[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) {
32 return reverse_iterator<_Tp*>(__array);33 return reverse_iterator<_Tp*>(__array);
33}34}
3435
35template <class _Ep>36template <class _Ep>
36_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) {37[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*>
38rbegin(initializer_list<_Ep> __il) {
37 return reverse_iterator<const _Ep*>(__il.end());39 return reverse_iterator<const _Ep*>(__il.end());
38}40}
3941
40template <class _Ep>42template <class _Ep>
41_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) {43[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*>
44rend(initializer_list<_Ep> __il) {
42 return reverse_iterator<const _Ep*>(__il.begin());45 return reverse_iterator<const _Ep*>(__il.begin());
43}46}
4447
45template <class _Cp>48template <class _Cp>
46_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) {49[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) {
47 return __c.rbegin();50 return __c.rbegin();
48}51}
4952
50template <class _Cp>53template <class _Cp>
51_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) {54[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(const _Cp& __c)
55 -> decltype(__c.rbegin()) {
52 return __c.rbegin();56 return __c.rbegin();
53}57}
5458
55template <class _Cp>59template <class _Cp>
56_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(_Cp& __c) -> decltype(__c.rend()) {60[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(_Cp& __c) -> decltype(__c.rend()) {
57 return __c.rend();61 return __c.rend();
58}62}
5963
60template <class _Cp>64template <class _Cp>
61_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(const _Cp& __c) -> decltype(__c.rend()) {65[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(const _Cp& __c)
66 -> decltype(__c.rend()) {
62 return __c.rend();67 return __c.rend();
63}68}
6469
65template <class _Cp>70template <class _Cp>
66_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crbegin(const _Cp& __c) -> decltype(std::rbegin(__c)) {71[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crbegin(const _Cp& __c)
72 -> decltype(std::rbegin(__c)) {
67 return std::rbegin(__c);73 return std::rbegin(__c);
68}74}
6975
70template <class _Cp>76template <class _Cp>
71_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crend(const _Cp& __c) -> decltype(std::rend(__c)) {77[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crend(const _Cp& __c)
78 -> decltype(std::rend(__c)) {
72 return std::rend(__c);79 return std::rend(__c);
73}80}
7481
75#endif // _LIBCPP_STD_VER >= 14
76
77_LIBCPP_END_NAMESPACE_STD82_LIBCPP_END_NAMESPACE_STD
7883
84#endif // _LIBCPP_STD_VER >= 14
85
79#endif // _LIBCPP___ITERATOR_REVERSE_ACCESS_H86#endif // _LIBCPP___ITERATOR_REVERSE_ACCESS_H
lib/libcxx/include/__iterator/reverse_iterator.h+16-30
...@@ -15,21 +15,13 @@...@@ -15,21 +15,13 @@
15#include <__compare/three_way_comparable.h>15#include <__compare/three_way_comparable.h>
16#include <__concepts/convertible_to.h>16#include <__concepts/convertible_to.h>
17#include <__config>17#include <__config>
18#include <__iterator/advance.h>
19#include <__iterator/concepts.h>18#include <__iterator/concepts.h>
20#include <__iterator/incrementable_traits.h>19#include <__iterator/incrementable_traits.h>
21#include <__iterator/iter_move.h>20#include <__iterator/iter_move.h>
22#include <__iterator/iter_swap.h>21#include <__iterator/iter_swap.h>
23#include <__iterator/iterator.h>22#include <__iterator/iterator.h>
24#include <__iterator/iterator_traits.h>23#include <__iterator/iterator_traits.h>
25#include <__iterator/next.h>
26#include <__iterator/prev.h>
27#include <__iterator/readable_traits.h>
28#include <__iterator/segmented_iterator.h>
29#include <__memory/addressof.h>24#include <__memory/addressof.h>
30#include <__ranges/access.h>
31#include <__ranges/concepts.h>
32#include <__ranges/subrange.h>
33#include <__type_traits/conditional.h>25#include <__type_traits/conditional.h>
34#include <__type_traits/enable_if.h>26#include <__type_traits/enable_if.h>
35#include <__type_traits/is_assignable.h>27#include <__type_traits/is_assignable.h>
...@@ -38,7 +30,6 @@...@@ -38,7 +30,6 @@
38#include <__type_traits/is_pointer.h>30#include <__type_traits/is_pointer.h>
39#include <__type_traits/is_same.h>31#include <__type_traits/is_same.h>
40#include <__utility/declval.h>32#include <__utility/declval.h>
41#include <__utility/move.h>
4233
43#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)34#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
44# pragma GCC system_header35# pragma GCC system_header
...@@ -121,8 +112,8 @@ public:...@@ -121,8 +112,8 @@ public:
121 return *this;112 return *this;
122 }113 }
123#endif114#endif
124 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Iter base() const { return current; }115 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Iter base() const { return current; }
125 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator*() const {116 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator*() const {
126 _Iter __tmp = current;117 _Iter __tmp = current;
127 return *--__tmp;118 return *--__tmp;
128 }119 }
...@@ -161,25 +152,29 @@ public:...@@ -161,25 +152,29 @@ public:
161 ++current;152 ++current;
162 return __tmp;153 return __tmp;
163 }154 }
164 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator operator+(difference_type __n) const {155 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator
156 operator+(difference_type __n) const {
165 return reverse_iterator(current - __n);157 return reverse_iterator(current - __n);
166 }158 }
167 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator+=(difference_type __n) {159 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator+=(difference_type __n) {
168 current -= __n;160 current -= __n;
169 return *this;161 return *this;
170 }162 }
171 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator operator-(difference_type __n) const {163 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator
164 operator-(difference_type __n) const {
172 return reverse_iterator(current + __n);165 return reverse_iterator(current + __n);
173 }166 }
174 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator-=(difference_type __n) {167 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator-=(difference_type __n) {
175 current += __n;168 current += __n;
176 return *this;169 return *this;
177 }170 }
178 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {171 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference
172 operator[](difference_type __n) const {
179 return *(*this + __n);173 return *(*this + __n);
180 }174 }
181175
182#if _LIBCPP_STD_VER >= 20176#if _LIBCPP_STD_VER >= 20
177 [[nodiscard]]
183 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i) noexcept(178 _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i) noexcept(
184 is_nothrow_copy_constructible_v<_Iter> && noexcept(ranges::iter_move(--std::declval<_Iter&>()))) {179 is_nothrow_copy_constructible_v<_Iter> && noexcept(ranges::iter_move(--std::declval<_Iter&>()))) {
185 auto __tmp = __i.base();180 auto __tmp = __i.base();
...@@ -280,21 +275,21 @@ operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&...@@ -280,21 +275,21 @@ operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
280275
281#ifndef _LIBCPP_CXX03_LANG276#ifndef _LIBCPP_CXX03_LANG
282template <class _Iter1, class _Iter2>277template <class _Iter1, class _Iter2>
283inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto278[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
284operator-(const reverse_iterator<_Iter1>& __x,279_LIBCPP_CONSTEXPR_SINCE_CXX17 auto operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
285 const reverse_iterator<_Iter2>& __y) -> decltype(__y.base() - __x.base()) {280 -> decltype(__y.base() - __x.base()) {
286 return __y.base() - __x.base();281 return __y.base() - __x.base();
287}282}
288#else283#else
289template <class _Iter1, class _Iter2>284template <class _Iter1, class _Iter2>
290inline _LIBCPP_HIDE_FROM_ABI typename reverse_iterator<_Iter1>::difference_type285[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI typename reverse_iterator<_Iter1>::difference_type
291operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) {286operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) {
292 return __y.base() - __x.base();287 return __y.base() - __x.base();
293}288}
294#endif289#endif
295290
296template <class _Iter>291template <class _Iter>
297inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Iter>292[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Iter>
298operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x) {293operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x) {
299 return reverse_iterator<_Iter>(__x.base() - __n);294 return reverse_iterator<_Iter>(__x.base() - __n);
300}295}
...@@ -307,21 +302,12 @@ inline constexpr bool disable_sized_sentinel_for<reverse_iterator<_Iter1>, rever...@@ -307,21 +302,12 @@ inline constexpr bool disable_sized_sentinel_for<reverse_iterator<_Iter1>, rever
307302
308#if _LIBCPP_STD_VER >= 14303#if _LIBCPP_STD_VER >= 14
309template <class _Iter>304template <class _Iter>
310inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Iter> make_reverse_iterator(_Iter __i) {305[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
306_LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Iter> make_reverse_iterator(_Iter __i) {
311 return reverse_iterator<_Iter>(__i);307 return reverse_iterator<_Iter>(__i);
312}308}
313#endif309#endif
314310
315#if _LIBCPP_STD_VER >= 20
316template <ranges::bidirectional_range _Range>
317_LIBCPP_HIDE_FROM_ABI constexpr ranges::subrange<reverse_iterator<ranges::iterator_t<_Range>>,
318 reverse_iterator<ranges::iterator_t<_Range>>>
319__reverse_range(_Range&& __range) {
320 auto __first = ranges::begin(__range);
321 return {std::make_reverse_iterator(ranges::next(__first, ranges::end(__range))), std::make_reverse_iterator(__first)};
322}
323#endif
324
325template <class _Iter, bool __b>311template <class _Iter, bool __b>
326struct __unwrap_iter_impl<reverse_iterator<reverse_iterator<_Iter> >, __b> {312struct __unwrap_iter_impl<reverse_iterator<reverse_iterator<_Iter> >, __b> {
327 using _UnwrappedIter _LIBCPP_NODEBUG = decltype(__unwrap_iter_impl<_Iter>::__unwrap(std::declval<_Iter>()));313 using _UnwrappedIter _LIBCPP_NODEBUG = decltype(__unwrap_iter_impl<_Iter>::__unwrap(std::declval<_Iter>()));
lib/libcxx/include/__iterator/segmented_iterator.h-2
...@@ -42,8 +42,6 @@...@@ -42,8 +42,6 @@
4242
43#include <__config>43#include <__config>
44#include <__cstddef/size_t.h>44#include <__cstddef/size_t.h>
45#include <__iterator/iterator_traits.h>
46#include <__type_traits/integral_constant.h>
4745
48#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)46#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
49# pragma GCC system_header47# pragma GCC system_header
lib/libcxx/include/__iterator/size.h+10-9
...@@ -20,25 +20,26 @@...@@ -20,25 +20,26 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 1723#if _LIBCPP_STD_VER >= 17
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27template <class _Cont>27template <class _Cont>
28[[nodiscard]]
28_LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) noexcept(noexcept(__c.size())) -> decltype(__c.size()) {29_LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) noexcept(noexcept(__c.size())) -> decltype(__c.size()) {
29 return __c.size();30 return __c.size();
30}31}
3132
32template <class _Tp, size_t _Sz>33template <class _Tp, size_t _Sz>
33_LIBCPP_HIDE_FROM_ABI constexpr size_t size(const _Tp (&)[_Sz]) noexcept {34[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t size(const _Tp (&)[_Sz]) noexcept {
34 return _Sz;35 return _Sz;
35}36}
3637
37# if _LIBCPP_STD_VER >= 2038# if _LIBCPP_STD_VER >= 20
38template <class _Cont>39template <class _Cont>
39_LIBCPP_HIDE_FROM_ABI constexpr auto40[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto ssize(const _Cont& __c) noexcept(
40ssize(const _Cont& __c) noexcept(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(41 noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size())))
41 __c.size()))) -> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> {42 -> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> {
42 return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size());43 return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size());
43}44}
4445
...@@ -47,14 +48,14 @@ ssize(const _Cont& __c) noexcept(noexcept(static_cast<common_type_t<ptrdiff_t, m...@@ -47,14 +48,14 @@ ssize(const _Cont& __c) noexcept(noexcept(static_cast<common_type_t<ptrdiff_t, m
47_LIBCPP_DIAGNOSTIC_PUSH48_LIBCPP_DIAGNOSTIC_PUSH
48_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wsign-conversion")49_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wsign-conversion")
49template <class _Tp, ptrdiff_t _Sz>50template <class _Tp, ptrdiff_t _Sz>
50_LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept {51[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept {
51 return _Sz;52 return _Sz;
52}53}
53_LIBCPP_DIAGNOSTIC_POP54_LIBCPP_DIAGNOSTIC_POP
54# endif55# endif
5556
56#endif // _LIBCPP_STD_VER >= 17
57
58_LIBCPP_END_NAMESPACE_STD57_LIBCPP_END_NAMESPACE_STD
5958
59#endif // _LIBCPP_STD_VER >= 17
60
60#endif // _LIBCPP___ITERATOR_SIZE_H61#endif // _LIBCPP___ITERATOR_SIZE_H
lib/libcxx/include/__iterator/static_bounded_iter.h+7-6
...@@ -128,7 +128,7 @@ private:...@@ -128,7 +128,7 @@ private:
128128
129public:129public:
130 // Dereference and indexing operations.130 // Dereference and indexing operations.
131 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {131 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {
132 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(132 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
133 __current() != __end(), "__static_bounded_iter::operator*: Attempt to dereference an iterator at the end");133 __current() != __end(), "__static_bounded_iter::operator*: Attempt to dereference an iterator at the end");
134 return *__current();134 return *__current();
...@@ -140,7 +140,8 @@ public:...@@ -140,7 +140,8 @@ public:
140 return std::__to_address(__current());140 return std::__to_address(__current());
141 }141 }
142142
143 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {143 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference
144 operator[](difference_type __n) const _NOEXCEPT {
144 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(145 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
145 __n >= __begin() - __current(),146 __n >= __begin() - __current(),
146 "__static_bounded_iter::operator[]: Attempt to index an iterator past the start");147 "__static_bounded_iter::operator[]: Attempt to index an iterator past the start");
...@@ -186,13 +187,13 @@ public:...@@ -186,13 +187,13 @@ public:
186 __current() += __n;187 __current() += __n;
187 return *this;188 return *this;
188 }189 }
189 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __static_bounded_iter190 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __static_bounded_iter
190 operator+(__static_bounded_iter const& __self, difference_type __n) _NOEXCEPT {191 operator+(__static_bounded_iter const& __self, difference_type __n) _NOEXCEPT {
191 __static_bounded_iter __tmp(__self);192 __static_bounded_iter __tmp(__self);
192 __tmp += __n;193 __tmp += __n;
193 return __tmp;194 return __tmp;
194 }195 }
195 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __static_bounded_iter196 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __static_bounded_iter
196 operator+(difference_type __n, __static_bounded_iter const& __self) _NOEXCEPT {197 operator+(difference_type __n, __static_bounded_iter const& __self) _NOEXCEPT {
197 __static_bounded_iter __tmp(__self);198 __static_bounded_iter __tmp(__self);
198 __tmp += __n;199 __tmp += __n;
...@@ -208,13 +209,13 @@ public:...@@ -208,13 +209,13 @@ public:
208 __current() -= __n;209 __current() -= __n;
209 return *this;210 return *this;
210 }211 }
211 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __static_bounded_iter212 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend __static_bounded_iter
212 operator-(__static_bounded_iter const& __self, difference_type __n) _NOEXCEPT {213 operator-(__static_bounded_iter const& __self, difference_type __n) _NOEXCEPT {
213 __static_bounded_iter __tmp(__self);214 __static_bounded_iter __tmp(__self);
214 __tmp -= __n;215 __tmp -= __n;
215 return __tmp;216 return __tmp;
216 }217 }
217 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend difference_type218 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 friend difference_type
218 operator-(__static_bounded_iter const& __x, __static_bounded_iter const& __y) _NOEXCEPT {219 operator-(__static_bounded_iter const& __x, __static_bounded_iter const& __y) _NOEXCEPT {
219 return __x.__current() - __y.__current();220 return __x.__current() - __y.__current();
220 }221 }
lib/libcxx/include/__iterator/wrap_iter.h+116-127
...@@ -15,7 +15,6 @@...@@ -15,7 +15,6 @@
15#include <__config>15#include <__config>
16#include <__cstddef/size_t.h>16#include <__cstddef/size_t.h>
17#include <__iterator/iterator_traits.h>17#include <__iterator/iterator_traits.h>
18#include <__memory/addressof.h>
19#include <__memory/pointer_traits.h>18#include <__memory/pointer_traits.h>
20#include <__type_traits/conjunction.h>19#include <__type_traits/conjunction.h>
21#include <__type_traits/disjunction.h>20#include <__type_traits/disjunction.h>
...@@ -34,18 +33,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -34,18 +33,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
34template <class _Iter>33template <class _Iter>
35class __wrap_iter {34class __wrap_iter {
36public:35public:
37 typedef _Iter iterator_type;36 typedef typename iterator_traits<_Iter>::value_type value_type;
38 typedef typename iterator_traits<iterator_type>::value_type value_type;37 typedef typename iterator_traits<_Iter>::difference_type difference_type;
39 typedef typename iterator_traits<iterator_type>::difference_type difference_type;38 typedef typename iterator_traits<_Iter>::pointer pointer;
40 typedef typename iterator_traits<iterator_type>::pointer pointer;39 typedef typename iterator_traits<_Iter>::reference reference;
41 typedef typename iterator_traits<iterator_type>::reference reference;40 typedef typename iterator_traits<_Iter>::iterator_category iterator_category;
42 typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
43#if _LIBCPP_STD_VER >= 2041#if _LIBCPP_STD_VER >= 20
44 typedef contiguous_iterator_tag iterator_concept;42 typedef contiguous_iterator_tag iterator_concept;
45#endif43#endif
4644
47private:45private:
48 iterator_type __i_;46 _Iter __i_;
4947
50public:48public:
51 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter() _NOEXCEPT : __i_() {}49 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter() _NOEXCEPT : __i_() {}
...@@ -57,7 +55,9 @@ public:...@@ -57,7 +55,9 @@ public:
57 int> = 0>55 int> = 0>
58 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter(const __wrap_iter<_OtherIter>& __u) _NOEXCEPT56 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter(const __wrap_iter<_OtherIter>& __u) _NOEXCEPT
59 : __i_(__u.__i_) {}57 : __i_(__u.__i_) {}
60 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT { return *__i_; }58 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {
59 return *__i_;
60 }
61 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pointer operator->() const _NOEXCEPT {61 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pointer operator->() const _NOEXCEPT {
62 return std::__to_address(__i_);62 return std::__to_address(__i_);
63 }63 }
...@@ -80,7 +80,8 @@ public:...@@ -80,7 +80,8 @@ public:
80 --(*this);80 --(*this);
81 return __tmp;81 return __tmp;
82 }82 }
83 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter operator+(difference_type __n) const _NOEXCEPT {83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter
84 operator+(difference_type __n) const _NOEXCEPT {
84 __wrap_iter __w(*this);85 __wrap_iter __w(*this);
85 __w += __n;86 __w += __n;
86 return __w;87 return __w;
...@@ -89,21 +90,21 @@ public:...@@ -89,21 +90,21 @@ public:
89 __i_ += __n;90 __i_ += __n;
90 return *this;91 return *this;
91 }92 }
92 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter operator-(difference_type __n) const _NOEXCEPT {93 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter
94 operator-(difference_type __n) const _NOEXCEPT {
93 return *this + (-__n);95 return *this + (-__n);
94 }96 }
95 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter& operator-=(difference_type __n) _NOEXCEPT {97 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter& operator-=(difference_type __n) _NOEXCEPT {
96 *this += -__n;98 *this += -__n;
97 return *this;99 return *this;
98 }100 }
99 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {101 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference
102 operator[](difference_type __n) const _NOEXCEPT {
100 return __i_[__n];103 return __i_[__n];
101 }104 }
102105
103 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 iterator_type base() const _NOEXCEPT { return __i_; }
104
105private:106private:
106 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __wrap_iter(iterator_type __x) _NOEXCEPT : __i_(__x) {}107 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __wrap_iter(_Iter __x) _NOEXCEPT : __i_(__x) {}
107108
108 template <class _Up>109 template <class _Up>
109 friend class __wrap_iter;110 friend class __wrap_iter;
...@@ -117,137 +118,125 @@ private:...@@ -117,137 +118,125 @@ private:
117 friend class span;118 friend class span;
118 template <class _Tp, size_t _Size>119 template <class _Tp, size_t _Size>
119 friend struct array;120 friend struct array;
120 template <class _Tp, class>
121 friend struct __optional_iterator;
122};
123
124template <class _Iter1>
125_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
126operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {
127 return __x.base() == __y.base();
128}
129
130template <class _Iter1, class _Iter2>
131_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
132operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
133 return __x.base() == __y.base();
134}
135
136template <class _Iter1>
137_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
138operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {
139 return __x.base() < __y.base();
140}
141
142template <class _Iter1, class _Iter2>
143_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
144operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
145 return __x.base() < __y.base();
146}
147121
148#if _LIBCPP_STD_VER <= 17122#if _LIBCPP_STD_VER <= 17
149template <class _Iter1>123 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
150_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool124 operator==(const __wrap_iter& __x, const __wrap_iter& __y) _NOEXCEPT {
151operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {125 return __x.__i_ == __y.__i_;
152 return !(__x == __y);126 }
153}127
154128 template <class _Iter2>
155template <class _Iter1, class _Iter2>129 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
156_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool130 operator==(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
157operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {131 return __x.__i_ == __y.__i_;
158 return !(__x == __y);132 }
159}133
160template <class _Iter1>134 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
161_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool135 operator<(const __wrap_iter& __x, const __wrap_iter& __y) _NOEXCEPT {
162operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {136 return __x.__i_ < __y.__i_;
163 return __y < __x;137 }
164}138
165139 template <class _Iter2>
166template <class _Iter1, class _Iter2>140 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
167_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool141 operator<(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
168operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {142 return __x.__i_ < __y.__i_;
169 return __y < __x;143 }
170}144
171145 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
172template <class _Iter1>146 operator!=(const __wrap_iter& __x, const __wrap_iter& __y) _NOEXCEPT {
173_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool147 return !(__x == __y);
174operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {148 }
175 return !(__x < __y);149
176}150 template <class _Iter2>
177151 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
178template <class _Iter1, class _Iter2>152 operator!=(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
179_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool153 return !(__x == __y);
180operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {154 }
181 return !(__x < __y);155
182}156 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
183157 operator>(const __wrap_iter& __x, const __wrap_iter& __y) _NOEXCEPT {
184template <class _Iter1>158 return __y < __x;
185_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool159 }
186operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {160
187 return !(__y < __x);161 template <class _Iter2>
188}162 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
189163 operator>(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
190template <class _Iter1, class _Iter2>164 return __y < __x;
191_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool165 }
192operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {166
193 return !(__y < __x);167 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
194}168 operator>=(const __wrap_iter& __x, const __wrap_iter& __y) _NOEXCEPT {
169 return !(__x < __y);
170 }
171
172 template <class _Iter2>
173 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
174 operator>=(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
175 return !(__x < __y);
176 }
177
178 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
179 operator<=(const __wrap_iter& __x, const __wrap_iter& __y) _NOEXCEPT {
180 return !(__y < __x);
181 }
182
183 template <class _Iter2>
184 _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool
185 operator<=(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT {
186 return !(__y < __x);
187 }
195188
196#else189#else
197template <class _Iter1, class _Iter2>190 _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __wrap_iter&, const __wrap_iter&) = default;
198_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering191
199operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept {192 template <class _Iter2>
200 if constexpr (three_way_comparable_with<_Iter1, _Iter2, strong_ordering>) {193 _LIBCPP_HIDE_FROM_ABI friend constexpr bool
201 return __x.base() <=> __y.base();194 operator==(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) noexcept {
202 } else {195 return __x.__i_ == __y.__i_;
203 if (__x.base() < __y.base())196 }
204 return strong_ordering::less;
205197
206 if (__x.base() == __y.base())198 template <class _Iter2>
207 return strong_ordering::equal;199 _LIBCPP_HIDE_FROM_ABI friend constexpr strong_ordering
200 operator<=>(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) noexcept {
201 if constexpr (three_way_comparable_with<_Iter, _Iter2, strong_ordering>) {
202 return __x.__i_ <=> __y.__i_;
203 } else {
204 if (__x.__i_ < __y.__i_)
205 return strong_ordering::less;
208206
209 return strong_ordering::greater;207 if (__x.__i_ == __y.__i_)
208 return strong_ordering::equal;
209
210 return strong_ordering::greater;
211 }
210 }212 }
211}
212#endif // _LIBCPP_STD_VER >= 20213#endif // _LIBCPP_STD_VER >= 20
213214
214template <class _Iter1, class _Iter2>
215_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
216#ifndef _LIBCPP_CXX03_LANG215#ifndef _LIBCPP_CXX03_LANG
217 auto216 template <class _Iter2>
218 operator-(const __wrap_iter<_Iter1>& __x,217 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX14 auto
219 const __wrap_iter<_Iter2>& __y) _NOEXCEPT->decltype(__x.base() - __y.base())218 operator-(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT->decltype(__x.__i_ - __y.__i_)
220#else219#else
221typename __wrap_iter<_Iter1>::difference_type220 template <class _Iter2>
222operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT221 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX14
222 typename __wrap_iter::difference_type operator-(const __wrap_iter& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
223#endif // C++03223#endif // C++03
224{224 {
225 return __x.base() - __y.base();225 return __x.__i_ - __y.__i_;
226}226 }
227227
228template <class _Iter1>228 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter
229_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter<_Iter1>229 operator+(typename __wrap_iter::difference_type __n, __wrap_iter __x) _NOEXCEPT {
230operator+(typename __wrap_iter<_Iter1>::difference_type __n, __wrap_iter<_Iter1> __x) _NOEXCEPT {230 __x += __n;
231 __x += __n;231 return __x;
232 return __x;232 }
233}233};
234234
235#if _LIBCPP_STD_VER <= 17235#if _LIBCPP_STD_VER <= 17
236template <class _It>236template <class _It>
237struct __libcpp_is_contiguous_iterator<__wrap_iter<_It> > : true_type {};237struct __libcpp_is_contiguous_iterator<__wrap_iter<_It> > : true_type {};
238#endif238#endif
239239
240template <class _It>
241struct pointer_traits<__wrap_iter<_It> > {
242 typedef __wrap_iter<_It> pointer;
243 typedef typename pointer_traits<_It>::element_type element_type;
244 typedef typename pointer_traits<_It>::difference_type difference_type;
245
246 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static element_type* to_address(pointer __w) _NOEXCEPT {
247 return std::__to_address(__w.base());
248 }
249};
250
251_LIBCPP_END_NAMESPACE_STD240_LIBCPP_END_NAMESPACE_STD
252241
253#endif // _LIBCPP___ITERATOR_WRAP_ITER_H242#endif // _LIBCPP___ITERATOR_WRAP_ITER_H
lib/libcxx/include/__locale+118-72
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11#define _LIBCPP___LOCALE11#define _LIBCPP___LOCALE
1212
13#include <__config>13#include <__config>
14#include <__configuration/availability.h>
1415
15#if _LIBCPP_HAS_LOCALIZATION16#if _LIBCPP_HAS_LOCALIZATION
1617
...@@ -26,6 +27,7 @@...@@ -26,6 +27,7 @@
26# include <cstdint>27# include <cstdint>
27# include <cstdlib>28# include <cstdlib>
28# include <string>29# include <string>
30# include <text_encoding>
2931
30// Some platforms require more includes than others. Keep the includes on all plaforms for now.32// Some platforms require more includes than others. Keep the includes on all plaforms for now.
31# include <cstddef>33# include <cstddef>
...@@ -42,6 +44,7 @@...@@ -42,6 +44,7 @@
42# endif44# endif
4345
44_LIBCPP_BEGIN_NAMESPACE_STD46_LIBCPP_BEGIN_NAMESPACE_STD
47_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4548
46class _LIBCPP_EXPORTED_FROM_ABI locale;49class _LIBCPP_EXPORTED_FROM_ABI locale;
4750
...@@ -88,7 +91,7 @@ public:...@@ -88,7 +91,7 @@ public:
88 const locale& operator=(const locale&) _NOEXCEPT;91 const locale& operator=(const locale&) _NOEXCEPT;
8992
90 template <class _Facet>93 template <class _Facet>
91 _LIBCPP_HIDE_FROM_ABI locale combine(const locale& __other) const {94 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI locale combine(const locale& __other) const {
92 if (!std::has_facet<_Facet>(__other))95 if (!std::has_facet<_Facet>(__other))
93 __throw_runtime_error("locale::combine: locale missing facet");96 __throw_runtime_error("locale::combine: locale missing facet");
9497
...@@ -96,21 +99,29 @@ public:...@@ -96,21 +99,29 @@ public:
96 }99 }
97100
98 // locale operations:101 // locale operations:
99 string name() const;102 [[__nodiscard__]] string name() const;
100 bool operator==(const locale&) const;103 bool operator==(const locale&) const;
101# if _LIBCPP_STD_VER <= 17104# if _LIBCPP_STD_VER <= 17
102 _LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const { return !(*this == __y); }105 _LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const { return !(*this == __y); }
103# endif106# endif
104 template <class _CharT, class _Traits, class _Allocator>107 template <class _CharT, class _Traits, class _Allocator>
108 [[__nodiscard__]]
105 _LIBCPP_HIDE_FROM_ABI bool operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,109 _LIBCPP_HIDE_FROM_ABI bool operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
106 const basic_string<_CharT, _Traits, _Allocator>& __y) const {110 const basic_string<_CharT, _Traits, _Allocator>& __y) const {
107 return std::use_facet<std::collate<_CharT> >(*this).compare(111 return std::use_facet<std::collate<_CharT> >(*this).compare(
108 __x.data(), __x.data() + __x.size(), __y.data(), __y.data() + __y.size()) < 0;112 __x.data(), __x.data() + __x.size(), __y.data(), __y.data() + __y.size()) < 0;
109 }113 }
114# if _LIBCPP_STD_VER >= 26
115 [[nodiscard]] _LIBCPP_AVAILABILITY_TEXT_ENCODING_ENVIRONMENT
116 _LIBCPP_HIDE_FROM_ABI std::text_encoding encoding() const {
117 std::string __name = name();
118 return std::__get_locale_encoding(__name.c_str());
119 }
120# endif
110121
111 // global locale objects:122 // global locale objects:
112 static locale global(const locale&);123 static locale global(const locale&);
113 static const locale& classic();124 [[__nodiscard__]] static const locale& classic();
114125
115private:126private:
116 class __imp;127 class __imp;
...@@ -118,6 +129,9 @@ private:...@@ -118,6 +129,9 @@ private:
118129
119 template <class>130 template <class>
120 friend struct __no_destroy;131 friend struct __no_destroy;
132
133 friend ios_base;
134
121 _LIBCPP_HIDE_FROM_ABI explicit locale(__private_constructor_tag, __imp* __loc) : __locale_(__loc) {}135 _LIBCPP_HIDE_FROM_ABI explicit locale(__private_constructor_tag, __imp* __loc) : __locale_(__loc) {}
122136
123 void __install_ctor(const locale&, facet*, long);137 void __install_ctor(const locale&, facet*, long);
...@@ -168,12 +182,12 @@ inline _LIBCPP_HIDE_FROM_ABI locale::locale(const locale& __other, _Facet* __f)...@@ -168,12 +182,12 @@ inline _LIBCPP_HIDE_FROM_ABI locale::locale(const locale& __other, _Facet* __f)
168}182}
169183
170template <class _Facet>184template <class _Facet>
171inline _LIBCPP_HIDE_FROM_ABI bool has_facet(const locale& __l) _NOEXCEPT {185[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool has_facet(const locale& __l) _NOEXCEPT {
172 return __l.has_facet(_Facet::id);186 return __l.has_facet(_Facet::id);
173}187}
174188
175template <class _Facet>189template <class _Facet>
176inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {190[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {
177 return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));191 return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
178}192}
179193
...@@ -187,19 +201,21 @@ public:...@@ -187,19 +201,21 @@ public:
187201
188 _LIBCPP_HIDE_FROM_ABI explicit collate(size_t __refs = 0) : locale::facet(__refs) {}202 _LIBCPP_HIDE_FROM_ABI explicit collate(size_t __refs = 0) : locale::facet(__refs) {}
189203
190 _LIBCPP_HIDE_FROM_ABI int204 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int
191 compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const {205 compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const {
192 return do_compare(__lo1, __hi1, __lo2, __hi2);206 return do_compare(__lo1, __hi1, __lo2, __hi2);
193 }207 }
194208
195 // FIXME(EricWF): The _LIBCPP_ALWAYS_INLINE is needed on Windows to work209 // FIXME(EricWF): The _LIBCPP_ALWAYS_INLINE is needed on Windows to work
196 // around a dllimport bug that expects an external instantiation.210 // around a dllimport bug that expects an external instantiation.
197 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE string_type211 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE string_type
198 transform(const char_type* __lo, const char_type* __hi) const {212 transform(const char_type* __lo, const char_type* __hi) const {
199 return do_transform(__lo, __hi);213 return do_transform(__lo, __hi);
200 }214 }
201215
202 _LIBCPP_HIDE_FROM_ABI long hash(const char_type* __lo, const char_type* __hi) const { return do_hash(__lo, __hi); }216 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI long hash(const char_type* __lo, const char_type* __hi) const {
217 return do_hash(__lo, __hi);
218 }
203219
204 static locale::id id;220 static locale::id id;
205221
...@@ -318,6 +334,8 @@ public:...@@ -318,6 +334,8 @@ public:
318# endif // defined(__BIONIC__)334# endif // defined(__BIONIC__)
319# elif defined(__GLIBC__)335# elif defined(__GLIBC__)
320 typedef unsigned short mask;336 typedef unsigned short mask;
337 _LIBCPP_DIAGNOSTIC_PUSH
338 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmodules-ambiguous-internal-linkage")
321 static const mask space = _ISspace;339 static const mask space = _ISspace;
322 static const mask print = _ISprint;340 static const mask print = _ISprint;
323 static const mask cntrl = _IScntrl;341 static const mask cntrl = _IScntrl;
...@@ -328,6 +346,7 @@ public:...@@ -328,6 +346,7 @@ public:
328 static const mask punct = _ISpunct;346 static const mask punct = _ISpunct;
329 static const mask xdigit = _ISxdigit;347 static const mask xdigit = _ISxdigit;
330 static const mask blank = _ISblank;348 static const mask blank = _ISblank;
349 _LIBCPP_DIAGNOSTIC_POP
331# if defined(__mips__) || (BYTE_ORDER == BIG_ENDIAN)350# if defined(__mips__) || (BYTE_ORDER == BIG_ENDIAN)
332 static const mask __regex_word = static_cast<mask>(_ISbit(15));351 static const mask __regex_word = static_cast<mask>(_ISbit(15));
333# else352# else
...@@ -435,6 +454,20 @@ public:...@@ -435,6 +454,20 @@ public:
435 static const mask blank = __ISBLANK;454 static const mask blank = __ISBLANK;
436# endif455# endif
437 static const mask __regex_word = 0x8000;456 static const mask __regex_word = 0x8000;
457// zig patch: haiku support
458# elif defined(__HAIKU__)
459 typedef unsigned short mask;
460 static const mask space = _ISspace;
461 static const mask print = _ISprint;
462 static const mask cntrl = _IScntrl;
463 static const mask upper = _ISupper;
464 static const mask lower = _ISlower;
465 static const mask alpha = _ISalpha;
466 static const mask digit = _ISdigit;
467 static const mask punct = _ISpunct;
468 static const mask xdigit = _ISxdigit;
469 static const mask blank = _ISblank;
470 static const mask __regex_word = 0x80;
438# else471# else
439# error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE?472# error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE?
440# endif473# endif
...@@ -459,39 +492,43 @@ public:...@@ -459,39 +492,43 @@ public:
459492
460 _LIBCPP_HIDE_FROM_ABI explicit ctype(size_t __refs = 0) : locale::facet(__refs) {}493 _LIBCPP_HIDE_FROM_ABI explicit ctype(size_t __refs = 0) : locale::facet(__refs) {}
461494
462 _LIBCPP_HIDE_FROM_ABI bool is(mask __m, char_type __c) const { return do_is(__m, __c); }495 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is(mask __m, char_type __c) const { return do_is(__m, __c); }
463496
464 _LIBCPP_HIDE_FROM_ABI const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const {497 _LIBCPP_HIDE_FROM_ABI const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const {
465 return do_is(__low, __high, __vec);498 return do_is(__low, __high, __vec);
466 }499 }
467500
468 _LIBCPP_HIDE_FROM_ABI const char_type* scan_is(mask __m, const char_type* __low, const char_type* __high) const {501 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char_type*
502 scan_is(mask __m, const char_type* __low, const char_type* __high) const {
469 return do_scan_is(__m, __low, __high);503 return do_scan_is(__m, __low, __high);
470 }504 }
471505
472 _LIBCPP_HIDE_FROM_ABI const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const {506 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char_type*
507 scan_not(mask __m, const char_type* __low, const char_type* __high) const {
473 return do_scan_not(__m, __low, __high);508 return do_scan_not(__m, __low, __high);
474 }509 }
475510
476 _LIBCPP_HIDE_FROM_ABI char_type toupper(char_type __c) const { return do_toupper(__c); }511 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type toupper(char_type __c) const { return do_toupper(__c); }
477512
478 _LIBCPP_HIDE_FROM_ABI const char_type* toupper(char_type* __low, const char_type* __high) const {513 _LIBCPP_HIDE_FROM_ABI const char_type* toupper(char_type* __low, const char_type* __high) const {
479 return do_toupper(__low, __high);514 return do_toupper(__low, __high);
480 }515 }
481516
482 _LIBCPP_HIDE_FROM_ABI char_type tolower(char_type __c) const { return do_tolower(__c); }517 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type tolower(char_type __c) const { return do_tolower(__c); }
483518
484 _LIBCPP_HIDE_FROM_ABI const char_type* tolower(char_type* __low, const char_type* __high) const {519 _LIBCPP_HIDE_FROM_ABI const char_type* tolower(char_type* __low, const char_type* __high) const {
485 return do_tolower(__low, __high);520 return do_tolower(__low, __high);
486 }521 }
487522
488 _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const { return do_widen(__c); }523 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const { return do_widen(__c); }
489524
490 _LIBCPP_HIDE_FROM_ABI const char* widen(const char* __low, const char* __high, char_type* __to) const {525 _LIBCPP_HIDE_FROM_ABI const char* widen(const char* __low, const char* __high, char_type* __to) const {
491 return do_widen(__low, __high, __to);526 return do_widen(__low, __high, __to);
492 }527 }
493528
494 _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const { return do_narrow(__c, __dfault); }529 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const {
530 return do_narrow(__c, __dfault);
531 }
495532
496 _LIBCPP_HIDE_FROM_ABI const char_type*533 _LIBCPP_HIDE_FROM_ABI const char_type*
497 narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const {534 narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const {
...@@ -530,7 +567,7 @@ public:...@@ -530,7 +567,7 @@ public:
530567
531 explicit ctype(const mask* __tab = nullptr, bool __del = false, size_t __refs = 0);568 explicit ctype(const mask* __tab = nullptr, bool __del = false, size_t __refs = 0);
532569
533 _LIBCPP_HIDE_FROM_ABI bool is(mask __m, char_type __c) const {570 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is(mask __m, char_type __c) const {
534 return std::__libcpp_isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) != 0 : false;571 return std::__libcpp_isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) != 0 : false;
535 }572 }
536573
...@@ -540,39 +577,43 @@ public:...@@ -540,39 +577,43 @@ public:
540 return __low;577 return __low;
541 }578 }
542579
543 _LIBCPP_HIDE_FROM_ABI const char_type* scan_is(mask __m, const char_type* __low, const char_type* __high) const {580 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char_type*
581 scan_is(mask __m, const char_type* __low, const char_type* __high) const {
544 for (; __low != __high; ++__low)582 for (; __low != __high; ++__low)
545 if (std::__libcpp_isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m))583 if (std::__libcpp_isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m))
546 break;584 break;
547 return __low;585 return __low;
548 }586 }
549587
550 _LIBCPP_HIDE_FROM_ABI const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const {588 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char_type*
589 scan_not(mask __m, const char_type* __low, const char_type* __high) const {
551 for (; __low != __high; ++__low)590 for (; __low != __high; ++__low)
552 if (!std::__libcpp_isascii(*__low) || !(__tab_[static_cast<int>(*__low)] & __m))591 if (!std::__libcpp_isascii(*__low) || !(__tab_[static_cast<int>(*__low)] & __m))
553 break;592 break;
554 return __low;593 return __low;
555 }594 }
556595
557 _LIBCPP_HIDE_FROM_ABI char_type toupper(char_type __c) const { return do_toupper(__c); }596 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type toupper(char_type __c) const { return do_toupper(__c); }
558597
559 _LIBCPP_HIDE_FROM_ABI const char_type* toupper(char_type* __low, const char_type* __high) const {598 _LIBCPP_HIDE_FROM_ABI const char_type* toupper(char_type* __low, const char_type* __high) const {
560 return do_toupper(__low, __high);599 return do_toupper(__low, __high);
561 }600 }
562601
563 _LIBCPP_HIDE_FROM_ABI char_type tolower(char_type __c) const { return do_tolower(__c); }602 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type tolower(char_type __c) const { return do_tolower(__c); }
564603
565 _LIBCPP_HIDE_FROM_ABI const char_type* tolower(char_type* __low, const char_type* __high) const {604 _LIBCPP_HIDE_FROM_ABI const char_type* tolower(char_type* __low, const char_type* __high) const {
566 return do_tolower(__low, __high);605 return do_tolower(__low, __high);
567 }606 }
568607
569 _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const { return do_widen(__c); }608 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const { return do_widen(__c); }
570609
571 _LIBCPP_HIDE_FROM_ABI const char* widen(const char* __low, const char* __high, char_type* __to) const {610 _LIBCPP_HIDE_FROM_ABI const char* widen(const char* __low, const char* __high, char_type* __to) const {
572 return do_widen(__low, __high, __to);611 return do_widen(__low, __high, __to);
573 }612 }
574613
575 _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const { return do_narrow(__c, __dfault); }614 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const {
615 return do_narrow(__c, __dfault);
616 }
576617
577 _LIBCPP_HIDE_FROM_ABI const char*618 _LIBCPP_HIDE_FROM_ABI const char*
578 narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const {619 narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const {
...@@ -586,8 +627,8 @@ public:...@@ -586,8 +627,8 @@ public:
586# else627# else
587 static const size_t table_size = 256;628 static const size_t table_size = 256;
588# endif629# endif
589 _LIBCPP_HIDE_FROM_ABI const mask* table() const _NOEXCEPT { return __tab_; }630 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const mask* table() const _NOEXCEPT { return __tab_; }
590 static const mask* classic_table() _NOEXCEPT;631 [[__nodiscard__]] static const mask* classic_table() _NOEXCEPT;
591632
592protected:633protected:
593 ~ctype() override;634 ~ctype() override;
...@@ -650,72 +691,72 @@ protected:...@@ -650,72 +691,72 @@ protected:
650# endif // _LIBCPP_HAS_WIDE_CHARACTERS691# endif // _LIBCPP_HAS_WIDE_CHARACTERS
651692
652template <class _CharT>693template <class _CharT>
653inline _LIBCPP_HIDE_FROM_ABI bool isspace(_CharT __c, const locale& __loc) {694[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isspace(_CharT __c, const locale& __loc) {
654 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c);695 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c);
655}696}
656697
657template <class _CharT>698template <class _CharT>
658inline _LIBCPP_HIDE_FROM_ABI bool isprint(_CharT __c, const locale& __loc) {699[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isprint(_CharT __c, const locale& __loc) {
659 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c);700 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c);
660}701}
661702
662template <class _CharT>703template <class _CharT>
663inline _LIBCPP_HIDE_FROM_ABI bool iscntrl(_CharT __c, const locale& __loc) {704[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool iscntrl(_CharT __c, const locale& __loc) {
664 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c);705 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c);
665}706}
666707
667template <class _CharT>708template <class _CharT>
668inline _LIBCPP_HIDE_FROM_ABI bool isupper(_CharT __c, const locale& __loc) {709[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isupper(_CharT __c, const locale& __loc) {
669 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c);710 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c);
670}711}
671712
672template <class _CharT>713template <class _CharT>
673inline _LIBCPP_HIDE_FROM_ABI bool islower(_CharT __c, const locale& __loc) {714[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool islower(_CharT __c, const locale& __loc) {
674 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c);715 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c);
675}716}
676717
677template <class _CharT>718template <class _CharT>
678inline _LIBCPP_HIDE_FROM_ABI bool isalpha(_CharT __c, const locale& __loc) {719[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isalpha(_CharT __c, const locale& __loc) {
679 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c);720 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c);
680}721}
681722
682template <class _CharT>723template <class _CharT>
683inline _LIBCPP_HIDE_FROM_ABI bool isdigit(_CharT __c, const locale& __loc) {724[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isdigit(_CharT __c, const locale& __loc) {
684 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c);725 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c);
685}726}
686727
687template <class _CharT>728template <class _CharT>
688inline _LIBCPP_HIDE_FROM_ABI bool ispunct(_CharT __c, const locale& __loc) {729[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool ispunct(_CharT __c, const locale& __loc) {
689 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c);730 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c);
690}731}
691732
692template <class _CharT>733template <class _CharT>
693inline _LIBCPP_HIDE_FROM_ABI bool isxdigit(_CharT __c, const locale& __loc) {734[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isxdigit(_CharT __c, const locale& __loc) {
694 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c);735 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c);
695}736}
696737
697template <class _CharT>738template <class _CharT>
698inline _LIBCPP_HIDE_FROM_ABI bool isalnum(_CharT __c, const locale& __loc) {739[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isalnum(_CharT __c, const locale& __loc) {
699 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c);740 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c);
700}741}
701742
702template <class _CharT>743template <class _CharT>
703inline _LIBCPP_HIDE_FROM_ABI bool isgraph(_CharT __c, const locale& __loc) {744[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool isgraph(_CharT __c, const locale& __loc) {
704 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c);745 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c);
705}746}
706747
707template <class _CharT>748template <class _CharT>
708_LIBCPP_HIDE_FROM_ABI bool isblank(_CharT __c, const locale& __loc) {749[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool isblank(_CharT __c, const locale& __loc) {
709 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c);750 return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c);
710}751}
711752
712template <class _CharT>753template <class _CharT>
713inline _LIBCPP_HIDE_FROM_ABI _CharT toupper(_CharT __c, const locale& __loc) {754[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _CharT toupper(_CharT __c, const locale& __loc) {
714 return std::use_facet<ctype<_CharT> >(__loc).toupper(__c);755 return std::use_facet<ctype<_CharT> >(__loc).toupper(__c);
715}756}
716757
717template <class _CharT>758template <class _CharT>
718inline _LIBCPP_HIDE_FROM_ABI _CharT tolower(_CharT __c, const locale& __loc) {759[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _CharT tolower(_CharT __c, const locale& __loc) {
719 return std::use_facet<ctype<_CharT> >(__loc).tolower(__c);760 return std::use_facet<ctype<_CharT> >(__loc).tolower(__c);
720}761}
721762
...@@ -770,16 +811,16 @@ public:...@@ -770,16 +811,16 @@ public:
770 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);811 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
771 }812 }
772813
773 _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }814 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }
774815
775 _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }816 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }
776817
777 _LIBCPP_HIDE_FROM_ABI int818 _LIBCPP_HIDE_FROM_ABI int
778 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {819 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
779 return do_length(__st, __frm, __end, __mx);820 return do_length(__st, __frm, __end, __mx);
780 }821 }
781822
782 _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }823 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }
783824
784 static locale::id id;825 static locale::id id;
785826
...@@ -852,16 +893,16 @@ public:...@@ -852,16 +893,16 @@ public:
852 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);893 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
853 }894 }
854895
855 _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }896 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }
856897
857 _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }898 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }
858899
859 _LIBCPP_HIDE_FROM_ABI int900 _LIBCPP_HIDE_FROM_ABI int
860 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {901 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
861 return do_length(__st, __frm, __end, __mx);902 return do_length(__st, __frm, __end, __mx);
862 }903 }
863904
864 _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }905 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }
865906
866 static locale::id id;907 static locale::id id;
867908
...@@ -933,16 +974,16 @@ public:...@@ -933,16 +974,16 @@ public:
933 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);974 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
934 }975 }
935976
936 _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }977 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }
937978
938 _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }979 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }
939980
940 _LIBCPP_HIDE_FROM_ABI int981 _LIBCPP_HIDE_FROM_ABI int
941 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {982 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
942 return do_length(__st, __frm, __end, __mx);983 return do_length(__st, __frm, __end, __mx);
943 }984 }
944985
945 _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }986 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }
946987
947 static locale::id id;988 static locale::id id;
948989
...@@ -976,10 +1017,11 @@ protected:...@@ -976,10 +1017,11 @@ protected:
9761017
977# if _LIBCPP_HAS_CHAR8_T1018# if _LIBCPP_HAS_CHAR8_T
9781019
979// template <> class codecvt<char16_t, char8_t, mbstate_t> // C++201020// template <> class codecvt<char16_t, char8_t, mbstate_t> // C++20, deprecated in C++20
9801021
981template <>1022template <>
982class _LIBCPP_EXPORTED_FROM_ABI codecvt<char16_t, char8_t, mbstate_t> : public locale::facet, public codecvt_base {1023class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXPORTED_FROM_ABI codecvt<char16_t, char8_t, mbstate_t>
1024 : public locale::facet, public codecvt_base {
983public:1025public:
984 typedef char16_t intern_type;1026 typedef char16_t intern_type;
985 typedef char8_t extern_type;1027 typedef char8_t extern_type;
...@@ -1014,16 +1056,16 @@ public:...@@ -1014,16 +1056,16 @@ public:
1014 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);1056 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1015 }1057 }
10161058
1017 _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }1059 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }
10181060
1019 _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }1061 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }
10201062
1021 _LIBCPP_HIDE_FROM_ABI int1063 _LIBCPP_HIDE_FROM_ABI int
1022 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {1064 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
1023 return do_length(__st, __frm, __end, __mx);1065 return do_length(__st, __frm, __end, __mx);
1024 }1066 }
10251067
1026 _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }1068 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }
10271069
1028 static locale::id id;1070 static locale::id id;
10291071
...@@ -1096,16 +1138,16 @@ public:...@@ -1096,16 +1138,16 @@ public:
1096 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);1138 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1097 }1139 }
10981140
1099 _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }1141 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }
11001142
1101 _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }1143 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }
11021144
1103 _LIBCPP_HIDE_FROM_ABI int1145 _LIBCPP_HIDE_FROM_ABI int
1104 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {1146 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
1105 return do_length(__st, __frm, __end, __mx);1147 return do_length(__st, __frm, __end, __mx);
1106 }1148 }
11071149
1108 _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }1150 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }
11091151
1110 static locale::id id;1152 static locale::id id;
11111153
...@@ -1139,10 +1181,11 @@ protected:...@@ -1139,10 +1181,11 @@ protected:
11391181
1140# if _LIBCPP_HAS_CHAR8_T1182# if _LIBCPP_HAS_CHAR8_T
11411183
1142// template <> class codecvt<char32_t, char8_t, mbstate_t> // C++201184// template <> class codecvt<char32_t, char8_t, mbstate_t> // C++20, deprecated in C++20
11431185
1144template <>1186template <>
1145class _LIBCPP_EXPORTED_FROM_ABI codecvt<char32_t, char8_t, mbstate_t> : public locale::facet, public codecvt_base {1187class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXPORTED_FROM_ABI codecvt<char32_t, char8_t, mbstate_t>
1188 : public locale::facet, public codecvt_base {
1146public:1189public:
1147 typedef char32_t intern_type;1190 typedef char32_t intern_type;
1148 typedef char8_t extern_type;1191 typedef char8_t extern_type;
...@@ -1177,16 +1220,16 @@ public:...@@ -1177,16 +1220,16 @@ public:
1177 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);1220 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1178 }1221 }
11791222
1180 _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }1223 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int encoding() const _NOEXCEPT { return do_encoding(); }
11811224
1182 _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }1225 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool always_noconv() const _NOEXCEPT { return do_always_noconv(); }
11831226
1184 _LIBCPP_HIDE_FROM_ABI int1227 _LIBCPP_HIDE_FROM_ABI int
1185 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {1228 length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
1186 return do_length(__st, __frm, __end, __mx);1229 return do_length(__st, __frm, __end, __mx);
1187 }1230 }
11881231
1189 _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }1232 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI int max_length() const _NOEXCEPT { return do_max_length(); }
11901233
1191 static locale::id id;1234 static locale::id id;
11921235
...@@ -1248,8 +1291,10 @@ _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>; // d...@@ -1248,8 +1291,10 @@ _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>; // d
1248extern template class _LIBCPP_DEPRECATED_IN_CXX201291extern template class _LIBCPP_DEPRECATED_IN_CXX20
1249_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>; // deprecated in C++201292_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>; // deprecated in C++20
1250# if _LIBCPP_HAS_CHAR8_T1293# if _LIBCPP_HAS_CHAR8_T
1251extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>; // C++201294extern template class _LIBCPP_DEPRECATED_IN_CXX20
1252extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>; // C++201295_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>; // C++20, deprecated in C++20
1296extern template class _LIBCPP_DEPRECATED_IN_CXX20
1297_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>; // C++20, deprecated in C++20
1253# endif1298# endif
12541299
1255template <size_t _Np>1300template <size_t _Np>
...@@ -1409,11 +1454,11 @@ public:...@@ -1409,11 +1454,11 @@ public:
14091454
1410 explicit numpunct(size_t __refs = 0);1455 explicit numpunct(size_t __refs = 0);
14111456
1412 _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); }1457 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); }
1413 _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }1458 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }
1414 _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }1459 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }
1415 _LIBCPP_HIDE_FROM_ABI string_type truename() const { return do_truename(); }1460 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type truename() const { return do_truename(); }
1416 _LIBCPP_HIDE_FROM_ABI string_type falsename() const { return do_falsename(); }1461 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type falsename() const { return do_falsename(); }
14171462
1418 static locale::id id;1463 static locale::id id;
14191464
...@@ -1439,11 +1484,11 @@ public:...@@ -1439,11 +1484,11 @@ public:
14391484
1440 explicit numpunct(size_t __refs = 0);1485 explicit numpunct(size_t __refs = 0);
14411486
1442 _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); }1487 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); }
1443 _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }1488 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }
1444 _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }1489 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }
1445 _LIBCPP_HIDE_FROM_ABI string_type truename() const { return do_truename(); }1490 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type truename() const { return do_truename(); }
1446 _LIBCPP_HIDE_FROM_ABI string_type falsename() const { return do_falsename(); }1491 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type falsename() const { return do_falsename(); }
14471492
1448 static locale::id id;1493 static locale::id id;
14491494
...@@ -1494,6 +1539,7 @@ protected:...@@ -1494,6 +1539,7 @@ protected:
1494};1539};
1495# endif // _LIBCPP_HAS_WIDE_CHARACTERS1540# endif // _LIBCPP_HAS_WIDE_CHARACTERS
14961541
1542_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1497_LIBCPP_END_NAMESPACE_STD1543_LIBCPP_END_NAMESPACE_STD
14981544
1499#endif // _LIBCPP_HAS_LOCALIZATION1545#endif // _LIBCPP_HAS_LOCALIZATION
lib/libcxx/include/__locale_dir/check_grouping.h+2
...@@ -20,10 +20,12 @@...@@ -20,10 +20,12 @@
20# endif20# endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
23_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2324
24_LIBCPP_EXPORTED_FROM_ABI void25_LIBCPP_EXPORTED_FROM_ABI void
25__check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end, ios_base::iostate& __err);26__check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end, ios_base::iostate& __err);
2627
28_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
27_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
2830
29#endif // _LIBCPP_HAS_LOCALIZATION31#endif // _LIBCPP_HAS_LOCALIZATION
lib/libcxx/include/__locale_dir/get_c_locale.h+2
...@@ -29,7 +29,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -29,7 +29,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
29# else29# else
30# define _LIBCPP_GET_C_LOCALE __cloc()30# define _LIBCPP_GET_C_LOCALE __cloc()
31// Get the C locale object31// Get the C locale object
32_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
32_LIBCPP_EXPORTED_FROM_ABI __locale::__locale_t __cloc();33_LIBCPP_EXPORTED_FROM_ABI __locale::__locale_t __cloc();
34_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
33# define __cloc_defined35# define __cloc_defined
34# endif36# endif
3537
lib/libcxx/include/__locale_dir/locale_base_api.h+22-8
...@@ -102,6 +102,8 @@...@@ -102,6 +102,8 @@
102//102//
103// int __snprintf(char*, size_t, __locale_t, const char*, ...); // required by the headers103// int __snprintf(char*, size_t, __locale_t, const char*, ...); // required by the headers
104// int __asprintf(char**, __locale_t, const char*, ...); // required by the headers104// int __asprintf(char**, __locale_t, const char*, ...); // required by the headers
105//
106// const char* __get_locale_encoding(__locale_t);
105// }107// }
106108
107#if _LIBCPP_HAS_LOCALIZATION109#if _LIBCPP_HAS_LOCALIZATION
...@@ -112,33 +114,40 @@...@@ -112,33 +114,40 @@
112# include <__locale_dir/support/freebsd.h>114# include <__locale_dir/support/freebsd.h>
113# elif defined(__NetBSD__)115# elif defined(__NetBSD__)
114# include <__locale_dir/support/netbsd.h>116# include <__locale_dir/support/netbsd.h>
117# elif defined(__OpenBSD__)
118# include <__locale_dir/support/openbsd.h>
115# elif defined(_LIBCPP_MSVCRT_LIKE)119# elif defined(_LIBCPP_MSVCRT_LIKE)
116# include <__locale_dir/support/windows.h>120# include <__locale_dir/support/windows.h>
117# elif defined(__Fuchsia__)121# elif defined(__Fuchsia__)
118# include <__locale_dir/support/fuchsia.h>122# include <__locale_dir/support/fuchsia.h>
123# elif _LIBCPP_LIBC_LLVM_LIBC
124# include <__locale_dir/support/llvm_libc.h>
119# elif defined(__linux__)125# elif defined(__linux__)
120# include <__locale_dir/support/linux.h>126# include <__locale_dir/support/linux.h>
121# elif _LIBCPP_LIBC_NEWLIB127# elif _LIBCPP_LIBC_NEWLIB
122# include <__locale_dir/support/newlib.h>128# include <__locale_dir/support/newlib.h>
123# elif defined(_AIX)129# elif defined(_AIX)
124# include <__locale_dir/support/aix.h>130# include <__locale_dir/support/aix.h>
131// zig patch: haiku support
132# elif defined(__HAIKU__)
133# include <__locale_dir/support/haiku.h>
134// zig patch: serenity support
135# elif defined(__serenity__)
136# include <__locale_dir/support/serenity.h>
125# else137# else
126138
127// TODO: This is a temporary definition to bridge between the old way we defined the locale base API139// TODO: This is a temporary definition to bridge between the old way we defined the locale base API
128// (by providing global non-reserved names) and the new API. As we move individual platforms140// (by providing global non-reserved names) and the new API. As we move individual platforms
129// towards the new way of defining the locale base API, this should disappear since each platform141// towards the new way of defining the locale base API, this should disappear since each platform
130// will define those directly.142// will define those directly.
131# if defined(__MVS__)143# include <__locale_dir/locale_base_api/ibm.h>
132# include <__locale_dir/locale_base_api/ibm.h>
133# elif defined(__OpenBSD__)
134# include <__locale_dir/locale_base_api/openbsd.h>
135# endif
136144
137# include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h>145# include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h>
138146
139# include <__cstddef/size_t.h>147# include <__cstddef/size_t.h>
140# include <__utility/forward.h>148# include <__utility/forward.h>
141# include <ctype.h>149# include <ctype.h>
150# include <langinfo.h>
142# include <string.h>151# include <string.h>
143# include <time.h>152# include <time.h>
144# if _LIBCPP_HAS_WIDE_CHARACTERS153# if _LIBCPP_HAS_WIDE_CHARACTERS
...@@ -228,8 +237,8 @@ inline _LIBCPP_HIDE_FROM_ABI wint_t __towupper(wint_t __ch, __locale_t __loc) {...@@ -228,8 +237,8 @@ inline _LIBCPP_HIDE_FROM_ABI wint_t __towupper(wint_t __ch, __locale_t __loc) {
228inline _LIBCPP_HIDE_FROM_ABI wint_t __towlower(wint_t __ch, __locale_t __loc) { return towlower_l(__ch, __loc); }237inline _LIBCPP_HIDE_FROM_ABI wint_t __towlower(wint_t __ch, __locale_t __loc) { return towlower_l(__ch, __loc); }
229# endif238# endif
230239
231inline _LIBCPP_HIDE_FROM_ABI size_t240inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
232__strftime(char* __s, size_t __max, const char* __format, const tm* __tm, __locale_t __loc) {241 __strftime(char* __s, size_t __max, const char* __format, const tm* __tm, __locale_t __loc) {
233 return strftime_l(__s, __max, __format, __tm, __loc);242 return strftime_l(__s, __max, __format, __tm, __loc);
234}243}
235244
...@@ -268,7 +277,12 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,...@@ -268,7 +277,12 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,
268 return __libcpp_mbsrtowcs_l(__dest, __src, __len, __ps, __loc);277 return __libcpp_mbsrtowcs_l(__dest, __src, __len, __ps, __loc);
269}278}
270# endif // _LIBCPP_HAS_WIDE_CHARACTERS279# endif // _LIBCPP_HAS_WIDE_CHARACTERS
271# endif // _LIBCPP_BUILDING_LIBRARY280
281inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) {
282 return ::nl_langinfo_l(CODESET, __loc);
283}
284
285# endif // _LIBCPP_BUILDING_LIBRARY
272286
273_LIBCPP_DIAGNOSTIC_PUSH287_LIBCPP_DIAGNOSTIC_PUSH
274_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")288_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
lib/libcxx/include/__locale_dir/locale_base_api/android.h deleted-45
...@@ -1,45 +0,0 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H
11#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H
12
13#include <stdlib.h>
14
15// FIXME: Is this actually required?
16extern "C" {
17#include <xlocale.h>
18}
19
20#include <android/api-level.h>
21
22// If we do not have this header, we are in a platform build rather than an NDK
23// build, which will always be at least as new as the ToT NDK, in which case we
24// don't need any of the inlines below since libc provides them.
25#if __has_include(<android/ndk-version.h>)
26# include <android/ndk-version.h>
27// In NDK versions later than 16, locale-aware functions are provided by
28// legacy_stdlib_inlines.h
29# if __NDK_MAJOR__ <= 16
30# if __ANDROID_API__ < 26
31
32inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
33 return ::strtof(__nptr, __endptr);
34}
35
36inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t) {
37 return ::strtod(__nptr, __endptr);
38}
39
40# endif // __ANDROID_API__ < 26
41
42# endif // __NDK_MAJOR__ <= 16
43#endif // __has_include(<android/ndk-version.h>)
44
45#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H
lib/libcxx/include/__locale_dir/locale_base_api/ibm.h created+97
...@@ -0,0 +1,97 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H
11#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H
12
13#if defined(__MVS__)
14# include <__support/ibm/locale_mgmt_zos.h>
15#endif // defined(__MVS__)
16
17#include <locale.h>
18#include <stdarg.h>
19#include <stdio.h>
20
21#include "cstdlib"
22
23#if defined(__MVS__)
24# include <wctype.h>
25// POSIX routines
26# include <__support/xlocale/__posix_l_fallback.h>
27#endif // defined(__MVS__)
28
29namespace {
30
31struct __setAndRestore {
32 explicit __setAndRestore(locale_t locale) {
33 if (locale == (locale_t)0) {
34 __cloc = newlocale(LC_ALL_MASK, "C", /* base */ (locale_t)0);
35 __stored = uselocale(__cloc);
36 } else {
37 __stored = uselocale(locale);
38 }
39 }
40
41 ~__setAndRestore() {
42 uselocale(__stored);
43 if (__cloc)
44 freelocale(__cloc);
45 }
46
47private:
48 locale_t __stored = (locale_t)0;
49 locale_t __cloc = (locale_t)0;
50};
51
52} // namespace
53
54// The following are not POSIX routines. These are quick-and-dirty hacks
55// to make things pretend to work
56inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t locale) {
57 __setAndRestore __newloc(locale);
58 return ::strtod(__nptr, __endptr);
59}
60
61inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t locale) {
62 __setAndRestore __newloc(locale);
63 return ::strtof(__nptr, __endptr);
64}
65
66inline _LIBCPP_HIDE_FROM_ABI long double strtold_l(const char* __nptr, char** __endptr, locale_t locale) {
67 __setAndRestore __newloc(locale);
68 return ::strtold(__nptr, __endptr);
69}
70
71inline _LIBCPP_HIDE_FROM_ABI
72_LIBCPP_ATTRIBUTE_FORMAT(__printf__, 2, 0) int vasprintf(char** strp, const char* fmt, va_list ap) {
73 const size_t buff_size = 256;
74 if ((*strp = (char*)malloc(buff_size)) == nullptr) {
75 return -1;
76 }
77
78 va_list ap_copy;
79 // va_copy may not be provided by the C library in C++03 mode.
80#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
81 __builtin_va_copy(ap_copy, ap);
82#else
83 va_copy(ap_copy, ap);
84#endif
85 int str_size = vsnprintf(*strp, buff_size, fmt, ap_copy);
86 va_end(ap_copy);
87
88 if ((size_t)str_size >= buff_size) {
89 if ((*strp = (char*)realloc(*strp, str_size + 1)) == nullptr) {
90 return -1;
91 }
92 str_size = vsnprintf(*strp, str_size + 1, fmt, ap);
93 }
94 return str_size;
95}
96
97#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H
lib/libcxx/include/__locale_dir/locale_base_api/musl.h deleted-31
...@@ -1,31 +0,0 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// This adds support for the extended locale functions that are currently
10// missing from the Musl C library.
11//
12// This only works when the specified locale is "C" or "POSIX", but that's
13// about as good as we can do without implementing full xlocale support
14// in Musl.
15//===----------------------------------------------------------------------===//
16
17#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_MUSL_H
18#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_MUSL_H
19
20#include <cstdlib>
21#include <cwchar>
22
23inline _LIBCPP_HIDE_FROM_ABI long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) {
24 return ::strtoll(__nptr, __endptr, __base);
25}
26
27inline _LIBCPP_HIDE_FROM_ABI unsigned long long strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) {
28 return ::strtoull(__nptr, __endptr, __base);
29}
30
31#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_MUSL_H
lib/libcxx/include/__locale_dir/locale_base_api/openbsd.h deleted-19
...@@ -1,19 +0,0 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H
11#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H
12
13#include <__support/xlocale/__strtonum_fallback.h>
14#include <clocale>
15#include <cstdlib>
16#include <ctype.h>
17#include <cwctype>
18
19#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H
lib/libcxx/include/__locale_dir/messages.h+7-3
...@@ -22,7 +22,8 @@...@@ -22,7 +22,8 @@
2222
23# if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))23# if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
24// Most unix variants have catopen. These are the specific ones that don't.24// Most unix variants have catopen. These are the specific ones that don't.
25# if !defined(__BIONIC__) && !_LIBCPP_LIBC_NEWLIB && !defined(__EMSCRIPTEN__)25// zig patch: serenity support
26# if !defined(__BIONIC__) && !_LIBCPP_LIBC_NEWLIB && !defined(__EMSCRIPTEN__) && !defined(__serenity__)
26# define _LIBCPP_HAS_CATOPEN 127# define _LIBCPP_HAS_CATOPEN 1
27# include <nl_types.h>28# include <nl_types.h>
28# else29# else
...@@ -33,6 +34,7 @@...@@ -33,6 +34,7 @@
33# endif34# endif
3435
35_LIBCPP_BEGIN_NAMESPACE_STD36_LIBCPP_BEGIN_NAMESPACE_STD
37_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3638
37class _LIBCPP_EXPORTED_FROM_ABI messages_base {39class _LIBCPP_EXPORTED_FROM_ABI messages_base {
38public:40public:
...@@ -49,11 +51,12 @@ public:...@@ -49,11 +51,12 @@ public:
4951
50 _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {}52 _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {}
5153
52 _LIBCPP_HIDE_FROM_ABI catalog open(const basic_string<char>& __nm, const locale& __loc) const {54 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI catalog open(const basic_string<char>& __nm, const locale& __loc) const {
53 return do_open(__nm, __loc);55 return do_open(__nm, __loc);
54 }56 }
5557
56 _LIBCPP_HIDE_FROM_ABI string_type get(catalog __c, int __set, int __msgid, const string_type& __dflt) const {58 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type
59 get(catalog __c, int __set, int __msgid, const string_type& __dflt) const {
57 return do_get(__c, __set, __msgid, __dflt);60 return do_get(__c, __set, __msgid, __dflt);
58 }61 }
5962
...@@ -136,6 +139,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;...@@ -136,6 +139,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;
136extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;139extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;
137# endif140# endif
138141
142_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
139_LIBCPP_END_NAMESPACE_STD143_LIBCPP_END_NAMESPACE_STD
140144
141#endif // _LIBCPP_HAS_LOCALIZATION145#endif // _LIBCPP_HAS_LOCALIZATION
lib/libcxx/include/__locale_dir/money.h+11-9
...@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS...@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS
32# include <__undef_macros>32# include <__undef_macros>
3333
34_LIBCPP_BEGIN_NAMESPACE_STD34_LIBCPP_BEGIN_NAMESPACE_STD
35_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3536
36// money_base37// money_base
3738
...@@ -55,15 +56,15 @@ public:...@@ -55,15 +56,15 @@ public:
5556
56 _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {}57 _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {}
5758
58 _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); }59 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); }
59 _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }60 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }
60 _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }61 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }
61 _LIBCPP_HIDE_FROM_ABI string_type curr_symbol() const { return do_curr_symbol(); }62 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type curr_symbol() const { return do_curr_symbol(); }
62 _LIBCPP_HIDE_FROM_ABI string_type positive_sign() const { return do_positive_sign(); }63 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type positive_sign() const { return do_positive_sign(); }
63 _LIBCPP_HIDE_FROM_ABI string_type negative_sign() const { return do_negative_sign(); }64 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI string_type negative_sign() const { return do_negative_sign(); }
64 _LIBCPP_HIDE_FROM_ABI int frac_digits() const { return do_frac_digits(); }65 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int frac_digits() const { return do_frac_digits(); }
65 _LIBCPP_HIDE_FROM_ABI pattern pos_format() const { return do_pos_format(); }66 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pattern pos_format() const { return do_pos_format(); }
66 _LIBCPP_HIDE_FROM_ABI pattern neg_format() const { return do_neg_format(); }67 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pattern neg_format() const { return do_neg_format(); }
6768
68 static locale::id id;69 static locale::id id;
69 static const bool intl = _International;70 static const bool intl = _International;
...@@ -864,6 +865,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>;...@@ -864,6 +865,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>;
864extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>;865extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>;
865# endif866# endif
866867
868_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
867_LIBCPP_END_NAMESPACE_STD869_LIBCPP_END_NAMESPACE_STD
868870
869_LIBCPP_POP_MACROS871_LIBCPP_POP_MACROS
lib/libcxx/include/__locale_dir/num.h+3-2
...@@ -42,6 +42,7 @@ _LIBCPP_PUSH_MACROS...@@ -42,6 +42,7 @@ _LIBCPP_PUSH_MACROS
42# include <__undef_macros>42# include <__undef_macros>
4343
44_LIBCPP_BEGIN_NAMESPACE_STD44_LIBCPP_BEGIN_NAMESPACE_STD
45_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4546
46struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base {47struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base {
47 static const int __num_get_buf_sz = 40;48 static const int __num_get_buf_sz = 40;
...@@ -95,9 +96,8 @@ struct __num_get : protected __num_get_base {...@@ -95,9 +96,8 @@ struct __num_get : protected __num_get_base {
95 _LIBCPP_DIAGNOSTIC_PUSH96 _LIBCPP_DIAGNOSTIC_PUSH
96 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi")97 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi")
97 using __vec = __simd_vector<char, 32>;98 using __vec = __simd_vector<char, 32>;
98 __vec __chars = std::__broadcast<__vec>(__val);
99 __vec __cmp = std::__partial_load<__vec, __int_chr_cnt>(__atoms);99 __vec __cmp = std::__partial_load<__vec, __int_chr_cnt>(__atoms);
100 auto __res = __chars == __cmp;100 auto __res = __vec(__val) == __cmp;
101 if (std::__none_of(__res))101 if (std::__none_of(__res))
102 return __int_chr_cnt;102 return __int_chr_cnt;
103 return std::min(__int_chr_cnt, std::__find_first_set(__res));103 return std::min(__int_chr_cnt, std::__find_first_set(__res));
...@@ -1008,6 +1008,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>;...@@ -1008,6 +1008,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>;
1008extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>;1008extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>;
1009# endif1009# endif
10101010
1011_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1011_LIBCPP_END_NAMESPACE_STD1012_LIBCPP_END_NAMESPACE_STD
10121013
1013_LIBCPP_POP_MACROS1014_LIBCPP_POP_MACROS
lib/libcxx/include/__locale_dir/pad_and_output.h+2-14
...@@ -55,13 +55,7 @@ _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output(...@@ -55,13 +55,7 @@ _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output(
55 __ns -= __sz;55 __ns -= __sz;
56 else56 else
57 __ns = 0;57 __ns = 0;
58 streamsize __np = __op - __ob;58 __s = std::copy(__ob, __op, __s);
59 if (__np > 0) {
60 if (__s.__sbuf_->sputn(__ob, __np) != __np) {
61 __s.__sbuf_ = nullptr;
62 return __s;
63 }
64 }
65 if (__ns > 0) {59 if (__ns > 0) {
66 basic_string<_CharT, _Traits> __sp(__ns, __fl);60 basic_string<_CharT, _Traits> __sp(__ns, __fl);
67 if (__s.__sbuf_->sputn(__sp.data(), __ns) != __ns) {61 if (__s.__sbuf_->sputn(__sp.data(), __ns) != __ns) {
...@@ -69,13 +63,7 @@ _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output(...@@ -69,13 +63,7 @@ _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output(
69 return __s;63 return __s;
70 }64 }
71 }65 }
72 __np = __oe - __op;66 __s = std::copy(__op, __oe, __s);
73 if (__np > 0) {
74 if (__s.__sbuf_->sputn(__op, __np) != __np) {
75 __s.__sbuf_ = nullptr;
76 return __s;
77 }
78 }
79 __iob.width(0);67 __iob.width(0);
80 return __s;68 return __s;
81}69}
lib/libcxx/include/__locale_dir/support/bsd_like.h+8-3
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#include <__utility/forward.h>15#include <__utility/forward.h>
16#include <clocale> // std::lconv16#include <clocale> // std::lconv
17#include <ctype.h>17#include <ctype.h>
18#include <langinfo.h>
18#include <stdio.h>19#include <stdio.h>
19#include <stdlib.h>20#include <stdlib.h>
20#include <string.h>21#include <string.h>
...@@ -133,8 +134,8 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __...@@ -133,8 +134,8 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __
133}134}
134# endif // _LIBCPP_HAS_WIDE_CHARACTERS135# endif // _LIBCPP_HAS_WIDE_CHARACTERS
135136
136inline _LIBCPP_HIDE_FROM_ABI size_t137inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
137__strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {138 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {
138 return ::strftime_l(__s, __max, __format, __tm, __loc);139 return ::strftime_l(__s, __max, __format, __tm, __loc);
139}140}
140141
...@@ -180,7 +181,11 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,...@@ -180,7 +181,11 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,
180 return ::mbsrtowcs_l(__dest, __src, __len, __ps, __loc);181 return ::mbsrtowcs_l(__dest, __src, __len, __ps, __loc);
181}182}
182# endif // _LIBCPP_HAS_WIDE_CHARACTERS183# endif // _LIBCPP_HAS_WIDE_CHARACTERS
183#endif // _LIBCPP_BUILDING_LIBRARY184
185inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) {
186 return ::nl_langinfo_l(CODESET, __loc);
187}
188#endif // _LIBCPP_BUILDING_LIBRARY
184189
185_LIBCPP_DIAGNOSTIC_PUSH190_LIBCPP_DIAGNOSTIC_PUSH
186_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")191_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
lib/libcxx/include/__locale_dir/support/fuchsia.h+5
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#include <cstdio>15#include <cstdio>
16#include <cstdlib>16#include <cstdlib>
17#include <cwchar>17#include <cwchar>
18#include <langinfo.h>
1819
19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20# pragma GCC system_header21# pragma GCC system_header
...@@ -69,6 +70,10 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {...@@ -69,6 +70,10 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
69 return std::localeconv();70 return std::localeconv();
70}71}
7172
73inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) {
74 return ::nl_langinfo_l(CODESET, __loc);
75}
76
72//77//
73// Other functions78// Other functions
74//79//
lib/libcxx/include/__locale_dir/support/haiku.h created+243
...@@ -0,0 +1,243 @@
1// zig patch: haiku support
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_HAIKU_H
11#define _LIBCPP___LOCALE_DIR_SUPPORT_HAIKU_H
12
13#include <__config>
14#include <cctype>
15#include <clocale>
16#include <cstdio>
17#include <cstdlib>
18#include <cstring>
19#if _LIBCPP_HAS_WIDE_CHARACTERS
20# include <cwchar>
21# include <cwctype>
22#endif
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28_LIBCPP_BEGIN_NAMESPACE_STD
29namespace __locale {
30
31struct __locale_guard {
32 _LIBCPP_HIDE_FROM_ABI __locale_guard(locale_t& __loc) : __old_loc_(::uselocale(__loc)) {}
33
34 _LIBCPP_HIDE_FROM_ABI ~__locale_guard() {
35 if (__old_loc_)
36 ::uselocale(__old_loc_);
37 }
38
39 locale_t __old_loc_;
40
41 __locale_guard(__locale_guard const&) = delete;
42 __locale_guard& operator=(__locale_guard const&) = delete;
43};
44
45//
46// Locale management
47//
48#define _LIBCPP_COLLATE_MASK LC_COLLATE_MASK
49#define _LIBCPP_CTYPE_MASK LC_CTYPE_MASK
50#define _LIBCPP_MONETARY_MASK LC_MONETARY_MASK
51#define _LIBCPP_NUMERIC_MASK LC_NUMERIC_MASK
52#define _LIBCPP_TIME_MASK LC_TIME_MASK
53#define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
54#define _LIBCPP_ALL_MASK LC_ALL_MASK
55#define _LIBCPP_LC_ALL LC_ALL
56
57using __locale_t _LIBCPP_NODEBUG = ::locale_t;
58
59#if defined(_LIBCPP_BUILDING_LIBRARY)
60using __lconv_t _LIBCPP_NODEBUG = std::lconv;
61
62inline _LIBCPP_HIDE_FROM_ABI __locale_t __newlocale(int __category_mask, const char* __locale, __locale_t __base) {
63 return ::newlocale(__category_mask, __locale, __base);
64}
65
66inline _LIBCPP_HIDE_FROM_ABI void __freelocale(__locale_t __loc) { ::freelocale(__loc); }
67
68inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, char const* __locale) {
69 return ::setlocale(__category, __locale);
70}
71
72inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
73 __locale_guard __current(__loc);
74 return std::localeconv();
75}
76#endif // _LIBCPP_BUILDING_LIBRARY
77
78//
79// Strtonum functions
80//
81inline _LIBCPP_HIDE_FROM_ABI float __strtof(const char* __nptr, char** __endptr, __locale_t __loc) {
82 __locale_guard __current(__loc);
83 return std::strtof(__nptr, __endptr);
84}
85
86inline _LIBCPP_HIDE_FROM_ABI double __strtod(const char* __nptr, char** __endptr, __locale_t __loc) {
87 __locale_guard __current(__loc);
88 return std::strtod(__nptr, __endptr);
89}
90
91inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __endptr, __locale_t __loc) {
92 __locale_guard __current(__loc);
93 return std::strtold(__nptr, __endptr);
94}
95
96//
97// Character manipulation functions
98//
99#if defined(_LIBCPP_BUILDING_LIBRARY)
100inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t __loc) { return ::toupper_l(__c, __loc); }
101
102inline _LIBCPP_HIDE_FROM_ABI int __tolower(int __c, __locale_t __loc) { return ::tolower_l(__c, __loc); }
103
104inline _LIBCPP_HIDE_FROM_ABI int __strcoll(const char* __s1, const char* __s2, __locale_t __loc) {
105 return ::strcoll_l(__s1, __s2, __loc);
106}
107
108inline _LIBCPP_HIDE_FROM_ABI size_t __strxfrm(char* __dest, const char* __src, size_t __n, __locale_t __loc) {
109 return ::strxfrm_l(__dest, __src, __n, __loc);
110}
111
112# if _LIBCPP_HAS_WIDE_CHARACTERS
113inline _LIBCPP_HIDE_FROM_ABI int __iswctype(wint_t __c, wctype_t __type, __locale_t __loc) {
114 return ::iswctype_l(__c, __type, __loc);
115}
116
117inline _LIBCPP_HIDE_FROM_ABI int __iswspace(wint_t __c, __locale_t __loc) { return ::iswspace_l(__c, __loc); }
118
119inline _LIBCPP_HIDE_FROM_ABI int __iswprint(wint_t __c, __locale_t __loc) { return ::iswprint_l(__c, __loc); }
120
121inline _LIBCPP_HIDE_FROM_ABI int __iswcntrl(wint_t __c, __locale_t __loc) { return ::iswcntrl_l(__c, __loc); }
122
123inline _LIBCPP_HIDE_FROM_ABI int __iswupper(wint_t __c, __locale_t __loc) { return ::iswupper_l(__c, __loc); }
124
125inline _LIBCPP_HIDE_FROM_ABI int __iswlower(wint_t __c, __locale_t __loc) { return ::iswlower_l(__c, __loc); }
126
127inline _LIBCPP_HIDE_FROM_ABI int __iswalpha(wint_t __c, __locale_t __loc) { return ::iswalpha_l(__c, __loc); }
128
129inline _LIBCPP_HIDE_FROM_ABI int __iswblank(wint_t __c, __locale_t __loc) { return ::iswblank_l(__c, __loc); }
130
131inline _LIBCPP_HIDE_FROM_ABI int __iswdigit(wint_t __c, __locale_t __loc) { return ::iswdigit_l(__c, __loc); }
132
133inline _LIBCPP_HIDE_FROM_ABI int __iswpunct(wint_t __c, __locale_t __loc) { return ::iswpunct_l(__c, __loc); }
134
135inline _LIBCPP_HIDE_FROM_ABI int __iswxdigit(wint_t __c, __locale_t __loc) { return ::iswxdigit_l(__c, __loc); }
136
137inline _LIBCPP_HIDE_FROM_ABI wint_t __towupper(wint_t __c, __locale_t __loc) { return ::towupper_l(__c, __loc); }
138
139inline _LIBCPP_HIDE_FROM_ABI wint_t __towlower(wint_t __c, __locale_t __loc) { return ::towlower_l(__c, __loc); }
140
141inline _LIBCPP_HIDE_FROM_ABI int __wcscoll(const wchar_t* __ws1, const wchar_t* __ws2, __locale_t __loc) {
142 return ::wcscoll_l(__ws1, __ws2, __loc);
143}
144
145inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __src, size_t __n, __locale_t __loc) {
146 return ::wcsxfrm_l(__dest, __src, __n, __loc);
147}
148# endif // _LIBCPP_HAS_WIDE_CHARACTERS
149
150inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
151 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {
152 return ::strftime_l(__s, __max, __format, __tm, __loc);
153}
154
155//
156// Other functions
157//
158inline _LIBCPP_HIDE_FROM_ABI decltype(MB_CUR_MAX) __mb_len_max(__locale_t __loc) {
159 __locale_guard __current(__loc);
160 return MB_CUR_MAX;
161}
162
163# if _LIBCPP_HAS_WIDE_CHARACTERS
164inline _LIBCPP_HIDE_FROM_ABI wint_t __btowc(int __c, __locale_t __loc) {
165 __locale_guard __current(__loc);
166 return std::btowc(__c);
167}
168
169inline _LIBCPP_HIDE_FROM_ABI int __wctob(wint_t __c, __locale_t __loc) {
170 __locale_guard __current(__loc);
171 return std::wctob(__c);
172}
173
174inline _LIBCPP_HIDE_FROM_ABI size_t
175__wcsnrtombs(char* __dest, const wchar_t** __src, size_t __nwc, size_t __len, mbstate_t* __ps, __locale_t __loc) {
176 __locale_guard __current(__loc);
177 return ::wcsnrtombs(__dest, __src, __nwc, __len, __ps); // non-standard
178}
179
180inline _LIBCPP_HIDE_FROM_ABI size_t __wcrtomb(char* __s, wchar_t __wc, mbstate_t* __ps, __locale_t __loc) {
181 __locale_guard __current(__loc);
182 return std::wcrtomb(__s, __wc, __ps);
183}
184
185inline _LIBCPP_HIDE_FROM_ABI size_t
186__mbsnrtowcs(wchar_t* __dest, const char** __src, size_t __nms, size_t __len, mbstate_t* __ps, __locale_t __loc) {
187 __locale_guard __current(__loc);
188 return ::mbsnrtowcs(__dest, __src, __nms, __len, __ps); // non-standard
189}
190
191inline _LIBCPP_HIDE_FROM_ABI size_t
192__mbrtowc(wchar_t* __pwc, const char* __s, size_t __n, mbstate_t* __ps, __locale_t __loc) {
193 __locale_guard __current(__loc);
194 return std::mbrtowc(__pwc, __s, __n, __ps);
195}
196
197inline _LIBCPP_HIDE_FROM_ABI int __mbtowc(wchar_t* __pwc, const char* __pmb, size_t __max, __locale_t __loc) {
198 __locale_guard __current(__loc);
199 return std::mbtowc(__pwc, __pmb, __max);
200}
201
202inline _LIBCPP_HIDE_FROM_ABI size_t __mbrlen(const char* __s, size_t __n, mbstate_t* __ps, __locale_t __loc) {
203 __locale_guard __current(__loc);
204 return std::mbrlen(__s, __n, __ps);
205}
206
207inline _LIBCPP_HIDE_FROM_ABI size_t
208__mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps, __locale_t __loc) {
209 __locale_guard __current(__loc);
210 return std::mbsrtowcs(__dest, __src, __len, __ps);
211}
212# endif // _LIBCPP_HAS_WIDE_CHARACTERS
213#endif // _LIBCPP_BUILDING_LIBRARY
214
215#ifndef _LIBCPP_COMPILER_GCC // GCC complains that this can't be always_inline due to C-style varargs
216_LIBCPP_HIDE_FROM_ABI
217#endif
218inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5) int __snprintf(
219 char* __s, size_t __n, __locale_t __loc, const char* __format, ...) {
220 va_list __va;
221 va_start(__va, __format);
222 __locale_guard __current(__loc);
223 int __res = std::vsnprintf(__s, __n, __format, __va);
224 va_end(__va);
225 return __res;
226}
227
228#ifndef _LIBCPP_COMPILER_GCC // GCC complains that this can't be always_inline due to C-style varargs
229_LIBCPP_HIDE_FROM_ABI
230#endif
231inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __asprintf(
232 char** __s, __locale_t __loc, const char* __format, ...) {
233 va_list __va;
234 va_start(__va, __format);
235 __locale_guard __current(__loc);
236 int __res = ::vasprintf(__s, __format, __va); // non-standard
237 va_end(__va);
238 return __res;
239}
240} // namespace __locale
241_LIBCPP_END_NAMESPACE_STD
242
243#endif // _LIBCPP___LOCALE_DIR_SUPPORT_HAIKU_H
lib/libcxx/include/__locale_dir/support/linux.h+12-3
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include <cstdio>17#include <cstdio>
18#include <cstdlib>18#include <cstdlib>
19#include <ctype.h>19#include <ctype.h>
20#include <langinfo.h>
20#include <stdarg.h>21#include <stdarg.h>
21#include <string.h>22#include <string.h>
22#include <time.h>23#include <time.h>
...@@ -148,8 +149,8 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __...@@ -148,8 +149,8 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __
148}149}
149# endif // _LIBCPP_HAS_WIDE_CHARACTERS150# endif // _LIBCPP_HAS_WIDE_CHARACTERS
150151
151inline _LIBCPP_HIDE_FROM_ABI size_t152inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
152__strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {153 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {
153 return strftime_l(__s, __max, __format, __tm, __loc);154 return strftime_l(__s, __max, __format, __tm, __loc);
154}155}
155156
...@@ -211,7 +212,15 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,...@@ -211,7 +212,15 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,
211 return std::mbsrtowcs(__dest, __src, __len, __ps);212 return std::mbsrtowcs(__dest, __src, __len, __ps);
212}213}
213# endif // _LIBCPP_HAS_WIDE_CHARACTERS214# endif // _LIBCPP_HAS_WIDE_CHARACTERS
214#endif // _LIBCPP_BUILDING_LIBRARY215
216inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding([[maybe_unused]] __locale_t __loc) {
217# if defined(__ANDROID__)
218 return "UTF-8";
219# else
220 return ::nl_langinfo_l(CODESET, __loc);
221# endif
222}
223#endif // _LIBCPP_BUILDING_LIBRARY
215224
216#ifndef _LIBCPP_COMPILER_GCC // GCC complains that this can't be always_inline due to C-style varargs225#ifndef _LIBCPP_COMPILER_GCC // GCC complains that this can't be always_inline due to C-style varargs
217_LIBCPP_HIDE_FROM_ABI226_LIBCPP_HIDE_FROM_ABI
lib/libcxx/include/__locale_dir/support/newlib.h+7-2
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include <cstdio>16#include <cstdio>
17#include <cstdlib>17#include <cstdlib>
18#include <ctype.h>18#include <ctype.h>
19#include <langinfo.h>
19#include <stdarg.h>20#include <stdarg.h>
20#include <string.h>21#include <string.h>
21#include <time.h>22#include <time.h>
...@@ -76,6 +77,10 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {...@@ -76,6 +77,10 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
76 __locale_guard __current(__loc);77 __locale_guard __current(__loc);
77 return std::localeconv();78 return std::localeconv();
78}79}
80
81inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) {
82 return ::nl_langinfo_l(CODESET, __loc);
83}
79#endif // _LIBCPP_BUILDING_LIBRARY84#endif // _LIBCPP_BUILDING_LIBRARY
8085
81//86//
...@@ -147,8 +152,8 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __...@@ -147,8 +152,8 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __
147}152}
148# endif // _LIBCPP_HAS_WIDE_CHARACTERS153# endif // _LIBCPP_HAS_WIDE_CHARACTERS
149154
150inline _LIBCPP_HIDE_FROM_ABI155inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
151size_t __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {156 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {
152 return strftime_l(__s, __max, __format, __tm, __loc);157 return strftime_l(__s, __max, __format, __tm, __loc);
153}158}
154159
lib/libcxx/include/__locale_dir/support/no_locale/characters.h+6-4
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include <cstring>16#include <cstring>
17#include <ctime>17#include <ctime>
18#if _LIBCPP_HAS_WIDE_CHARACTERS18#if _LIBCPP_HAS_WIDE_CHARACTERS
19# include <cwchar>
19# include <cwctype>20# include <cwctype>
20#endif21#endif
2122
...@@ -23,13 +24,14 @@...@@ -23,13 +24,14 @@
23# pragma GCC system_header24# pragma GCC system_header
24#endif25#endif
2526
27#if defined(_LIBCPP_BUILDING_LIBRARY)
28
26_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
27namespace __locale {30namespace __locale {
2831
29//32//
30// Character manipulation functions33// Character manipulation functions
31//34//
32#if defined(_LIBCPP_BUILDING_LIBRARY)
33inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t) { return std::toupper(__c); }35inline _LIBCPP_HIDE_FROM_ABI int __toupper(int __c, __locale_t) { return std::toupper(__c); }
3436
35inline _LIBCPP_HIDE_FROM_ABI int __tolower(int __c, __locale_t) { return std::tolower(__c); }37inline _LIBCPP_HIDE_FROM_ABI int __tolower(int __c, __locale_t) { return std::tolower(__c); }
...@@ -80,13 +82,13 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __...@@ -80,13 +82,13 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __
80}82}
81# endif // _LIBCPP_HAS_WIDE_CHARACTERS83# endif // _LIBCPP_HAS_WIDE_CHARACTERS
8284
83inline _LIBCPP_HIDE_FROM_ABI size_t85inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
84__strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t) {86 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t) {
85 return std::strftime(__s, __max, __format, __tm);87 return std::strftime(__s, __max, __format, __tm);
86}88}
87#endif // _LIBCPP_BUILDING_LIBRARY
8889
89} // namespace __locale90} // namespace __locale
90_LIBCPP_END_NAMESPACE_STD91_LIBCPP_END_NAMESPACE_STD
9192
93#endif // _LIBCPP_BUILDING_LIBRARY
92#endif // _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CHARACTERS_H94#endif // _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CHARACTERS_H
lib/libcxx/include/__locale_dir/support/no_locale/conversions.h created+73
...@@ -0,0 +1,73 @@
1//===-----------------------------------------------------------------------===//
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#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CONVERSIONS_H
10#define _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CONVERSIONS_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__std_mbstate_t.h>
15#include <cstdlib>
16#if _LIBCPP_HAS_WIDE_CHARACTERS
17# include <cwchar>
18#endif
19
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21# pragma GCC system_header
22#endif
23
24#if defined(_LIBCPP_BUILDING_LIBRARY)
25
26_LIBCPP_BEGIN_NAMESPACE_STD
27namespace __locale {
28
29inline _LIBCPP_HIDE_FROM_ABI decltype(MB_CUR_MAX) __mb_len_max(__locale_t) { return MB_CUR_MAX; }
30
31# if _LIBCPP_HAS_WIDE_CHARACTERS
32inline _LIBCPP_HIDE_FROM_ABI wint_t __btowc(int __c, __locale_t) { return std::btowc(__c); }
33
34inline _LIBCPP_HIDE_FROM_ABI int __wctob(wint_t __c, __locale_t) { return std::wctob(__c); }
35
36inline _LIBCPP_HIDE_FROM_ABI size_t
37__wcsnrtombs(char* __dest, const wchar_t** __src, size_t __nwc, size_t __len, mbstate_t* __ps, __locale_t) {
38 return ::wcsnrtombs(__dest, __src, __nwc, __len, __ps); // Non-standard
39}
40
41inline _LIBCPP_HIDE_FROM_ABI size_t __wcrtomb(char* __s, wchar_t __wc, mbstate_t* __ps, __locale_t) {
42 return std::wcrtomb(__s, __wc, __ps);
43}
44
45inline _LIBCPP_HIDE_FROM_ABI size_t
46__mbsnrtowcs(wchar_t* __dest, const char** __src, size_t __nms, size_t __len, mbstate_t* __ps, __locale_t) {
47 return ::mbsnrtowcs(__dest, __src, __nms, __len, __ps); // Non-standard
48}
49
50inline _LIBCPP_HIDE_FROM_ABI size_t
51__mbrtowc(wchar_t* __pwc, const char* __s, size_t __n, mbstate_t* __ps, __locale_t) {
52 return std::mbrtowc(__pwc, __s, __n, __ps);
53}
54
55inline _LIBCPP_HIDE_FROM_ABI int __mbtowc(wchar_t* __pwc, const char* __pmb, size_t __max, __locale_t) {
56 return std::mbtowc(__pwc, __pmb, __max);
57}
58
59inline _LIBCPP_HIDE_FROM_ABI size_t __mbrlen(const char* __s, size_t __n, mbstate_t* __ps, __locale_t) {
60 return std::mbrlen(__s, __n, __ps);
61}
62
63inline _LIBCPP_HIDE_FROM_ABI size_t
64__mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps, __locale_t) {
65 return std::mbsrtowcs(__dest, __src, __len, __ps);
66}
67# endif // _LIBCPP_HAS_WIDE_CHARACTERS
68
69} // namespace __locale
70_LIBCPP_END_NAMESPACE_STD
71
72#endif // _LIBCPP_BUILDING_LIBRARY
73#endif // _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CONVERSIONS_H
lib/libcxx/include/__locale_dir/support/no_locale/formatting.h created+50
...@@ -0,0 +1,50 @@
1//===-----------------------------------------------------------------------===//
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#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_FORMATTING_H
10#define _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_FORMATTING_H
11
12#include <__config>
13#include <__utility/forward.h>
14#include <cstdio>
15
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header
18#endif
19
20_LIBCPP_BEGIN_NAMESPACE_STD
21namespace __locale {
22
23_LIBCPP_DIAGNOSTIC_PUSH
24_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
25_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") // GCC doesn't support [[gnu::format]] on variadic templates
26#ifdef _LIBCPP_COMPILER_CLANG_BASED
27# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) _LIBCPP_ATTRIBUTE_FORMAT(__VA_ARGS__)
28#else
29# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) /* nothing */
30#endif
31
32template <class... _Args>
33_LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 4, 5) int __snprintf(
34 char* __s, size_t __n, __locale_t, const char* __format, _Args&&... __args) {
35 return std::snprintf(__s, __n, __format, std::forward<_Args>(__args)...);
36}
37
38template <class... _Args>
39_LIBCPP_HIDE_FROM_ABI _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __asprintf(
40 char** __s, __locale_t, const char* __format, _Args&&... __args) {
41 return ::asprintf(__s, __format, std::forward<_Args>(__args)...); // non-standard
42}
43
44_LIBCPP_DIAGNOSTIC_POP
45#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
46
47} // namespace __locale
48_LIBCPP_END_NAMESPACE_STD
49
50#endif // _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_FORMATTING_H
lib/libcxx/include/__locale_dir/support/openbsd.h created+236
...@@ -0,0 +1,236 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H
11#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H
12
13#include <__config>
14#include <__cstddef/size_t.h>
15#include <__std_mbstate_t.h>
16#include <__utility/forward.h>
17#include <clocale> // std::lconv
18#include <ctype.h>
19#include <stdio.h>
20#include <stdlib.h>
21#include <string.h>
22#include <time.h>
23#if _LIBCPP_HAS_WIDE_CHARACTERS
24# include <wchar.h>
25# include <wctype.h>
26#endif
27#if defined(_LIBCPP_BUILDING_LIBRARY)
28# include <langinfo.h>
29#endif
30
31#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
32# pragma GCC system_header
33#endif
34
35_LIBCPP_BEGIN_NAMESPACE_STD
36namespace __locale {
37
38struct __locale_guard {
39 __locale_guard(locale_t& __loc) : __old_loc_(::uselocale(__loc)) {}
40
41 ~__locale_guard() {
42 if (__old_loc_)
43 ::uselocale(__old_loc_);
44 }
45
46 locale_t __old_loc_;
47
48 __locale_guard(__locale_guard const&) = delete;
49 __locale_guard& operator=(__locale_guard const&) = delete;
50};
51
52//
53// Locale management
54//
55#define _LIBCPP_COLLATE_MASK LC_COLLATE_MASK
56#define _LIBCPP_CTYPE_MASK LC_CTYPE_MASK
57#define _LIBCPP_MONETARY_MASK LC_MONETARY_MASK
58#define _LIBCPP_NUMERIC_MASK LC_NUMERIC_MASK
59#define _LIBCPP_TIME_MASK LC_TIME_MASK
60#define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
61#define _LIBCPP_ALL_MASK LC_ALL_MASK
62#define _LIBCPP_LC_ALL LC_ALL
63
64using __locale_t _LIBCPP_NODEBUG = ::locale_t;
65#if defined(_LIBCPP_BUILDING_LIBRARY)
66using __lconv_t _LIBCPP_NODEBUG = std::lconv;
67
68inline __locale_t __newlocale(int __category_mask, const char* __locale, __locale_t __base) {
69 return ::newlocale(__category_mask, __locale, __base);
70}
71
72inline void __freelocale(__locale_t __loc) { ::freelocale(__loc); }
73
74inline char* __setlocale(int __category, char const* __locale) { return ::setlocale(__category, __locale); }
75
76inline __lconv_t* __localeconv(__locale_t& __loc) {
77 __locale_guard __current(__loc);
78 return ::localeconv();
79}
80
81inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) {
82 return ::nl_langinfo_l(CODESET, __loc);
83}
84#endif // _LIBCPP_BUILDING_LIBRARY
85
86//
87// Strtonum functions
88//
89inline float __strtof(const char* __nptr, char** __endptr, __locale_t) { return ::strtof(__nptr, __endptr); }
90
91inline double __strtod(const char* __nptr, char** __endptr, __locale_t) { return ::strtod(__nptr, __endptr); }
92
93inline long double __strtold(const char* __nptr, char** __endptr, __locale_t) { return ::strtold(__nptr, __endptr); }
94
95//
96// Character manipulation functions
97//
98#if defined(_LIBCPP_BUILDING_LIBRARY)
99inline int __toupper(int __c, __locale_t __loc) { return ::toupper_l(__c, __loc); }
100
101inline int __tolower(int __c, __locale_t __loc) { return ::tolower_l(__c, __loc); }
102
103inline int __strcoll(const char* __s1, const char* __s2, __locale_t __loc) { return ::strcoll_l(__s1, __s2, __loc); }
104
105inline size_t __strxfrm(char* __dest, const char* __src, size_t __n, __locale_t __loc) {
106 return ::strxfrm_l(__dest, __src, __n, __loc);
107}
108
109# if _LIBCPP_HAS_WIDE_CHARACTERS
110inline int __iswctype(wint_t __c, wctype_t __type, __locale_t __loc) { return ::iswctype_l(__c, __type, __loc); }
111
112inline int __iswspace(wint_t __c, __locale_t __loc) { return ::iswspace_l(__c, __loc); }
113
114inline int __iswprint(wint_t __c, __locale_t __loc) { return ::iswprint_l(__c, __loc); }
115
116inline int __iswcntrl(wint_t __c, __locale_t __loc) { return ::iswcntrl_l(__c, __loc); }
117
118inline int __iswupper(wint_t __c, __locale_t __loc) { return ::iswupper_l(__c, __loc); }
119
120inline int __iswlower(wint_t __c, __locale_t __loc) { return ::iswlower_l(__c, __loc); }
121
122inline int __iswalpha(wint_t __c, __locale_t __loc) { return ::iswalpha_l(__c, __loc); }
123
124inline int __iswblank(wint_t __c, __locale_t __loc) { return ::iswblank_l(__c, __loc); }
125
126inline int __iswdigit(wint_t __c, __locale_t __loc) { return ::iswdigit_l(__c, __loc); }
127
128inline int __iswpunct(wint_t __c, __locale_t __loc) { return ::iswpunct_l(__c, __loc); }
129
130inline int __iswxdigit(wint_t __c, __locale_t __loc) { return ::iswxdigit_l(__c, __loc); }
131
132inline wint_t __towupper(wint_t __c, __locale_t __loc) { return ::towupper_l(__c, __loc); }
133
134inline wint_t __towlower(wint_t __c, __locale_t __loc) { return ::towlower_l(__c, __loc); }
135
136inline int __wcscoll(const wchar_t* __ws1, const wchar_t* __ws2, __locale_t __loc) {
137 return ::wcscoll_l(__ws1, __ws2, __loc);
138}
139
140inline size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __src, size_t __n, __locale_t __loc) {
141 return ::wcsxfrm_l(__dest, __src, __n, __loc);
142}
143# endif // _LIBCPP_HAS_WIDE_CHARACTERS
144
145inline _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
146 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {
147 return ::strftime_l(__s, __max, __format, __tm, __loc);
148}
149
150//
151// Other functions
152//
153inline decltype(MB_CUR_MAX) __mb_len_max(__locale_t __loc) {
154 __locale_guard __current(__loc);
155 return MB_CUR_MAX;
156}
157
158# if _LIBCPP_HAS_WIDE_CHARACTERS
159inline wint_t __btowc(int __c, __locale_t __loc) {
160 __locale_guard __current(__loc);
161 return btowc(__c);
162}
163
164inline int __wctob(wint_t __c, __locale_t __loc) {
165 __locale_guard __current(__loc);
166 return wctob(__c);
167}
168
169inline size_t
170__wcsnrtombs(char* __dest, const wchar_t** __src, size_t __nwc, size_t __len, mbstate_t* __ps, __locale_t __loc) {
171 __locale_guard __current(__loc);
172 return wcsnrtombs(__dest, __src, __nwc, __len, __ps); // wcsnrtombs is a POSIX extension
173}
174
175inline size_t __wcrtomb(char* __s, wchar_t __wc, mbstate_t* __ps, __locale_t __loc) {
176 __locale_guard __current(__loc);
177 return wcrtomb(__s, __wc, __ps);
178}
179
180inline size_t
181__mbsnrtowcs(wchar_t* __dest, const char** __src, size_t __nms, size_t __len, mbstate_t* __ps, __locale_t __loc) {
182 __locale_guard __current(__loc);
183 return mbsnrtowcs(__dest, __src, __nms, __len, __ps); // mbsnrtowcs is a POSIX extension
184}
185
186inline size_t __mbrtowc(wchar_t* __pwc, const char* __s, size_t __n, mbstate_t* __ps, __locale_t __loc) {
187 __locale_guard __current(__loc);
188 return mbrtowc(__pwc, __s, __n, __ps);
189}
190
191inline int __mbtowc(wchar_t* __pwc, const char* __pmb, size_t __max, __locale_t __loc) {
192 __locale_guard __current(__loc);
193 return mbtowc(__pwc, __pmb, __max);
194}
195
196inline size_t __mbrlen(const char* __s, size_t __n, mbstate_t* __ps, __locale_t __loc) {
197 __locale_guard __current(__loc);
198 return mbrlen(__s, __n, __ps);
199}
200
201inline size_t __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps, __locale_t __loc) {
202 __locale_guard __current(__loc);
203 return mbsrtowcs(__dest, __src, __len, __ps);
204}
205# endif // _LIBCPP_HAS_WIDE_CHARACTERS
206#endif // _LIBCPP_BUILDING_LIBRARY
207
208_LIBCPP_DIAGNOSTIC_PUSH
209_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
210_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") // GCC doesn't support [[gnu::format]] on variadic templates
211#ifdef _LIBCPP_COMPILER_CLANG_BASED
212# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) _LIBCPP_ATTRIBUTE_FORMAT(__VA_ARGS__)
213#else
214# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) /* nothing */
215#endif
216
217template <class... _Args>
218_LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 4, 5)
219int __snprintf(char* __s, size_t __n, __locale_t __loc, const char* __format, _Args&&... __args) {
220 __locale_guard __current(__loc);
221 return ::snprintf(__s, __n, __format, std::forward<_Args>(__args)...);
222}
223
224template <class... _Args>
225_LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4)
226int __asprintf(char** __s, __locale_t __loc, const char* __format, _Args&&... __args) {
227 __locale_guard __current(__loc);
228 return ::asprintf(__s, __format, std::forward<_Args>(__args)...); // non-standard
229}
230_LIBCPP_DIAGNOSTIC_POP
231#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
232
233} // namespace __locale
234_LIBCPP_END_NAMESPACE_STD
235
236#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H
lib/libcxx/include/__locale_dir/support/serenity.h created+274
...@@ -0,0 +1,274 @@
1// zig patch: serenity support
2// -*- C++ -*-
3//===-----------------------------------------------------------------------===//
4//
5// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6// See https://llvm.org/LICENSE.txt for license information.
7// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_SERENITY_H
12#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_SERENITY_H
13
14#include <__config>
15#include <__cstddef/size_t.h>
16#include <__std_mbstate_t.h>
17#include <__utility/forward.h>
18#include <clocale> // std::lconv
19#include <ctype.h>
20#include <langinfo.h>
21#include <stdio.h>
22#include <stdlib.h>
23#include <string.h>
24#include <time.h>
25#if _LIBCPP_HAS_WIDE_CHARACTERS
26# include <wchar.h>
27# include <wctype.h>
28#endif
29
30#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
31# pragma GCC system_header
32#endif
33
34_LIBCPP_BEGIN_NAMESPACE_STD
35namespace __locale {
36
37struct __locale_guard {
38 __locale_guard(locale_t& __loc) : __old_loc_(::uselocale(__loc)) {}
39
40 ~__locale_guard() {
41 if (__old_loc_)
42 ::uselocale(__old_loc_);
43 }
44
45 locale_t __old_loc_;
46
47 __locale_guard(__locale_guard const&) = delete;
48 __locale_guard& operator=(__locale_guard const&) = delete;
49};
50
51//
52// Locale management
53//
54#define _LIBCPP_COLLATE_MASK LC_COLLATE_MASK
55#define _LIBCPP_CTYPE_MASK LC_CTYPE_MASK
56#define _LIBCPP_MONETARY_MASK LC_MONETARY_MASK
57#define _LIBCPP_NUMERIC_MASK LC_NUMERIC_MASK
58#define _LIBCPP_TIME_MASK LC_TIME_MASK
59#define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
60#define _LIBCPP_ALL_MASK LC_ALL_MASK
61#define _LIBCPP_LC_ALL LC_ALL
62
63using __locale_t _LIBCPP_NODEBUG = ::locale_t;
64#if defined(_LIBCPP_BUILDING_LIBRARY)
65using __lconv_t _LIBCPP_NODEBUG = std::lconv;
66
67inline __locale_t __newlocale(int __category_mask, const char* __locale, __locale_t __base) {
68 return ::newlocale(__category_mask, __locale, __base);
69}
70
71inline void __freelocale(__locale_t __loc) { ::freelocale(__loc); }
72
73inline char* __setlocale(int __category, char const* __locale) { return ::setlocale(__category, __locale); }
74
75inline __lconv_t* __localeconv(__locale_t& __loc) {
76 __locale_guard __current(__loc);
77 return ::localeconv();
78}
79#endif // _LIBCPP_BUILDING_LIBRARY
80
81//
82// Strtonum functions
83//
84inline float __strtof(const char* __nptr, char** __endptr, __locale_t) { return ::strtof(__nptr, __endptr); }
85
86inline double __strtod(const char* __nptr, char** __endptr, __locale_t) { return ::strtod(__nptr, __endptr); }
87
88inline long double __strtold(const char* __nptr, char** __endptr, __locale_t) { return ::strtold(__nptr, __endptr); }
89
90//
91// Character manipulation functions
92//
93#if defined(_LIBCPP_BUILDING_LIBRARY)
94inline int __toupper(int __c, __locale_t __loc) {
95 __locale_guard __current(__loc);
96 return ::toupper(__c);
97}
98
99inline int __tolower(int __c, __locale_t __loc) {
100 __locale_guard __current(__loc);
101 return ::tolower(__c);
102}
103
104inline int __strcoll(const char* __s1, const char* __s2, __locale_t __loc) {
105 __locale_guard __current(__loc);
106 return ::strcoll(__s1, __s2);
107}
108
109inline size_t __strxfrm(char* __dest, const char* __src, size_t __n, __locale_t __loc) {
110 __locale_guard __current(__loc);
111 return ::strxfrm(__dest, __src, __n);
112}
113
114# if _LIBCPP_HAS_WIDE_CHARACTERS
115inline int __iswctype(wint_t __c, wctype_t __type, __locale_t __loc) {
116 __locale_guard __current(__loc);
117 return ::iswctype(__c, __type); }
118
119inline int __iswspace(wint_t __c, __locale_t __loc) {
120 __locale_guard __current(__loc);
121 return ::iswspace(__c); }
122
123inline int __iswprint(wint_t __c, __locale_t __loc) {
124 __locale_guard __current(__loc);
125 return ::iswprint(__c); }
126
127inline int __iswcntrl(wint_t __c, __locale_t __loc) {
128 __locale_guard __current(__loc);
129 return ::iswcntrl(__c); }
130
131inline int __iswupper(wint_t __c, __locale_t __loc) {
132 __locale_guard __current(__loc);
133 return ::iswupper(__c); }
134
135inline int __iswlower(wint_t __c, __locale_t __loc) {
136 __locale_guard __current(__loc);
137 return ::iswlower(__c); }
138
139inline int __iswalpha(wint_t __c, __locale_t __loc) {
140 __locale_guard __current(__loc);
141 return ::iswalpha(__c); }
142
143inline int __iswblank(wint_t __c, __locale_t __loc) {
144 __locale_guard __current(__loc);
145 return ::iswblank(__c); }
146
147inline int __iswdigit(wint_t __c, __locale_t __loc) {
148 __locale_guard __current(__loc);
149 return ::iswdigit(__c); }
150
151inline int __iswpunct(wint_t __c, __locale_t __loc) {
152 __locale_guard __current(__loc);
153 return ::iswpunct(__c); }
154
155inline int __iswxdigit(wint_t __c, __locale_t __loc) {
156 __locale_guard __current(__loc);
157 return ::iswxdigit(__c); }
158
159inline wint_t __towupper(wint_t __c, __locale_t __loc) {
160 __locale_guard __current(__loc);
161 return ::towupper(__c); }
162
163inline wint_t __towlower(wint_t __c, __locale_t __loc) {
164 __locale_guard __current(__loc);
165 return ::towlower(__c); }
166
167inline int __wcscoll(const wchar_t* __ws1, const wchar_t* __ws2, __locale_t __loc) {
168 __locale_guard __current(__loc);
169 return ::wcscoll(__ws1, __ws2);
170}
171
172inline size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __src, size_t __n, __locale_t __loc) {
173 __locale_guard __current(__loc);
174 return ::wcsxfrm(__dest, __src, __n);
175}
176# endif // _LIBCPP_HAS_WIDE_CHARACTERS
177
178inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) {
179 return ::nl_langinfo_l(CODESET, __loc);
180}
181
182inline _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
183 __strftime(char* __s, size_t __max, const char* __format, const struct tm* __tm, __locale_t __loc) {
184 __locale_guard __current(__loc);
185 return ::strftime(__s, __max, __format, __tm);
186}
187
188//
189// Other functions
190//
191inline decltype(MB_CUR_MAX) __mb_len_max(__locale_t __loc) {
192 __locale_guard __current(__loc);
193 return MB_CUR_MAX;
194}
195
196# if _LIBCPP_HAS_WIDE_CHARACTERS
197inline wint_t __btowc(int __c, __locale_t __loc) {
198 __locale_guard __current(__loc);
199 return btowc(__c);
200}
201
202inline int __wctob(wint_t __c, __locale_t __loc) {
203 __locale_guard __current(__loc);
204 return wctob(__c);
205}
206
207inline size_t
208__wcsnrtombs(char* __dest, const wchar_t** __src, size_t __nwc, size_t __len, mbstate_t* __ps, __locale_t __loc) {
209 __locale_guard __current(__loc);
210 return wcsnrtombs(__dest, __src, __nwc, __len, __ps); // wcsnrtombs is a POSIX extension
211}
212
213inline size_t __wcrtomb(char* __s, wchar_t __wc, mbstate_t* __ps, __locale_t __loc) {
214 __locale_guard __current(__loc);
215 return wcrtomb(__s, __wc, __ps);
216}
217
218inline size_t
219__mbsnrtowcs(wchar_t* __dest, const char** __src, size_t __nms, size_t __len, mbstate_t* __ps, __locale_t __loc) {
220 __locale_guard __current(__loc);
221 return mbsnrtowcs(__dest, __src, __nms, __len, __ps); // mbsnrtowcs is a POSIX extension
222}
223
224inline size_t __mbrtowc(wchar_t* __pwc, const char* __s, size_t __n, mbstate_t* __ps, __locale_t __loc) {
225 __locale_guard __current(__loc);
226 return mbrtowc(__pwc, __s, __n, __ps);
227}
228
229inline int __mbtowc(wchar_t* __pwc, const char* __pmb, size_t __max, __locale_t __loc) {
230 __locale_guard __current(__loc);
231 return mbtowc(__pwc, __pmb, __max);
232}
233
234inline size_t __mbrlen(const char* __s, size_t __n, mbstate_t* __ps, __locale_t __loc) {
235 __locale_guard __current(__loc);
236 return mbrlen(__s, __n, __ps);
237}
238
239inline size_t __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps, __locale_t __loc) {
240 __locale_guard __current(__loc);
241 return mbsrtowcs(__dest, __src, __len, __ps);
242}
243# endif // _LIBCPP_HAS_WIDE_CHARACTERS
244#endif // _LIBCPP_BUILDING_LIBRARY
245
246_LIBCPP_DIAGNOSTIC_PUSH
247_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
248_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") // GCC doesn't support [[gnu::format]] on variadic templates
249#ifdef _LIBCPP_COMPILER_CLANG_BASED
250# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) _LIBCPP_ATTRIBUTE_FORMAT(__VA_ARGS__)
251#else
252# define _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(...) /* nothing */
253#endif
254
255template <class... _Args>
256_LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 4, 5)
257int __snprintf(char* __s, size_t __n, __locale_t __loc, const char* __format, _Args&&... __args) {
258 __locale_guard __current(__loc);
259 return ::snprintf(__s, __n, __format, std::forward<_Args>(__args)...);
260}
261
262template <class... _Args>
263_LIBCPP_VARIADIC_ATTRIBUTE_FORMAT(__printf__, 3, 4)
264int __asprintf(char** __s, __locale_t __loc, const char* __format, _Args&&... __args) {
265 __locale_guard __current(__loc);
266 return ::asprintf(__s, __format, std::forward<_Args>(__args)...); // non-standard
267}
268_LIBCPP_DIAGNOSTIC_POP
269#undef _LIBCPP_VARIADIC_ATTRIBUTE_FORMAT
270
271} // namespace __locale
272_LIBCPP_END_NAMESPACE_STD
273
274#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_SERENITY_H
lib/libcxx/include/__locale_dir/support/windows.h+7-3
...@@ -27,6 +27,7 @@...@@ -27,6 +27,7 @@
27#endif27#endif
2828
29_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
30_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
30namespace __locale {31namespace __locale {
3132
32using __lconv_t _LIBCPP_NODEBUG = std::lconv;33using __lconv_t _LIBCPP_NODEBUG = std::lconv;
...@@ -163,6 +164,7 @@ inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, const char* __loc...@@ -163,6 +164,7 @@ inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, const char* __loc
163 return __new_locale;164 return __new_locale;
164}165}
165_LIBCPP_EXPORTED_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc);166_LIBCPP_EXPORTED_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc);
167_LIBCPP_EXPORTED_FROM_ABI const char* __get_locale_encoding(__locale_t __loc);
166#endif // _LIBCPP_BUILDING_LIBRARY168#endif // _LIBCPP_BUILDING_LIBRARY
167169
168//170//
...@@ -230,10 +232,11 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __...@@ -230,10 +232,11 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __wcsxfrm(wchar_t* __dest, const wchar_t* __
230# endif // _LIBCPP_HAS_WIDE_CHARACTERS232# endif // _LIBCPP_HAS_WIDE_CHARACTERS
231233
232# if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800234# if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800
233_LIBCPP_EXPORTED_FROM_ABI size_t __strftime(char*, size_t, const char*, const struct tm*, __locale_t);235_LIBCPP_EXPORTED_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
236 __strftime(char*, size_t, const char*, const struct tm*, __locale_t);
234# else237# else
235inline _LIBCPP_HIDE_FROM_ABI size_t238inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_ATTRIBUTE_FORMAT(__strftime__, 3, 0) size_t
236__strftime(char* __ret, size_t __n, const char* __format, const struct tm* __tm, __locale_t __loc) {239 __strftime(char* __ret, size_t __n, const char* __format, const struct tm* __tm, __locale_t __loc) {
237 return ::_strftime_l(__ret, __n, __format, __tm, __loc);240 return ::_strftime_l(__ret, __n, __format, __tm, __loc);
238}241}
239# endif242# endif
...@@ -303,6 +306,7 @@ struct __locale_guard {...@@ -303,6 +306,7 @@ struct __locale_guard {
303#endif // _LIBCPP_BUILDING_LIBRARY306#endif // _LIBCPP_BUILDING_LIBRARY
304307
305} // namespace __locale308} // namespace __locale
309_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
306_LIBCPP_END_NAMESPACE_STD310_LIBCPP_END_NAMESPACE_STD
307311
308#endif // _LIBCPP___LOCALE_DIR_SUPPORT_WINDOWS_H312#endif // _LIBCPP___LOCALE_DIR_SUPPORT_WINDOWS_H
lib/libcxx/include/__locale_dir/time.h+2
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22# endif22# endif
2323
24_LIBCPP_BEGIN_NAMESPACE_STD24_LIBCPP_BEGIN_NAMESPACE_STD
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2526
26template <class _CharT, class _InputIterator>27template <class _CharT, class _InputIterator>
27_LIBCPP_HIDE_FROM_ABI int __get_up_to_n_digits(28_LIBCPP_HIDE_FROM_ABI int __get_up_to_n_digits(
...@@ -755,6 +756,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>;...@@ -755,6 +756,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>;
755extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>;756extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>;
756# endif757# endif
757758
759_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
758_LIBCPP_END_NAMESPACE_STD760_LIBCPP_END_NAMESPACE_STD
759761
760#endif // _LIBCPP_HAS_LOCALIZATION762#endif // _LIBCPP_HAS_LOCALIZATION
lib/libcxx/include/__locale_dir/wbuffer_convert.h+4-2
...@@ -27,6 +27,7 @@ _LIBCPP_PUSH_MACROS...@@ -27,6 +27,7 @@ _LIBCPP_PUSH_MACROS
27# include <__undef_macros>27# include <__undef_macros>
2828
29_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
30_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3031
31template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >32template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
32class _LIBCPP_DEPRECATED_IN_CXX17 wbuffer_convert : public basic_streambuf<_Elem, _Tr> {33class _LIBCPP_DEPRECATED_IN_CXX17 wbuffer_convert : public basic_streambuf<_Elem, _Tr> {
...@@ -67,7 +68,7 @@ public:...@@ -67,7 +68,7 @@ public:
6768
68 _LIBCPP_HIDE_FROM_ABI ~wbuffer_convert();69 _LIBCPP_HIDE_FROM_ABI ~wbuffer_convert();
6970
70 _LIBCPP_HIDE_FROM_ABI streambuf* rdbuf() const { return __bufptr_; }71 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI streambuf* rdbuf() const { return __bufptr_; }
71 _LIBCPP_HIDE_FROM_ABI streambuf* rdbuf(streambuf* __bytebuf) {72 _LIBCPP_HIDE_FROM_ABI streambuf* rdbuf(streambuf* __bytebuf) {
72 streambuf* __r = __bufptr_;73 streambuf* __r = __bufptr_;
73 __bufptr_ = __bytebuf;74 __bufptr_ = __bytebuf;
...@@ -77,7 +78,7 @@ public:...@@ -77,7 +78,7 @@ public:
77 wbuffer_convert(const wbuffer_convert&) = delete;78 wbuffer_convert(const wbuffer_convert&) = delete;
78 wbuffer_convert& operator=(const wbuffer_convert&) = delete;79 wbuffer_convert& operator=(const wbuffer_convert&) = delete;
7980
80 _LIBCPP_HIDE_FROM_ABI state_type state() const { return __st_; }81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI state_type state() const { return __st_; }
8182
82protected:83protected:
83 _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type underflow();84 _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type underflow();
...@@ -419,6 +420,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>* wbuffer_convert<_Codecvt, _Elem, _Tr>::__...@@ -419,6 +420,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>* wbuffer_convert<_Codecvt, _Elem, _Tr>::__
419420
420_LIBCPP_SUPPRESS_DEPRECATED_POP421_LIBCPP_SUPPRESS_DEPRECATED_POP
421422
423_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
422_LIBCPP_END_NAMESPACE_STD424_LIBCPP_END_NAMESPACE_STD
423425
424_LIBCPP_POP_MACROS426_LIBCPP_POP_MACROS
lib/libcxx/include/__locale_dir/wstring_convert.h+14-10
...@@ -64,28 +64,30 @@ public:...@@ -64,28 +64,30 @@ public:
64 wstring_convert(const wstring_convert& __wc) = delete;64 wstring_convert(const wstring_convert& __wc) = delete;
65 wstring_convert& operator=(const wstring_convert& __wc) = delete;65 wstring_convert& operator=(const wstring_convert& __wc) = delete;
6666
67 _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(char __byte) { return from_bytes(&__byte, &__byte + 1); }67 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(char __byte) {
68 _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __ptr) {68 return from_bytes(&__byte, &__byte + 1);
69 }
70 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __ptr) {
69 return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr));71 return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr));
70 }72 }
71 _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const byte_string& __str) {73 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const byte_string& __str) {
72 return from_bytes(__str.data(), __str.data() + __str.size());74 return from_bytes(__str.data(), __str.data() + __str.size());
73 }75 }
74 _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __first, const char* __last);76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __first, const char* __last);
7577
76 _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(_Elem __wchar) {78 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(_Elem __wchar) {
77 return to_bytes(std::addressof(__wchar), std::addressof(__wchar) + 1);79 return to_bytes(std::addressof(__wchar), std::addressof(__wchar) + 1);
78 }80 }
79 _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __wptr) {81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __wptr) {
80 return to_bytes(__wptr, __wptr + char_traits<_Elem>::length(__wptr));82 return to_bytes(__wptr, __wptr + char_traits<_Elem>::length(__wptr));
81 }83 }
82 _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const wide_string& __wstr) {84 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const wide_string& __wstr) {
83 return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());85 return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());
84 }86 }
85 _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __first, const _Elem* __last);87 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __first, const _Elem* __last);
8688
87 _LIBCPP_HIDE_FROM_ABI size_t converted() const _NOEXCEPT { return __cvtcount_; }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t converted() const _NOEXCEPT { return __cvtcount_; }
88 _LIBCPP_HIDE_FROM_ABI state_type state() const { return __cvtstate_; }90 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI state_type state() const { return __cvtstate_; }
89};91};
9092
91_LIBCPP_SUPPRESS_DEPRECATED_PUSH93_LIBCPP_SUPPRESS_DEPRECATED_PUSH
...@@ -174,9 +176,11 @@ wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::from_bytes(const char*...@@ -174,9 +176,11 @@ wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::from_bytes(const char*
174 return __wide_err_string_;176 return __wide_err_string_;
175}177}
176178
179_LIBCPP_SUPPRESS_DEPRECATED_PUSH
177template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>180template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc>
178typename wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::byte_string181typename wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::byte_string
179wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::to_bytes(const _Elem* __frm, const _Elem* __frm_end) {182wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::to_bytes(const _Elem* __frm, const _Elem* __frm_end) {
183 _LIBCPP_SUPPRESS_DEPRECATED_POP
180 __cvtcount_ = 0;184 __cvtcount_ = 0;
181 if (__cvtptr_ != nullptr) {185 if (__cvtptr_ != nullptr) {
182 byte_string __bs(2 * (__frm_end - __frm), char());186 byte_string __bs(2 * (__frm_end - __frm), char());
lib/libcxx/include/__log_hardening_failure+2
...@@ -24,7 +24,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -24,7 +24,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2424
25// This function should never be called directly from the code -- it should only be called through the25// This function should never be called directly from the code -- it should only be called through the
26// `_LIBCPP_LOG_HARDENING_FAILURE` macro.26// `_LIBCPP_LOG_HARDENING_FAILURE` macro.
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
27[[__gnu__::__cold__]] _LIBCPP_EXPORTED_FROM_ABI void __log_hardening_failure(const char* __message) noexcept;28[[__gnu__::__cold__]] _LIBCPP_EXPORTED_FROM_ABI void __log_hardening_failure(const char* __message) noexcept;
29_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
2830
29// _LIBCPP_LOG_HARDENING_FAILURE(message)31// _LIBCPP_LOG_HARDENING_FAILURE(message)
30//32//
lib/libcxx/include/__math/abs.h+13
...@@ -63,6 +63,19 @@ template <class = int>...@@ -63,6 +63,19 @@ template <class = int>
63 return __builtin_llabs(__x);63 return __builtin_llabs(__x);
64}64}
6565
66#if _LIBCPP_HAS_INT128
67[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI inline __int128_t abs(__int128_t __x) _NOEXCEPT { return __x < 0 ? -__x : __x; }
68#endif
69
70#if defined(__BITINT_MAXWIDTH__)
71// _BitInt does not integer-promote, so without a same-type overload a narrow
72// signed _BitInt would be an ambiguous call against abs(int/long/long long).
73template <int _Np>
74[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _BitInt(_Np) abs(_BitInt(_Np) __x) _NOEXCEPT {
75 return __x < 0 ? -__x : __x;
76}
77#endif
78
66} // namespace __math79} // namespace __math
6780
68_LIBCPP_END_NAMESPACE_STD81_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__math/gamma.h+28
...@@ -55,6 +55,34 @@ inline _LIBCPP_HIDE_FROM_ABI double tgamma(_A1 __x) _NOEXCEPT {...@@ -55,6 +55,34 @@ inline _LIBCPP_HIDE_FROM_ABI double tgamma(_A1 __x) _NOEXCEPT {
55 return __builtin_tgamma((double)__x);55 return __builtin_tgamma((double)__x);
56}56}
5757
58// __lgamma_r
59//
60// POSIX systems provide a function named lgamma_r which is a reentrant version of lgamma. Use that
61// whenever possible. However, we avoid re-declaring the actual function since different platforms
62// declare it differently in the first place: instead use `asm` to get the compiler to call the right
63// function.
64
65#if defined(_LIBCPP_MSVCRT_LIKE) // reentrant version is not available on Windows
66
67inline _LIBCPP_HIDE_FROM_ABI double __lgamma_r(double __d) _NOEXCEPT { return __builtin_lgamma(__d); }
68
69#else
70
71_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
72# if defined(_LIBCPP_OBJECT_FORMAT_MACHO)
73double __lgamma_r_shim(double, int*) _NOEXCEPT __asm__("_lgamma_r");
74# else
75double __lgamma_r_shim(double, int*) _NOEXCEPT __asm__("lgamma_r");
76# endif
77_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
78
79inline _LIBCPP_HIDE_FROM_ABI double __lgamma_r(double __d) _NOEXCEPT {
80 int __sign;
81 return __math::__lgamma_r_shim(__d, &__sign);
82}
83
84#endif
85
58} // namespace __math86} // namespace __math
5987
60_LIBCPP_END_NAMESPACE_STD88_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__math/special_functions.h+5-5
...@@ -21,10 +21,10 @@...@@ -21,10 +21,10 @@
21# pragma GCC system_header21# pragma GCC system_header
22#endif22#endif
2323
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26#if _LIBCPP_STD_VER >= 1724#if _LIBCPP_STD_VER >= 17
2725
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28template <class _Real>28template <class _Real>
29_LIBCPP_HIDE_FROM_ABI _Real __hermite(unsigned __n, _Real __x) {29_LIBCPP_HIDE_FROM_ABI _Real __hermite(unsigned __n, _Real __x) {
30 // The Hermite polynomial H_n(x).30 // The Hermite polynomial H_n(x).
...@@ -49,7 +49,7 @@ _LIBCPP_HIDE_FROM_ABI _Real __hermite(unsigned __n, _Real __x) {...@@ -49,7 +49,7 @@ _LIBCPP_HIDE_FROM_ABI _Real __hermite(unsigned __n, _Real __x) {
49 }49 }
5050
51 if (!__math::isfinite(__H_n)) {51 if (!__math::isfinite(__H_n)) {
52 // Overflow occured. Two possible cases:52 // Overflow occurred. Two possible cases:
53 // n is odd: return infinity of the same sign as x.53 // n is odd: return infinity of the same sign as x.
54 // n is even: return +Inf54 // n is even: return +Inf
55 _Real __inf = std::numeric_limits<_Real>::infinity();55 _Real __inf = std::numeric_limits<_Real>::infinity();
...@@ -77,8 +77,8 @@ _LIBCPP_HIDE_FROM_ABI double hermite(unsigned __n, _Integer __x) {...@@ -77,8 +77,8 @@ _LIBCPP_HIDE_FROM_ABI double hermite(unsigned __n, _Integer __x) {
77 return std::hermite(__n, static_cast<double>(__x));77 return std::hermite(__n, static_cast<double>(__x));
78}78}
7979
80#endif // _LIBCPP_STD_VER >= 17
81
82_LIBCPP_END_NAMESPACE_STD80_LIBCPP_END_NAMESPACE_STD
8381
82#endif // _LIBCPP_STD_VER >= 17
83
84#endif // _LIBCPP___MATH_SPECIAL_FUNCTIONS_H84#endif // _LIBCPP___MATH_SPECIAL_FUNCTIONS_H
lib/libcxx/include/__mbstate_t.h+4
...@@ -39,10 +39,14 @@...@@ -39,10 +39,14 @@
39# define __NEED_mbstate_t39# define __NEED_mbstate_t
40# include <bits/alltypes.h>40# include <bits/alltypes.h>
41# undef __NEED_mbstate_t41# undef __NEED_mbstate_t
42#elif _LIBCPP_LIBC_LLVM_LIBC
43# include <llvm-libc-types/mbstate_t.h>
42#elif __has_include(<bits/types/mbstate_t.h>)44#elif __has_include(<bits/types/mbstate_t.h>)
43# include <bits/types/mbstate_t.h> // works on most Unixes45# include <bits/types/mbstate_t.h> // works on most Unixes
44#elif __has_include(<sys/_types/_mbstate_t.h>)46#elif __has_include(<sys/_types/_mbstate_t.h>)
45# include <sys/_types/_mbstate_t.h> // works on Darwin47# include <sys/_types/_mbstate_t.h> // works on Darwin
48#elif __has_include(<bits/mbstate_t.h>)
49# include <bits/mbstate_t.h> // works for Android
46#elif __has_include_next(<wchar.h>)50#elif __has_include_next(<wchar.h>)
47# include_next <wchar.h> // use the C standard provider of mbstate_t if present51# include_next <wchar.h> // use the C standard provider of mbstate_t if present
48#elif __has_include_next(<uchar.h>)52#elif __has_include_next(<uchar.h>)
lib/libcxx/include/__mdspan/aligned_accessor.h+4-4
...@@ -33,10 +33,10 @@...@@ -33,10 +33,10 @@
33_LIBCPP_PUSH_MACROS33_LIBCPP_PUSH_MACROS
34#include <__undef_macros>34#include <__undef_macros>
3535
36_LIBCPP_BEGIN_NAMESPACE_STD
37
38#if _LIBCPP_STD_VER >= 2636#if _LIBCPP_STD_VER >= 26
3937
38_LIBCPP_BEGIN_NAMESPACE_STD
39
40template <class _ElementType, size_t _ByteAlignment>40template <class _ElementType, size_t _ByteAlignment>
41struct aligned_accessor {41struct aligned_accessor {
42 static_assert(_ByteAlignment != 0 && (_ByteAlignment & (_ByteAlignment - 1)) == 0,42 static_assert(_ByteAlignment != 0 && (_ByteAlignment & (_ByteAlignment - 1)) == 0,
...@@ -78,10 +78,10 @@ struct aligned_accessor {...@@ -78,10 +78,10 @@ struct aligned_accessor {
78 }78 }
79};79};
8080
81#endif // _LIBCPP_STD_VER >= 26
82
83_LIBCPP_END_NAMESPACE_STD81_LIBCPP_END_NAMESPACE_STD
8482
83#endif // _LIBCPP_STD_VER >= 26
84
85_LIBCPP_POP_MACROS85_LIBCPP_POP_MACROS
8686
87#endif // _LIBCPP___MDSPAN_ALIGNED_ACCESSOR_H87#endif // _LIBCPP___MDSPAN_ALIGNED_ACCESSOR_H
lib/libcxx/include/__mdspan/extents.h+76-81
...@@ -21,12 +21,16 @@...@@ -21,12 +21,16 @@
21#include <__config>21#include <__config>
2222
23#include <__concepts/arithmetic.h>23#include <__concepts/arithmetic.h>
24#include <__concepts/same_as.h>
24#include <__type_traits/common_type.h>25#include <__type_traits/common_type.h>
25#include <__type_traits/integer_traits.h>26#include <__type_traits/integer_traits.h>
26#include <__type_traits/is_convertible.h>27#include <__type_traits/is_convertible.h>
27#include <__type_traits/is_nothrow_constructible.h>28#include <__type_traits/is_nothrow_constructible.h>
28#include <__type_traits/is_signed.h>29#include <__type_traits/is_signed.h>
29#include <__type_traits/make_unsigned.h>30#include <__type_traits/make_unsigned.h>
31#include <__type_traits/remove_cvref.h>
32#include <__utility/as_const.h>
33#include <__utility/forward.h>
30#include <__utility/integer_sequence.h>34#include <__utility/integer_sequence.h>
31#include <__utility/unreachable.h>35#include <__utility/unreachable.h>
32#include <array>36#include <array>
...@@ -46,25 +50,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -46,25 +50,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
46#if _LIBCPP_STD_VER >= 2350#if _LIBCPP_STD_VER >= 23
4751
48namespace __mdspan_detail {52namespace __mdspan_detail {
49
50// ------------------------------------------------------------------
51// ------------ __static_array --------------------------------------
52// ------------------------------------------------------------------
53// array like class which provides an array of static values with get
54template <class _Tp, _Tp... _Values>
55struct __static_array {
56 static constexpr array<_Tp, sizeof...(_Values)> __array = {_Values...};
57
58public:
59 _LIBCPP_HIDE_FROM_ABI static constexpr size_t __size() { return sizeof...(_Values); }
60 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp __get(size_t __index) noexcept { return __array[__index]; }
61
62 template <size_t _Index>
63 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp __get() {
64 return __get(_Index);
65 }
66};
67
68// ------------------------------------------------------------------53// ------------------------------------------------------------------
69// ------------ __possibly_empty_array -----------------------------54// ------------ __possibly_empty_array -----------------------------
70// ------------------------------------------------------------------55// ------------------------------------------------------------------
...@@ -117,35 +102,28 @@ struct __static_partial_sums {...@@ -117,35 +102,28 @@ struct __static_partial_sums {
117// array like class which has a mix of static and runtime values but102// array like class which has a mix of static and runtime values but
118// only stores the runtime values.103// only stores the runtime values.
119// The type of the static and the runtime values can be different.104// The type of the static and the runtime values can be different.
120// The position of a dynamic value is indicated through a tag value.105// The position of a dynamic value is indicated by dynamic_extent.
121template <class _TDynamic, class _TStatic, _TStatic _DynTag, _TStatic... _Values>106template <class _TDynamic, class _TStatic, _TStatic... _Values>
122struct __maybe_static_array {107struct __maybe_static_array {
123 static_assert(is_convertible<_TStatic, _TDynamic>::value,108 static_assert(is_convertible_v<_TStatic, _TDynamic>,
124 "__maybe_static_array: _TStatic must be convertible to _TDynamic");109 "__maybe_static_array: _TStatic must be convertible to _TDynamic");
125 static_assert(is_convertible<_TDynamic, _TStatic>::value,110 static_assert(is_convertible_v<_TDynamic, _TStatic>,
126 "__maybe_static_array: _TDynamic must be convertible to _TStatic");111 "__maybe_static_array: _TDynamic must be convertible to _TStatic");
127112
128private:113private:
129 // Static values member114 // Static values member
130 static constexpr size_t __size_ = sizeof...(_Values);115 static constexpr size_t __size_ = sizeof...(_Values);
131 static constexpr size_t __size_dynamic_ = ((_Values == _DynTag) + ... + 0);116 static constexpr size_t __size_dynamic_ = ((_Values == dynamic_extent) + ... + 0);
132 using _StaticValues _LIBCPP_NODEBUG = __static_array<_TStatic, _Values...>;
133 using _DynamicValues _LIBCPP_NODEBUG = __possibly_empty_array<_TDynamic, __size_dynamic_>;117 using _DynamicValues _LIBCPP_NODEBUG = __possibly_empty_array<_TDynamic, __size_dynamic_>;
134118
135 // Dynamic values member119 static constexpr array<_TStatic, sizeof...(_Values)> __static_values_ = {_Values...};
136 _LIBCPP_NO_UNIQUE_ADDRESS _DynamicValues __dyn_vals_;120 _LIBCPP_NO_UNIQUE_ADDRESS _DynamicValues __dyn_vals_;
137121
138 // static mapping of indices to the position in the dynamic values array122 // static mapping of indices to the position in the dynamic values array
139 using _DynamicIdxMap _LIBCPP_NODEBUG = __static_partial_sums<static_cast<size_t>(_Values == _DynTag)...>;123 using _DynamicIdxMap _LIBCPP_NODEBUG = __static_partial_sums<static_cast<size_t>(_Values == dynamic_extent)...>;
140
141 template <size_t... _Indices>
142 _LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<_Indices...>) noexcept {
143 return _DynamicValues{((void)_Indices, 0)...};
144 }
145124
146public:125public:
147 _LIBCPP_HIDE_FROM_ABI constexpr __maybe_static_array() noexcept126 _LIBCPP_HIDE_FROM_ABI constexpr __maybe_static_array() noexcept : __dyn_vals_{} {}
148 : __dyn_vals_{__zeros(make_index_sequence<__size_dynamic_>())} {}
149127
150 // constructors from dynamic values only -- this covers the case for rank() == 0128 // constructors from dynamic values only -- this covers the case for rank() == 0
151 template <class... _DynVals>129 template <class... _DynVals>
...@@ -169,8 +147,8 @@ public:...@@ -169,8 +147,8 @@ public:
169 static_assert(sizeof...(_DynVals) == __size_, "Invalid number of values.");147 static_assert(sizeof...(_DynVals) == __size_, "Invalid number of values.");
170 _TDynamic __values[__size_] = {static_cast<_TDynamic>(__vals)...};148 _TDynamic __values[__size_] = {static_cast<_TDynamic>(__vals)...};
171 for (size_t __i = 0; __i < __size_; __i++) {149 for (size_t __i = 0; __i < __size_; __i++) {
172 _TStatic __static_val = _StaticValues::__get(__i);150 _TStatic __static_val = __static_values_[__i];
173 if (__static_val == _DynTag) {151 if (__static_val == dynamic_extent) {
174 __dyn_vals_[_DynamicIdxMap::__get(__i)] = __values[__i];152 __dyn_vals_[_DynamicIdxMap::__get(__i)] = __values[__i];
175 } else153 } else
176 // Not catching this could lead to out of bounds errors later154 // Not catching this could lead to out of bounds errors later
...@@ -188,8 +166,8 @@ public:...@@ -188,8 +166,8 @@ public:
188 _LIBCPP_HIDE_FROM_ABI constexpr __maybe_static_array(const span<_Tp, _Size>& __vals) {166 _LIBCPP_HIDE_FROM_ABI constexpr __maybe_static_array(const span<_Tp, _Size>& __vals) {
189 static_assert(_Size == __size_ || __size_ == dynamic_extent);167 static_assert(_Size == __size_ || __size_ == dynamic_extent);
190 for (size_t __i = 0; __i < __size_; __i++) {168 for (size_t __i = 0; __i < __size_; __i++) {
191 _TStatic __static_val = _StaticValues::__get(__i);169 _TStatic __static_val = __static_values_[__i];
192 if (__static_val == _DynTag) {170 if (__static_val == dynamic_extent) {
193 __dyn_vals_[_DynamicIdxMap::__get(__i)] = static_cast<_TDynamic>(__vals[__i]);171 __dyn_vals_[_DynamicIdxMap::__get(__i)] = static_cast<_TDynamic>(__vals[__i]);
194 } else172 } else
195 // Not catching this could lead to out of bounds errors later173 // Not catching this could lead to out of bounds errors later
...@@ -205,13 +183,15 @@ public:...@@ -205,13 +183,15 @@ public:
205 // access functions183 // access functions
206 _LIBCPP_HIDE_FROM_ABI static constexpr _TStatic __static_value(size_t __i) noexcept {184 _LIBCPP_HIDE_FROM_ABI static constexpr _TStatic __static_value(size_t __i) noexcept {
207 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < __size_, "extents access: index must be less than rank");185 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < __size_, "extents access: index must be less than rank");
208 return _StaticValues::__get(__i);186 return __static_values_[__i];
209 }187 }
210188
211 _LIBCPP_HIDE_FROM_ABI constexpr _TDynamic __value(size_t __i) const {189 _LIBCPP_HIDE_FROM_ABI constexpr _TDynamic __value(size_t __i) const {
212 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < __size_, "extents access: index must be less than rank");190 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < __size_, "extents access: index must be less than rank");
213 _TStatic __static_val = _StaticValues::__get(__i);191 _TStatic __static_val = __static_values_[__i];
214 return __static_val == _DynTag ? __dyn_vals_[_DynamicIdxMap::__get(__i)] : static_cast<_TDynamic>(__static_val);192 return __static_val == dynamic_extent
193 ? __dyn_vals_[_DynamicIdxMap::__get(__i)]
194 : static_cast<_TDynamic>(__static_val);
215 }195 }
216 _LIBCPP_HIDE_FROM_ABI constexpr _TDynamic operator[](size_t __i) const {196 _LIBCPP_HIDE_FROM_ABI constexpr _TDynamic operator[](size_t __i) const {
217 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < __size_, "extents access: index must be less than rank");197 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < __size_, "extents access: index must be less than rank");
...@@ -252,19 +232,6 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __is_representable_as(_From __value) {...@@ -252,19 +232,6 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __is_representable_as(_From __value) {
252 return true;232 return true;
253}233}
254234
255template <integral _To, class... _From>
256_LIBCPP_HIDE_FROM_ABI constexpr bool __are_representable_as(_From... __values) {
257 return (__mdspan_detail::__is_representable_as<_To>(__values) && ... && true);
258}
259
260template <integral _To, class _From, size_t _Size>
261_LIBCPP_HIDE_FROM_ABI constexpr bool __are_representable_as(span<_From, _Size> __values) {
262 for (size_t __i = 0; __i < _Size; __i++)
263 if (!__mdspan_detail::__is_representable_as<_To>(__values[__i]))
264 return false;
265 return true;
266}
267
268} // namespace __mdspan_detail235} // namespace __mdspan_detail
269236
270// ------------------------------------------------------------------237// ------------------------------------------------------------------
...@@ -293,10 +260,45 @@ private:...@@ -293,10 +260,45 @@ private:
293 static constexpr rank_type __rank_dynamic_ = ((_Extents == dynamic_extent) + ... + 0);260 static constexpr rank_type __rank_dynamic_ = ((_Extents == dynamic_extent) + ... + 0);
294261
295 // internal storage type using __maybe_static_array262 // internal storage type using __maybe_static_array
296 using _Values _LIBCPP_NODEBUG =263 using _Values _LIBCPP_NODEBUG = __mdspan_detail::__maybe_static_array<_IndexType, size_t, _Extents...>;
297 __mdspan_detail::__maybe_static_array<_IndexType, size_t, dynamic_extent, _Extents...>;
298 [[no_unique_address]] _Values __vals_;264 [[no_unique_address]] _Values __vals_;
299265
266 template <class _OtherIndexType>
267 _LIBCPP_HIDE_FROM_ABI static constexpr index_type __checked_index_cast(_OtherIndexType&& __value) noexcept {
268 using _OtherType = remove_cvref_t<_OtherIndexType>;
269 if constexpr (integral<_OtherType> && !same_as<_OtherType, bool>) {
270 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
271 __mdspan_detail::__is_representable_as<index_type>(__value),
272 "extents ctor: arguments must be representable as index_type and nonnegative");
273 return static_cast<index_type>(__value);
274 } else {
275 auto __converted_val = static_cast<index_type>(std::forward<_OtherIndexType>(__value));
276 if constexpr (is_signed_v<index_type>) {
277 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
278 __converted_val >= 0, "extents ctor: arguments must be representable as index_type and nonnegative");
279 }
280 return __converted_val;
281 }
282 }
283
284 template <class... _OtherIndexTypes>
285 _LIBCPP_HIDE_FROM_ABI static constexpr _Values
286 __representability_checked_cast(_OtherIndexTypes&&... __values) noexcept {
287 return _Values{__checked_index_cast(std::forward<_OtherIndexTypes>(__values))...};
288 }
289
290 template <class _OtherIndexType, size_t _Size, size_t... _Idxs>
291 _LIBCPP_HIDE_FROM_ABI static constexpr _Values
292 __representability_checked_cast(const array<_OtherIndexType, _Size>& __exts, index_sequence<_Idxs...>) noexcept {
293 return __representability_checked_cast(__exts[_Idxs]...);
294 }
295
296 template <class _OtherIndexType, size_t _Size, size_t... _Idxs>
297 _LIBCPP_HIDE_FROM_ABI static constexpr _Values
298 __representability_checked_cast(const span<_OtherIndexType, _Size>& __exts, index_sequence<_Idxs...>) noexcept {
299 return __representability_checked_cast(std::as_const(__exts[_Idxs])...);
300 }
301
300public:302public:
301 // [mdspan.extents.obs], observers of multidimensional index space303 // [mdspan.extents.obs], observers of multidimensional index space
302 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return __rank_; }304 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return __rank_; }
...@@ -319,12 +321,9 @@ public:...@@ -319,12 +321,9 @@ public:
319 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&321 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&
320 (sizeof...(_OtherIndexTypes) == __rank_ || sizeof...(_OtherIndexTypes) == __rank_dynamic_))322 (sizeof...(_OtherIndexTypes) == __rank_ || sizeof...(_OtherIndexTypes) == __rank_dynamic_))
321 _LIBCPP_HIDE_FROM_ABI constexpr explicit extents(_OtherIndexTypes... __dynvals) noexcept323 _LIBCPP_HIDE_FROM_ABI constexpr explicit extents(_OtherIndexTypes... __dynvals) noexcept
322 : __vals_(static_cast<index_type>(__dynvals)...) {324 // Not catching this could lead to out of bounds errors later
323 // Not catching this could lead to out of bounds errors later325 // e.g. mdspan m(ptr, dextents<char, 1>(200u)); leads to an extent of -56 on m
324 // e.g. mdspan m(ptr, dextents<char, 1>(200u)); leads to an extent of -56 on m326 : __vals_(__representability_checked_cast(std::move(__dynvals)...)) {}
325 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__are_representable_as<index_type>(__dynvals...),
326 "extents ctor: arguments must be representable as index_type and nonnegative");
327 }
328327
329 template <class _OtherIndexType, size_t _Size>328 template <class _OtherIndexType, size_t _Size>
330 requires(is_convertible_v<const _OtherIndexType&, index_type> &&329 requires(is_convertible_v<const _OtherIndexType&, index_type> &&
...@@ -332,12 +331,9 @@ public:...@@ -332,12 +331,9 @@ public:
332 (_Size == __rank_ || _Size == __rank_dynamic_))331 (_Size == __rank_ || _Size == __rank_dynamic_))
333 explicit(_Size != __rank_dynamic_)332 explicit(_Size != __rank_dynamic_)
334 _LIBCPP_HIDE_FROM_ABI constexpr extents(const array<_OtherIndexType, _Size>& __exts) noexcept333 _LIBCPP_HIDE_FROM_ABI constexpr extents(const array<_OtherIndexType, _Size>& __exts) noexcept
335 : __vals_(span(__exts)) {334 // Not catching this could lead to out of bounds errors later
336 // Not catching this could lead to out of bounds errors later335 // e.g. mdspan m(ptr, dextents<char, 1>(200u)); leads to an extent of -56 on m
337 // e.g. mdspan m(ptr, dextents<char, 1>(array<unsigned,1>(200))); leads to an extent of -56 on m336 : __vals_(__representability_checked_cast(__exts, make_index_sequence<_Size>())) {}
338 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__are_representable_as<index_type>(span(__exts)),
339 "extents ctor: arguments must be representable as index_type and nonnegative");
340 }
341337
342 template <class _OtherIndexType, size_t _Size>338 template <class _OtherIndexType, size_t _Size>
343 requires(is_convertible_v<const _OtherIndexType&, index_type> &&339 requires(is_convertible_v<const _OtherIndexType&, index_type> &&
...@@ -345,13 +341,9 @@ public:...@@ -345,13 +341,9 @@ public:
345 (_Size == __rank_ || _Size == __rank_dynamic_))341 (_Size == __rank_ || _Size == __rank_dynamic_))
346 explicit(_Size != __rank_dynamic_)342 explicit(_Size != __rank_dynamic_)
347 _LIBCPP_HIDE_FROM_ABI constexpr extents(const span<_OtherIndexType, _Size>& __exts) noexcept343 _LIBCPP_HIDE_FROM_ABI constexpr extents(const span<_OtherIndexType, _Size>& __exts) noexcept
348 : __vals_(__exts) {344 // Not catching this could lead to out of bounds errors later
349 // Not catching this could lead to out of bounds errors later345 // e.g. mdspan m(ptr, dextents<char, 1>(200u)); leads to an extent of -56 on m
350 // e.g. array a{200u}; mdspan<int, dextents<char,1>> m(ptr, extents(span<unsigned,1>(a))); leads to an extent of -56346 : __vals_(__representability_checked_cast(__exts, make_index_sequence<_Size>())) {}
351 // on m
352 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__are_representable_as<index_type>(__exts),
353 "extents ctor: arguments must be representable as index_type and nonnegative");
354 }
355347
356private:348private:
357 // Function to construct extents storage from other extents.349 // Function to construct extents storage from other extents.
...@@ -433,6 +425,15 @@ public:...@@ -433,6 +425,15 @@ public:
433 }425 }
434 return true;426 return true;
435 }427 }
428
429 template <class _OtherIndexType>
430 _LIBCPP_HIDE_FROM_ABI static constexpr auto __index_cast(_OtherIndexType&& __i) noexcept {
431 using _OtherIndex = remove_cvref_t<_OtherIndexType>;
432 if constexpr (integral<_OtherIndex> && !same_as<_OtherIndex, bool>)
433 return __i;
434 else
435 return static_cast<index_type>(std::forward<_OtherIndexType>(__i));
436 }
436};437};
437438
438// Recursive helper classes to implement dextents alias for extents439// Recursive helper classes to implement dextents alias for extents
...@@ -465,15 +466,9 @@ using dims = dextents<_IndexType, _Rank>;...@@ -465,15 +466,9 @@ using dims = dextents<_IndexType, _Rank>;
465# endif466# endif
466467
467// Deduction guide for extents468// Deduction guide for extents
468# if _LIBCPP_STD_VER >= 26
469template <class... _IndexTypes>469template <class... _IndexTypes>
470 requires(is_convertible_v<_IndexTypes, size_t> && ...)470 requires(is_convertible_v<_IndexTypes, size_t> && ...)
471explicit extents(_IndexTypes...) -> extents<size_t, __maybe_static_ext<_IndexTypes>...>;471explicit extents(_IndexTypes...) -> extents<size_t, __maybe_static_ext<_IndexTypes>...>;
472# else
473template <class... _IndexTypes>
474 requires(is_convertible_v<_IndexTypes, size_t> && ...)
475explicit extents(_IndexTypes...) -> extents<size_t, size_t(((void)sizeof(_IndexTypes), dynamic_extent))...>;
476# endif
477472
478namespace __mdspan_detail {473namespace __mdspan_detail {
479474
lib/libcxx/include/__mdspan/layout_left.h+3-3
...@@ -47,9 +47,9 @@ public:...@@ -47,9 +47,9 @@ public:
47 "layout_left::mapping template argument must be a specialization of extents.");47 "layout_left::mapping template argument must be a specialization of extents.");
4848
49 using extents_type = _Extents;49 using extents_type = _Extents;
50 using index_type = typename extents_type::index_type;50 using index_type = extents_type::index_type;
51 using size_type = typename extents_type::size_type;51 using size_type = extents_type::size_type;
52 using rank_type = typename extents_type::rank_type;52 using rank_type = extents_type::rank_type;
53 using layout_type = layout_left;53 using layout_type = layout_left;
5454
55private:55private:
lib/libcxx/include/__mdspan/layout_right.h+3-3
...@@ -47,9 +47,9 @@ public:...@@ -47,9 +47,9 @@ public:
47 "layout_right::mapping template argument must be a specialization of extents.");47 "layout_right::mapping template argument must be a specialization of extents.");
4848
49 using extents_type = _Extents;49 using extents_type = _Extents;
50 using index_type = typename extents_type::index_type;50 using index_type = extents_type::index_type;
51 using size_type = typename extents_type::size_type;51 using size_type = extents_type::size_type;
52 using rank_type = typename extents_type::rank_type;52 using rank_type = extents_type::rank_type;
53 using layout_type = layout_right;53 using layout_type = layout_right;
5454
55private:55private:
lib/libcxx/include/__mdspan/layout_stride.h+18-30
...@@ -72,9 +72,9 @@ public:...@@ -72,9 +72,9 @@ public:
72 "layout_stride::mapping template argument must be a specialization of extents.");72 "layout_stride::mapping template argument must be a specialization of extents.");
7373
74 using extents_type = _Extents;74 using extents_type = _Extents;
75 using index_type = typename extents_type::index_type;75 using index_type = extents_type::index_type;
76 using size_type = typename extents_type::size_type;76 using size_type = extents_type::size_type;
77 using rank_type = typename extents_type::rank_type;77 using rank_type = extents_type::rank_type;
78 using layout_type = layout_stride;78 using layout_type = layout_stride;
7979
80private:80private:
...@@ -296,38 +296,26 @@ public:...@@ -296,38 +296,26 @@ public:
296 }296 }
297297
298 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_unique() noexcept { return true; }298 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_unique() noexcept { return true; }
299 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_exhaustive() noexcept { return false; }299 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_exhaustive() noexcept {
300 if constexpr (__rank_ == 0)
301 return true;
302 for (size_t __r = 0; __r < __rank_; ++__r)
303 if (extents_type::static_extent(__r) == 0)
304 return true;
305 return false;
306 }
300 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_strided() noexcept { return true; }307 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_strided() noexcept { return true; }
301308
302 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_unique() noexcept { return true; }309 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_unique() noexcept { return true; }
303 // The answer of this function is fairly complex in the case where one or more
304 // extents are zero.
305 // Technically it is meaningless to query is_exhaustive() in that case, but unfortunately
306 // the way the standard defines this function, we can't give a simple true or false then.
307 _LIBCPP_HIDE_FROM_ABI constexpr bool is_exhaustive() const noexcept {310 _LIBCPP_HIDE_FROM_ABI constexpr bool is_exhaustive() const noexcept {
308 if constexpr (__rank_ == 0)311 if constexpr (is_always_exhaustive())
309 return true;312 return true;
310 else {313 index_type __span_size = required_span_size();
311 index_type __span_size = required_span_size();314 if (__span_size == static_cast<index_type>(0))
312 if (__span_size == static_cast<index_type>(0)) {315 return true;
313 if constexpr (__rank_ == 1)316 return __span_size == [&]<size_t... _Pos>(index_sequence<_Pos...>) {
314 return __strides_[0] == 1;317 return (__extents_.extent(_Pos) * ... * static_cast<index_type>(1));
315 else {318 }(make_index_sequence<__rank_>());
316 rank_type __r_largest = 0;
317 for (rank_type __r = 1; __r < __rank_; __r++)
318 if (__strides_[__r] > __strides_[__r_largest])
319 __r_largest = __r;
320 for (rank_type __r = 0; __r < __rank_; __r++)
321 if (__extents_.extent(__r) == 0 && __r != __r_largest)
322 return false;
323 return true;
324 }
325 } else {
326 return required_span_size() == [&]<size_t... _Pos>(index_sequence<_Pos...>) {
327 return (__extents_.extent(_Pos) * ... * static_cast<index_type>(1));
328 }(make_index_sequence<__rank_>());
329 }
330 }
331 }319 }
332 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_strided() noexcept { return true; }320 _LIBCPP_HIDE_FROM_ABI static constexpr bool is_strided() noexcept { return true; }
333321
lib/libcxx/include/__mdspan/mdspan.h+55-21
...@@ -30,6 +30,7 @@...@@ -30,6 +30,7 @@
30#include <__type_traits/is_constructible.h>30#include <__type_traits/is_constructible.h>
31#include <__type_traits/is_convertible.h>31#include <__type_traits/is_convertible.h>
32#include <__type_traits/is_nothrow_constructible.h>32#include <__type_traits/is_nothrow_constructible.h>
33#include <__type_traits/is_object.h>
33#include <__type_traits/is_pointer.h>34#include <__type_traits/is_pointer.h>
34#include <__type_traits/is_same.h>35#include <__type_traits/is_same.h>
35#include <__type_traits/rank.h>36#include <__type_traits/rank.h>
...@@ -37,9 +38,11 @@...@@ -37,9 +38,11 @@
37#include <__type_traits/remove_cv.h>38#include <__type_traits/remove_cv.h>
38#include <__type_traits/remove_pointer.h>39#include <__type_traits/remove_pointer.h>
39#include <__type_traits/remove_reference.h>40#include <__type_traits/remove_reference.h>
41#include <__utility/as_const.h>
40#include <__utility/integer_sequence.h>42#include <__utility/integer_sequence.h>
41#include <array>43#include <array>
42#include <span>44#include <span>
45#include <stdexcept>
4346
44#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)47#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
45# pragma GCC system_header48# pragma GCC system_header
...@@ -66,6 +69,9 @@ class mdspan {...@@ -66,6 +69,9 @@ class mdspan {
66private:69private:
67 static_assert(__mdspan_detail::__is_extents_v<_Extents>,70 static_assert(__mdspan_detail::__is_extents_v<_Extents>,
68 "mdspan: Extents template parameter must be a specialization of extents.");71 "mdspan: Extents template parameter must be a specialization of extents.");
72 static_assert(
73 is_object_v<_ElementType> && requires { sizeof(_ElementType); },
74 "mdspan: ElementType template parameter must be a complete object type");
69 static_assert(!is_array_v<_ElementType>, "mdspan: ElementType template parameter may not be an array type");75 static_assert(!is_array_v<_ElementType>, "mdspan: ElementType template parameter may not be an array type");
70 static_assert(!is_abstract_v<_ElementType>, "mdspan: ElementType template parameter may not be an abstract class");76 static_assert(!is_abstract_v<_ElementType>, "mdspan: ElementType template parameter may not be an abstract class");
71 static_assert(is_same_v<_ElementType, typename _AccessorPolicy::element_type>,77 static_assert(is_same_v<_ElementType, typename _AccessorPolicy::element_type>,
...@@ -78,14 +84,14 @@ public:...@@ -78,14 +84,14 @@ public:
78 using extents_type = _Extents;84 using extents_type = _Extents;
79 using layout_type = _LayoutPolicy;85 using layout_type = _LayoutPolicy;
80 using accessor_type = _AccessorPolicy;86 using accessor_type = _AccessorPolicy;
81 using mapping_type = typename layout_type::template mapping<extents_type>;87 using mapping_type = layout_type::template mapping<extents_type>;
82 using element_type = _ElementType;88 using element_type = _ElementType;
83 using value_type = remove_cv_t<element_type>;89 using value_type = remove_cv_t<element_type>;
84 using index_type = typename extents_type::index_type;90 using index_type = extents_type::index_type;
85 using size_type = typename extents_type::size_type;91 using size_type = extents_type::size_type;
86 using rank_type = typename extents_type::rank_type;92 using rank_type = extents_type::rank_type;
87 using data_handle_type = typename accessor_type::data_handle_type;93 using data_handle_type = accessor_type::data_handle_type;
88 using reference = typename accessor_type::reference;94 using reference = accessor_type::reference;
8995
90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return extents_type::rank(); }96 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank() noexcept { return extents_type::rank(); }
91 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank_dynamic() noexcept {97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr rank_type rank_dynamic() noexcept {
...@@ -187,11 +193,11 @@ public:...@@ -187,11 +193,11 @@ public:
187 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&193 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&
188 (sizeof...(_OtherIndexTypes) == rank()))194 (sizeof...(_OtherIndexTypes) == rank()))
189 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const {195 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const {
190 // Note the standard layouts would also check this, but user provided ones may not, so we196 return [&]<class... _IndexTypes>(_IndexTypes... __idxs) -> reference {
191 // check the precondition here197 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__is_multidimensional_index_in(extents(), __idxs...),
192 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__is_multidimensional_index_in(extents(), __indices...),198 "mdspan: operator[] out of bounds access");
193 "mdspan: operator[] out of bounds access");199 return __acc_.access(__ptr_, __map_(static_cast<index_type>(std::move(__idxs))...));
194 return __acc_.access(__ptr_, __map_(static_cast<index_type>(std::move(__indices))...));200 }(extents_type::__index_cast(std::move(__indices))...);
195 }201 }
196202
197 template <class _OtherIndexType>203 template <class _OtherIndexType>
...@@ -200,7 +206,7 @@ public:...@@ -200,7 +206,7 @@ public:
200 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference206 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference
201 operator[](const array< _OtherIndexType, rank()>& __indices) const {207 operator[](const array< _OtherIndexType, rank()>& __indices) const {
202 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {208 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {
203 return __map_(__indices[_Idxs]...);209 return __map_(extents_type::__index_cast(__indices[_Idxs])...);
204 }(make_index_sequence<rank()>()));210 }(make_index_sequence<rank()>()));
205 }211 }
206212
...@@ -209,10 +215,41 @@ public:...@@ -209,10 +215,41 @@ public:
209 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)215 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)
210 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](span<_OtherIndexType, rank()> __indices) const {216 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](span<_OtherIndexType, rank()> __indices) const {
211 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {217 return __acc_.access(__ptr_, [&]<size_t... _Idxs>(index_sequence<_Idxs...>) {
212 return __map_(__indices[_Idxs]...);218 return __map_(extents_type::__index_cast(__indices[_Idxs])...);
213 }(make_index_sequence<rank()>()));219 }(make_index_sequence<rank()>()));
214 }220 }
215221
222# if _LIBCPP_STD_VER >= 26
223 template <class... _OtherIndexTypes>
224 requires((is_convertible_v<_OtherIndexTypes, index_type> && ...) &&
225 (is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&
226 (sizeof...(_OtherIndexTypes) == rank()))
227 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference at(_OtherIndexTypes... __indices) const {
228 if (!__mdspan_detail::__is_multidimensional_index_in(__map_.extents(), __indices...)) {
229 __throw_out_of_range();
230 }
231 return (*this)[extents_type::__index_cast(std::move(__indices))...];
232 }
233
234 template <class _OtherIndexType>
235 requires(is_convertible_v<const _OtherIndexType&, index_type> &&
236 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)
237 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference at(const array<_OtherIndexType, rank()>& __indices) const {
238 return [&]<size_t... _Idxs>(index_sequence<_Idxs...>) -> reference {
239 return at(extents_type::__index_cast(__indices[_Idxs])...);
240 }(make_index_sequence<rank()>());
241 }
242
243 template <class _OtherIndexType>
244 requires(is_convertible_v<const _OtherIndexType&, index_type> &&
245 is_nothrow_constructible_v<index_type, const _OtherIndexType&>)
246 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reference at(span<_OtherIndexType, rank()> __indices) const {
247 return [&]<size_t... _Idxs>(index_sequence<_Idxs...>) -> reference {
248 return at(extents_type::__index_cast(std::as_const(__indices[_Idxs]))...);
249 }(make_index_sequence<rank()>());
250 }
251# endif
252
216 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept {253 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_type size() const noexcept {
217 // Could leave this as only checked in debug mode: semantically size() is never254 // Could leave this as only checked in debug mode: semantically size() is never
218 // guaranteed to be related to any accessible range255 // guaranteed to be related to any accessible range
...@@ -269,19 +306,16 @@ private:...@@ -269,19 +306,16 @@ private:
269306
270 template <class, class, class, class>307 template <class, class, class, class>
271 friend class mdspan;308 friend class mdspan;
272};
273309
274# if _LIBCPP_STD_VER >= 26310# if _LIBCPP_STD_VER >= 26
311 _LIBCPP_HIDE_FROM_ABI void __throw_out_of_range() const { std::__throw_out_of_range("mdspan"); }
312# endif
313};
314
275template <class _ElementType, class... _OtherIndexTypes>315template <class _ElementType, class... _OtherIndexTypes>
276 requires((is_convertible_v<_OtherIndexTypes, size_t> && ...) && (sizeof...(_OtherIndexTypes) > 0))316 requires((is_convertible_v<_OtherIndexTypes, size_t> && ...) && (sizeof...(_OtherIndexTypes) > 0))
277explicit mdspan(_ElementType*, _OtherIndexTypes...)317explicit mdspan(_ElementType*, _OtherIndexTypes...)
278 -> mdspan<_ElementType, extents<size_t, __maybe_static_ext<_OtherIndexTypes>...>>;318 -> mdspan<_ElementType, extents<size_t, __maybe_static_ext<_OtherIndexTypes>...>>;
279# else
280template <class _ElementType, class... _OtherIndexTypes>
281 requires((is_convertible_v<_OtherIndexTypes, size_t> && ...) && (sizeof...(_OtherIndexTypes) > 0))
282explicit mdspan(_ElementType*, _OtherIndexTypes...)
283 -> mdspan<_ElementType, dextents<size_t, sizeof...(_OtherIndexTypes)>>;
284# endif
285319
286template <class _Pointer>320template <class _Pointer>
287 requires(is_pointer_v<remove_reference_t<_Pointer>>)321 requires(is_pointer_v<remove_reference_t<_Pointer>>)
...@@ -309,7 +343,7 @@ mdspan(_ElementType*, const _MappingType&)...@@ -309,7 +343,7 @@ mdspan(_ElementType*, const _MappingType&)
309 -> mdspan<_ElementType, typename _MappingType::extents_type, typename _MappingType::layout_type>;343 -> mdspan<_ElementType, typename _MappingType::extents_type, typename _MappingType::layout_type>;
310344
311template <class _MappingType, class _AccessorType>345template <class _MappingType, class _AccessorType>
312mdspan(const typename _AccessorType::data_handle_type, const _MappingType&, const _AccessorType&)346mdspan(typename _AccessorType::data_handle_type, const _MappingType&, const _AccessorType&)
313 -> mdspan<typename _AccessorType::element_type,347 -> mdspan<typename _AccessorType::element_type,
314 typename _MappingType::extents_type,348 typename _MappingType::extents_type,
315 typename _MappingType::layout_type,349 typename _MappingType::layout_type,
lib/libcxx/include/__memory/aligned_alloc.h deleted-63
...@@ -1,63 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___MEMORY_ALIGNED_ALLOC_H
10#define _LIBCPP___MEMORY_ALIGNED_ALLOC_H
11
12#include <__config>
13#include <cstdlib>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
22
23// Low-level helpers to call the aligned allocation and deallocation functions
24// on the target platform. This is used to implement libc++'s own memory
25// allocation routines -- if you need to allocate memory inside the library,
26// chances are that you want to use `__libcpp_allocate` instead.
27//
28// Returns the allocated memory, or `nullptr` on failure.
29inline _LIBCPP_HIDE_FROM_ABI void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
30# if defined(_LIBCPP_MSVCRT_LIKE)
31 return ::_aligned_malloc(__size, __alignment);
32# elif _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_C11_ALIGNED_ALLOC
33 // aligned_alloc() requires that __size is a multiple of __alignment,
34 // but for C++ [new.delete.general], only states "if the value of an
35 // alignment argument passed to any of these functions is not a valid
36 // alignment value, the behavior is undefined".
37 // To handle calls such as ::operator new(1, std::align_val_t(128)), we
38 // round __size up to the next multiple of __alignment.
39 size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
40 // Rounding up could have wrapped around to zero, so we have to add another
41 // max() ternary to the actual call site to avoid succeeded in that case.
42 return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
43# else
44 void* __result = nullptr;
45 (void)::posix_memalign(&__result, __alignment, __size);
46 // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
47 return __result;
48# endif
49}
50
51inline _LIBCPP_HIDE_FROM_ABI void __libcpp_aligned_free(void* __ptr) {
52# if defined(_LIBCPP_MSVCRT_LIKE)
53 ::_aligned_free(__ptr);
54# else
55 ::free(__ptr);
56# endif
57}
58
59#endif // _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
60
61_LIBCPP_END_NAMESPACE_STD
62
63#endif // _LIBCPP___MEMORY_ALIGNED_ALLOC_H
lib/libcxx/include/__memory/allocator_traits.h+61-1
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11#define _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H11#define _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
1212
13#include <__config>13#include <__config>
14#include <__cstddef/ptrdiff_t.h>
14#include <__cstddef/size_t.h>15#include <__cstddef/size_t.h>
15#include <__fwd/memory.h>16#include <__fwd/memory.h>
16#include <__memory/construct_at.h>17#include <__memory/construct_at.h>
...@@ -223,8 +224,13 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(allocation_result);...@@ -223,8 +224,13 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(allocation_result);
223224
224#endif // _LIBCPP_STD_VER225#endif // _LIBCPP_STD_VER
225226
227template <class>
228struct allocator_traits;
229
230// We have a base class that can be specialized for different allocators, since the metaprogramming to get the aliases
231// is quite expensive and the definition of these aliases is usually quite trivial in the end.
226template <class _Alloc>232template <class _Alloc>
227struct allocator_traits {233struct __allocator_traits_base {
228 using allocator_type = _Alloc;234 using allocator_type = _Alloc;
229 using value_type = typename allocator_type::value_type;235 using value_type = typename allocator_type::value_type;
230 using pointer = __pointer<value_type, allocator_type>;236 using pointer = __pointer<value_type, allocator_type>;
...@@ -253,6 +259,60 @@ struct allocator_traits {...@@ -253,6 +259,60 @@ struct allocator_traits {
253 using other = allocator_traits<typename rebind_alloc<_Tp>::other>;259 using other = allocator_traits<typename rebind_alloc<_Tp>::other>;
254 };260 };
255#endif // _LIBCPP_CXX03_LANG261#endif // _LIBCPP_CXX03_LANG
262};
263
264template <class _Tp>
265struct __allocator_traits_base<allocator<_Tp> > {
266 using allocator_type = allocator<_Tp>;
267 using value_type = _Tp;
268 using pointer = _Tp*;
269 using const_pointer = const _Tp*;
270 using void_pointer = void*;
271 using const_void_pointer = const void*;
272 using difference_type = ptrdiff_t;
273 using size_type = size_t;
274 using propagate_on_container_copy_assignment = false_type;
275 using propagate_on_container_move_assignment = true_type;
276 using propagate_on_container_swap = false_type;
277 using is_always_equal = true_type;
278
279#ifndef _LIBCPP_CXX03_LANG
280 template <class _Up>
281 using rebind_alloc = allocator<_Up>;
282 template <class _Up>
283 using rebind_traits = allocator_traits<allocator<_Up> >;
284#else
285 template <class _Up>
286 struct rebind_alloc {
287 using other = allocator<_Up>;
288 };
289 template <class _Up>
290 struct rebind_traits {
291 using other = allocator_traits<allocator<_Up> >;
292 };
293#endif
294};
295
296template <class _Alloc>
297struct allocator_traits : __allocator_traits_base<_Alloc> {
298 using __base _LIBCPP_NODEBUG = __allocator_traits_base<_Alloc>;
299
300 using allocator_type = typename __base::allocator_type;
301 using value_type = typename __base::value_type;
302 using pointer = typename __base::pointer;
303 using const_pointer = typename __base::const_pointer;
304 using void_pointer = typename __base::void_pointer;
305 using const_void_pointer = typename __base::const_void_pointer;
306 using difference_type = typename __base::difference_type;
307 using size_type = typename __base::size_type;
308 using propagate_on_container_copy_assignment = typename __base::propagate_on_container_copy_assignment;
309 using propagate_on_container_move_assignment = typename __base::propagate_on_container_move_assignment;
310 using is_always_equal = typename __base::is_always_equal;
311
312 template <class _Tp>
313 using rebind_alloc = typename __base::template rebind_alloc<_Tp>;
314 template <class _Tp>
315 using rebind_traits = typename __base::template rebind_traits<_Tp>;
256316
257 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer317 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer
258 allocate(allocator_type& __a, size_type __n) {318 allocate(allocator_type& __a, size_type __n) {
lib/libcxx/include/__memory/compressed_pair.h+4-29
...@@ -20,8 +20,6 @@...@@ -20,8 +20,6 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25// ================================================================================================================== //23// ================================================================================================================== //
26// The utilites here are for staying ABI compatible with the legacy `__compressed_pair`. They should not be used //24// The utilites here are for staying ABI compatible with the legacy `__compressed_pair`. They should not be used //
27// for new data structures. Use `_LIBCPP_NO_UNIQUE_ADDRESS` for new data structures instead (but make sure you //25// for new data structures. Use `_LIBCPP_NO_UNIQUE_ADDRESS` for new data structures instead (but make sure you //
...@@ -59,6 +57,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -59,6 +57,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
5957
60#ifndef _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING58#ifndef _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING
6159
60_LIBCPP_BEGIN_NAMESPACE_STD
61
62template <class _Tp>62template <class _Tp>
63inline const size_t __compressed_pair_alignment = _LIBCPP_ALIGNOF(_Tp);63inline const size_t __compressed_pair_alignment = _LIBCPP_ALIGNOF(_Tp);
6464
...@@ -94,16 +94,6 @@ class __compressed_pair_padding<_ToPad, true> {};...@@ -94,16 +94,6 @@ class __compressed_pair_padding<_ToPad, true> {};
94 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \94 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \
95 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \95 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
96 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _)96 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _)
97
98# define _LIBCPP_COMPRESSED_TRIPLE(T1, Initializer1, T2, Initializer2, T3, Initializer3) \
99 _LIBCPP_NO_UNIQUE_ADDRESS \
100 __attribute__((__aligned__(::std::__compressed_pair_alignment<T2>), \
101 __aligned__(::std::__compressed_pair_alignment<T3>))) T1 Initializer1; \
102 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \
103 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
104 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \
105 _LIBCPP_NO_UNIQUE_ADDRESS T3 Initializer3; \
106 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T3> _LIBCPP_CONCAT3(__padding3_, __LINE__, _)
107# else97# else
108# define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \98# define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \
109 struct { \99 struct { \
...@@ -112,31 +102,16 @@ class __compressed_pair_padding<_ToPad, true> {};...@@ -112,31 +102,16 @@ class __compressed_pair_padding<_ToPad, true> {};
112 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \102 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
113 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \103 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \
114 }104 }
115
116# define _LIBCPP_COMPRESSED_TRIPLE(T1, Initializer1, T2, Initializer2, T3, Initializer3) \
117 struct { \
118 _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1; \
119 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _); \
120 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
121 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3(__padding2_, __LINE__, _); \
122 _LIBCPP_NO_UNIQUE_ADDRESS T3 Initializer3; \
123 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T3> _LIBCPP_CONCAT3(__padding3_, __LINE__, _); \
124 }
125# endif105# endif
126106
107_LIBCPP_END_NAMESPACE_STD
108
127#else109#else
128# define _LIBCPP_COMPRESSED_ELEMENT(T1, Initializer1) _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1110# define _LIBCPP_COMPRESSED_ELEMENT(T1, Initializer1) _LIBCPP_NO_UNIQUE_ADDRESS T1 Initializer1
129111
130# define _LIBCPP_COMPRESSED_PAIR(T1, Name1, T2, Name2) \112# define _LIBCPP_COMPRESSED_PAIR(T1, Name1, T2, Name2) \
131 _LIBCPP_NO_UNIQUE_ADDRESS T1 Name1; \113 _LIBCPP_NO_UNIQUE_ADDRESS T1 Name1; \
132 _LIBCPP_NO_UNIQUE_ADDRESS T2 Name2114 _LIBCPP_NO_UNIQUE_ADDRESS T2 Name2
133
134# define _LIBCPP_COMPRESSED_TRIPLE(T1, Name1, T2, Name2, T3, Name3) \
135 _LIBCPP_NO_UNIQUE_ADDRESS T1 Name1; \
136 _LIBCPP_NO_UNIQUE_ADDRESS T2 Name2; \
137 _LIBCPP_NO_UNIQUE_ADDRESS T3 Name3
138#endif // _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING115#endif // _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING
139116
140_LIBCPP_END_NAMESPACE_STD
141
142#endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H117#endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H
lib/libcxx/include/__memory/inout_ptr.h+5-6
...@@ -11,10 +11,9 @@...@@ -11,10 +11,9 @@
11#define _LIBCPP___INOUT_PTR_H11#define _LIBCPP___INOUT_PTR_H
1212
13#include <__config>13#include <__config>
14#include <__fwd/memory.h>
14#include <__memory/addressof.h>15#include <__memory/addressof.h>
15#include <__memory/pointer_traits.h>16#include <__memory/pointer_traits.h>
16#include <__memory/shared_ptr.h>
17#include <__memory/unique_ptr.h>
18#include <__type_traits/is_pointer.h>17#include <__type_traits/is_pointer.h>
19#include <__type_traits/is_same.h>18#include <__type_traits/is_same.h>
20#include <__type_traits/is_specialization.h>19#include <__type_traits/is_specialization.h>
...@@ -30,10 +29,10 @@...@@ -30,10 +29,10 @@
30_LIBCPP_PUSH_MACROS29_LIBCPP_PUSH_MACROS
31#include <__undef_macros>30#include <__undef_macros>
3231
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35#if _LIBCPP_STD_VER >= 2332#if _LIBCPP_STD_VER >= 23
3633
34_LIBCPP_BEGIN_NAMESPACE_STD
35
37template <class _Smart, class _Pointer, class... _Args>36template <class _Smart, class _Pointer, class... _Args>
38class inout_ptr_t {37class inout_ptr_t {
39 static_assert(!__is_specialization_v<_Smart, shared_ptr>, "std::shared_ptr<> is not supported with std::inout_ptr.");38 static_assert(!__is_specialization_v<_Smart, shared_ptr>, "std::shared_ptr<> is not supported with std::inout_ptr.");
...@@ -101,10 +100,10 @@ template <class _Pointer = void, class _Smart, class... _Args>...@@ -101,10 +100,10 @@ template <class _Pointer = void, class _Smart, class... _Args>
101 return std::inout_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);100 return std::inout_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);
102}101}
103102
104#endif // _LIBCPP_STD_VER >= 23
105
106_LIBCPP_END_NAMESPACE_STD103_LIBCPP_END_NAMESPACE_STD
107104
105#endif // _LIBCPP_STD_VER >= 23
106
108_LIBCPP_POP_MACROS107_LIBCPP_POP_MACROS
109108
110#endif // _LIBCPP___INOUT_PTR_H109#endif // _LIBCPP___INOUT_PTR_H
lib/libcxx/include/__memory/is_sufficiently_aligned.h+6-1
...@@ -20,11 +20,16 @@...@@ -20,11 +20,16 @@
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2222
23template <size_t _Alignment, class _Tp>
24[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __is_sufficiently_aligned(_Tp* __ptr) {
25 return reinterpret_cast<uintptr_t>(__ptr) % _Alignment == 0;
26}
27
23#if _LIBCPP_STD_VER >= 2628#if _LIBCPP_STD_VER >= 26
2429
25template <size_t _Alignment, class _Tp>30template <size_t _Alignment, class _Tp>
26[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_sufficiently_aligned(_Tp* __ptr) {31[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool is_sufficiently_aligned(_Tp* __ptr) {
27 return reinterpret_cast<uintptr_t>(__ptr) % _Alignment == 0;32 return std::__is_sufficiently_aligned<_Alignment>(__ptr);
28}33}
2934
30#endif // _LIBCPP_STD_VER >= 2635#endif // _LIBCPP_STD_VER >= 26
lib/libcxx/include/__memory/out_ptr.h+5-6
...@@ -11,10 +11,9 @@...@@ -11,10 +11,9 @@
11#define _LIBCPP___OUT_PTR_H11#define _LIBCPP___OUT_PTR_H
1212
13#include <__config>13#include <__config>
14#include <__fwd/memory.h>
14#include <__memory/addressof.h>15#include <__memory/addressof.h>
15#include <__memory/pointer_traits.h>16#include <__memory/pointer_traits.h>
16#include <__memory/shared_ptr.h>
17#include <__memory/unique_ptr.h>
18#include <__type_traits/is_pointer.h>17#include <__type_traits/is_pointer.h>
19#include <__type_traits/is_specialization.h>18#include <__type_traits/is_specialization.h>
20#include <__type_traits/is_void.h>19#include <__type_traits/is_void.h>
...@@ -29,10 +28,10 @@...@@ -29,10 +28,10 @@
29_LIBCPP_PUSH_MACROS28_LIBCPP_PUSH_MACROS
30#include <__undef_macros>29#include <__undef_macros>
3130
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34#if _LIBCPP_STD_VER >= 2331#if _LIBCPP_STD_VER >= 23
3532
33_LIBCPP_BEGIN_NAMESPACE_STD
34
36template <class _Smart, class _Pointer, class... _Args>35template <class _Smart, class _Pointer, class... _Args>
37class out_ptr_t {36class out_ptr_t {
38 static_assert(!__is_specialization_v<_Smart, shared_ptr> || sizeof...(_Args) > 0,37 static_assert(!__is_specialization_v<_Smart, shared_ptr> || sizeof...(_Args) > 0,
...@@ -93,10 +92,10 @@ template <class _Pointer = void, class _Smart, class... _Args>...@@ -93,10 +92,10 @@ template <class _Pointer = void, class _Smart, class... _Args>
93 return std::out_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);92 return std::out_ptr_t<_Smart, _Ptr, _Args&&...>(__s, std::forward<_Args>(__args)...);
94}93}
9594
96#endif // _LIBCPP_STD_VER >= 23
97
98_LIBCPP_END_NAMESPACE_STD95_LIBCPP_END_NAMESPACE_STD
9996
97#endif // _LIBCPP_STD_VER >= 23
98
100_LIBCPP_POP_MACROS99_LIBCPP_POP_MACROS
101100
102#endif // _LIBCPP___OUT_PTR_H101#endif // _LIBCPP___OUT_PTR_H
lib/libcxx/include/__memory/pointer_traits.h+20-35
...@@ -14,12 +14,10 @@...@@ -14,12 +14,10 @@
14#include <__cstddef/ptrdiff_t.h>14#include <__cstddef/ptrdiff_t.h>
15#include <__memory/addressof.h>15#include <__memory/addressof.h>
16#include <__type_traits/conditional.h>16#include <__type_traits/conditional.h>
17#include <__type_traits/conjunction.h>
18#include <__type_traits/decay.h>17#include <__type_traits/decay.h>
19#include <__type_traits/detected_or.h>18#include <__type_traits/detected_or.h>
20#include <__type_traits/enable_if.h>19#include <__type_traits/enable_if.h>
21#include <__type_traits/integral_constant.h>20#include <__type_traits/integral_constant.h>
22#include <__type_traits/is_class.h>
23#include <__type_traits/is_function.h>21#include <__type_traits/is_function.h>
24#include <__type_traits/is_void.h>22#include <__type_traits/is_void.h>
25#include <__type_traits/nat.h>23#include <__type_traits/nat.h>
...@@ -139,9 +137,6 @@ using __rebind_pointer_t _LIBCPP_NODEBUG = typename pointer_traits<_From>::templ...@@ -139,9 +137,6 @@ using __rebind_pointer_t _LIBCPP_NODEBUG = typename pointer_traits<_From>::templ
139137
140// to_address138// to_address
141139
142template <class _Pointer, class = void>
143struct __to_address_helper;
144
145template <class _Tp>140template <class _Tp>
146_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {141_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {
147 static_assert(!is_function<_Tp>::value, "_Tp is a function type");142 static_assert(!is_function<_Tp>::value, "_Tp is a function type");
...@@ -149,48 +144,38 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {...@@ -149,48 +144,38 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {
149}144}
150145
151template <class _Pointer, class = void>146template <class _Pointer, class = void>
152struct _HasToAddress : false_type {};147inline const bool __has_to_address_v = false;
153148
154template <class _Pointer>149template <class _Pointer>
155struct _HasToAddress<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>())) >150inline const bool
156 : true_type {};151 __has_to_address_v<_Pointer,
152 decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))> = true;
157153
158template <class _Pointer, class = void>154template <class _Pointer, class = void>
159struct _HasArrow : false_type {};155inline const bool __has_arrow_v = false;
160
161template <class _Pointer>
162struct _HasArrow<_Pointer, decltype((void)std::declval<const _Pointer&>().operator->()) > : true_type {};
163156
164template <class _Pointer>157template <class _Pointer>
165struct _IsFancyPointer {158inline const bool __has_arrow_v<_Pointer, decltype((void)std::declval<const _Pointer&>().operator->()) > = true;
166 static const bool value = _HasArrow<_Pointer>::value || _HasToAddress<_Pointer>::value;
167};
168159
169// enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers160template <class _Pointer, __enable_if_t<__has_to_address_v<_Pointer>, int> = 0>
170template <class _Pointer, __enable_if_t< _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value, int> = 0>161_LIBCPP_CONSTEXPR __decay_t<decltype(pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))>
171_LIBCPP_HIDE_FROM_ABI
172_LIBCPP_CONSTEXPR __decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>
173__to_address(const _Pointer& __p) _NOEXCEPT {162__to_address(const _Pointer& __p) _NOEXCEPT {
174 return __to_address_helper<_Pointer>::__call(__p);163 return pointer_traits<_Pointer>::to_address(__p);
175}164}
176165
177template <class _Pointer, class>166template <class _Pointer>
178struct __to_address_helper {167struct __to_address_arrow_result;
179 _LIBCPP_HIDE_FROM_ABI
180 _LIBCPP_CONSTEXPR static decltype(std::__to_address(std::declval<const _Pointer&>().operator->()))
181 __call(const _Pointer& __p) _NOEXCEPT {
182 return std::__to_address(__p.operator->());
183 }
184};
185168
169template <class _Pointer, __enable_if_t<!__has_to_address_v<_Pointer> && __has_arrow_v<_Pointer>, int> = 0>
170_LIBCPP_CONSTEXPR typename __to_address_arrow_result<_Pointer>::type __to_address(const _Pointer& __p) _NOEXCEPT {
171 return std::__to_address(__p.operator->());
172}
173
174// The return type needs to see all `__to_address` overloads, so this is delayed until after all the overloads have been
175// defined. This could also be moved to a trailing return type, but that's not available in C++03.
186template <class _Pointer>176template <class _Pointer>
187struct __to_address_helper<_Pointer,177struct __to_address_arrow_result {
188 decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))> {178 using type _LIBCPP_NODEBUG = __decay_t<decltype(std::__to_address(std::declval<const _Pointer&>().operator->()))>;
189 _LIBCPP_HIDE_FROM_ABI
190 _LIBCPP_CONSTEXPR static decltype(pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))
191 __call(const _Pointer& __p) _NOEXCEPT {
192 return pointer_traits<_Pointer>::to_address(__p);
193 }
194};179};
195180
196#if _LIBCPP_STD_VER >= 20181#if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__memory/ranges_uninitialized_algorithms.h+29-26
...@@ -44,14 +44,16 @@ namespace ranges {...@@ -44,14 +44,16 @@ namespace ranges {
44struct __uninitialized_default_construct {44struct __uninitialized_default_construct {
45 template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel>45 template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel>
46 requires default_initializable<iter_value_t<_ForwardIterator>>46 requires default_initializable<iter_value_t<_ForwardIterator>>
47 _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {47 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
48 operator()(_ForwardIterator __first, _Sentinel __last) const {
48 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;49 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
49 return std::__uninitialized_default_construct<_ValueType>(std::move(__first), std::move(__last));50 return std::__uninitialized_default_construct<_ValueType>(std::move(__first), std::move(__last));
50 }51 }
5152
52 template <__nothrow_forward_range _ForwardRange>53 template <__nothrow_forward_range _ForwardRange>
53 requires default_initializable<range_value_t<_ForwardRange>>54 requires default_initializable<range_value_t<_ForwardRange>>
54 _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const {55 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 borrowed_iterator_t<_ForwardRange>
56 operator()(_ForwardRange&& __range) const {
55 return (*this)(ranges::begin(__range), ranges::end(__range));57 return (*this)(ranges::begin(__range), ranges::end(__range));
56 }58 }
57};59};
...@@ -65,7 +67,7 @@ inline constexpr auto uninitialized_default_construct = __uninitialized_default_...@@ -65,7 +67,7 @@ inline constexpr auto uninitialized_default_construct = __uninitialized_default_
65struct __uninitialized_default_construct_n {67struct __uninitialized_default_construct_n {
66 template <__nothrow_forward_iterator _ForwardIterator>68 template <__nothrow_forward_iterator _ForwardIterator>
67 requires default_initializable<iter_value_t<_ForwardIterator>>69 requires default_initializable<iter_value_t<_ForwardIterator>>
68 _LIBCPP_HIDE_FROM_ABI _ForwardIterator70 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
69 operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n) const {71 operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n) const {
70 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;72 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
71 return std::__uninitialized_default_construct_n<_ValueType>(std::move(__first), __n);73 return std::__uninitialized_default_construct_n<_ValueType>(std::move(__first), __n);
...@@ -81,14 +83,16 @@ inline constexpr auto uninitialized_default_construct_n = __uninitialized_defaul...@@ -81,14 +83,16 @@ inline constexpr auto uninitialized_default_construct_n = __uninitialized_defaul
81struct __uninitialized_value_construct {83struct __uninitialized_value_construct {
82 template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel>84 template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel>
83 requires default_initializable<iter_value_t<_ForwardIterator>>85 requires default_initializable<iter_value_t<_ForwardIterator>>
84 _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {86 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
87 operator()(_ForwardIterator __first, _Sentinel __last) const {
85 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;88 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
86 return std::__uninitialized_value_construct<_ValueType>(std::move(__first), std::move(__last));89 return std::__uninitialized_value_construct<_ValueType>(std::move(__first), std::move(__last));
87 }90 }
8891
89 template <__nothrow_forward_range _ForwardRange>92 template <__nothrow_forward_range _ForwardRange>
90 requires default_initializable<range_value_t<_ForwardRange>>93 requires default_initializable<range_value_t<_ForwardRange>>
91 _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const {94 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 borrowed_iterator_t<_ForwardRange>
95 operator()(_ForwardRange&& __range) const {
92 return (*this)(ranges::begin(__range), ranges::end(__range));96 return (*this)(ranges::begin(__range), ranges::end(__range));
93 }97 }
94};98};
...@@ -102,7 +106,7 @@ inline constexpr auto uninitialized_value_construct = __uninitialized_value_cons...@@ -102,7 +106,7 @@ inline constexpr auto uninitialized_value_construct = __uninitialized_value_cons
102struct __uninitialized_value_construct_n {106struct __uninitialized_value_construct_n {
103 template <__nothrow_forward_iterator _ForwardIterator>107 template <__nothrow_forward_iterator _ForwardIterator>
104 requires default_initializable<iter_value_t<_ForwardIterator>>108 requires default_initializable<iter_value_t<_ForwardIterator>>
105 _LIBCPP_HIDE_FROM_ABI _ForwardIterator109 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
106 operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n) const {110 operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n) const {
107 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;111 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
108 return std::__uninitialized_value_construct_n<_ValueType>(std::move(__first), __n);112 return std::__uninitialized_value_construct_n<_ValueType>(std::move(__first), __n);
...@@ -118,14 +122,16 @@ inline constexpr auto uninitialized_value_construct_n = __uninitialized_value_co...@@ -118,14 +122,16 @@ inline constexpr auto uninitialized_value_construct_n = __uninitialized_value_co
118struct __uninitialized_fill {122struct __uninitialized_fill {
119 template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel, class _Tp>123 template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel, class _Tp>
120 requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>124 requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>
121 _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const {125 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
126 operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const {
122 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;127 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
123 return std::__uninitialized_fill<_ValueType>(std::move(__first), std::move(__last), __x);128 return std::__uninitialized_fill<_ValueType>(std::move(__first), std::move(__last), __x);
124 }129 }
125130
126 template <__nothrow_forward_range _ForwardRange, class _Tp>131 template <__nothrow_forward_range _ForwardRange, class _Tp>
127 requires constructible_from<range_value_t<_ForwardRange>, const _Tp&>132 requires constructible_from<range_value_t<_ForwardRange>, const _Tp&>
128 _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range, const _Tp& __x) const {133 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 borrowed_iterator_t<_ForwardRange>
134 operator()(_ForwardRange&& __range, const _Tp& __x) const {
129 return (*this)(ranges::begin(__range), ranges::end(__range), __x);135 return (*this)(ranges::begin(__range), ranges::end(__range), __x);
130 }136 }
131};137};
...@@ -139,7 +145,7 @@ inline constexpr auto uninitialized_fill = __uninitialized_fill{};...@@ -139,7 +145,7 @@ inline constexpr auto uninitialized_fill = __uninitialized_fill{};
139struct __uninitialized_fill_n {145struct __uninitialized_fill_n {
140 template <__nothrow_forward_iterator _ForwardIterator, class _Tp>146 template <__nothrow_forward_iterator _ForwardIterator, class _Tp>
141 requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>147 requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>
142 _LIBCPP_HIDE_FROM_ABI _ForwardIterator148 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
143 operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n, const _Tp& __x) const {149 operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n, const _Tp& __x) const {
144 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;150 using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
145 return std::__uninitialized_fill_n<_ValueType>(std::move(__first), __n, __x);151 return std::__uninitialized_fill_n<_ValueType>(std::move(__first), __n, __x);
...@@ -161,20 +167,20 @@ struct __uninitialized_copy {...@@ -161,20 +167,20 @@ struct __uninitialized_copy {
161 __nothrow_forward_iterator _OutputIterator,167 __nothrow_forward_iterator _OutputIterator,
162 __nothrow_sentinel_for<_OutputIterator> _Sentinel2>168 __nothrow_sentinel_for<_OutputIterator> _Sentinel2>
163 requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>>169 requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>>
164 _LIBCPP_HIDE_FROM_ABI uninitialized_copy_result<_InputIterator, _OutputIterator>170 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 uninitialized_copy_result<_InputIterator, _OutputIterator>
165 operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {171 operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {
166 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;172 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
167173
168 auto __stop_copying = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };174 auto __stop_copying = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };
169 auto __result = std::__uninitialized_copy<_ValueType>(175 return std::__uninitialized_copy<_ValueType>(
170 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __stop_copying);176 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __stop_copying);
171 return {std::move(__result.first), std::move(__result.second)};
172 }177 }
173178
174 template <input_range _InputRange, __nothrow_forward_range _OutputRange>179 template <input_range _InputRange, __nothrow_forward_range _OutputRange>
175 requires constructible_from<range_value_t<_OutputRange>, range_reference_t<_InputRange>>180 requires constructible_from<range_value_t<_OutputRange>, range_reference_t<_InputRange>>
176 _LIBCPP_HIDE_FROM_ABI uninitialized_copy_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>181 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
177 operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const {182 uninitialized_copy_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>
183 operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const {
178 return (*this)(184 return (*this)(
179 ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), ranges::end(__out_range));185 ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), ranges::end(__out_range));
180 }186 }
...@@ -194,16 +200,14 @@ struct __uninitialized_copy_n {...@@ -194,16 +200,14 @@ struct __uninitialized_copy_n {
194 __nothrow_forward_iterator _OutputIterator,200 __nothrow_forward_iterator _OutputIterator,
195 __nothrow_sentinel_for<_OutputIterator> _Sentinel>201 __nothrow_sentinel_for<_OutputIterator> _Sentinel>
196 requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>>202 requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>>
197 _LIBCPP_HIDE_FROM_ABI uninitialized_copy_n_result<_InputIterator, _OutputIterator>203 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 uninitialized_copy_n_result<_InputIterator, _OutputIterator>
198 operator()(_InputIterator __ifirst,204 operator()(_InputIterator __ifirst,
199 iter_difference_t<_InputIterator> __n,205 iter_difference_t<_InputIterator> __n,
200 _OutputIterator __ofirst,206 _OutputIterator __ofirst,
201 _Sentinel __olast) const {207 _Sentinel __olast) const {
202 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;208 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
203 auto __stop_copying = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };209 auto __stop_copying = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };
204 auto __result =210 return std::__uninitialized_copy_n<_ValueType>(std::move(__ifirst), __n, std::move(__ofirst), __stop_copying);
205 std::__uninitialized_copy_n<_ValueType>(std::move(__ifirst), __n, std::move(__ofirst), __stop_copying);
206 return {std::move(__result.first), std::move(__result.second)};
207 }211 }
208};212};
209213
...@@ -222,20 +226,20 @@ struct __uninitialized_move {...@@ -222,20 +226,20 @@ struct __uninitialized_move {
222 __nothrow_forward_iterator _OutputIterator,226 __nothrow_forward_iterator _OutputIterator,
223 __nothrow_sentinel_for<_OutputIterator> _Sentinel2>227 __nothrow_sentinel_for<_OutputIterator> _Sentinel2>
224 requires constructible_from<iter_value_t<_OutputIterator>, iter_rvalue_reference_t<_InputIterator>>228 requires constructible_from<iter_value_t<_OutputIterator>, iter_rvalue_reference_t<_InputIterator>>
225 _LIBCPP_HIDE_FROM_ABI uninitialized_move_result<_InputIterator, _OutputIterator>229 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 uninitialized_move_result<_InputIterator, _OutputIterator>
226 operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {230 operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {
227 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;231 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
228 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };232 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };
229 auto __stop_moving = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };233 auto __stop_moving = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };
230 auto __result = std::__uninitialized_move<_ValueType>(234 return std::__uninitialized_move<_ValueType>(
231 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __stop_moving, __iter_move);235 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __stop_moving, __iter_move);
232 return {std::move(__result.first), std::move(__result.second)};
233 }236 }
234237
235 template <input_range _InputRange, __nothrow_forward_range _OutputRange>238 template <input_range _InputRange, __nothrow_forward_range _OutputRange>
236 requires constructible_from<range_value_t<_OutputRange>, range_rvalue_reference_t<_InputRange>>239 requires constructible_from<range_value_t<_OutputRange>, range_rvalue_reference_t<_InputRange>>
237 _LIBCPP_HIDE_FROM_ABI uninitialized_move_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>240 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
238 operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const {241 uninitialized_move_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>>
242 operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const {
239 return (*this)(243 return (*this)(
240 ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), ranges::end(__out_range));244 ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), ranges::end(__out_range));
241 }245 }
...@@ -255,7 +259,7 @@ struct __uninitialized_move_n {...@@ -255,7 +259,7 @@ struct __uninitialized_move_n {
255 __nothrow_forward_iterator _OutputIterator,259 __nothrow_forward_iterator _OutputIterator,
256 __nothrow_sentinel_for<_OutputIterator> _Sentinel>260 __nothrow_sentinel_for<_OutputIterator> _Sentinel>
257 requires constructible_from<iter_value_t<_OutputIterator>, iter_rvalue_reference_t<_InputIterator>>261 requires constructible_from<iter_value_t<_OutputIterator>, iter_rvalue_reference_t<_InputIterator>>
258 _LIBCPP_HIDE_FROM_ABI uninitialized_move_n_result<_InputIterator, _OutputIterator>262 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 uninitialized_move_n_result<_InputIterator, _OutputIterator>
259 operator()(_InputIterator __ifirst,263 operator()(_InputIterator __ifirst,
260 iter_difference_t<_InputIterator> __n,264 iter_difference_t<_InputIterator> __n,
261 _OutputIterator __ofirst,265 _OutputIterator __ofirst,
...@@ -263,9 +267,8 @@ struct __uninitialized_move_n {...@@ -263,9 +267,8 @@ struct __uninitialized_move_n {
263 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;267 using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
264 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };268 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };
265 auto __stop_moving = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };269 auto __stop_moving = [&__olast](auto&& __out_iter) -> bool { return __out_iter == __olast; };
266 auto __result = std::__uninitialized_move_n<_ValueType>(270 return std::__uninitialized_move_n<_ValueType>(
267 std::move(__ifirst), __n, std::move(__ofirst), __stop_moving, __iter_move);271 std::move(__ifirst), __n, std::move(__ofirst), __stop_moving, __iter_move);
268 return {std::move(__result.first), std::move(__result.second)};
269 }272 }
270};273};
271274
lib/libcxx/include/__memory/raw_storage_iterator.h+4-4
...@@ -21,13 +21,13 @@...@@ -21,13 +21,13 @@
21# pragma GCC system_header21# pragma GCC system_header
22#endif22#endif
2323
24#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
25
24_LIBCPP_PUSH_MACROS26_LIBCPP_PUSH_MACROS
25#include <__undef_macros>27#include <__undef_macros>
2628
27_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
2830
29#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
30
31template <class _OutputIterator, class _Tp>31template <class _OutputIterator, class _Tp>
32class _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator32class _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
33 : public __iterator_base<raw_storage_iterator<_OutputIterator, _Tp>, output_iterator_tag, void, void, void, void> {33 : public __iterator_base<raw_storage_iterator<_OutputIterator, _Tp>, output_iterator_tag, void, void, void, void> {
...@@ -71,10 +71,10 @@ public:...@@ -71,10 +71,10 @@ public:
71# endif71# endif
72};72};
7373
74#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
75
76_LIBCPP_END_NAMESPACE_STD74_LIBCPP_END_NAMESPACE_STD
7775
78_LIBCPP_POP_MACROS76_LIBCPP_POP_MACROS
7977
78#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
79
80#endif // _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H80#endif // _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
lib/libcxx/include/__memory/shared_count.h+2
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
21_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2122
22// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)23// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)
23// should be sufficient for thread safety.24// should be sufficient for thread safety.
...@@ -111,6 +112,7 @@ private:...@@ -111,6 +112,7 @@ private:
111 virtual void __on_zero_shared_weak() _NOEXCEPT = 0;112 virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
112};113};
113114
115_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
114_LIBCPP_END_NAMESPACE_STD116_LIBCPP_END_NAMESPACE_STD
115117
116#endif // _LIBCPP___MEMORY_SHARED_COUNT_H118#endif // _LIBCPP___MEMORY_SHARED_COUNT_H
lib/libcxx/include/__memory/shared_ptr.h+209-277
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#ifndef _LIBCPP___MEMORY_SHARED_PTR_H10#ifndef _LIBCPP___MEMORY_SHARED_PTR_H
11#define _LIBCPP___MEMORY_SHARED_PTR_H11#define _LIBCPP___MEMORY_SHARED_PTR_H
1212
13#include <__atomic/memory_order.h>
13#include <__compare/compare_three_way.h>14#include <__compare/compare_three_way.h>
14#include <__compare/ordering.h>15#include <__compare/ordering.h>
15#include <__config>16#include <__config>
...@@ -27,19 +28,17 @@...@@ -27,19 +28,17 @@
27#include <__memory/allocator_destructor.h>28#include <__memory/allocator_destructor.h>
28#include <__memory/allocator_traits.h>29#include <__memory/allocator_traits.h>
29#include <__memory/auto_ptr.h>30#include <__memory/auto_ptr.h>
30#include <__memory/compressed_pair.h>
31#include <__memory/construct_at.h>31#include <__memory/construct_at.h>
32#include <__memory/destroy.h>32#include <__memory/destroy.h>
33#include <__memory/pointer_traits.h>33#include <__memory/pointer_traits.h>
34#include <__memory/shared_count.h>34#include <__memory/shared_count.h>
35#include <__memory/uninitialized_algorithms.h>35#include <__memory/uninitialized_algorithms.h>
36#include <__memory/uninitialized_multidimensional_algorithms.h>
36#include <__memory/unique_ptr.h>37#include <__memory/unique_ptr.h>
37#include <__type_traits/add_reference.h>38#include <__type_traits/add_reference.h>
38#include <__type_traits/conditional.h>39#include <__type_traits/conditional.h>
39#include <__type_traits/conjunction.h>40#include <__type_traits/conjunction.h>
40#include <__type_traits/disjunction.h>
41#include <__type_traits/enable_if.h>41#include <__type_traits/enable_if.h>
42#include <__type_traits/integral_constant.h>
43#include <__type_traits/is_array.h>42#include <__type_traits/is_array.h>
44#include <__type_traits/is_constructible.h>43#include <__type_traits/is_constructible.h>
45#include <__type_traits/is_convertible.h>44#include <__type_traits/is_convertible.h>
...@@ -47,10 +46,11 @@...@@ -47,10 +46,11 @@
47#include <__type_traits/is_reference.h>46#include <__type_traits/is_reference.h>
48#include <__type_traits/is_same.h>47#include <__type_traits/is_same.h>
49#include <__type_traits/nat.h>48#include <__type_traits/nat.h>
50#include <__type_traits/negation.h>
51#include <__type_traits/remove_cv.h>49#include <__type_traits/remove_cv.h>
52#include <__type_traits/remove_extent.h>50#include <__type_traits/remove_extent.h>
51#include <__type_traits/remove_pointer.h>
53#include <__type_traits/remove_reference.h>52#include <__type_traits/remove_reference.h>
53#include <__type_traits/void_t.h>
54#include <__utility/declval.h>54#include <__utility/declval.h>
55#include <__utility/exception_guard.h>55#include <__utility/exception_guard.h>
56#include <__utility/forward.h>56#include <__utility/forward.h>
...@@ -58,9 +58,6 @@...@@ -58,9 +58,6 @@
58#include <__utility/swap.h>58#include <__utility/swap.h>
59#include <__verbose_abort>59#include <__verbose_abort>
60#include <typeinfo>60#include <typeinfo>
61#if _LIBCPP_HAS_ATOMIC_HEADER
62# include <__atomic/memory_order.h>
63#endif
6461
65#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)62#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
66# pragma GCC system_header63# pragma GCC system_header
...@@ -70,6 +67,7 @@ _LIBCPP_PUSH_MACROS...@@ -70,6 +67,7 @@ _LIBCPP_PUSH_MACROS
70#include <__undef_macros>67#include <__undef_macros>
7168
72_LIBCPP_BEGIN_NAMESPACE_STD69_LIBCPP_BEGIN_NAMESPACE_STD
70_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
7371
74class _LIBCPP_EXPORTED_FROM_ABI bad_weak_ptr : public std::exception {72class _LIBCPP_EXPORTED_FROM_ABI bad_weak_ptr : public std::exception {
75public:73public:
...@@ -92,47 +90,36 @@ template <class _Tp>...@@ -92,47 +90,36 @@ template <class _Tp>
92class weak_ptr;90class weak_ptr;
9391
94template <class _Tp, class _Dp, class _Alloc>92template <class _Tp, class _Dp, class _Alloc>
95class __shared_ptr_pointer : public __shared_weak_count {93class _LIBCPP_HIDE_STRUCT_FROM_ABI __shared_ptr_pointer final : public __shared_weak_count {
96 _LIBCPP_COMPRESSED_TRIPLE(_Tp, __ptr_, _Dp, __deleter_, _Alloc, __alloc_);94 _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
95 _LIBCPP_NO_UNIQUE_ADDRESS _Dp __deleter_;
96 _LIBCPP_NO_UNIQUE_ADDRESS _Tp __ptr_;
9797
98public:98public:
99 _LIBCPP_HIDE_FROM_ABI __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)99 _LIBCPP_HIDE_FROM_ABI __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
100 : __ptr_(__p), __deleter_(std::move(__d)), __alloc_(std::move(__a)) {}100 : __alloc_(std::move(__a)), __deleter_(std::move(__d)), __ptr_(__p) {}
101101
102#if _LIBCPP_HAS_RTTI102#if _LIBCPP_HAS_RTTI
103 _LIBCPP_HIDE_FROM_ABI_VIRTUAL const void* __get_deleter(const type_info&) const _NOEXCEPT override;103 _LIBCPP_HIDE_FROM_ABI_VIRTUAL const void* __get_deleter(const type_info& __t) const _NOEXCEPT override {
104 return __t == typeid(_Dp) ? std::addressof(__deleter_) : nullptr;
105 }
104#endif106#endif
105107
106private:108private:
107 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override;109 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
108 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override;110 __deleter_(__ptr_);
109};111 __ptr_.~_Tp();
110112 __deleter_.~_Dp();
111#if _LIBCPP_HAS_RTTI113 }
112
113template <class _Tp, class _Dp, class _Alloc>
114const void* __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT {
115 return __t == typeid(_Dp) ? std::addressof(__deleter_) : nullptr;
116}
117
118#endif // _LIBCPP_HAS_RTTI
119114
120template <class _Tp, class _Dp, class _Alloc>115 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
121void __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared() _NOEXCEPT {116 using __alloc_t = __allocator_traits_rebind_t<_Alloc, __shared_ptr_pointer>;
122 __deleter_(__ptr_);
123 __deleter_.~_Dp();
124}
125117
126template <class _Tp, class _Dp, class _Alloc>118 __alloc_t __a(__alloc_);
127void __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT {119 __alloc_.~_Alloc();
128 typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_pointer>::type _Al;120 __a.deallocate(pointer_traits<typename allocator_traits<__alloc_t>::pointer>::pointer_to(*this), 1);
129 typedef allocator_traits<_Al> _ATraits;121 }
130 typedef pointer_traits<typename _ATraits::pointer> _PTraits;122};
131
132 _Al __a(__alloc_);
133 __alloc_.~_Alloc();
134 __a.deallocate(_PTraits::pointer_to(*this), 1);
135}
136123
137// This tag is used to instantiate an allocator type. The various shared_ptr control blocks124// This tag is used to instantiate an allocator type. The various shared_ptr control blocks
138// detect that the allocator has been instantiated for this type and perform alternative125// detect that the allocator has been instantiated for this type and perform alternative
...@@ -140,79 +127,54 @@ void __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT {...@@ -140,79 +127,54 @@ void __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT {
140struct __for_overwrite_tag {};127struct __for_overwrite_tag {};
141128
142template <class _Tp, class _Alloc>129template <class _Tp, class _Alloc>
143struct __shared_ptr_emplace : __shared_weak_count {130struct _LIBCPP_HIDE_STRUCT_FROM_ABI __shared_ptr_emplace : __shared_weak_count {
144 using __value_type _LIBCPP_NODEBUG = __remove_cv_t<_Tp>;131 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<_Alloc>;
132 using __value_type _LIBCPP_NODEBUG = __remove_cv_t<_Tp>;
145133
146 template <class... _Args,134 template <class... _Args>
147 class _Allocator = _Alloc,135 _LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace(_Alloc __a, _Args&&... __args) : __alloc_(std::move(__a)) {
148 __enable_if_t<is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>136 allocator_traits<_Alloc>::construct(__alloc_, __get_elem(), std::forward<_Args>(__args)...);
149 _LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace(_Alloc __a, _Args&&...) : __storage_(std::move(__a)) {
150 static_assert(
151 sizeof...(_Args) == 0, "No argument should be provided to the control block when using _for_overwrite");
152 ::new (static_cast<void*>(__get_elem())) __value_type;
153 }137 }
154138
155 template <class... _Args,139 _LIBCPP_HIDE_FROM_ABI __value_type* __get_elem() _NOEXCEPT { return reinterpret_cast<__value_type*>(__buffer_); }
156 class _Allocator = _Alloc,
157 __enable_if_t<!is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>
158 _LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace(_Alloc __a, _Args&&... __args) : __storage_(std::move(__a)) {
159 using _TpAlloc = typename __allocator_traits_rebind<_Alloc, __value_type>::type;
160 _TpAlloc __tmp(*__get_alloc());
161 allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), std::forward<_Args>(__args)...);
162 }
163
164 _LIBCPP_HIDE_FROM_ABI _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
165
166 _LIBCPP_HIDE_FROM_ABI __value_type* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
167140
168private:141private:
169 template <class _Allocator = _Alloc,142 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override {
170 __enable_if_t<is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>143 allocator_traits<_Alloc>::destroy(__alloc_, __get_elem());
171 _LIBCPP_HIDE_FROM_ABI void __on_zero_shared_impl() _NOEXCEPT {
172 __get_elem()->~__value_type();
173 }
174
175 template <class _Allocator = _Alloc,
176 __enable_if_t<!is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>
177 _LIBCPP_HIDE_FROM_ABI void __on_zero_shared_impl() _NOEXCEPT {
178 using _TpAlloc = typename __allocator_traits_rebind<_Allocator, __remove_cv_t<_Tp> >::type;
179 _TpAlloc __tmp(*__get_alloc());
180 allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem());
181 }144 }
182145
183 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override { __on_zero_shared_impl(); }
184
185 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {146 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
186 using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type;147 using __alloc_t = __allocator_traits_rebind_t<_Alloc, __shared_ptr_emplace>;
187 using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer;148 __alloc_t __tmp(__alloc_);
188 _ControlBlockAlloc __tmp(*__get_alloc());149 __alloc_.~_Alloc();
189 __storage_.~_Storage();150 allocator_traits<__alloc_t>::deallocate(
190 allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, pointer_traits<_ControlBlockPointer>::pointer_to(*this), 1);151 __tmp, pointer_traits<typename allocator_traits<__alloc_t>::pointer>::pointer_to(*this), 1);
191 }152 }
192153
193 // TODO: It should be possible to refactor this to remove `_Storage` entirely.154 _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
194 // This class implements the control block for non-array shared pointers created155 _ALIGNAS_TYPE(__value_type) char __buffer_[sizeof(__value_type)];
195 // through `std::allocate_shared` and `std::make_shared`.156};
196 struct _Storage {
197 struct _Data {
198 _LIBCPP_COMPRESSED_PAIR(_Alloc, __alloc_, __value_type, __elem_);
199 };
200157
201 _ALIGNAS_TYPE(_Data) char __buffer_[sizeof(_Data)];158template <class _Tp, class _Alloc>
159struct _LIBCPP_HIDE_STRUCT_FROM_ABI __shared_ptr_emplace_for_overwrite : __shared_weak_count {
160 using __value_type _LIBCPP_NODEBUG = __remove_cv_t<_Tp>;
202161
203 _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) { ::new ((void*)__get_alloc()) _Alloc(std::move(__a)); }162 _LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace_for_overwrite(_Alloc __a) : __alloc_(std::move(__a)) {}
204 _LIBCPP_HIDE_FROM_ABI ~_Storage() { __get_alloc()->~_Alloc(); }
205163
206 _LIBCPP_HIDE_FROM_ABI _Alloc* __get_alloc() _NOEXCEPT {164 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override { __value_.~__value_type(); }
207 return std::addressof(reinterpret_cast<_Data*>(__buffer_)->__alloc_);165 _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override {
208 }166 using __alloc_t = __allocator_traits_rebind_t<_Alloc, __shared_ptr_emplace_for_overwrite>;
167 using __alloc_traits = allocator_traits<__alloc_t>;
168 __alloc_t __tmp(__alloc_);
169 __alloc_.~_Alloc();
170 __alloc_traits::deallocate(__tmp, pointer_traits<typename __alloc_traits::pointer>::pointer_to(*this), 1);
171 }
209172
210 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI __value_type* __get_elem() _NOEXCEPT {173 _LIBCPP_HIDE_FROM_ABI __value_type* __get_elem() _NOEXCEPT { return std::addressof(__value_); }
211 return std::addressof(reinterpret_cast<_Data*>(__buffer_)->__elem_);
212 }
213 };
214174
215 _Storage __storage_;175private:
176 _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
177 _LIBCPP_NO_UNIQUE_ADDRESS __value_type __value_;
216};178};
217179
218struct __shared_ptr_dummy_rebind_allocator_type;180struct __shared_ptr_dummy_rebind_allocator_type;
...@@ -233,16 +195,16 @@ class enable_shared_from_this;...@@ -233,16 +195,16 @@ class enable_shared_from_this;
233// when either Y* is convertible to T* or Y is U[N] and T is cv U[].195// when either Y* is convertible to T* or Y is U[N] and T is cv U[].
234#if _LIBCPP_STD_VER >= 17196#if _LIBCPP_STD_VER >= 17
235template <class _Yp, class _Tp>197template <class _Yp, class _Tp>
236struct __bounded_convertible_to_unbounded : false_type {};198inline const bool __bounded_convertible_to_unbounded_v = false;
237199
238template <class _Up, std::size_t _Np, class _Tp>200template <class _Up, std::size_t _Np, class _Tp>
239struct __bounded_convertible_to_unbounded<_Up[_Np], _Tp> : is_same<__remove_cv_t<_Tp>, _Up[]> {};201inline const bool __bounded_convertible_to_unbounded_v<_Up[_Np], _Tp> = is_same_v<remove_cv_t<_Tp>, _Up[]>;
240202
241template <class _Yp, class _Tp>203template <class _Yp, class _Tp>
242struct __compatible_with : _Or< is_convertible<_Yp*, _Tp*>, __bounded_convertible_to_unbounded<_Yp, _Tp> > {};204inline const bool __compatible_with_v = is_convertible_v<_Yp*, _Tp*> || __bounded_convertible_to_unbounded_v<_Yp, _Tp>;
243#else205#else
244template <class _Yp, class _Tp>206template <class _Yp, class _Tp>
245struct __compatible_with : is_convertible<_Yp*, _Tp*> {};207inline const bool __compatible_with_v = is_convertible<_Yp*, _Tp*>::value;
246#endif // _LIBCPP_STD_VER >= 17208#endif // _LIBCPP_STD_VER >= 17
247209
248// Constructors that take raw pointers have a different set of "compatible" constraints210// Constructors that take raw pointers have a different set of "compatible" constraints
...@@ -252,49 +214,46 @@ struct __compatible_with : is_convertible<_Yp*, _Tp*> {};...@@ -252,49 +214,46 @@ struct __compatible_with : is_convertible<_Yp*, _Tp*> {};
252// - If T is not an array type, then Y* is convertible to T*.214// - If T is not an array type, then Y* is convertible to T*.
253#if _LIBCPP_STD_VER >= 17215#if _LIBCPP_STD_VER >= 17
254template <class _Yp, class _Tp, class = void>216template <class _Yp, class _Tp, class = void>
255struct __raw_pointer_compatible_with : _And< _Not<is_array<_Tp>>, is_convertible<_Yp*, _Tp*> > {};217inline const bool __raw_pointer_compatible_with_v = !is_array_v<_Tp> && is_convertible_v<_Yp*, _Tp*>;
256218
257template <class _Yp, class _Up, std::size_t _Np>219template <class _Yp, class _Up, std::size_t _Np>
258struct __raw_pointer_compatible_with<_Yp, _Up[_Np], __enable_if_t< is_convertible<_Yp (*)[_Np], _Up (*)[_Np]>::value> >220inline const bool
259 : true_type {};221 __raw_pointer_compatible_with_v<_Yp, _Up[_Np], enable_if_t<is_convertible_v<_Yp (*)[_Np], _Up (*)[_Np]>>> = true;
260222
261template <class _Yp, class _Up>223template <class _Yp, class _Up>
262struct __raw_pointer_compatible_with<_Yp, _Up[], __enable_if_t< is_convertible<_Yp (*)[], _Up (*)[]>::value> >224inline const bool __raw_pointer_compatible_with_v<_Yp, _Up[], enable_if_t<is_convertible_v<_Yp (*)[], _Up (*)[]>>> =
263 : true_type {};225 true;
264226
265#else227#else
266template <class _Yp, class _Tp>228template <class _Yp, class _Tp>
267struct __raw_pointer_compatible_with : is_convertible<_Yp*, _Tp*> {};229inline const bool __raw_pointer_compatible_with_v = is_convertible<_Yp*, _Tp*>::value;
268#endif // _LIBCPP_STD_VER >= 17230#endif // _LIBCPP_STD_VER >= 17
269231
270template <class _Ptr, class = void>232template <class _Ptr, class = void>
271struct __is_deletable : false_type {};233inline const bool __is_deletable_v = false;
272template <class _Ptr>234template <class _Ptr>
273struct __is_deletable<_Ptr, decltype(delete std::declval<_Ptr>())> : true_type {};235inline const bool __is_deletable_v<_Ptr, decltype(delete std::declval<_Ptr>())> = true;
274236
275template <class _Ptr, class = void>237template <class _Ptr, class = void>
276struct __is_array_deletable : false_type {};238inline const bool __is_array_deletable_v = false;
277template <class _Ptr>239template <class _Ptr>
278struct __is_array_deletable<_Ptr, decltype(delete[] std::declval<_Ptr>())> : true_type {};240inline const bool __is_array_deletable_v<_Ptr, decltype(delete[] std::declval<_Ptr>())> = true;
279
280template <class _Dp, class _Pt, class = decltype(std::declval<_Dp>()(std::declval<_Pt>()))>
281true_type __well_formed_deleter_test(int);
282241
283template <class, class>242template <class _Dp, class _Pt, class = void>
284false_type __well_formed_deleter_test(...);243inline const bool __well_formed_deleter_v = false;
285244
286template <class _Dp, class _Pt>245template <class _Dp, class _Pt>
287struct __well_formed_deleter : decltype(std::__well_formed_deleter_test<_Dp, _Pt>(0)) {};246inline const bool __well_formed_deleter_v<_Dp, _Pt, __void_t<decltype(std::declval<_Dp>()(std::declval<_Pt>()))> > =
247 true;
288248
289template <class _Dp, class _Yp, class _Tp>249template <class _Dp, class _Yp, class _Tp>
290struct __shared_ptr_deleter_ctor_reqs {250inline const bool __shared_ptr_deleter_ctor_reqs_v =
291 static const bool value = __raw_pointer_compatible_with<_Yp, _Tp>::value && is_move_constructible<_Dp>::value &&251 __raw_pointer_compatible_with_v<_Yp, _Tp> && is_move_constructible<_Dp>::value &&
292 __well_formed_deleter<_Dp, _Yp*>::value;252 __well_formed_deleter_v<_Dp, _Yp*>;
293};
294253
295template <class _Dp>254template <class _Dp>
296using __shared_ptr_nullptr_deleter_ctor_reqs _LIBCPP_NODEBUG =255inline const bool __shared_ptr_nullptr_deleter_ctor_reqs_v =
297 _And<is_move_constructible<_Dp>, __well_formed_deleter<_Dp, nullptr_t> >;256 is_move_constructible<_Dp>::value && __well_formed_deleter_v<_Dp, nullptr_t>;
298257
299#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)258#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
300# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))259# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))
...@@ -328,16 +287,15 @@ public:...@@ -328,16 +287,15 @@ public:
328 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}287 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}
329288
330 template <class _Yp,289 template <class _Yp,
331 __enable_if_t< _And< __raw_pointer_compatible_with<_Yp, _Tp>290 __enable_if_t<__raw_pointer_compatible_with_v<_Yp, _Tp>
332 // In C++03 we get errors when trying to do SFINAE with the291 // In C++03 we get errors when trying to do SFINAE with the
333 // delete operator, so we always pretend that it's deletable.292 // delete operator, so we always pretend that it's deletable.
334 // The same happens on GCC.293 // The same happens on GCC.
335#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC)294#if !defined(_LIBCPP_CXX03_LANG)
336 ,295 && (is_array<_Tp>::value ? __is_array_deletable_v<_Yp*> : __is_deletable_v<_Yp*>)
337 _If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> >
338#endif296#endif
339 >::value,297 ,
340 int> = 0>298 int> = 0>
341 _LIBCPP_HIDE_FROM_ABI explicit shared_ptr(_Yp* __p) : __ptr_(__p) {299 _LIBCPP_HIDE_FROM_ABI explicit shared_ptr(_Yp* __p) : __ptr_(__p) {
342 unique_ptr<_Yp> __hold(__p);300 unique_ptr<_Yp> __hold(__p);
343 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;301 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
...@@ -347,7 +305,7 @@ public:...@@ -347,7 +305,7 @@ public:
347 __enable_weak_this(__p, __p);305 __enable_weak_this(__p, __p);
348 }306 }
349307
350 template <class _Yp, class _Dp, __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>308 template <class _Yp, class _Dp, __enable_if_t<__shared_ptr_deleter_ctor_reqs_v<_Dp, _Yp, _Tp>, int> = 0>
351 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d) : __ptr_(__p) {309 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d) : __ptr_(__p) {
352 auto __guard = std::__make_exception_guard([&] { __d(__p); });310 auto __guard = std::__make_exception_guard([&] { __d(__p); });
353 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;311 typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
...@@ -361,10 +319,7 @@ public:...@@ -361,10 +319,7 @@ public:
361 __guard.__complete();319 __guard.__complete();
362 }320 }
363321
364 template <class _Yp,322 template <class _Yp, class _Dp, class _Alloc, __enable_if_t<__shared_ptr_deleter_ctor_reqs_v<_Dp, _Yp, _Tp>, int> = 0>
365 class _Dp,
366 class _Alloc,
367 __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>
368 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d, _Alloc __a) : __ptr_(__p) {323 _LIBCPP_HIDE_FROM_ABI shared_ptr(_Yp* __p, _Dp __d, _Alloc __a) : __ptr_(__p) {
369 auto __guard = std::__make_exception_guard([&] { __d(__p); });324 auto __guard = std::__make_exception_guard([&] { __d(__p); });
370 typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;325 typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
...@@ -387,7 +342,7 @@ public:...@@ -387,7 +342,7 @@ public:
387 _LIBCPP_HIDE_FROM_ABI shared_ptr(342 _LIBCPP_HIDE_FROM_ABI shared_ptr(
388 nullptr_t __p,343 nullptr_t __p,
389 _Dp __d,344 _Dp __d,
390 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())345 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs_v<_Dp>, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())
391 : __ptr_(nullptr) {346 : __ptr_(nullptr) {
392 auto __guard = std::__make_exception_guard([&] { __d(__p); });347 auto __guard = std::__make_exception_guard([&] { __d(__p); });
393 typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;348 typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
...@@ -405,7 +360,7 @@ public:...@@ -405,7 +360,7 @@ public:
405 nullptr_t __p,360 nullptr_t __p,
406 _Dp __d,361 _Dp __d,
407 _Alloc __a,362 _Alloc __a,
408 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())363 __enable_if_t<__shared_ptr_nullptr_deleter_ctor_reqs_v<_Dp>, __nullptr_sfinae_tag> = __nullptr_sfinae_tag())
409 : __ptr_(nullptr) {364 : __ptr_(nullptr) {
410 auto __guard = std::__make_exception_guard([&] { __d(__p); });365 auto __guard = std::__make_exception_guard([&] { __d(__p); });
411 typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;366 typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
...@@ -447,7 +402,7 @@ public:...@@ -447,7 +402,7 @@ public:
447 __cntrl_->__add_shared();402 __cntrl_->__add_shared();
448 }403 }
449404
450 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>405 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
451 _LIBCPP_HIDE_FROM_ABI shared_ptr(const shared_ptr<_Yp>& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {406 _LIBCPP_HIDE_FROM_ABI shared_ptr(const shared_ptr<_Yp>& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
452 if (__cntrl_)407 if (__cntrl_)
453 __cntrl_->__add_shared();408 __cntrl_->__add_shared();
...@@ -458,13 +413,13 @@ public:...@@ -458,13 +413,13 @@ public:
458 __r.__cntrl_ = nullptr;413 __r.__cntrl_ = nullptr;
459 }414 }
460415
461 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>416 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
462 _LIBCPP_HIDE_FROM_ABI shared_ptr(shared_ptr<_Yp>&& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {417 _LIBCPP_HIDE_FROM_ABI shared_ptr(shared_ptr<_Yp>&& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
463 __r.__ptr_ = nullptr;418 __r.__ptr_ = nullptr;
464 __r.__cntrl_ = nullptr;419 __r.__cntrl_ = nullptr;
465 }420 }
466421
467 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>422 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
468 _LIBCPP_HIDE_FROM_ABI explicit shared_ptr(const weak_ptr<_Yp>& __r)423 _LIBCPP_HIDE_FROM_ABI explicit shared_ptr(const weak_ptr<_Yp>& __r)
469 : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_) {424 : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_) {
470 if (__cntrl_ == nullptr)425 if (__cntrl_ == nullptr)
...@@ -483,7 +438,7 @@ public:...@@ -483,7 +438,7 @@ public:
483438
484 template <class _Yp,439 template <class _Yp,
485 class _Dp,440 class _Dp,
486 __enable_if_t<__compatible_with<_Yp, _Tp>::value &&441 __enable_if_t<__compatible_with_v<_Yp, _Tp> &&
487 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,442 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
488 int> = 0>443 int> = 0>
489 _LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {444 _LIBCPP_HIDE_FROM_ABI shared_ptr(unique_ptr<_Yp, _Dp>&& __r) : __ptr_(__r.get()) {
...@@ -506,7 +461,7 @@ public:...@@ -506,7 +461,7 @@ public:
506 return *this;461 return *this;
507 }462 }
508463
509 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>464 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
510 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>& operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT {465 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>& operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT {
511 shared_ptr(__r).swap(*this);466 shared_ptr(__r).swap(*this);
512 return *this;467 return *this;
...@@ -517,7 +472,7 @@ public:...@@ -517,7 +472,7 @@ public:
517 return *this;472 return *this;
518 }473 }
519474
520 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>475 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
521 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>& operator=(shared_ptr<_Yp>&& __r) {476 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>& operator=(shared_ptr<_Yp>&& __r) {
522 shared_ptr(std::move(__r)).swap(*this);477 shared_ptr(std::move(__r)).swap(*this);
523 return *this;478 return *this;
...@@ -535,8 +490,8 @@ public:...@@ -535,8 +490,8 @@ public:
535490
536 template <class _Yp,491 template <class _Yp,
537 class _Dp,492 class _Dp,
538 __enable_if_t<_And< __compatible_with<_Yp, _Tp>,493 __enable_if_t<__compatible_with_v<_Yp, _Tp> &&
539 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*> >::value,494 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
540 int> = 0>495 int> = 0>
541 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>& operator=(unique_ptr<_Yp, _Dp>&& __r) {496 _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp>& operator=(unique_ptr<_Yp, _Dp>&& __r) {
542 shared_ptr(std::move(__r)).swap(*this);497 shared_ptr(std::move(__r)).swap(*this);
...@@ -550,20 +505,17 @@ public:...@@ -550,20 +505,17 @@ public:
550505
551 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT { shared_ptr().swap(*this); }506 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT { shared_ptr().swap(*this); }
552507
553 template <class _Yp, __enable_if_t<__raw_pointer_compatible_with<_Yp, _Tp>::value, int> = 0>508 template <class _Yp, __enable_if_t<__raw_pointer_compatible_with_v<_Yp, _Tp>, int> = 0>
554 _LIBCPP_HIDE_FROM_ABI void reset(_Yp* __p) {509 _LIBCPP_HIDE_FROM_ABI void reset(_Yp* __p) {
555 shared_ptr(__p).swap(*this);510 shared_ptr(__p).swap(*this);
556 }511 }
557512
558 template <class _Yp, class _Dp, __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>513 template <class _Yp, class _Dp, __enable_if_t<__shared_ptr_deleter_ctor_reqs_v<_Dp, _Yp, _Tp>, int> = 0>
559 _LIBCPP_HIDE_FROM_ABI void reset(_Yp* __p, _Dp __d) {514 _LIBCPP_HIDE_FROM_ABI void reset(_Yp* __p, _Dp __d) {
560 shared_ptr(__p, __d).swap(*this);515 shared_ptr(__p, __d).swap(*this);
561 }516 }
562517
563 template <class _Yp,518 template <class _Yp, class _Dp, class _Alloc, __enable_if_t<__shared_ptr_deleter_ctor_reqs_v<_Dp, _Yp, _Tp>, int> = 0>
564 class _Dp,
565 class _Alloc,
566 __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value, int> = 0>
567 _LIBCPP_HIDE_FROM_ABI void reset(_Yp* __p, _Dp __d, _Alloc __a) {519 _LIBCPP_HIDE_FROM_ABI void reset(_Yp* __p, _Dp __d, _Alloc __a) {
568 shared_ptr(__p, __d, __a).swap(*this);520 shared_ptr(__p, __d, __a).swap(*this);
569 }521 }
...@@ -647,7 +599,26 @@ private:...@@ -647,7 +599,26 @@ private:
647 }599 }
648 }600 }
649601
650 _LIBCPP_HIDE_FROM_ABI void __enable_weak_this(...) _NOEXCEPT {}602 template <class _Vp>
603 static __type_identity<_Vp> __get_shared_from_this_impl(const enable_shared_from_this<_Vp>*);
604
605 template <class _Vp, class = void>
606 struct __get_shared_from_this {
607 using type _LIBCPP_NODEBUG = __nat;
608 };
609
610 template <class _Vp>
611 struct __get_shared_from_this<_Vp, __void_t<decltype(__get_shared_from_this_impl(static_cast<_Vp*>(nullptr)))> > {
612 using type _LIBCPP_NODEBUG = const enable_shared_from_this<typename decltype(__get_shared_from_this_impl(
613 static_cast<_Vp*>(nullptr)))::type>*;
614 };
615
616 template <
617 class _Yp,
618 class _OrigPtr,
619 __enable_if_t<!is_convertible<_OrigPtr, typename __get_shared_from_this<__remove_pointer_t<_Yp> >::type>::value,
620 int> = 0>
621 _LIBCPP_HIDE_FROM_ABI void __enable_weak_this(_Yp, _OrigPtr) {}
651622
652 template <class, class _Yp>623 template <class, class _Yp>
653 struct __shared_ptr_default_delete : default_delete<_Yp> {};624 struct __shared_ptr_default_delete : default_delete<_Yp> {};
...@@ -674,15 +645,22 @@ shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;...@@ -674,15 +645,22 @@ shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;
674//645//
675// std::allocate_shared and std::make_shared646// std::allocate_shared and std::make_shared
676//647//
677template <class _Tp, class _Alloc, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>648
678[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&&... __args) {649template <class _ControlBlock, class _Tp, class _Alloc, class... _Args>
679 using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;650_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> __allocate_shared_impl(const _Alloc& __alloc, _Args&&... __args) {
680 using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;651 using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
681 __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);652 __allocation_guard<_ControlBlockAllocator> __guard(__alloc, 1);
682 ::new ((void*)std::addressof(*__guard.__get())) _ControlBlock(__a, std::forward<_Args>(__args)...);653 ::new ((void*)std::addressof(*__guard.__get())) _ControlBlock(__alloc, std::forward<_Args>(__args)...);
683 auto __control_block = __guard.__release_ptr();654 auto __control_block = __guard.__release_ptr();
684 return shared_ptr<_Tp>::__create_with_control_block(655 return shared_ptr<_Tp>::__create_with_control_block(
685 (*__control_block).__get_elem(), std::addressof(*__control_block));656 __control_block->__get_elem(), std::__to_address(__control_block));
657}
658
659template <class _Tp, class _Alloc, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>
660[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&&... __args) {
661 using _CanonicalAlloc = __allocator_traits_rebind_t<_Alloc, __remove_cv_t<_Tp> >;
662 using _ControlBlock = __shared_ptr_emplace<_Tp, _CanonicalAlloc>;
663 return std::__allocate_shared_impl<_ControlBlock, _Tp>(_CanonicalAlloc(__a), std::forward<_Args>(__args)...);
686}664}
687665
688template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>666template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> = 0>
...@@ -694,9 +672,9 @@ template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> =...@@ -694,9 +672,9 @@ template <class _Tp, class... _Args, __enable_if_t<!is_array<_Tp>::value, int> =
694672
695template <class _Tp, class _Alloc, __enable_if_t<!is_array<_Tp>::value, int> = 0>673template <class _Tp, class _Alloc, __enable_if_t<!is_array<_Tp>::value, int> = 0>
696[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {674[[nodiscard]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a) {
697 using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;675 using _CanonicalAlloc = __allocator_traits_rebind_t<_Alloc, remove_cv_t<_Tp>>;
698 _ForOverwriteAllocator __alloc(__a);676 using _ControlBlock = __shared_ptr_emplace_for_overwrite<_Tp, _CanonicalAlloc>;
699 return std::allocate_shared<_Tp>(__alloc);677 return std::__allocate_shared_impl<_ControlBlock, _Tp>(_CanonicalAlloc(__a));
700}678}
701679
702template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>680template <class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>
...@@ -752,7 +730,7 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count {...@@ -752,7 +730,7 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count {
752 // [1]: https://en.wikipedia.org/wiki/Data_structure_alignment#Computing_padding730 // [1]: https://en.wikipedia.org/wiki/Data_structure_alignment#Computing_padding
753 size_t __bytes = __elements == 0 ? sizeof(__unbounded_array_control_block)731 size_t __bytes = __elements == 0 ? sizeof(__unbounded_array_control_block)
754 : (__elements - 1) * sizeof(_Tp) + sizeof(__unbounded_array_control_block);732 : (__elements - 1) * sizeof(_Tp) + sizeof(__unbounded_array_control_block);
755 constexpr size_t __align = alignof(_Tp);733 constexpr size_t __align = alignof(__unbounded_array_control_block);
756 return (__bytes + __align - 1) & ~(__align - 1);734 return (__bytes + __align - 1) & ~(__align - 1);
757 }735 }
758736
...@@ -1171,44 +1149,93 @@ private:...@@ -1171,44 +1149,93 @@ private:
1171 __shared_weak_count* __cntrl_;1149 __shared_weak_count* __cntrl_;
11721150
1173public:1151public:
1174 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;1152 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}
1153
1154 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
1155 _LIBCPP_HIDE_FROM_ABI weak_ptr(shared_ptr<_Yp> const& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
1156 if (__cntrl_)
1157 __cntrl_->__add_weak();
1158 }
1159
1160 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr const& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
1161 if (__cntrl_)
1162 __cntrl_->__add_weak();
1163 }
1164
1165 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
1166 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr<_Yp> const& __r) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {
1167 shared_ptr<_Yp> __s = __r.lock();
1168 *this = weak_ptr<_Tp>(__s);
1169 }
11751170
1176 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>1171 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr&& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
1177 _LIBCPP_HIDE_FROM_ABI weak_ptr(shared_ptr<_Yp> const& __r) _NOEXCEPT;1172 __r.__ptr_ = nullptr;
1173 __r.__cntrl_ = nullptr;
1174 }
11781175
1179 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr const& __r) _NOEXCEPT;1176 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
1177 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr<_Yp>&& __r) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {
1178 shared_ptr<_Yp> __s = __r.lock();
1179 *this = weak_ptr<_Tp>(__s);
1180 __r.reset();
1181 }
11801182
1181 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>1183 _LIBCPP_HIDE_FROM_ABI ~weak_ptr() {
1182 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr<_Yp> const& __r) _NOEXCEPT;1184 if (__cntrl_)
1185 __cntrl_->__release_weak();
1186 }
11831187
1184 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr&& __r) _NOEXCEPT;1188 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT {
1189 weak_ptr(__r).swap(*this);
1190 return *this;
1191 }
11851192
1186 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>1193 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
1187 _LIBCPP_HIDE_FROM_ABI weak_ptr(weak_ptr<_Yp>&& __r) _NOEXCEPT;1194 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT {
1195 weak_ptr(__r).swap(*this);
1196 return *this;
1197 }
11881198
1189 _LIBCPP_HIDE_FROM_ABI ~weak_ptr();1199 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT {
1200 weak_ptr(std::move(__r)).swap(*this);
1201 return *this;
1202 }
11901203
1191 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;1204 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
1192 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>1205 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT {
1193 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;1206 weak_ptr(std::move(__r)).swap(*this);
1207 return *this;
1208 }
11941209
1195 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;1210 template <class _Yp, __enable_if_t<__compatible_with_v<_Yp, _Tp>, int> = 0>
1196 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>1211 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT {
1197 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;1212 weak_ptr(__r).swap(*this);
1213 return *this;
1214 }
11981215
1199 template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>1216 _LIBCPP_HIDE_FROM_ABI void swap(weak_ptr& __r) _NOEXCEPT {
1200 _LIBCPP_HIDE_FROM_ABI weak_ptr& operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;1217 std::swap(__ptr_, __r.__ptr_);
1218 std::swap(__cntrl_, __r.__cntrl_);
1219 }
12011220
1202 _LIBCPP_HIDE_FROM_ABI void swap(weak_ptr& __r) _NOEXCEPT;1221 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT { weak_ptr().swap(*this); }
1203 _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT;
12041222
1205 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT {1223 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI long use_count() const _NOEXCEPT {
1206 return __cntrl_ ? __cntrl_->use_count() : 0;1224 return __cntrl_ ? __cntrl_->use_count() : 0;
1207 }1225 }
1226
1208 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool expired() const _NOEXCEPT {1227 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool expired() const _NOEXCEPT {
1209 return __cntrl_ == nullptr || __cntrl_->use_count() == 0;1228 return __cntrl_ == nullptr || __cntrl_->use_count() == 0;
1210 }1229 }
1211 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> lock() const _NOEXCEPT;1230
1231 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> lock() const _NOEXCEPT {
1232 shared_ptr<_Tp> __r;
1233 __r.__cntrl_ = __cntrl_ ? __cntrl_->lock() : __cntrl_;
1234 if (__r.__cntrl_)
1235 __r.__ptr_ = __ptr_;
1236 return __r;
1237 }
1238
1212 template <class _Up>1239 template <class _Up>
1213 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT {1240 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT {
1214 return __cntrl_ < __r.__cntrl_;1241 return __cntrl_ < __r.__cntrl_;
...@@ -1229,107 +1256,11 @@ template <class _Tp>...@@ -1229,107 +1256,11 @@ template <class _Tp>
1229weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;1256weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
1230#endif1257#endif
12311258
1232template <class _Tp>
1233inline _LIBCPP_CONSTEXPR weak_ptr<_Tp>::weak_ptr() _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}
1234
1235template <class _Tp>
1236inline weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
1237 if (__cntrl_)
1238 __cntrl_->__add_weak();
1239}
1240
1241template <class _Tp>
1242template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
1243inline weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
1244 if (__cntrl_)
1245 __cntrl_->__add_weak();
1246}
1247
1248template <class _Tp>
1249template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
1250inline weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {
1251 shared_ptr<_Yp> __s = __r.lock();
1252 *this = weak_ptr<_Tp>(__s);
1253}
1254
1255template <class _Tp>
1256inline weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) {
1257 __r.__ptr_ = nullptr;
1258 __r.__cntrl_ = nullptr;
1259}
1260
1261template <class _Tp>
1262template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
1263inline weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {
1264 shared_ptr<_Yp> __s = __r.lock();
1265 *this = weak_ptr<_Tp>(__s);
1266 __r.reset();
1267}
1268
1269template <class _Tp>
1270weak_ptr<_Tp>::~weak_ptr() {
1271 if (__cntrl_)
1272 __cntrl_->__release_weak();
1273}
1274
1275template <class _Tp>
1276inline weak_ptr<_Tp>& weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT {
1277 weak_ptr(__r).swap(*this);
1278 return *this;
1279}
1280
1281template <class _Tp>
1282template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
1283inline weak_ptr<_Tp>& weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT {
1284 weak_ptr(__r).swap(*this);
1285 return *this;
1286}
1287
1288template <class _Tp>
1289inline weak_ptr<_Tp>& weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT {
1290 weak_ptr(std::move(__r)).swap(*this);
1291 return *this;
1292}
1293
1294template <class _Tp>
1295template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
1296inline weak_ptr<_Tp>& weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT {
1297 weak_ptr(std::move(__r)).swap(*this);
1298 return *this;
1299}
1300
1301template <class _Tp>
1302template <class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
1303inline weak_ptr<_Tp>& weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT {
1304 weak_ptr(__r).swap(*this);
1305 return *this;
1306}
1307
1308template <class _Tp>
1309inline void weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT {
1310 std::swap(__ptr_, __r.__ptr_);
1311 std::swap(__cntrl_, __r.__cntrl_);
1312}
1313
1314template <class _Tp>1259template <class _Tp>
1315inline _LIBCPP_HIDE_FROM_ABI void swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT {1260inline _LIBCPP_HIDE_FROM_ABI void swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT {
1316 __x.swap(__y);1261 __x.swap(__y);
1317}1262}
13181263
1319template <class _Tp>
1320inline void weak_ptr<_Tp>::reset() _NOEXCEPT {
1321 weak_ptr().swap(*this);
1322}
1323
1324template <class _Tp>
1325shared_ptr<_Tp> weak_ptr<_Tp>::lock() const _NOEXCEPT {
1326 shared_ptr<_Tp> __r;
1327 __r.__cntrl_ = __cntrl_ ? __cntrl_->lock() : __cntrl_;
1328 if (__r.__cntrl_)
1329 __r.__ptr_ = __ptr_;
1330 return __r;
1331}
1332
1333#if _LIBCPP_STD_VER >= 171264#if _LIBCPP_STD_VER >= 17
1334template <class _Tp = void>1265template <class _Tp = void>
1335struct owner_less;1266struct owner_less;
...@@ -1536,6 +1467,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_weak_explicit(...@@ -1536,6 +1467,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_weak_explicit(
15361467
1537#endif // _LIBCPP_HAS_THREADS1468#endif // _LIBCPP_HAS_THREADS
15381469
1470_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1539_LIBCPP_END_NAMESPACE_STD1471_LIBCPP_END_NAMESPACE_STD
15401472
1541_LIBCPP_POP_MACROS1473_LIBCPP_POP_MACROS
lib/libcxx/include/__memory/temporary_buffer.h+3
...@@ -26,6 +26,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -26,6 +26,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
26template <class _Tp>26template <class _Tp>
27[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 pair<_Tp*, ptrdiff_t>27[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 pair<_Tp*, ptrdiff_t>
28get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT {28get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT {
29 if (__n <= 0)
30 return pair<_Tp*, ptrdiff_t>();
31
29 __unique_temporary_buffer<_Tp> __unique_buf = std::__allocate_unique_temporary_buffer<_Tp>(__n);32 __unique_temporary_buffer<_Tp> __unique_buf = std::__allocate_unique_temporary_buffer<_Tp>(__n);
30 pair<_Tp*, ptrdiff_t> __result(__unique_buf.get(), __unique_buf.get_deleter().__count_);33 pair<_Tp*, ptrdiff_t> __result(__unique_buf.get(), __unique_buf.get_deleter().__count_);
31 __unique_buf.release();34 __unique_buf.release();
lib/libcxx/include/__memory/uninitialized_algorithms.h+53-192
...@@ -11,11 +11,10 @@...@@ -11,11 +11,10 @@
11#define _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H11#define _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
1212
13#include <__algorithm/copy.h>13#include <__algorithm/copy.h>
14#include <__algorithm/move.h>14#include <__algorithm/in_out_result.h>
15#include <__algorithm/unwrap_iter.h>15#include <__algorithm/unwrap_iter.h>
16#include <__algorithm/unwrap_range.h>16#include <__algorithm/unwrap_range.h>
17#include <__config>17#include <__config>
18#include <__cstddef/size_t.h>
19#include <__fwd/memory.h>18#include <__fwd/memory.h>
20#include <__iterator/iterator_traits.h>19#include <__iterator/iterator_traits.h>
21#include <__iterator/reverse_iterator.h>20#include <__iterator/reverse_iterator.h>
...@@ -25,15 +24,13 @@...@@ -25,15 +24,13 @@
25#include <__memory/destroy.h>24#include <__memory/destroy.h>
26#include <__memory/pointer_traits.h>25#include <__memory/pointer_traits.h>
27#include <__type_traits/enable_if.h>26#include <__type_traits/enable_if.h>
28#include <__type_traits/extent.h>
29#include <__type_traits/is_array.h>
30#include <__type_traits/is_constant_evaluated.h>27#include <__type_traits/is_constant_evaluated.h>
28#include <__type_traits/is_reference.h>
31#include <__type_traits/is_same.h>29#include <__type_traits/is_same.h>
32#include <__type_traits/is_trivially_assignable.h>30#include <__type_traits/is_trivially_assignable.h>
33#include <__type_traits/is_trivially_constructible.h>31#include <__type_traits/is_trivially_constructible.h>
34#include <__type_traits/is_trivially_relocatable.h>32#include <__type_traits/is_trivially_relocatable.h>
35#include <__type_traits/remove_const.h>33#include <__type_traits/remove_const.h>
36#include <__type_traits/remove_extent.h>
37#include <__utility/exception_guard.h>34#include <__utility/exception_guard.h>
38#include <__utility/move.h>35#include <__utility/move.h>
39#include <__utility/pair.h>36#include <__utility/pair.h>
...@@ -57,7 +54,8 @@ struct __always_false {...@@ -57,7 +54,8 @@ struct __always_false {
57// uninitialized_copy54// uninitialized_copy
5855
59template <class _ValueType, class _InputIterator, class _Sentinel1, class _ForwardIterator, class _EndPredicate>56template <class _ValueType, class _InputIterator, class _Sentinel1, class _ForwardIterator, class _EndPredicate>
60inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_copy(57inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __in_out_result<_InputIterator, _ForwardIterator>
58__uninitialized_copy(
61 _InputIterator __ifirst, _Sentinel1 __ilast, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {59 _InputIterator __ifirst, _Sentinel1 __ilast, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {
62 _ForwardIterator __idx = __ofirst;60 _ForwardIterator __idx = __ofirst;
63 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });61 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
...@@ -65,22 +63,22 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali...@@ -65,22 +63,22 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
65 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);63 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
66 __guard.__complete();64 __guard.__complete();
6765
68 return pair<_InputIterator, _ForwardIterator>(std::move(__ifirst), std::move(__idx));66 return {std::move(__ifirst), std::move(__idx)};
69}67}
7068
71template <class _InputIterator, class _ForwardIterator>69template <class _InputIterator, class _ForwardIterator>
72_LIBCPP_HIDE_FROM_ABI _ForwardIterator70_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
73uninitialized_copy(_InputIterator __ifirst, _InputIterator __ilast, _ForwardIterator __ofirst) {71uninitialized_copy(_InputIterator __ifirst, _InputIterator __ilast, _ForwardIterator __ofirst) {
74 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;72 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
75 auto __result = std::__uninitialized_copy<_ValueType>(73 auto __result = std::__uninitialized_copy<_ValueType>(
76 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __always_false());74 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __always_false());
77 return std::move(__result.second);75 return std::move(__result.__out_);
78}76}
7977
80// uninitialized_copy_n78// uninitialized_copy_n
8179
82template <class _ValueType, class _InputIterator, class _Size, class _ForwardIterator, class _EndPredicate>80template <class _ValueType, class _InputIterator, class _Size, class _ForwardIterator, class _EndPredicate>
83inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>81inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __in_out_result<_InputIterator, _ForwardIterator>
84__uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {82__uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_copying) {
85 _ForwardIterator __idx = __ofirst;83 _ForwardIterator __idx = __ofirst;
86 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });84 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
...@@ -88,22 +86,22 @@ __uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __of...@@ -88,22 +86,22 @@ __uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __of
88 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);86 ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
89 __guard.__complete();87 __guard.__complete();
9088
91 return pair<_InputIterator, _ForwardIterator>(std::move(__ifirst), std::move(__idx));89 return {std::move(__ifirst), std::move(__idx)};
92}90}
9391
94template <class _InputIterator, class _Size, class _ForwardIterator>92template <class _InputIterator, class _Size, class _ForwardIterator>
95inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator93inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
96uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst) {94uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst) {
97 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;95 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
98 auto __result =96 auto __result =
99 std::__uninitialized_copy_n<_ValueType>(std::move(__ifirst), __n, std::move(__ofirst), __always_false());97 std::__uninitialized_copy_n<_ValueType>(std::move(__ifirst), __n, std::move(__ofirst), __always_false());
100 return std::move(__result.second);98 return std::move(__result.__out_);
101}99}
102100
103// uninitialized_fill101// uninitialized_fill
104102
105template <class _ValueType, class _ForwardIterator, class _Sentinel, class _Tp>103template <class _ValueType, class _ForwardIterator, class _Sentinel, class _Tp>
106inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator104inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
107__uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) {105__uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) {
108 _ForwardIterator __idx = __first;106 _ForwardIterator __idx = __first;
109 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });107 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
...@@ -115,7 +113,7 @@ __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)...@@ -115,7 +113,7 @@ __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
115}113}
116114
117template <class _ForwardIterator, class _Tp>115template <class _ForwardIterator, class _Tp>
118inline _LIBCPP_HIDE_FROM_ABI void116inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
119uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) {117uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) {
120 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;118 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
121 (void)std::__uninitialized_fill<_ValueType>(__first, __last, __x);119 (void)std::__uninitialized_fill<_ValueType>(__first, __last, __x);
...@@ -124,7 +122,7 @@ uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp&...@@ -124,7 +122,7 @@ uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp&
124// uninitialized_fill_n122// uninitialized_fill_n
125123
126template <class _ValueType, class _ForwardIterator, class _Size, class _Tp>124template <class _ValueType, class _ForwardIterator, class _Size, class _Tp>
127inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator125inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
128__uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {126__uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
129 _ForwardIterator __idx = __first;127 _ForwardIterator __idx = __first;
130 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });128 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
...@@ -136,7 +134,7 @@ __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {...@@ -136,7 +134,7 @@ __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
136}134}
137135
138template <class _ForwardIterator, class _Size, class _Tp>136template <class _ForwardIterator, class _Size, class _Tp>
139inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator137inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
140uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {138uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
141 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;139 typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
142 return std::__uninitialized_fill_n<_ValueType>(__first, __n, __x);140 return std::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
...@@ -144,10 +142,18 @@ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {...@@ -144,10 +142,18 @@ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
144142
145#if _LIBCPP_STD_VER >= 17143#if _LIBCPP_STD_VER >= 17
146144
145template <class _Iter>
146_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) __deref_move(_Iter& __it) {
147 if constexpr (is_lvalue_reference_v<decltype(*__it)>)
148 return std::move(*__it);
149 else
150 return *__it;
151}
152
147// uninitialized_default_construct153// uninitialized_default_construct
148154
149template <class _ValueType, class _ForwardIterator, class _Sentinel>155template <class _ValueType, class _ForwardIterator, class _Sentinel>
150inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator156inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
151__uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {157__uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
152 auto __idx = __first;158 auto __idx = __first;
153 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });159 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
...@@ -159,7 +165,8 @@ __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {...@@ -159,7 +165,8 @@ __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
159}165}
160166
161template <class _ForwardIterator>167template <class _ForwardIterator>
162inline _LIBCPP_HIDE_FROM_ABI void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {168inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
169uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
163 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;170 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
164 (void)std::__uninitialized_default_construct<_ValueType>(std::move(__first), std::move(__last));171 (void)std::__uninitialized_default_construct<_ValueType>(std::move(__first), std::move(__last));
165}172}
...@@ -167,7 +174,8 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_default_construct(_ForwardIterat...@@ -167,7 +174,8 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_default_construct(_ForwardIterat
167// uninitialized_default_construct_n174// uninitialized_default_construct_n
168175
169template <class _ValueType, class _ForwardIterator, class _Size>176template <class _ValueType, class _ForwardIterator, class _Size>
170inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {177inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
178__uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
171 auto __idx = __first;179 auto __idx = __first;
172 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });180 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
173 for (; __n > 0; ++__idx, (void)--__n)181 for (; __n > 0; ++__idx, (void)--__n)
...@@ -178,7 +186,8 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_...@@ -178,7 +186,8 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_
178}186}
179187
180template <class _ForwardIterator, class _Size>188template <class _ForwardIterator, class _Size>
181inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {189inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
190uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
182 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;191 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
183 return std::__uninitialized_default_construct_n<_ValueType>(std::move(__first), __n);192 return std::__uninitialized_default_construct_n<_ValueType>(std::move(__first), __n);
184}193}
...@@ -186,7 +195,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_default_construct_n(...@@ -186,7 +195,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_default_construct_n(
186// uninitialized_value_construct195// uninitialized_value_construct
187196
188template <class _ValueType, class _ForwardIterator, class _Sentinel>197template <class _ValueType, class _ForwardIterator, class _Sentinel>
189inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator198inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
190__uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {199__uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
191 auto __idx = __first;200 auto __idx = __first;
192 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });201 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
...@@ -198,7 +207,8 @@ __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {...@@ -198,7 +207,8 @@ __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
198}207}
199208
200template <class _ForwardIterator>209template <class _ForwardIterator>
201inline _LIBCPP_HIDE_FROM_ABI void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {210inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
211uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
202 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;212 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
203 (void)std::__uninitialized_value_construct<_ValueType>(std::move(__first), std::move(__last));213 (void)std::__uninitialized_value_construct<_ValueType>(std::move(__first), std::move(__last));
204}214}
...@@ -206,7 +216,8 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_value_construct(_ForwardIterator...@@ -206,7 +216,8 @@ inline _LIBCPP_HIDE_FROM_ABI void uninitialized_value_construct(_ForwardIterator
206// uninitialized_value_construct_n216// uninitialized_value_construct_n
207217
208template <class _ValueType, class _ForwardIterator, class _Size>218template <class _ValueType, class _ForwardIterator, class _Size>
209inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {219inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
220__uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
210 auto __idx = __first;221 auto __idx = __first;
211 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });222 auto __guard = std::__make_exception_guard([&] { std::__destroy(__first, __idx); });
212 for (; __n > 0; ++__idx, (void)--__n)223 for (; __n > 0; ++__idx, (void)--__n)
...@@ -217,7 +228,8 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(...@@ -217,7 +228,8 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(
217}228}
218229
219template <class _ForwardIterator, class _Size>230template <class _ForwardIterator, class _Size>
220inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {231inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
232uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
221 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;233 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
222 return std::__uninitialized_value_construct_n<_ValueType>(std::move(__first), __n);234 return std::__uninitialized_value_construct_n<_ValueType>(std::move(__first), __n);
223}235}
...@@ -230,12 +242,12 @@ template <class _ValueType,...@@ -230,12 +242,12 @@ template <class _ValueType,
230 class _ForwardIterator,242 class _ForwardIterator,
231 class _EndPredicate,243 class _EndPredicate,
232 class _IterMove>244 class _IterMove>
233inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_move(245inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __in_out_result<_InputIterator, _ForwardIterator>
234 _InputIterator __ifirst,246__uninitialized_move(_InputIterator __ifirst,
235 _Sentinel1 __ilast,247 _Sentinel1 __ilast,
236 _ForwardIterator __ofirst,248 _ForwardIterator __ofirst,
237 _EndPredicate __stop_moving,249 _EndPredicate __stop_moving,
238 _IterMove __iter_move) {250 _IterMove __iter_move) {
239 auto __idx = __ofirst;251 auto __idx = __ofirst;
240 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });252 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
241 for (; __ifirst != __ilast && !__stop_moving(__idx); ++__idx, (void)++__ifirst) {253 for (; __ifirst != __ilast && !__stop_moving(__idx); ++__idx, (void)++__ifirst) {
...@@ -247,14 +259,14 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali...@@ -247,14 +259,14 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
247}259}
248260
249template <class _InputIterator, class _ForwardIterator>261template <class _InputIterator, class _ForwardIterator>
250inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator262inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ForwardIterator
251uninitialized_move(_InputIterator __ifirst, _InputIterator __ilast, _ForwardIterator __ofirst) {263uninitialized_move(_InputIterator __ifirst, _InputIterator __ilast, _ForwardIterator __ofirst) {
252 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;264 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
253 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return std::move(*__iter); };265 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return std::__deref_move(__iter); };
254266
255 auto __result = std::__uninitialized_move<_ValueType>(267 auto __result = std::__uninitialized_move<_ValueType>(
256 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __always_false(), __iter_move);268 std::move(__ifirst), std::move(__ilast), std::move(__ofirst), __always_false(), __iter_move);
257 return std::move(__result.second);269 return std::move(__result.__out_);
258}270}
259271
260// uninitialized_move_n272// uninitialized_move_n
...@@ -265,7 +277,8 @@ template <class _ValueType,...@@ -265,7 +277,8 @@ template <class _ValueType,
265 class _ForwardIterator,277 class _ForwardIterator,
266 class _EndPredicate,278 class _EndPredicate,
267 class _IterMove>279 class _IterMove>
268inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitialized_move_n(280inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __in_out_result<_InputIterator, _ForwardIterator>
281__uninitialized_move_n(
269 _InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_moving, _IterMove __iter_move) {282 _InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst, _EndPredicate __stop_moving, _IterMove __iter_move) {
270 auto __idx = __ofirst;283 auto __idx = __ofirst;
271 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });284 auto __guard = std::__make_exception_guard([&] { std::__destroy(__ofirst, __idx); });
...@@ -277,166 +290,14 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali...@@ -277,166 +290,14 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
277}290}
278291
279template <class _InputIterator, class _Size, class _ForwardIterator>292template <class _InputIterator, class _Size, class _ForwardIterator>
280inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>293inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<_InputIterator, _ForwardIterator>
281uninitialized_move_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst) {294uninitialized_move_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst) {
282 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;295 using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
283 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return std::move(*__iter); };296 auto __iter_move = [](auto&& __iter) -> decltype(auto) { return std::__deref_move(__iter); };
284297
285 return std::__uninitialized_move_n<_ValueType>(298 auto __result = std::__uninitialized_move_n<_ValueType>(
286 std::move(__ifirst), __n, std::move(__ofirst), __always_false(), __iter_move);299 std::move(__ifirst), __n, std::move(__ofirst), __always_false(), __iter_move);
287}300 return {std::move(__result.__in_), std::move(__result.__out_)};
288
289// TODO: Rewrite this to iterate left to right and use reverse_iterators when calling
290// Destroys every element in the range [first, last) FROM RIGHT TO LEFT using allocator
291// destruction. If elements are themselves C-style arrays, they are recursively destroyed
292// in the same manner.
293//
294// This function assumes that destructors do not throw, and that the allocator is bound to
295// the correct type.
296template <class _Alloc,
297 class _BidirIter,
298 __enable_if_t<__has_bidirectional_iterator_category<_BidirIter>::value, int> = 0>
299_LIBCPP_HIDE_FROM_ABI constexpr void
300__allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter __first, _BidirIter __last) noexcept {
301 using _ValueType = typename iterator_traits<_BidirIter>::value_type;
302 static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _ValueType>,
303 "The allocator should already be rebound to the correct type");
304
305 if (__first == __last)
306 return;
307
308 if constexpr (is_array_v<_ValueType>) {
309 static_assert(!__is_unbounded_array_v<_ValueType>,
310 "arrays of unbounded arrays don't exist, but if they did we would mess up here");
311
312 using _Element = remove_extent_t<_ValueType>;
313 __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
314 do {
315 --__last;
316 decltype(auto) __array = *__last;
317 std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + extent_v<_ValueType>);
318 } while (__last != __first);
319 } else {
320 do {
321 --__last;
322 allocator_traits<_Alloc>::destroy(__alloc, std::addressof(*__last));
323 } while (__last != __first);
324 }
325}
326
327// Constructs the object at the given location using the allocator's construct method.
328//
329// If the object being constructed is an array, each element of the array is allocator-constructed,
330// recursively. If an exception is thrown during the construction of an array, the initialized
331// elements are destroyed in reverse order of initialization using allocator destruction.
332//
333// This function assumes that the allocator is bound to the correct type.
334template <class _Alloc, class _Tp>
335_LIBCPP_HIDE_FROM_ABI constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc) {
336 static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
337 "The allocator should already be rebound to the correct type");
338
339 if constexpr (is_array_v<_Tp>) {
340 using _Element = remove_extent_t<_Tp>;
341 __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
342 size_t __i = 0;
343 _Tp& __array = *__loc;
344
345 // If an exception is thrown, destroy what we have constructed so far in reverse order.
346 auto __guard = std::__make_exception_guard([&]() {
347 std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
348 });
349
350 for (; __i != extent_v<_Tp>; ++__i) {
351 std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]));
352 }
353 __guard.__complete();
354 } else {
355 allocator_traits<_Alloc>::construct(__alloc, __loc);
356 }
357}
358
359// Constructs the object at the given location using the allocator's construct method, passing along
360// the provided argument.
361//
362// If the object being constructed is an array, the argument is also assumed to be an array. Each
363// each element of the array being constructed is allocator-constructed from the corresponding
364// element of the argument array. If an exception is thrown during the construction of an array,
365// the initialized elements are destroyed in reverse order of initialization using allocator
366// destruction.
367//
368// This function assumes that the allocator is bound to the correct type.
369template <class _Alloc, class _Tp, class _Arg>
370_LIBCPP_HIDE_FROM_ABI constexpr void
371__allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc, _Arg const& __arg) {
372 static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
373 "The allocator should already be rebound to the correct type");
374
375 if constexpr (is_array_v<_Tp>) {
376 static_assert(is_array_v<_Arg>,
377 "Provided non-array initialization argument to __allocator_construct_at_multidimensional when "
378 "trying to construct an array.");
379
380 using _Element = remove_extent_t<_Tp>;
381 __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
382 size_t __i = 0;
383 _Tp& __array = *__loc;
384
385 // If an exception is thrown, destroy what we have constructed so far in reverse order.
386 auto __guard = std::__make_exception_guard([&]() {
387 std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
388 });
389 for (; __i != extent_v<_Tp>; ++__i) {
390 std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]), __arg[__i]);
391 }
392 __guard.__complete();
393 } else {
394 allocator_traits<_Alloc>::construct(__alloc, __loc, __arg);
395 }
396}
397
398// Given a range starting at it and containing n elements, initializes each element in the
399// range from left to right using the construct method of the allocator (rebound to the
400// correct type).
401//
402// If an exception is thrown, the initialized elements are destroyed in reverse order of
403// initialization using allocator_traits destruction. If the elements in the range are C-style
404// arrays, they are initialized element-wise using allocator construction, and recursively so.
405template <class _Alloc,
406 class _BidirIter,
407 class _Tp,
408 class _Size = typename iterator_traits<_BidirIter>::difference_type>
409_LIBCPP_HIDE_FROM_ABI constexpr void
410__uninitialized_allocator_fill_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n, _Tp const& __value) {
411 using _ValueType = typename iterator_traits<_BidirIter>::value_type;
412 __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
413 _BidirIter __begin = __it;
414
415 // If an exception is thrown, destroy what we have constructed so far in reverse order.
416 auto __guard =
417 std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
418 for (; __n != 0; --__n, ++__it) {
419 std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it), __value);
420 }
421 __guard.__complete();
422}
423
424// Same as __uninitialized_allocator_fill_n_multidimensional, but doesn't pass any initialization argument
425// to the allocator's construct method, which results in value initialization.
426template <class _Alloc, class _BidirIter, class _Size = typename iterator_traits<_BidirIter>::difference_type>
427_LIBCPP_HIDE_FROM_ABI constexpr void
428__uninitialized_allocator_value_construct_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n) {
429 using _ValueType = typename iterator_traits<_BidirIter>::value_type;
430 __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
431 _BidirIter __begin = __it;
432
433 // If an exception is thrown, destroy what we have constructed so far in reverse order.
434 auto __guard =
435 std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
436 for (; __n != 0; --__n, ++__it) {
437 std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it));
438 }
439 __guard.__complete();
440}301}
441302
442#endif // _LIBCPP_STD_VER >= 17303#endif // _LIBCPP_STD_VER >= 17
...@@ -486,7 +347,7 @@ inline const bool __allocator_has_trivial_copy_construct_v<allocator<_Type>, _Ty...@@ -486,7 +347,7 @@ inline const bool __allocator_has_trivial_copy_construct_v<allocator<_Type>, _Ty
486template <class _Alloc,347template <class _Alloc,
487 class _In,348 class _In,
488 class _Out,349 class _Out,
489 __enable_if_t<is_trivially_copy_constructible<_In>::value && is_trivially_copy_assignable<_In>::value &&350 __enable_if_t<is_trivially_copy_constructible<_In>::value && is_trivially_assignable<_Out&, _In&>::value &&
490 is_same<__remove_const_t<_In>, __remove_const_t<_Out> >::value &&351 is_same<__remove_const_t<_In>, __remove_const_t<_Out> >::value &&
491 __allocator_has_trivial_copy_construct_v<_Alloc, _In>,352 __allocator_has_trivial_copy_construct_v<_Alloc, _In>,
492 int> = 0>353 int> = 0>
lib/libcxx/include/__memory/uninitialized_multidimensional_algorithms.h created+194
...@@ -0,0 +1,194 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___MEMORY_UNINITIALIZED_MULTIDIMENSIONAL_ALGORITHMS_H
10#define _LIBCPP___MEMORY_UNINITIALIZED_MULTIDIMENSIONAL_ALGORITHMS_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__iterator/iterator_traits.h>
15#include <__memory/addressof.h>
16#include <__memory/allocator_traits.h>
17#include <__type_traits/enable_if.h>
18#include <__type_traits/extent.h>
19#include <__type_traits/is_array.h>
20#include <__type_traits/is_same.h>
21#include <__type_traits/remove_extent.h>
22#include <__utility/exception_guard.h>
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28_LIBCPP_PUSH_MACROS
29#include <__undef_macros>
30
31#if _LIBCPP_STD_VER >= 17
32
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35// TODO: Rewrite this to iterate left to right and use reverse_iterators when calling
36// Destroys every element in the range [first, last) FROM RIGHT TO LEFT using allocator
37// destruction. If elements are themselves C-style arrays, they are recursively destroyed
38// in the same manner.
39//
40// This function assumes that destructors do not throw, and that the allocator is bound to
41// the correct type.
42template <class _Alloc,
43 class _BidirIter,
44 __enable_if_t<__has_bidirectional_iterator_category<_BidirIter>::value, int> = 0>
45_LIBCPP_HIDE_FROM_ABI constexpr void
46__allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter __first, _BidirIter __last) noexcept {
47 using _ValueType = typename iterator_traits<_BidirIter>::value_type;
48 static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _ValueType>,
49 "The allocator should already be rebound to the correct type");
50
51 if (__first == __last)
52 return;
53
54 if constexpr (is_array_v<_ValueType>) {
55 static_assert(!__is_unbounded_array_v<_ValueType>,
56 "arrays of unbounded arrays don't exist, but if they did we would mess up here");
57
58 using _Element = remove_extent_t<_ValueType>;
59 __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
60 do {
61 --__last;
62 decltype(auto) __array = *__last;
63 std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + extent_v<_ValueType>);
64 } while (__last != __first);
65 } else {
66 do {
67 --__last;
68 allocator_traits<_Alloc>::destroy(__alloc, std::addressof(*__last));
69 } while (__last != __first);
70 }
71}
72
73// Constructs the object at the given location using the allocator's construct method.
74//
75// If the object being constructed is an array, each element of the array is allocator-constructed,
76// recursively. If an exception is thrown during the construction of an array, the initialized
77// elements are destroyed in reverse order of initialization using allocator destruction.
78//
79// This function assumes that the allocator is bound to the correct type.
80template <class _Alloc, class _Tp>
81_LIBCPP_HIDE_FROM_ABI constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc) {
82 static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
83 "The allocator should already be rebound to the correct type");
84
85 if constexpr (is_array_v<_Tp>) {
86 using _Element = remove_extent_t<_Tp>;
87 __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
88 size_t __i = 0;
89 _Tp& __array = *__loc;
90
91 // If an exception is thrown, destroy what we have constructed so far in reverse order.
92 auto __guard = std::__make_exception_guard([&]() {
93 std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
94 });
95
96 for (; __i != extent_v<_Tp>; ++__i) {
97 std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]));
98 }
99 __guard.__complete();
100 } else {
101 allocator_traits<_Alloc>::construct(__alloc, __loc);
102 }
103}
104
105// Constructs the object at the given location using the allocator's construct method, passing along
106// the provided argument.
107//
108// If the object being constructed is an array, the argument is also assumed to be an array. Each
109// each element of the array being constructed is allocator-constructed from the corresponding
110// element of the argument array. If an exception is thrown during the construction of an array,
111// the initialized elements are destroyed in reverse order of initialization using allocator
112// destruction.
113//
114// This function assumes that the allocator is bound to the correct type.
115template <class _Alloc, class _Tp, class _Arg>
116_LIBCPP_HIDE_FROM_ABI constexpr void
117__allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc, _Arg const& __arg) {
118 static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
119 "The allocator should already be rebound to the correct type");
120
121 if constexpr (is_array_v<_Tp>) {
122 static_assert(is_array_v<_Arg>,
123 "Provided non-array initialization argument to __allocator_construct_at_multidimensional when "
124 "trying to construct an array.");
125
126 using _Element = remove_extent_t<_Tp>;
127 __allocator_traits_rebind_t<_Alloc, _Element> __elem_alloc(__alloc);
128 size_t __i = 0;
129 _Tp& __array = *__loc;
130
131 // If an exception is thrown, destroy what we have constructed so far in reverse order.
132 auto __guard = std::__make_exception_guard([&]() {
133 std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
134 });
135 for (; __i != extent_v<_Tp>; ++__i) {
136 std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]), __arg[__i]);
137 }
138 __guard.__complete();
139 } else {
140 allocator_traits<_Alloc>::construct(__alloc, __loc, __arg);
141 }
142}
143
144// Given a range starting at it and containing n elements, initializes each element in the
145// range from left to right using the construct method of the allocator (rebound to the
146// correct type).
147//
148// If an exception is thrown, the initialized elements are destroyed in reverse order of
149// initialization using allocator_traits destruction. If the elements in the range are C-style
150// arrays, they are initialized element-wise using allocator construction, and recursively so.
151template <class _Alloc,
152 class _BidirIter,
153 class _Tp,
154 class _Size = typename iterator_traits<_BidirIter>::difference_type>
155_LIBCPP_HIDE_FROM_ABI constexpr void
156__uninitialized_allocator_fill_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n, _Tp const& __value) {
157 using _ValueType = typename iterator_traits<_BidirIter>::value_type;
158 __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
159 _BidirIter __begin = __it;
160
161 // If an exception is thrown, destroy what we have constructed so far in reverse order.
162 auto __guard =
163 std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
164 for (; __n != 0; --__n, ++__it) {
165 std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it), __value);
166 }
167 __guard.__complete();
168}
169
170// Same as __uninitialized_allocator_fill_n_multidimensional, but doesn't pass any initialization argument
171// to the allocator's construct method, which results in value initialization.
172template <class _Alloc, class _BidirIter, class _Size = typename iterator_traits<_BidirIter>::difference_type>
173_LIBCPP_HIDE_FROM_ABI constexpr void
174__uninitialized_allocator_value_construct_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n) {
175 using _ValueType = typename iterator_traits<_BidirIter>::value_type;
176 __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
177 _BidirIter __begin = __it;
178
179 // If an exception is thrown, destroy what we have constructed so far in reverse order.
180 auto __guard =
181 std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
182 for (; __n != 0; --__n, ++__it) {
183 std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it));
184 }
185 __guard.__complete();
186}
187
188_LIBCPP_END_NAMESPACE_STD
189
190#endif // _LIBCPP_STD_VER >= 17
191
192_LIBCPP_POP_MACROS
193
194#endif // _LIBCPP___MEMORY_UNINITIALIZED_MULTIDIMENSIONAL_ALGORITHMS_H
lib/libcxx/include/__memory/unique_ptr.h+62-110
...@@ -27,7 +27,6 @@...@@ -27,7 +27,6 @@
27#include <__type_traits/add_reference.h>27#include <__type_traits/add_reference.h>
28#include <__type_traits/common_type.h>28#include <__type_traits/common_type.h>
29#include <__type_traits/conditional.h>29#include <__type_traits/conditional.h>
30#include <__type_traits/dependent_type.h>
31#include <__type_traits/enable_if.h>30#include <__type_traits/enable_if.h>
32#include <__type_traits/integral_constant.h>31#include <__type_traits/integral_constant.h>
33#include <__type_traits/is_array.h>32#include <__type_traits/is_array.h>
...@@ -43,7 +42,8 @@...@@ -43,7 +42,8 @@
43#include <__type_traits/is_trivially_relocatable.h>42#include <__type_traits/is_trivially_relocatable.h>
44#include <__type_traits/is_void.h>43#include <__type_traits/is_void.h>
45#include <__type_traits/remove_extent.h>44#include <__type_traits/remove_extent.h>
46#include <__type_traits/type_identity.h>45#include <__type_traits/remove_reference.h>
46#include <__type_traits/void_t.h>
47#include <__utility/declval.h>47#include <__utility/declval.h>
48#include <__utility/forward.h>48#include <__utility/forward.h>
49#include <__utility/move.h>49#include <__utility/move.h>
...@@ -95,27 +95,17 @@ inline const bool __is_default_deleter_v = false;...@@ -95,27 +95,17 @@ inline const bool __is_default_deleter_v = false;
95template <class _Tp>95template <class _Tp>
96inline const bool __is_default_deleter_v<default_delete<_Tp> > = true;96inline const bool __is_default_deleter_v<default_delete<_Tp> > = true;
9797
98template <class _Deleter>98template <class, class = void>
99struct __unique_ptr_deleter_sfinae {99inline const bool __can_dereference = false;
100 static_assert(!is_reference<_Deleter>::value, "incorrect specialization");
101 typedef const _Deleter& __lval_ref_type;
102 typedef _Deleter&& __good_rval_ref_type;
103 typedef true_type __enable_rval_overload;
104};
105100
106template <class _Deleter>101template <class _Tp>
107struct __unique_ptr_deleter_sfinae<_Deleter const&> {102inline const bool __can_dereference<_Tp, decltype((void)*std::declval<_Tp>())> = true;
108 typedef const _Deleter& __lval_ref_type;
109 typedef const _Deleter&& __bad_rval_ref_type;
110 typedef false_type __enable_rval_overload;
111};
112103
113template <class _Deleter>104template <class _Tp, class = void>
114struct __unique_ptr_deleter_sfinae<_Deleter&> {105inline const bool __can_add_pointer = false;
115 typedef _Deleter& __lval_ref_type;106
116 typedef _Deleter&& __bad_rval_ref_type;107template <class _Tp>
117 typedef false_type __enable_rval_overload;108inline const bool __can_add_pointer<_Tp, __void_t<_Tp*> > = true;
118};
119109
120#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)110#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
121# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))111# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))
...@@ -125,13 +115,14 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {...@@ -125,13 +115,14 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {
125115
126template <class _Tp, class _Dp = default_delete<_Tp> >116template <class _Tp, class _Dp = default_delete<_Tp> >
127class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI unique_ptr {117class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI unique_ptr {
118 static_assert(__can_add_pointer<_Tp>, "unique_ptr<T, D> requires T* to be a valid type");
119 static_assert(!is_rvalue_reference<_Dp>::value, "the specified deleter type cannot be an rvalue reference");
120
128public:121public:
129 typedef _Tp element_type;122 typedef _Tp element_type;
130 typedef _Dp deleter_type;123 typedef _Dp deleter_type;
131 using pointer _LIBCPP_NODEBUG = __pointer<_Tp, deleter_type>;124 using pointer _LIBCPP_NODEBUG = __pointer<_Tp, deleter_type>;
132125
133 static_assert(!is_rvalue_reference<deleter_type>::value, "the specified deleter type cannot be an rvalue reference");
134
135 // A unique_ptr contains the following members which may be trivially relocatable:126 // A unique_ptr contains the following members which may be trivially relocatable:
136 // - pointer : this may be trivially relocatable, so it's checked127 // - pointer : this may be trivially relocatable, so it's checked
137 // - deleter_type: this may be trivially relocatable, so it's checked128 // - deleter_type: this may be trivially relocatable, so it's checked
...@@ -146,24 +137,6 @@ public:...@@ -146,24 +137,6 @@ public:
146private:137private:
147 _LIBCPP_COMPRESSED_PAIR(pointer, __ptr_, deleter_type, __deleter_);138 _LIBCPP_COMPRESSED_PAIR(pointer, __ptr_, deleter_type, __deleter_);
148139
149 using _DeleterSFINAE _LIBCPP_NODEBUG = __unique_ptr_deleter_sfinae<_Dp>;
150
151 template <bool _Dummy>
152 using _LValRefType _LIBCPP_NODEBUG = typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
153
154 template <bool _Dummy>
155 using _GoodRValRefType _LIBCPP_NODEBUG = typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
156
157 template <bool _Dummy>
158 using _BadRValRefType _LIBCPP_NODEBUG = typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
159
160 template <bool _Dummy, class _Deleter = typename __dependent_type< __type_identity<deleter_type>, _Dummy>::type>
161 using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG =
162 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value>;
163
164 template <class _ArgType>
165 using _EnableIfDeleterConstructible _LIBCPP_NODEBUG = __enable_if_t<is_constructible<deleter_type, _ArgType>::value>;
166
167 template <class _UPtr, class _Up>140 template <class _UPtr, class _Up>
168 using _EnableIfMoveConvertible _LIBCPP_NODEBUG =141 using _EnableIfMoveConvertible _LIBCPP_NODEBUG =
169 __enable_if_t< is_convertible<typename _UPtr::pointer, pointer>::value && !is_array<_Up>::value >;142 __enable_if_t< is_convertible<typename _UPtr::pointer, pointer>::value && !is_array<_Up>::value >;
...@@ -177,31 +150,33 @@ private:...@@ -177,31 +150,33 @@ private:
177 using _EnableIfDeleterAssignable _LIBCPP_NODEBUG = __enable_if_t< is_assignable<_Dp&, _UDel&&>::value >;150 using _EnableIfDeleterAssignable _LIBCPP_NODEBUG = __enable_if_t< is_assignable<_Dp&, _UDel&&>::value >;
178151
179public:152public:
180 template <bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy> >153 template <class _Deleter = deleter_type,
154 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value, int> = 0>
181 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(), __deleter_() {}155 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(), __deleter_() {}
182156
183 template <bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy> >157 template <class _Deleter = deleter_type,
158 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value, int> = 0>
184 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(), __deleter_() {}159 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(), __deleter_() {}
185160
186 template <bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy> >161 template <class _Deleter = deleter_type,
162 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value, int> = 0>
187 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(pointer __p) _NOEXCEPT163 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(pointer __p) _NOEXCEPT
188 : __ptr_(__p),164 : __ptr_(__p),
189 __deleter_() {}165 __deleter_() {}
190166
191 template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >167 template <class _Deleter = deleter_type, __enable_if_t<is_copy_constructible<_Deleter>::value, int> = 0>
192 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT168 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(pointer __p, const deleter_type& __d) _NOEXCEPT
193 : __ptr_(__p),169 : __ptr_(__p),
194 __deleter_(__d) {}170 __deleter_(__d) {}
195171
196 template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >172 template <class _Deleter = deleter_type,
197 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT173 __enable_if_t<!is_reference<_Deleter>::value && is_move_constructible<_Deleter>::value, int> = 0>
174 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(pointer __p, deleter_type&& __d) _NOEXCEPT
198 : __ptr_(__p),175 : __ptr_(__p),
199 __deleter_(std::move(__d)) {176 __deleter_(std::move(__d)) {}
200 static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
201 }
202177
203 template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > >178 template <class _Deleter = deleter_type, __enable_if_t<is_reference<_Deleter>::value, int> = 0>
204 _LIBCPP_HIDE_FROM_ABI unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete;179 _LIBCPP_HIDE_FROM_ABI unique_ptr(pointer, __libcpp_remove_reference_t<deleter_type>&&) = delete;
205180
206 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr&& __u) _NOEXCEPT181 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr&& __u) _NOEXCEPT
207 : __ptr_(__u.release()),182 : __ptr_(__u.release()),
...@@ -222,7 +197,7 @@ public:...@@ -222,7 +197,7 @@ public:
222#endif197#endif
223198
224 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {199 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
225 reset(__u.release());200 reset(__u.release()); // NOLINT(misc-uniqueptr-reset-release)
226 __deleter_ = std::forward<deleter_type>(__u.get_deleter());201 __deleter_ = std::forward<deleter_type>(__u.get_deleter());
227 return *this;202 return *this;
228 }203 }
...@@ -258,6 +233,7 @@ public:...@@ -258,6 +233,7 @@ public:
258 return *this;233 return *this;
259 }234 }
260235
236 template <class _Ptr = pointer, __enable_if_t<__can_dereference<_Ptr>, int> = 0>
261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const237 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const
262 _NOEXCEPT_(_NOEXCEPT_(*std::declval<pointer>())) {238 _NOEXCEPT_(_NOEXCEPT_(*std::declval<pointer>())) {
263 return *__ptr_;239 return *__ptr_;
...@@ -434,27 +410,6 @@ private:...@@ -434,27 +410,6 @@ private:
434 (is_same<pointer, element_type*>::value &&410 (is_same<pointer, element_type*>::value &&
435 is_convertible<_FromElem (*)[], element_type (*)[]>::value) > {};411 is_convertible<_FromElem (*)[], element_type (*)[]>::value) > {};
436412
437 typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
438
439 template <bool _Dummy>
440 using _LValRefType _LIBCPP_NODEBUG = typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
441
442 template <bool _Dummy>
443 using _GoodRValRefType _LIBCPP_NODEBUG = typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
444
445 template <bool _Dummy>
446 using _BadRValRefType _LIBCPP_NODEBUG = typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
447
448 template <bool _Dummy, class _Deleter = typename __dependent_type< __type_identity<deleter_type>, _Dummy>::type>
449 using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG =
450 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value>;
451
452 template <class _ArgType>
453 using _EnableIfDeleterConstructible _LIBCPP_NODEBUG = __enable_if_t<is_constructible<deleter_type, _ArgType>::value>;
454
455 template <class _Pp>
456 using _EnableIfPointerConvertible _LIBCPP_NODEBUG = __enable_if_t< _CheckArrayPointerConversion<_Pp>::value >;
457
458 template <class _UPtr, class _Up, class _ElemT = typename _UPtr::element_type>413 template <class _UPtr, class _Up, class _ElemT = typename _UPtr::element_type>
459 using _EnableIfMoveConvertible _LIBCPP_NODEBUG =414 using _EnableIfMoveConvertible _LIBCPP_NODEBUG =
460 __enable_if_t< is_array<_Up>::value && is_same<pointer, element_type*>::value &&415 __enable_if_t< is_array<_Up>::value && is_same<pointer, element_type*>::value &&
...@@ -470,17 +425,19 @@ private:...@@ -470,17 +425,19 @@ private:
470 using _EnableIfDeleterAssignable _LIBCPP_NODEBUG = __enable_if_t< is_assignable<_Dp&, _UDel&&>::value >;425 using _EnableIfDeleterAssignable _LIBCPP_NODEBUG = __enable_if_t< is_assignable<_Dp&, _UDel&&>::value >;
471426
472public:427public:
473 template <bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy> >428 template <class _Deleter = deleter_type,
429 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value, int> = 0>
474 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(), __deleter_() {}430 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(), __deleter_() {}
475431
476 template <bool _Dummy = true, class = _EnableIfDeleterDefaultConstructible<_Dummy> >432 template <class _Deleter = deleter_type,
433 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value, int> = 0>
477 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(), __deleter_() {}434 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(), __deleter_() {}
478435
479 template <class _Pp,436 template <class _Ptr,
480 bool _Dummy = true,437 class _Deleter = deleter_type,
481 class = _EnableIfDeleterDefaultConstructible<_Dummy>,438 __enable_if_t<is_default_constructible<_Deleter>::value && !is_pointer<_Deleter>::value, int> = 0,
482 class = _EnableIfPointerConvertible<_Pp> >439 __enable_if_t<_CheckArrayPointerConversion<_Ptr>::value, int> = 0>
483 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(_Pp __ptr) _NOEXCEPT440 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 explicit unique_ptr(_Ptr __ptr) _NOEXCEPT
484 : __ptr_(__ptr),441 : __ptr_(__ptr),
485 __deleter_() {}442 __deleter_() {}
486443
...@@ -490,43 +447,38 @@ public:...@@ -490,43 +447,38 @@ public:
490 : __ptr_(__ptr),447 : __ptr_(__ptr),
491 __checker_(__size) {}448 __checker_(__size) {}
492449
493 template <class _Pp,450 template <class _Ptr,
494 bool _Dummy = true,451 class _Deleter = deleter_type,
495 class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >,452 __enable_if_t<is_copy_constructible<_Deleter>::value, int> = 0,
496 class = _EnableIfPointerConvertible<_Pp> >453 __enable_if_t<_CheckArrayPointerConversion<_Ptr>::value, int> = 0>
497 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(_Pp __ptr, _LValRefType<_Dummy> __deleter) _NOEXCEPT454 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(_Ptr __ptr, const deleter_type& __deleter) _NOEXCEPT
498 : __ptr_(__ptr),455 : __ptr_(__ptr),
499 __deleter_(__deleter) {}456 __deleter_(__deleter) {}
500457
501 template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >458 template <class _Deleter = deleter_type, __enable_if_t<is_copy_constructible<_Deleter>::value, int> = 0>
502 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(nullptr_t, _LValRefType<_Dummy> __deleter) _NOEXCEPT459 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(nullptr_t, const deleter_type& __deleter) _NOEXCEPT
503 : __ptr_(nullptr),460 : __ptr_(nullptr),
504 __deleter_(__deleter) {}461 __deleter_(__deleter) {}
505462
506 template <class _Pp,463 template <class _Ptr,
507 bool _Dummy = true,464 class _Deleter = deleter_type,
508 class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >,465 __enable_if_t<!is_reference<_Deleter>::value && is_move_constructible<_Deleter>::value, int> = 0,
509 class = _EnableIfPointerConvertible<_Pp> >466 __enable_if_t<_CheckArrayPointerConversion<_Ptr>::value, int> = 0>
510 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23467 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(_Ptr __ptr, deleter_type&& __deleter) _NOEXCEPT
511 unique_ptr(_Pp __ptr, _GoodRValRefType<_Dummy> __deleter) _NOEXCEPT
512 : __ptr_(__ptr),468 : __ptr_(__ptr),
513 __deleter_(std::move(__deleter)) {469 __deleter_(std::move(__deleter)) {}
514 static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
515 }
516470
517 template <bool _Dummy = true, class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >471 template <class _Deleter = deleter_type,
518 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23472 __enable_if_t<!is_reference<_Deleter>::value && is_move_constructible<_Deleter>::value, int> = 0>
519 unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __deleter) _NOEXCEPT473 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(nullptr_t, deleter_type&& __deleter) _NOEXCEPT
520 : __ptr_(nullptr),474 : __ptr_(nullptr),
521 __deleter_(std::move(__deleter)) {475 __deleter_(std::move(__deleter)) {}
522 static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
523 }
524476
525 template <class _Pp,477 template <class _Ptr,
526 bool _Dummy = true,478 class _Deleter = deleter_type,
527 class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >,479 __enable_if_t<is_reference<_Deleter>::value, int> = 0,
528 class = _EnableIfPointerConvertible<_Pp> >480 __enable_if_t<_CheckArrayPointerConversion<_Ptr>::value, int> = 0>
529 _LIBCPP_HIDE_FROM_ABI unique_ptr(_Pp __ptr, _BadRValRefType<_Dummy> __deleter) = delete;481 _LIBCPP_HIDE_FROM_ABI unique_ptr(_Ptr, __libcpp_remove_reference_t<deleter_type>&&) = delete;
530482
531 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr&& __u) _NOEXCEPT483 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr&& __u) _NOEXCEPT
532 : __ptr_(__u.release()),484 : __ptr_(__u.release()),
...@@ -534,7 +486,7 @@ public:...@@ -534,7 +486,7 @@ public:
534 __checker_(std::move(__u.__checker_)) {}486 __checker_(std::move(__u.__checker_)) {}
535487
536 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {488 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
537 reset(__u.release());489 reset(__u.release()); // NOLINT(misc-uniqueptr-reset-release)
538 __deleter_ = std::forward<deleter_type>(__u.get_deleter());490 __deleter_ = std::forward<deleter_type>(__u.get_deleter());
539 __checker_ = std::move(__u.__checker_);491 __checker_ = std::move(__u.__checker_);
540 return *this;492 return *this;
lib/libcxx/include/__memory/uses_allocator_construction.h+6-6
...@@ -27,10 +27,10 @@...@@ -27,10 +27,10 @@
27_LIBCPP_PUSH_MACROS27_LIBCPP_PUSH_MACROS
28#include <__undef_macros>28#include <__undef_macros>
2929
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32#if _LIBCPP_STD_VER >= 1730#if _LIBCPP_STD_VER >= 17
3331
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34template <class _Tp>34template <class _Tp>
35inline constexpr bool __is_cv_std_pair = __is_pair_v<remove_cv_t<_Tp>>;35inline constexpr bool __is_cv_std_pair = __is_pair_v<remove_cv_t<_Tp>>;
3636
...@@ -202,9 +202,7 @@ __uninitialized_construct_using_allocator(_Type* __ptr, const _Alloc& __alloc, _...@@ -202,9 +202,7 @@ __uninitialized_construct_using_allocator(_Type* __ptr, const _Alloc& __alloc, _
202 __uses_allocator_construction_args<_Type>::__apply(__alloc, std::forward<_Args>(__args)...));202 __uses_allocator_construction_args<_Type>::__apply(__alloc, std::forward<_Args>(__args)...));
203}203}
204204
205#endif // _LIBCPP_STD_VER >= 17205# if _LIBCPP_STD_VER >= 20
206
207#if _LIBCPP_STD_VER >= 20
208206
209template <class _Type, class _Alloc, class... _Args>207template <class _Type, class _Alloc, class... _Args>
210_LIBCPP_HIDE_FROM_ABI constexpr auto uses_allocator_construction_args(const _Alloc& __alloc, _Args&&... __args) noexcept208_LIBCPP_HIDE_FROM_ABI constexpr auto uses_allocator_construction_args(const _Alloc& __alloc, _Args&&... __args) noexcept
...@@ -225,10 +223,12 @@ uninitialized_construct_using_allocator(_Type* __ptr, const _Alloc& __alloc, _Ar...@@ -225,10 +223,12 @@ uninitialized_construct_using_allocator(_Type* __ptr, const _Alloc& __alloc, _Ar
225 return /*--*/ std::__uninitialized_construct_using_allocator(__ptr, __alloc, std::forward<_Args>(__args)...);223 return /*--*/ std::__uninitialized_construct_using_allocator(__ptr, __alloc, std::forward<_Args>(__args)...);
226}224}
227225
228#endif // _LIBCPP_STD_VER >= 20226# endif // _LIBCPP_STD_VER >= 20
229227
230_LIBCPP_END_NAMESPACE_STD228_LIBCPP_END_NAMESPACE_STD
231229
230#endif // _LIBCPP_STD_VER >= 17
231
232_LIBCPP_POP_MACROS232_LIBCPP_POP_MACROS
233233
234#endif // _LIBCPP___MEMORY_USES_ALLOCATOR_CONSTRUCTION_H234#endif // _LIBCPP___MEMORY_USES_ALLOCATOR_CONSTRUCTION_H
lib/libcxx/include/__memory/valid_range.h created+74
...@@ -0,0 +1,74 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___MEMORY_VALID_RANGE_H
10#define _LIBCPP___MEMORY_VALID_RANGE_H
11
12#include <__algorithm/comp.h>
13#include <__assert>
14#include <__config>
15#include <__iterator/iterator_traits.h>
16#include <__memory/assume_aligned.h>
17#include <__memory/pointer_traits.h>
18#include <__type_traits/is_constant_evaluated.h>
19#include <__type_traits/is_same.h>
20#include <__type_traits/remove_cvref.h>
21
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
23# pragma GCC system_header
24#endif
25
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28// A valid range as defined by the C++ Standard has the following constraints:
29// - [__first, __last) is dereferenceable
30// - __last is reachable from __first
31// - if __first and __last are contiguous iterators, the pointers they "decay to" are correctly aligned according to the
32// language rules for pointers
33
34// This function attempts to detect invalid ranges as defined above. Specifically, it checks bullet (2). This also means
35// that it doesn't return whether a range is actually valid, but only whether a range is definitely not valid.
36// The checks may be extended in the future.
37template <class _Tp>
38_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool
39__is_valid_range(const _Tp* __first, const _Tp* __last) {
40 if (__libcpp_is_constant_evaluated()) {
41 // If this is not a constant during constant evaluation, that is because __first and __last are not
42 // part of the same allocation. If they are part of the same allocation, we must still make sure they
43 // are ordered properly.
44 return __builtin_constant_p(__first <= __last) && __first <= __last;
45 }
46
47 return !__less<>()(__last, __first);
48}
49
50// This function allows the compiler to assume that [__first, __last) is a valid range as defined above.
51//
52// In practice, we only add explicit assumptions for bullets (1) and (3). These assumptions allow (currently only
53// clang-based compilers) to auto-vectorize algorithms that contain early returns.
54template <class _Iter, class _Sent>
55_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
56__assume_valid_range([[__maybe_unused__]] _Iter&& __first, [[__maybe_unused__]] _Sent&& __last) {
57#if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2300 && !defined(_LIBCPP_CXX03_LANG)
58 if constexpr (__libcpp_is_contiguous_iterator<__remove_cvref_t<_Iter>>::value &&
59 is_same<__remove_cvref_t<_Iter>, __remove_cvref_t<_Sent>>::value) {
60 _LIBCPP_ASSERT_INTERNAL(std::__is_valid_range(std::__to_address(__first), std::__to_address(__last)),
61 "Valid range assumption does not hold");
62 if (!__libcpp_is_constant_evaluated()) {
63 using __value_type = typename iterator_traits<__remove_cvref_t<_Iter>>::value_type;
64 __builtin_assume_dereferenceable(std::__to_address(__first), (__last - __first) * sizeof(__value_type));
65 (void)std::__assume_aligned<_LIBCPP_ALIGNOF(__value_type)>(std::__to_address(__first));
66 (void)std::__assume_aligned<_LIBCPP_ALIGNOF(__value_type)>(std::__to_address(__last));
67 }
68 }
69#endif
70}
71
72_LIBCPP_END_NAMESPACE_STD
73
74#endif // _LIBCPP___MEMORY_VALID_RANGE_H
lib/libcxx/include/__memory_resource/memory_resource.h+2
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
21#if _LIBCPP_STD_VER >= 1721#if _LIBCPP_STD_VER >= 17
2222
23_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
24_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2425
25namespace pmr {26namespace pmr {
2627
...@@ -84,6 +85,7 @@ null_memory_resource() noexcept;...@@ -84,6 +85,7 @@ null_memory_resource() noexcept;
8485
85} // namespace pmr86} // namespace pmr
8687
88_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
87_LIBCPP_END_NAMESPACE_STD89_LIBCPP_END_NAMESPACE_STD
8890
89#endif // _LIBCPP_STD_VER >= 1791#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__memory_resource/monotonic_buffer_resource.h+2
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
21#if _LIBCPP_STD_VER >= 1721#if _LIBCPP_STD_VER >= 17
2222
23_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
24_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2425
25namespace pmr {26namespace pmr {
2627
...@@ -112,6 +113,7 @@ private:...@@ -112,6 +113,7 @@ private:
112113
113} // namespace pmr114} // namespace pmr
114115
116_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
115_LIBCPP_END_NAMESPACE_STD117_LIBCPP_END_NAMESPACE_STD
116118
117#endif // _LIBCPP_STD_VER >= 17119#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__memory_resource/synchronized_pool_resource.h+2
...@@ -24,6 +24,7 @@...@@ -24,6 +24,7 @@
24#if _LIBCPP_STD_VER >= 1724#if _LIBCPP_STD_VER >= 17
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2728
28namespace pmr {29namespace pmr {
2930
...@@ -88,6 +89,7 @@ private:...@@ -88,6 +89,7 @@ private:
8889
89} // namespace pmr90} // namespace pmr
9091
92_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
91_LIBCPP_END_NAMESPACE_STD93_LIBCPP_END_NAMESPACE_STD
9294
93#endif // _LIBCPP_STD_VER >= 1795#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__memory_resource/unsynchronized_pool_resource.h+2
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2323
24_LIBCPP_BEGIN_NAMESPACE_STD24_LIBCPP_BEGIN_NAMESPACE_STD
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2526
26namespace pmr {27namespace pmr {
2728
...@@ -99,6 +100,7 @@ private:...@@ -99,6 +100,7 @@ private:
99100
100} // namespace pmr101} // namespace pmr
101102
103_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
102_LIBCPP_END_NAMESPACE_STD104_LIBCPP_END_NAMESPACE_STD
103105
104#endif // _LIBCPP_STD_VER >= 17106#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__mutex/lock_guard.h+1-1
...@@ -34,7 +34,7 @@ public:...@@ -34,7 +34,7 @@ public:
3434
35 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_REQUIRES_CAPABILITY(__m)35 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_REQUIRES_CAPABILITY(__m)
36 : __m_(__m) {}36 : __m_(__m) {}
37 _LIBCPP_RELEASE_CAPABILITY _LIBCPP_HIDE_FROM_ABI ~lock_guard() { __m_.unlock(); }37 _LIBCPP_RELEASE_CAPABILITY() _LIBCPP_HIDE_FROM_ABI ~lock_guard() { __m_.unlock(); }
3838
39 lock_guard(lock_guard const&) = delete;39 lock_guard(lock_guard const&) = delete;
40 lock_guard& operator=(lock_guard const&) = delete;40 lock_guard& operator=(lock_guard const&) = delete;
lib/libcxx/include/__mutex/mutex.h+3-1
...@@ -20,6 +20,7 @@...@@ -20,6 +20,7 @@
20#if _LIBCPP_HAS_THREADS20#if _LIBCPP_HAS_THREADS
2121
22_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
23_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2324
24class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_CAPABILITY("mutex") mutex {25class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_CAPABILITY("mutex") mutex {
25 __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;26 __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
...@@ -38,7 +39,7 @@ public:...@@ -38,7 +39,7 @@ public:
3839
39 _LIBCPP_ACQUIRE_CAPABILITY() void lock();40 _LIBCPP_ACQUIRE_CAPABILITY() void lock();
40 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock() _NOEXCEPT;41 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock() _NOEXCEPT;
41 _LIBCPP_RELEASE_CAPABILITY void unlock() _NOEXCEPT;42 _LIBCPP_RELEASE_CAPABILITY() void unlock() _NOEXCEPT;
4243
43 typedef __libcpp_mutex_t* native_handle_type;44 typedef __libcpp_mutex_t* native_handle_type;
44 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }45 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }
...@@ -46,6 +47,7 @@ public:...@@ -46,6 +47,7 @@ public:
4647
47static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");48static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");
4849
50_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
49_LIBCPP_END_NAMESPACE_STD51_LIBCPP_END_NAMESPACE_STD
5052
51#endif // _LIBCPP_HAS_THREADS53#endif // _LIBCPP_HAS_THREADS
lib/libcxx/include/__mutex/once_flag.h+2
...@@ -113,7 +113,9 @@ void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {...@@ -113,7 +113,9 @@ void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {
113 (*__p)();113 (*__p)();
114}114}
115115
116_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
116_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));117_LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));
118_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
117119
118template <class _ValueType>120template <class _ValueType>
119inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) {121inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) {
lib/libcxx/include/__mutex/unique_lock.h+5-5
...@@ -84,13 +84,13 @@ public:...@@ -84,13 +84,13 @@ public:
84 }84 }
8585
86 _LIBCPP_HIDE_FROM_ABI void lock();86 _LIBCPP_HIDE_FROM_ABI void lock();
87 _LIBCPP_HIDE_FROM_ABI bool try_lock();87 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock();
8888
89 template <class _Rep, class _Period>89 template <class _Rep, class _Period>
90 _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);90 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);
9191
92 template <class _Clock, class _Duration>92 template <class _Clock, class _Duration>
93 _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);93 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
9494
95 _LIBCPP_HIDE_FROM_ABI void unlock();95 _LIBCPP_HIDE_FROM_ABI void unlock();
9696
...@@ -106,9 +106,9 @@ public:...@@ -106,9 +106,9 @@ public:
106 return __m;106 return __m;
107 }107 }
108108
109 _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }109 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }
110 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }110 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }
111 _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }111 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }
112};112};
113_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);113_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
114114
lib/libcxx/include/__new/exceptions.h+3
...@@ -24,6 +24,8 @@...@@ -24,6 +24,8 @@
24#endif24#endif
2525
26_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD26_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
28
27#if !defined(_LIBCPP_ABI_VCRUNTIME)29#if !defined(_LIBCPP_ABI_VCRUNTIME)
2830
29class _LIBCPP_EXPORTED_FROM_ABI bad_alloc : public exception {31class _LIBCPP_EXPORTED_FROM_ABI bad_alloc : public exception {
...@@ -74,6 +76,7 @@ public:...@@ -74,6 +76,7 @@ public:
74 _LIBCPP_VERBOSE_ABORT("bad_array_new_length was thrown in -fno-exceptions mode");76 _LIBCPP_VERBOSE_ABORT("bad_array_new_length was thrown in -fno-exceptions mode");
75#endif77#endif
76}78}
79_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
77_LIBCPP_END_UNVERSIONED_NAMESPACE_STD80_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
7881
79#endif // _LIBCPP___NEW_EXCEPTIONS_H82#endif // _LIBCPP___NEW_EXCEPTIONS_H
lib/libcxx/include/__new/new_handler.h+4
...@@ -19,9 +19,13 @@...@@ -19,9 +19,13 @@
19# include <new.h>19# include <new.h>
20#else20#else
21_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD21_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
23
22typedef void (*new_handler)();24typedef void (*new_handler)();
23_LIBCPP_EXPORTED_FROM_ABI new_handler set_new_handler(new_handler) _NOEXCEPT;25_LIBCPP_EXPORTED_FROM_ABI new_handler set_new_handler(new_handler) _NOEXCEPT;
24_LIBCPP_EXPORTED_FROM_ABI new_handler get_new_handler() _NOEXCEPT;26_LIBCPP_EXPORTED_FROM_ABI new_handler get_new_handler() _NOEXCEPT;
27
28_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
25_LIBCPP_END_UNVERSIONED_NAMESPACE_STD29_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
26#endif // _LIBCPP_ABI_VCRUNTIME30#endif // _LIBCPP_ABI_VCRUNTIME
2731
lib/libcxx/include/__new/placement_new_delete.h+2-2
...@@ -27,8 +27,8 @@ operator new(std::size_t, void* __p) _NOEXCEPT {...@@ -27,8 +27,8 @@ operator new(std::size_t, void* __p) _NOEXCEPT {
27operator new[](std::size_t, void* __p) _NOEXCEPT {27operator new[](std::size_t, void* __p) _NOEXCEPT {
28 return __p;28 return __p;
29}29}
30inline _LIBCPP_HIDE_FROM_ABI void operator delete(void*, void*) _NOEXCEPT {}30inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void operator delete(void*, void*) _NOEXCEPT {}
31inline _LIBCPP_HIDE_FROM_ABI void operator delete[](void*, void*) _NOEXCEPT {}31inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void operator delete[](void*, void*) _NOEXCEPT {}
32#endif32#endif
3333
34#endif // _LIBCPP___NEW_PLACEMENT_NEW_DELETE_H34#endif // _LIBCPP___NEW_PLACEMENT_NEW_DELETE_H
lib/libcxx/include/__node_handle+37-36
...@@ -31,29 +31,29 @@ private:...@@ -31,29 +31,29 @@ private:
31public:31public:
32 // [container.node.cons], constructors, copy, and assignment32 // [container.node.cons], constructors, copy, and assignment
33 constexpr node-handle() noexcept : ptr_(), alloc_() {}33 constexpr node-handle() noexcept : ptr_(), alloc_() {}
34 node-handle(node-handle&&) noexcept;34 constexpr node-handle(node-handle&&) noexcept; // constexpr since C++26
35 node-handle& operator=(node-handle&&);35 constexpr node-handle& operator=(node-handle&&); // constexpr since C++26
3636
37 // [container.node.dtor], destructor37 // [container.node.dtor], destructor
38 ~node-handle();38 constexpr ~node-handle(); // constexpr since C++26
3939
40 // [container.node.observers], observers40 // [container.node.observers], observers
41 value_type& value() const; // not present for map containers41 value_type& value() const; // not present for map containers
42 key_type& key() const; // not present for set containers42 key_type& key() const; // not present for set containers
43 mapped_type& mapped() const; // not present for set containers43 constexpr mapped_type& mapped() const; // not present for set containers, constexpr since C++26
4444
45 allocator_type get_allocator() const;45 constexpr allocator_type get_allocator() const; // constexpr since C++26
46 explicit operator bool() const noexcept;46 constexpr explicit operator bool() const noexcept; // constexpr since C++26
47 [[nodiscard]] bool empty() const noexcept; // nodiscard since C++2047 [[nodiscard]] constexpr bool empty() const noexcept; // nodiscard since C++20, constexpr since C++26
4848
49 // [container.node.modifiers], modifiers49 // [container.node.modifiers], modifiers
50 void swap(node-handle&)50 constexpr void swap(node-handle&)
51 noexcept(ator_traits::propagate_on_container_swap::value ||51 noexcept(ator_traits::propagate_on_container_swap::value ||
52 ator_traits::is_always_equal::value);52 ator_traits::is_always_equal::value); // constexpr since C++26
5353
54 friend void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) {54 constexpr friend void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) {
55 x.swap(y);55 x.swap(y);
56 }56 } // constexpr since C++26
57};57};
5858
59*/59*/
...@@ -63,6 +63,7 @@ public:...@@ -63,6 +63,7 @@ public:
63#include <__memory/allocator_traits.h>63#include <__memory/allocator_traits.h>
64#include <__memory/pointer_traits.h>64#include <__memory/pointer_traits.h>
65#include <__type_traits/is_specialization.h>65#include <__type_traits/is_specialization.h>
66#include <__utility/exchange.h>
66#include <optional>67#include <optional>
6768
68#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)69#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -72,10 +73,10 @@ public:...@@ -72,10 +73,10 @@ public:
72_LIBCPP_PUSH_MACROS73_LIBCPP_PUSH_MACROS
73#include <__undef_macros>74#include <__undef_macros>
7475
75_LIBCPP_BEGIN_NAMESPACE_STD
76
77#if _LIBCPP_STD_VER >= 1776#if _LIBCPP_STD_VER >= 17
7877
78_LIBCPP_BEGIN_NAMESPACE_STD
79
79// Specialized in __tree & __hash_table for their _NodeType.80// Specialized in __tree & __hash_table for their _NodeType.
80template <class _NodeType, class _Alloc>81template <class _NodeType, class _Alloc>
81struct __generic_container_node_destructor;82struct __generic_container_node_destructor;
...@@ -99,12 +100,12 @@ private:...@@ -99,12 +100,12 @@ private:
99 __node_pointer_type __ptr_ = nullptr;100 __node_pointer_type __ptr_ = nullptr;
100 optional<allocator_type> __alloc_;101 optional<allocator_type> __alloc_;
101102
102 _LIBCPP_HIDE_FROM_ABI void __release_ptr() {103 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __release_ptr() {
103 __ptr_ = nullptr;104 __ptr_ = nullptr;
104 __alloc_ = std::nullopt;105 __alloc_ = std::nullopt;
105 }106 }
106107
107 _LIBCPP_HIDE_FROM_ABI void __destroy_node_pointer() {108 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __destroy_node_pointer() {
108 if (__ptr_ != nullptr) {109 if (__ptr_ != nullptr) {
109 typedef typename __allocator_traits_rebind< allocator_type, _NodeType>::type __node_alloc_type;110 typedef typename __allocator_traits_rebind< allocator_type, _NodeType>::type __node_alloc_type;
110 __node_alloc_type __alloc(*__alloc_);111 __node_alloc_type __alloc(*__alloc_);
...@@ -113,19 +114,17 @@ private:...@@ -113,19 +114,17 @@ private:
113 }114 }
114 }115 }
115116
116 _LIBCPP_HIDE_FROM_ABI __basic_node_handle(__node_pointer_type __ptr, allocator_type const& __alloc)117 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
118 __basic_node_handle(__node_pointer_type __ptr, allocator_type const& __alloc)
117 : __ptr_(__ptr), __alloc_(__alloc) {}119 : __ptr_(__ptr), __alloc_(__alloc) {}
118120
119public:121public:
120 _LIBCPP_HIDE_FROM_ABI __basic_node_handle() = default;122 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __basic_node_handle() = default;
121123
122 _LIBCPP_HIDE_FROM_ABI __basic_node_handle(__basic_node_handle&& __other) noexcept124 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __basic_node_handle(__basic_node_handle&& __other) noexcept
123 : __ptr_(__other.__ptr_), __alloc_(std::move(__other.__alloc_)) {125 : __ptr_(std::exchange(__other.__ptr_, nullptr)), __alloc_(std::exchange(__other.__alloc_, std::nullopt)) {}
124 __other.__ptr_ = nullptr;
125 __other.__alloc_ = std::nullopt;
126 }
127126
128 _LIBCPP_HIDE_FROM_ABI __basic_node_handle& operator=(__basic_node_handle&& __other) {127 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __basic_node_handle& operator=(__basic_node_handle&& __other) {
129 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(128 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
130 __alloc_ == std::nullopt || __alloc_traits::propagate_on_container_move_assignment::value ||129 __alloc_ == std::nullopt || __alloc_traits::propagate_on_container_move_assignment::value ||
131 __alloc_ == __other.__alloc_,130 __alloc_ == __other.__alloc_,
...@@ -133,24 +132,23 @@ public:...@@ -133,24 +132,23 @@ public:
133 "node_type::operator=(node_type&&)");132 "node_type::operator=(node_type&&)");
134133
135 __destroy_node_pointer();134 __destroy_node_pointer();
136 __ptr_ = __other.__ptr_;135 __ptr_ = std::exchange(__other.__ptr_, nullptr);
137136
138 if (__alloc_traits::propagate_on_container_move_assignment::value || __alloc_ == std::nullopt)137 if (__alloc_traits::propagate_on_container_move_assignment::value || __alloc_ == std::nullopt)
139 __alloc_ = std::move(__other.__alloc_);138 __alloc_ = std::move(__other.__alloc_);
140139
141 __other.__ptr_ = nullptr;
142 __other.__alloc_ = std::nullopt;140 __other.__alloc_ = std::nullopt;
143141
144 return *this;142 return *this;
145 }143 }
146144
147 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return *__alloc_; }145 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const { return *__alloc_; }
148146
149 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return __ptr_ != nullptr; }147 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit operator bool() const { return __ptr_ != nullptr; }
150148
151 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return __ptr_ == nullptr; }149 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const { return __ptr_ == nullptr; }
152150
153 _LIBCPP_HIDE_FROM_ABI void swap(__basic_node_handle& __other) noexcept(151 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(__basic_node_handle& __other) noexcept(
154 __alloc_traits::propagate_on_container_swap::value || __alloc_traits::is_always_equal::value) {152 __alloc_traits::propagate_on_container_swap::value || __alloc_traits::is_always_equal::value) {
155 using std::swap;153 using std::swap;
156 swap(__ptr_, __other.__ptr_);154 swap(__ptr_, __other.__ptr_);
...@@ -159,19 +157,21 @@ public:...@@ -159,19 +157,21 @@ public:
159 swap(__alloc_, __other.__alloc_);157 swap(__alloc_, __other.__alloc_);
160 }158 }
161159
162 _LIBCPP_HIDE_FROM_ABI friend void160 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 friend void
163 swap(__basic_node_handle& __a, __basic_node_handle& __b) noexcept(noexcept(__a.swap(__b))) {161 swap(__basic_node_handle& __a, __basic_node_handle& __b) noexcept(noexcept(__a.swap(__b))) {
164 __a.swap(__b);162 __a.swap(__b);
165 }163 }
166164
167 _LIBCPP_HIDE_FROM_ABI ~__basic_node_handle() { __destroy_node_pointer(); }165 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~__basic_node_handle() { __destroy_node_pointer(); }
168};166};
169167
170template <class _NodeType, class _Derived>168template <class _NodeType, class _Derived>
171struct __set_node_handle_specifics {169struct __set_node_handle_specifics {
172 typedef typename _NodeType::__node_value_type value_type;170 typedef typename _NodeType::__node_value_type value_type;
173171
174 _LIBCPP_HIDE_FROM_ABI value_type& value() const { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }172 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_type& value() const {
173 return static_cast<_Derived const*>(this)->__ptr_->__get_value();
174 }
175};175};
176176
177template <class _NodeType, class _Derived>177template <class _NodeType, class _Derived>
...@@ -179,6 +179,7 @@ struct __map_node_handle_specifics {...@@ -179,6 +179,7 @@ struct __map_node_handle_specifics {
179 using key_type = __remove_const_t<typename _NodeType::__node_value_type::first_type>;179 using key_type = __remove_const_t<typename _NodeType::__node_value_type::first_type>;
180 using mapped_type = typename _NodeType::__node_value_type::second_type;180 using mapped_type = typename _NodeType::__node_value_type::second_type;
181181
182 // This method is not constexpr as per the standard.
182 _LIBCPP_HIDE_FROM_ABI key_type& key() const {183 _LIBCPP_HIDE_FROM_ABI key_type& key() const {
183 return const_cast<key_type&>(static_cast<_Derived const*>(this)->__ptr_->__get_value().first);184 return const_cast<key_type&>(static_cast<_Derived const*>(this)->__ptr_->__get_value().first);
184 }185 }
...@@ -201,10 +202,10 @@ struct __insert_return_type {...@@ -201,10 +202,10 @@ struct __insert_return_type {
201 _NodeType node;202 _NodeType node;
202};203};
203204
204#endif // _LIBCPP_STD_VER >= 17
205
206_LIBCPP_END_NAMESPACE_STD205_LIBCPP_END_NAMESPACE_STD
207206
207#endif // _LIBCPP_STD_VER >= 17
208
208_LIBCPP_POP_MACROS209_LIBCPP_POP_MACROS
209210
210#endif // _LIBCPP___NODE_HANDLE211#endif // _LIBCPP___NODE_HANDLE
lib/libcxx/include/__numeric/accumulate.h+2-2
...@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS...@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS
23_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
2424
25template <class _InputIterator, class _Tp>25template <class _InputIterator, class _Tp>
26_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp26[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
27accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) {27accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) {
28 for (; __first != __last; ++__first)28 for (; __first != __last; ++__first)
29#if _LIBCPP_STD_VER >= 2029#if _LIBCPP_STD_VER >= 20
...@@ -35,7 +35,7 @@ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) {...@@ -35,7 +35,7 @@ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) {
35}35}
3636
37template <class _InputIterator, class _Tp, class _BinaryOperation>37template <class _InputIterator, class _Tp, class _BinaryOperation>
38_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp38[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
39accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) {39accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) {
40 for (; __first != __last; ++__first)40 for (; __first != __last; ++__first)
41#if _LIBCPP_STD_VER >= 2041#if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__numeric/gcd_lcm.h+2-2
...@@ -47,7 +47,7 @@ constexpr _LIBCPP_HIDE_FROM_ABI _Result __abs_in_type(_Source __t) noexcept {...@@ -47,7 +47,7 @@ constexpr _LIBCPP_HIDE_FROM_ABI _Result __abs_in_type(_Source __t) noexcept {
47}47}
4848
49template <class _Tp, class _Up>49template <class _Tp, class _Up>
50constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {50[[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {
51 static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to gcd must be integer types");51 static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to gcd must be integer types");
52 static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to gcd cannot be bool");52 static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to gcd cannot be bool");
53 static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to gcd cannot be bool");53 static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to gcd cannot be bool");
...@@ -95,7 +95,7 @@ constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {...@@ -95,7 +95,7 @@ constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {
95}95}
9696
97template <class _Tp, class _Up>97template <class _Tp, class _Up>
98constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) {98[[nodiscard]] constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) {
99 static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to lcm must be integer types");99 static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to lcm must be integer types");
100 static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to lcm cannot be bool");100 static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to lcm cannot be bool");
101 static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to lcm cannot be bool");101 static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to lcm cannot be bool");
lib/libcxx/include/__numeric/inner_product.h+2-2
...@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS...@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS
23_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
2424
25template <class _InputIterator1, class _InputIterator2, class _Tp>25template <class _InputIterator1, class _InputIterator2, class _Tp>
26_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp26[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
27inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) {27inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) {
28 for (; __first1 != __last1; ++__first1, (void)++__first2)28 for (; __first1 != __last1; ++__first1, (void)++__first2)
29#if _LIBCPP_STD_VER >= 2029#if _LIBCPP_STD_VER >= 20
...@@ -35,7 +35,7 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2...@@ -35,7 +35,7 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2
35}35}
3636
37template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>37template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
38_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp inner_product(38[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp inner_product(
39 _InputIterator1 __first1,39 _InputIterator1 __first1,
40 _InputIterator1 __last1,40 _InputIterator1 __last1,
41 _InputIterator2 __first2,41 _InputIterator2 __first2,
lib/libcxx/include/__numeric/pstl.h+6-6
...@@ -41,7 +41,7 @@ template <class _ExecutionPolicy,...@@ -41,7 +41,7 @@ template <class _ExecutionPolicy,
41 class _BinaryOperation,41 class _BinaryOperation,
42 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,42 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
43 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>43 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
44_LIBCPP_HIDE_FROM_ABI _Tp reduce(44[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Tp reduce(
45 _ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __op) {45 _ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __op) {
46 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators");46 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators");
47 using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>;47 using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>;
...@@ -58,7 +58,7 @@ template <class _ExecutionPolicy,...@@ -58,7 +58,7 @@ template <class _ExecutionPolicy,
58 class _Tp,58 class _Tp,
59 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,59 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
60 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>60 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
61_LIBCPP_HIDE_FROM_ABI _Tp61[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Tp
62reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init) {62reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Tp __init) {
63 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators");63 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators");
64 using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>;64 using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>;
...@@ -70,7 +70,7 @@ template <class _ExecutionPolicy,...@@ -70,7 +70,7 @@ template <class _ExecutionPolicy,
70 class _ForwardIterator,70 class _ForwardIterator,
71 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,71 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
72 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>72 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
73_LIBCPP_HIDE_FROM_ABI __iterator_value_type<_ForwardIterator>73[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __iterator_value_type<_ForwardIterator>
74reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) {74reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) {
75 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators");75 _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR(_ForwardIterator, "reduce requires ForwardIterators");
76 using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>;76 using _Implementation = __pstl::__dispatch<__pstl::__reduce, __pstl::__current_configuration, _RawPolicy>;
...@@ -90,7 +90,7 @@ template <class _ExecutionPolicy,...@@ -90,7 +90,7 @@ template <class _ExecutionPolicy,
90 class _BinaryOperation2,90 class _BinaryOperation2,
91 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,91 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
92 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>92 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
93_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(93[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(
94 _ExecutionPolicy&& __policy,94 _ExecutionPolicy&& __policy,
95 _ForwardIterator1 __first1,95 _ForwardIterator1 __first1,
96 _ForwardIterator1 __last1,96 _ForwardIterator1 __last1,
...@@ -120,7 +120,7 @@ template <class _ExecutionPolicy,...@@ -120,7 +120,7 @@ template <class _ExecutionPolicy,
120 class _Tp,120 class _Tp,
121 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,121 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
122 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>122 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
123_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(123[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(
124 _ExecutionPolicy&& __policy,124 _ExecutionPolicy&& __policy,
125 _ForwardIterator1 __first1,125 _ForwardIterator1 __first1,
126 _ForwardIterator1 __last1,126 _ForwardIterator1 __last1,
...@@ -147,7 +147,7 @@ template <class _ExecutionPolicy,...@@ -147,7 +147,7 @@ template <class _ExecutionPolicy,
147 class _UnaryOperation,147 class _UnaryOperation,
148 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,148 class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
149 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>149 enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
150_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(150[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Tp transform_reduce(
151 _ExecutionPolicy&& __policy,151 _ExecutionPolicy&& __policy,
152 _ForwardIterator __first,152 _ForwardIterator __first,
153 _ForwardIterator __last,153 _ForwardIterator __last,
lib/libcxx/include/__numeric/ranges_iota.h+4-3
...@@ -26,9 +26,10 @@...@@ -26,9 +26,10 @@
26_LIBCPP_PUSH_MACROS26_LIBCPP_PUSH_MACROS
27#include <__undef_macros>27#include <__undef_macros>
2828
29#if _LIBCPP_STD_VER >= 23
30
29_LIBCPP_BEGIN_NAMESPACE_STD31_LIBCPP_BEGIN_NAMESPACE_STD
3032
31#if _LIBCPP_STD_VER >= 23
32namespace ranges {33namespace ranges {
33template <typename _Out, typename _Tp>34template <typename _Out, typename _Tp>
34using iota_result = ranges::out_value_result<_Out, _Tp>;35using iota_result = ranges::out_value_result<_Out, _Tp>;
...@@ -56,10 +57,10 @@ public:...@@ -56,10 +57,10 @@ public:
56inline constexpr auto iota = __iota_fn{};57inline constexpr auto iota = __iota_fn{};
57} // namespace ranges58} // namespace ranges
5859
59#endif // _LIBCPP_STD_VER >= 23
60
61_LIBCPP_END_NAMESPACE_STD60_LIBCPP_END_NAMESPACE_STD
6261
62#endif // _LIBCPP_STD_VER >= 23
63
63_LIBCPP_POP_MACROS64_LIBCPP_POP_MACROS
6465
65#endif // _LIBCPP___NUMERIC_RANGES_IOTA_H66#endif // _LIBCPP___NUMERIC_RANGES_IOTA_H
lib/libcxx/include/__numeric/reduce.h+8-6
...@@ -22,32 +22,34 @@...@@ -22,32 +22,34 @@
22_LIBCPP_PUSH_MACROS22_LIBCPP_PUSH_MACROS
23#include <__undef_macros>23#include <__undef_macros>
2424
25#if _LIBCPP_STD_VER >= 17
26
25_LIBCPP_BEGIN_NAMESPACE_STD27_LIBCPP_BEGIN_NAMESPACE_STD
2628
27#if _LIBCPP_STD_VER >= 17
28template <class _InputIterator, class _Tp, class _BinaryOp>29template <class _InputIterator, class _Tp, class _BinaryOp>
29_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp30[[nodiscard]] _LIBCPP_HIDE_FROM_ABI
30reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b) {31_LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b) {
31 for (; __first != __last; ++__first)32 for (; __first != __last; ++__first)
32 __init = __b(std::move(__init), *__first);33 __init = __b(std::move(__init), *__first);
33 return __init;34 return __init;
34}35}
3536
36template <class _InputIterator, class _Tp>37template <class _InputIterator, class _Tp>
37_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp38[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
38reduce(_InputIterator __first, _InputIterator __last, _Tp __init) {39reduce(_InputIterator __first, _InputIterator __last, _Tp __init) {
39 return std::reduce(__first, __last, __init, std::plus<>());40 return std::reduce(__first, __last, __init, std::plus<>());
40}41}
4142
42template <class _InputIterator>43template <class _InputIterator>
43_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename iterator_traits<_InputIterator>::value_type44[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename iterator_traits<_InputIterator>::value_type
44reduce(_InputIterator __first, _InputIterator __last) {45reduce(_InputIterator __first, _InputIterator __last) {
45 return std::reduce(__first, __last, typename iterator_traits<_InputIterator>::value_type{});46 return std::reduce(__first, __last, typename iterator_traits<_InputIterator>::value_type{});
46}47}
47#endif
4848
49_LIBCPP_END_NAMESPACE_STD49_LIBCPP_END_NAMESPACE_STD
5050
51#endif // _LIBCPP_STD_VER >= 17
52
51_LIBCPP_POP_MACROS53_LIBCPP_POP_MACROS
5254
53#endif // _LIBCPP___NUMERIC_REDUCE_H55#endif // _LIBCPP___NUMERIC_REDUCE_H
lib/libcxx/include/__numeric/saturation_arithmetic.h+15-15
...@@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
29#if _LIBCPP_STD_VER >= 2029#if _LIBCPP_STD_VER >= 20
3030
31template <__signed_or_unsigned_integer _Tp>31template <__signed_or_unsigned_integer _Tp>
32_LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {32_LIBCPP_HIDE_FROM_ABI constexpr _Tp __saturating_add(_Tp __x, _Tp __y) noexcept {
33# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 210133# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2101
34 return __builtin_elementwise_add_sat(__x, __y);34 return __builtin_elementwise_add_sat(__x, __y);
35# else35# else
...@@ -51,7 +51,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {...@@ -51,7 +51,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {
51}51}
5252
53template <__signed_or_unsigned_integer _Tp>53template <__signed_or_unsigned_integer _Tp>
54_LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {54_LIBCPP_HIDE_FROM_ABI constexpr _Tp __saturating_sub(_Tp __x, _Tp __y) noexcept {
55# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 210155# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2101
56 return __builtin_elementwise_sub_sat(__x, __y);56 return __builtin_elementwise_sub_sat(__x, __y);
57# else57# else
...@@ -74,7 +74,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {...@@ -74,7 +74,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {
74}74}
7575
76template <__signed_or_unsigned_integer _Tp>76template <__signed_or_unsigned_integer _Tp>
77_LIBCPP_HIDE_FROM_ABI constexpr _Tp __mul_sat(_Tp __x, _Tp __y) noexcept {77_LIBCPP_HIDE_FROM_ABI constexpr _Tp __saturating_mul(_Tp __x, _Tp __y) noexcept {
78 if (_Tp __mul; !__builtin_mul_overflow(__x, __y, std::addressof(__mul)))78 if (_Tp __mul; !__builtin_mul_overflow(__x, __y, std::addressof(__mul)))
79 return __mul;79 return __mul;
80 // Handle overflow80 // Handle overflow
...@@ -90,7 +90,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mul_sat(_Tp __x, _Tp __y) noexcept {...@@ -90,7 +90,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mul_sat(_Tp __x, _Tp __y) noexcept {
90}90}
9191
92template <__signed_or_unsigned_integer _Tp>92template <__signed_or_unsigned_integer _Tp>
93_LIBCPP_HIDE_FROM_ABI constexpr _Tp __div_sat(_Tp __x, _Tp __y) noexcept {93_LIBCPP_HIDE_FROM_ABI constexpr _Tp __saturating_div(_Tp __x, _Tp __y) noexcept {
94 _LIBCPP_ASSERT_UNCATEGORIZED(__y != 0, "Division by 0 is undefined");94 _LIBCPP_ASSERT_UNCATEGORIZED(__y != 0, "Division by 0 is undefined");
95 if constexpr (__unsigned_integer<_Tp>) {95 if constexpr (__unsigned_integer<_Tp>) {
96 return __x / __y;96 return __x / __y;
...@@ -103,7 +103,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __div_sat(_Tp __x, _Tp __y) noexcept {...@@ -103,7 +103,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __div_sat(_Tp __x, _Tp __y) noexcept {
103}103}
104104
105template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>105template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>
106_LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {106_LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturating_cast(_Tp __x) noexcept {
107 // Saturation is impossible edge case when ((min _Rp) < (min _Tp) && (max _Rp) > (max _Tp)) and it is expected to be107 // Saturation is impossible edge case when ((min _Rp) < (min _Tp) && (max _Rp) > (max _Tp)) and it is expected to be
108 // optimized out by the compiler.108 // optimized out by the compiler.
109109
...@@ -121,28 +121,28 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {...@@ -121,28 +121,28 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {
121#if _LIBCPP_STD_VER >= 26121#if _LIBCPP_STD_VER >= 26
122122
123template <__signed_or_unsigned_integer _Tp>123template <__signed_or_unsigned_integer _Tp>
124[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {124[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp saturating_add(_Tp __x, _Tp __y) noexcept {
125 return std::__add_sat(__x, __y);125 return std::__saturating_add(__x, __y);
126}126}
127127
128template <__signed_or_unsigned_integer _Tp>128template <__signed_or_unsigned_integer _Tp>
129[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {129[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp saturating_sub(_Tp __x, _Tp __y) noexcept {
130 return std::__sub_sat(__x, __y);130 return std::__saturating_sub(__x, __y);
131}131}
132132
133template <__signed_or_unsigned_integer _Tp>133template <__signed_or_unsigned_integer _Tp>
134[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {134[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp saturating_mul(_Tp __x, _Tp __y) noexcept {
135 return std::__mul_sat(__x, __y);135 return std::__saturating_mul(__x, __y);
136}136}
137137
138template <__signed_or_unsigned_integer _Tp>138template <__signed_or_unsigned_integer _Tp>
139[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {139[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp saturating_div(_Tp __x, _Tp __y) noexcept {
140 return std::__div_sat(__x, __y);140 return std::__saturating_div(__x, __y);
141}141}
142142
143template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>143template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>
144[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {144[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Rp saturating_cast(_Tp __x) noexcept {
145 return std::__saturate_cast<_Rp>(__x);145 return std::__saturating_cast<_Rp>(__x);
146}146}
147147
148#endif // _LIBCPP_STD_VER >= 26148#endif // _LIBCPP_STD_VER >= 26
lib/libcxx/include/__numeric/transform_reduce.h+8-6
...@@ -21,19 +21,20 @@...@@ -21,19 +21,20 @@
21_LIBCPP_PUSH_MACROS21_LIBCPP_PUSH_MACROS
22#include <__undef_macros>22#include <__undef_macros>
2323
24#if _LIBCPP_STD_VER >= 17
25
24_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2527
26#if _LIBCPP_STD_VER >= 17
27template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>28template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
28_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp29[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
29transform_reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b, _UnaryOp __u) {30_Tp transform_reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b, _UnaryOp __u) {
30 for (; __first != __last; ++__first)31 for (; __first != __last; ++__first)
31 __init = __b(std::move(__init), __u(*__first));32 __init = __b(std::move(__init), __u(*__first));
32 return __init;33 return __init;
33}34}
3435
35template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOp1, class _BinaryOp2>36template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOp1, class _BinaryOp2>
36_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(37[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(
37 _InputIterator1 __first1,38 _InputIterator1 __first1,
38 _InputIterator1 __last1,39 _InputIterator1 __last1,
39 _InputIterator2 __first2,40 _InputIterator2 __first2,
...@@ -46,14 +47,15 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(...@@ -46,14 +47,15 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(
46}47}
4748
48template <class _InputIterator1, class _InputIterator2, class _Tp>49template <class _InputIterator1, class _InputIterator2, class _Tp>
49_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp50[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp
50transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) {51transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) {
51 return std::transform_reduce(__first1, __last1, __first2, std::move(__init), std::plus<>(), std::multiplies<>());52 return std::transform_reduce(__first1, __last1, __first2, std::move(__init), std::plus<>(), std::multiplies<>());
52}53}
53#endif
5454
55_LIBCPP_END_NAMESPACE_STD55_LIBCPP_END_NAMESPACE_STD
5656
57#endif // _LIBCPP_STD_VER >= 17
58
57_LIBCPP_POP_MACROS59_LIBCPP_POP_MACROS
5860
59#endif // _LIBCPP___NUMERIC_TRANSFORM_REDUCE_H61#endif // _LIBCPP___NUMERIC_TRANSFORM_REDUCE_H
lib/libcxx/include/__ostream/basic_ostream.h+2
...@@ -41,6 +41,7 @@ _LIBCPP_PUSH_MACROS...@@ -41,6 +41,7 @@ _LIBCPP_PUSH_MACROS
41# include <__undef_macros>41# include <__undef_macros>
4242
43_LIBCPP_BEGIN_NAMESPACE_STD43_LIBCPP_BEGIN_NAMESPACE_STD
44_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4445
45template <class _CharT, class _Traits>46template <class _CharT, class _Traits>
46class basic_ostream : virtual public basic_ios<_CharT, _Traits> {47class basic_ostream : virtual public basic_ios<_CharT, _Traits> {
...@@ -672,6 +673,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;...@@ -672,6 +673,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
672extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;673extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
673# endif674# endif
674675
676_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
675_LIBCPP_END_NAMESPACE_STD677_LIBCPP_END_NAMESPACE_STD
676678
677_LIBCPP_POP_MACROS679_LIBCPP_POP_MACROS
lib/libcxx/include/__ostream/print.h+8-9
...@@ -82,12 +82,14 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(ostream& __os, string_view _...@@ -82,12 +82,14 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(ostream& __os, string_view _
82// native Unicode API;82// native Unicode API;
83// Whether the returned FILE* is "a terminal capable of displaying Unicode"83// Whether the returned FILE* is "a terminal capable of displaying Unicode"
84// is determined in the same way as the print(FILE*, ...) overloads.84// is determined in the same way as the print(FILE*, ...) overloads.
85_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
85_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os);86_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os);
87_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
8688
87# if _LIBCPP_HAS_UNICODE89# if _LIBCPP_HAS_UNICODE
88template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).90template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
89_LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) {91_LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) {
90# if _LIBCPP_AVAILABILITY_HAS_PRINT == 092# ifndef _LIBCPP_WIN32API
91 return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl);93 return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl);
92# else94# else
93 FILE* __file = std::__get_ostream_file(__os);95 FILE* __file = std::__get_ostream_file(__os);
...@@ -110,13 +112,10 @@ _LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, fo...@@ -110,13 +112,10 @@ _LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, fo
110# endif // _LIBCPP_HAS_EXCEPTIONS112# endif // _LIBCPP_HAS_EXCEPTIONS
111 ostream::sentry __s(__os);113 ostream::sentry __s(__os);
112 if (__s) {114 if (__s) {
113# ifndef _LIBCPP_WIN32API115 auto __result = std::vformat(__fmt, __args);
114 __print::__vprint_unicode_posix(__file, __fmt, __args, __write_nl, true);116 if (__write_nl)
115# elif _LIBCPP_HAS_WIDE_CHARACTERS117 __result.push_back('\n');
116 __print::__vprint_unicode_windows(__file, __fmt, __args, __write_nl, true);118 __print::__output_unicode_windows(__file, __result);
117# else
118# error "Windows builds with wchar_t disabled are not supported."
119# endif
120 }119 }
121120
122# if _LIBCPP_HAS_EXCEPTIONS121# if _LIBCPP_HAS_EXCEPTIONS
...@@ -124,7 +123,7 @@ _LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, fo...@@ -124,7 +123,7 @@ _LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, fo
124 __os.__set_badbit_and_consider_rethrow();123 __os.__set_badbit_and_consider_rethrow();
125 }124 }
126# endif // _LIBCPP_HAS_EXCEPTIONS125# endif // _LIBCPP_HAS_EXCEPTIONS
127# endif // _LIBCPP_AVAILABILITY_HAS_PRINT126# endif // _LIBCPP_WIN32API
128}127}
129128
130template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).129template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
lib/libcxx/include/__pstl/backend_fwd.h+20
...@@ -109,6 +109,13 @@ struct __is_partitioned;...@@ -109,6 +109,13 @@ struct __is_partitioned;
109// optional<bool>109// optional<bool>
110// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;110// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;
111111
112template <class _Backend, class _ExecutionPolicy>
113struct __find_first_of;
114// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
115// optional<_ForwardIterator1>
116// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
117// _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Predicate __pred) const noexcept;
118
112template <class _Backend, class _ExecutionPolicy>119template <class _Backend, class _ExecutionPolicy>
113struct __for_each;120struct __for_each;
114// template <class _Policy, class _ForwardIterator, class _Function>121// template <class _Policy, class _ForwardIterator, class _Function>
...@@ -159,6 +166,13 @@ struct __generate_n;...@@ -159,6 +166,13 @@ struct __generate_n;
159// optional<__empty>166// optional<__empty>
160// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _Generator __gen) const noexcept;167// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _Generator __gen) const noexcept;
161168
169template <class _Backend, class _ExecutionPolicy>
170struct __reverse_copy;
171// template <class _Policy, class _BidirectionalIterator, class _ForwardIterator>
172// optional<_ForwardIterator>
173// operator()(_Policy&&, _BidirectionalIterator __first, _BidirectionalIterator __last,
174// _ForwardIterator __result) const noexcept;
175
162template <class _Backend, class _ExecutionPolicy>176template <class _Backend, class _ExecutionPolicy>
163struct __merge;177struct __merge;
164// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardOutIterator, class _Comp>178// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardOutIterator, class _Comp>
...@@ -297,6 +311,12 @@ struct __reduce;...@@ -297,6 +311,12 @@ struct __reduce;
297// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,311// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,
298// _Tp __init, _BinaryOperation __op) const noexcept;312// _Tp __init, _BinaryOperation __op) const noexcept;
299313
314template <class _Backend, class _ExecutionPolicy>
315struct __is_sorted;
316// template <class _Policy, class _ForwardIterator, class _Comp>
317// optional<bool>
318// operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Comp&& __comp) const noexcept;
319
300} // namespace __pstl320} // namespace __pstl
301_LIBCPP_END_NAMESPACE_STD321_LIBCPP_END_NAMESPACE_STD
302322
lib/libcxx/include/__pstl/backends/default.h+78
...@@ -12,15 +12,21 @@...@@ -12,15 +12,21 @@
12#include <__algorithm/copy_n.h>12#include <__algorithm/copy_n.h>
13#include <__algorithm/equal.h>13#include <__algorithm/equal.h>
14#include <__algorithm/fill_n.h>14#include <__algorithm/fill_n.h>
15#include <__algorithm/find.h>
16#include <__algorithm/find_if.h>
15#include <__algorithm/for_each_n.h>17#include <__algorithm/for_each_n.h>
18#include <__algorithm/is_sorted.h>
16#include <__config>19#include <__config>
17#include <__functional/identity.h>20#include <__functional/identity.h>
18#include <__functional/not_fn.h>21#include <__functional/not_fn.h>
19#include <__functional/operations.h>22#include <__functional/operations.h>
20#include <__iterator/concepts.h>23#include <__iterator/concepts.h>
21#include <__iterator/iterator_traits.h>24#include <__iterator/iterator_traits.h>
25#include <__iterator/next.h>
26#include <__iterator/reverse_iterator.h>
22#include <__pstl/backend_fwd.h>27#include <__pstl/backend_fwd.h>
23#include <__pstl/dispatch.h>28#include <__pstl/dispatch.h>
29#include <__type_traits/desugars_to.h>
24#include <__utility/empty.h>30#include <__utility/empty.h>
25#include <__utility/forward.h>31#include <__utility/forward.h>
26#include <__utility/move.h>32#include <__utility/move.h>
...@@ -55,6 +61,7 @@ namespace __pstl {...@@ -55,6 +61,7 @@ namespace __pstl {
55// - all_of61// - all_of
56// - none_of62// - none_of
57// - is_partitioned63// - is_partitioned
64// - find_first_of
58//65//
59// for_each family66// for_each family
60// ---------------67// ---------------
...@@ -80,6 +87,7 @@ namespace __pstl {...@@ -80,6 +87,7 @@ namespace __pstl {
80// - count87// - count
81// - equal(3 legs)88// - equal(3 legs)
82// - equal89// - equal
90// - is_sorted
83// - reduce91// - reduce
84//92//
85// transform and transform_binary family93// transform and transform_binary family
...@@ -89,6 +97,7 @@ namespace __pstl {...@@ -89,6 +97,7 @@ namespace __pstl {
89// - move97// - move
90// - copy98// - copy
91// - copy_n99// - copy_n
100// - reverse_copy
92// - rotate_copy101// - rotate_copy
93//102//
94103
...@@ -178,6 +187,30 @@ struct __is_partitioned<__default_backend_tag, _ExecutionPolicy> {...@@ -178,6 +187,30 @@ struct __is_partitioned<__default_backend_tag, _ExecutionPolicy> {
178 }187 }
179};188};
180189
190template <class _ExecutionPolicy>
191struct __find_first_of<__default_backend_tag, _ExecutionPolicy> {
192 template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
193 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator1>
194 operator()(_Policy&& __policy,
195 _ForwardIterator1 __first1,
196 _ForwardIterator1 __last1,
197 _ForwardIterator2 __first2,
198 _ForwardIterator2 __last2,
199 _Predicate&& __pred) const noexcept {
200 using _FindIf = __dispatch<__find_if, __current_configuration, _ExecutionPolicy>;
201 using _Ref1 = __iterator_reference<_ForwardIterator1>;
202 using _Ref2 = __iterator_reference<_ForwardIterator2>;
203 return _FindIf()(__policy, std::move(__first1), std::move(__last1), [&](_Ref1 __element) {
204 if constexpr (__desugars_to_v<__equal_tag, _Predicate, _Ref1, _Ref2>) {
205 // bypass an equality predicate and call directly to std::find() to allow more vectorization
206 return std::find(__first2, __last2, __element) != __last2;
207 } else {
208 return std::find_if(__first2, __last2, [&](_Ref2 __value) { return __pred(__element, __value); }) != __last2;
209 }
210 });
211 }
212};
213
181//////////////////////////////////////////////////////////////214//////////////////////////////////////////////////////////////
182// for_each family215// for_each family
183//////////////////////////////////////////////////////////////216//////////////////////////////////////////////////////////////
...@@ -388,6 +421,35 @@ struct __reduce<__default_backend_tag, _ExecutionPolicy> {...@@ -388,6 +421,35 @@ struct __reduce<__default_backend_tag, _ExecutionPolicy> {
388 }421 }
389};422};
390423
424template <class _ExecutionPolicy>
425struct __is_sorted<__default_backend_tag, _ExecutionPolicy> {
426 template <class _Policy, class _ForwardIterator, class _Comp>
427 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<bool>
428 operator()(_Policy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Comp&& __comp) const noexcept {
429 if constexpr (__has_bidirectional_iterator_category<_ForwardIterator>::value) {
430 if (__first == __last)
431 return true; // Empty, sorted by definition
432 _ForwardIterator __first2 = std::next(__first);
433 if (__first2 == __last)
434 return true; // Only one element, sorted by definition
435 --__last; // Make two iterator ranges: [__first, __first + n - 1) and [__first + 1, __first + n)
436 using _TransformReduce = __dispatch<__transform_reduce_binary, __current_configuration, _ExecutionPolicy>;
437 using _Ref = __iterator_reference<_ForwardIterator>;
438 return _TransformReduce()(
439 __policy,
440 std::move(__first),
441 std::move(__last),
442 std::move(__first2),
443 true,
444 std::logical_and{},
445 [&](_Ref __left, _Ref __right) -> bool { return !__comp(__right, __left); });
446 } else {
447 // Currently anything outside bidirectional iterators has to be processed serially
448 return std::is_sorted(std::move(__first), std::move(__last), std::forward<_Comp>(__comp));
449 }
450 }
451};
452
391//////////////////////////////////////////////////////////////453//////////////////////////////////////////////////////////////
392// transform family454// transform family
393//////////////////////////////////////////////////////////////455//////////////////////////////////////////////////////////////
...@@ -497,6 +559,22 @@ struct __rotate_copy<__default_backend_tag, _ExecutionPolicy> {...@@ -497,6 +559,22 @@ struct __rotate_copy<__default_backend_tag, _ExecutionPolicy> {
497 }559 }
498};560};
499561
562template <class _ExecutionPolicy>
563struct __reverse_copy<__default_backend_tag, _ExecutionPolicy> {
564 template <class _Policy, class _BidirectionalIterator, class _ForwardIterator>
565 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<_ForwardIterator>
566 operator()(_Policy&& __policy,
567 _BidirectionalIterator __first,
568 _BidirectionalIterator __last,
569 _ForwardIterator __result) const noexcept {
570 using _Copy = __dispatch<__copy, __current_configuration, _ExecutionPolicy>;
571 return _Copy()(__policy,
572 std::reverse_iterator<_BidirectionalIterator>(std::move(__last)),
573 std::reverse_iterator<_BidirectionalIterator>(std::move(__first)),
574 std::move(__result));
575 }
576};
577
500} // namespace __pstl578} // namespace __pstl
501_LIBCPP_END_NAMESPACE_STD579_LIBCPP_END_NAMESPACE_STD
502580
lib/libcxx/include/__pstl/backends/libdispatch.h+2
...@@ -48,6 +48,7 @@ _LIBCPP_PUSH_MACROS...@@ -48,6 +48,7 @@ _LIBCPP_PUSH_MACROS
48#if _LIBCPP_STD_VER >= 1748#if _LIBCPP_STD_VER >= 17
4949
50_LIBCPP_BEGIN_NAMESPACE_STD50_LIBCPP_BEGIN_NAMESPACE_STD
51_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
51namespace __pstl {52namespace __pstl {
5253
53namespace __libdispatch {54namespace __libdispatch {
...@@ -393,6 +394,7 @@ struct __fill<__libdispatch_backend_tag, _ExecutionPolicy>...@@ -393,6 +394,7 @@ struct __fill<__libdispatch_backend_tag, _ExecutionPolicy>
393 : __cpu_parallel_fill<__libdispatch_backend_tag, _ExecutionPolicy> {};394 : __cpu_parallel_fill<__libdispatch_backend_tag, _ExecutionPolicy> {};
394395
395} // namespace __pstl396} // namespace __pstl
397_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
396_LIBCPP_END_NAMESPACE_STD398_LIBCPP_END_NAMESPACE_STD
397399
398#endif // _LIBCPP_STD_VER >= 17400#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__random/bernoulli_distribution.h+7-7
...@@ -36,7 +36,7 @@ public:...@@ -36,7 +36,7 @@ public:
3636
37 _LIBCPP_HIDE_FROM_ABI explicit param_type(double __p = 0.5) : __p_(__p) {}37 _LIBCPP_HIDE_FROM_ABI explicit param_type(double __p = 0.5) : __p_(__p) {}
3838
39 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }39 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
4040
41 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {41 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
42 return __x.__p_ == __y.__p_;42 return __x.__p_ == __y.__p_;
...@@ -60,20 +60,20 @@ public:...@@ -60,20 +60,20 @@ public:
6060
61 // generating functions61 // generating functions
62 template <class _URNG>62 template <class _URNG>
63 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {63 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
64 return (*this)(__g, __p_);64 return (*this)(__g, __p_);
65 }65 }
66 template <class _URNG>66 template <class _URNG>
67 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);67 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
6868
69 // property functions69 // property functions
70 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }70 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
7171
72 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }72 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
73 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }73 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
7474
75 _LIBCPP_HIDE_FROM_ABI result_type min() const { return false; }75 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return false; }
76 _LIBCPP_HIDE_FROM_ABI result_type max() const { return true; }76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return true; }
7777
78 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const bernoulli_distribution& __x, const bernoulli_distribution& __y) {78 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const bernoulli_distribution& __x, const bernoulli_distribution& __y) {
79 return __x.__p_ == __y.__p_;79 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/binomial_distribution.h+13-32
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#define _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H10#define _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H
1111
12#include <__config>12#include <__config>
13#include <__math/gamma.h>
13#include <__random/is_valid.h>14#include <__random/is_valid.h>
14#include <__random/uniform_real_distribution.h>15#include <__random/uniform_real_distribution.h>
15#include <cmath>16#include <cmath>
...@@ -44,8 +45,8 @@ public:...@@ -44,8 +45,8 @@ public:
4445
45 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __t = 1, double __p = 0.5);46 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __t = 1, double __p = 0.5);
4647
47 _LIBCPP_HIDE_FROM_ABI result_type t() const { return __t_; }48 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type t() const { return __t_; }
48 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }49 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
4950
50 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {51 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
51 return __x.__t_ == __y.__t_ && __x.__p_ == __y.__p_;52 return __x.__t_ == __y.__t_ && __x.__p_ == __y.__p_;
...@@ -73,21 +74,21 @@ public:...@@ -73,21 +74,21 @@ public:
7374
74 // generating functions75 // generating functions
75 template <class _URNG>76 template <class _URNG>
76 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
77 return (*this)(__g, __p_);78 return (*this)(__g, __p_);
78 }79 }
79 template <class _URNG>80 template <class _URNG>
80 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
8182
82 // property functions83 // property functions
83 _LIBCPP_HIDE_FROM_ABI result_type t() const { return __p_.t(); }84 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type t() const { return __p_.t(); }
84 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
8586
86 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }87 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
87 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }88 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8889
89 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }90 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
90 _LIBCPP_HIDE_FROM_ABI result_type max() const { return t(); }91 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return t(); }
9192
92 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const binomial_distribution& __x, const binomial_distribution& __y) {93 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const binomial_distribution& __x, const binomial_distribution& __y) {
93 return __x.__p_ == __y.__p_;94 return __x.__p_ == __y.__p_;
...@@ -97,33 +98,13 @@ public:...@@ -97,33 +98,13 @@ public:
97 }98 }
98};99};
99100
100// Some libc declares the math functions to be `noexcept`.
101#if _LIBCPP_GLIBC_PREREQ(2, 8) || defined(__LLVM_LIBC__)
102# define _LIBCPP_LGAMMA_R_NOEXCEPT _NOEXCEPT
103#else
104# define _LIBCPP_LGAMMA_R_NOEXCEPT
105#endif
106
107#if !defined(_LIBCPP_MSVCRT_LIKE)
108extern "C" double lgamma_r(double, int*) _LIBCPP_LGAMMA_R_NOEXCEPT;
109#endif
110
111inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma(double __d) {
112#if defined(_LIBCPP_MSVCRT_LIKE)
113 return lgamma(__d);
114#else
115 int __sign;
116 return lgamma_r(__d, &__sign);
117#endif
118}
119
120template <class _IntType>101template <class _IntType>
121binomial_distribution<_IntType>::param_type::param_type(result_type __t, double __p) : __t_(__t), __p_(__p) {102binomial_distribution<_IntType>::param_type::param_type(result_type __t, double __p) : __t_(__t), __p_(__p) {
122 if (0 < __p_ && __p_ < 1) {103 if (0 < __p_ && __p_ < 1) {
123 __r0_ = static_cast<result_type>((__t_ + 1) * __p_);104 __r0_ = static_cast<result_type>((__t_ + 1) * __p_);
124 __pr_ = std::exp(105 __pr_ =
125 std::__libcpp_lgamma(__t_ + 1.) - std::__libcpp_lgamma(__r0_ + 1.) - std::__libcpp_lgamma(__t_ - __r0_ + 1.) +106 std::exp(__math::__lgamma_r(__t_ + 1.) - __math::__lgamma_r(__r0_ + 1.) -
126 __r0_ * std::log(__p_) + (__t_ - __r0_) * std::log(1 - __p_));107 __math::__lgamma_r(__t_ - __r0_ + 1.) + __r0_ * std::log(__p_) + (__t_ - __r0_) * std::log(1 - __p_));
127 __odds_ratio_ = __p_ / (1 - __p_);108 __odds_ratio_ = __p_ / (1 - __p_);
128 }109 }
129}110}
lib/libcxx/include/__random/cauchy_distribution.h+9-9
...@@ -43,8 +43,8 @@ public:...@@ -43,8 +43,8 @@ public:
4343
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}
4545
46 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
47 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }47 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
4848
49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
50 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;50 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
...@@ -70,21 +70,21 @@ public:...@@ -70,21 +70,21 @@ public:
7070
71 // generating functions71 // generating functions
72 template <class _URNG>72 template <class _URNG>
73 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {73 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
74 return (*this)(__g, __p_);74 return (*this)(__g, __p_);
75 }75 }
76 template <class _URNG>76 template <class _URNG>
77 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7878
79 // property functions79 // property functions
80 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
81 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
8282
83 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
84 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }84 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8585
86 _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
87 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }87 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
8888
89 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const cauchy_distribution& __x, const cauchy_distribution& __y) {89 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const cauchy_distribution& __x, const cauchy_distribution& __y) {
90 return __x.__p_ == __y.__p_;90 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/chi_squared_distribution.h+7-7
...@@ -41,7 +41,7 @@ public:...@@ -41,7 +41,7 @@ public:
4141
42 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __n = 1) : __n_(__n) {}42 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __n = 1) : __n_(__n) {}
4343
44 _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }44 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
4545
46 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {46 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
47 return __x.__n_ == __y.__n_;47 return __x.__n_ == __y.__n_;
...@@ -65,22 +65,22 @@ public:...@@ -65,22 +65,22 @@ public:
6565
66 // generating functions66 // generating functions
67 template <class _URNG>67 template <class _URNG>
68 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {68 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
69 return (*this)(__g, __p_);69 return (*this)(__g, __p_);
70 }70 }
71 template <class _URNG>71 template <class _URNG>
72 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {72 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
73 return gamma_distribution<result_type>(__p.n() / 2, 2)(__g);73 return gamma_distribution<result_type>(__p.n() / 2, 2)(__g);
74 }74 }
7575
76 // property functions76 // property functions
77 _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
7878
79 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
80 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }80 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8181
82 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
83 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
8484
85 friend _LIBCPP_HIDE_FROM_ABI bool85 friend _LIBCPP_HIDE_FROM_ABI bool
86 operator==(const chi_squared_distribution& __x, const chi_squared_distribution& __y) {86 operator==(const chi_squared_distribution& __x, const chi_squared_distribution& __y) {
lib/libcxx/include/__random/discard_block_engine.h+9-10
...@@ -54,8 +54,8 @@ public:...@@ -54,8 +54,8 @@ public:
54 static constexpr result_type _Max = _Engine::max();54 static constexpr result_type _Max = _Engine::max();
55#endif55#endif
5656
57 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }57 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }
58 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }58 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }
5959
60 // constructors and seeding functions60 // constructors and seeding functions
61 _LIBCPP_HIDE_FROM_ABI discard_block_engine() : __n_(0) {}61 _LIBCPP_HIDE_FROM_ABI discard_block_engine() : __n_(0) {}
...@@ -64,10 +64,9 @@ public:...@@ -64,10 +64,9 @@ public:
64 _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Engine&& __e) : __e_(std::move(__e)), __n_(0) {}64 _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Engine&& __e) : __e_(std::move(__e)), __n_(0) {}
65#endif // _LIBCPP_CXX03_LANG65#endif // _LIBCPP_CXX03_LANG
66 _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}66 _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
67 template <67 template <class _Sseq,
68 class _Sseq,68 __enable_if_t<__is_seed_sequence_v<_Sseq, discard_block_engine> && !is_convertible<_Sseq, _Engine>::value,
69 __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value && !is_convertible<_Sseq, _Engine>::value,69 int> = 0>
70 int> = 0>
71 _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Sseq& __q) : __e_(__q), __n_(0) {}70 _LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Sseq& __q) : __e_(__q), __n_(0) {}
72 _LIBCPP_HIDE_FROM_ABI void seed() {71 _LIBCPP_HIDE_FROM_ABI void seed() {
73 __e_.seed();72 __e_.seed();
...@@ -77,21 +76,21 @@ public:...@@ -77,21 +76,21 @@ public:
77 __e_.seed(__sd);76 __e_.seed(__sd);
78 __n_ = 0;77 __n_ = 0;
79 }78 }
80 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value, int> = 0>79 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, discard_block_engine>, int> = 0>
81 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {80 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
82 __e_.seed(__q);81 __e_.seed(__q);
83 __n_ = 0;82 __n_ = 0;
84 }83 }
8584
86 // generating functions85 // generating functions
87 _LIBCPP_HIDE_FROM_ABI result_type operator()();86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()();
88 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {87 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
89 for (; __z; --__z)88 for (; __z; --__z)
90 operator()();89 (void)operator()();
91 }90 }
9291
93 // property functions92 // property functions
94 _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }93 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
9594
96 template <class _Eng, size_t _Pp, size_t _Rp>95 template <class _Eng, size_t _Pp, size_t _Rp>
97 friend bool96 friend bool
lib/libcxx/include/__random/discrete_distribution.h+7-7
...@@ -52,7 +52,7 @@ public:...@@ -52,7 +52,7 @@ public:
52 template <class _UnaryOperation>52 template <class _UnaryOperation>
53 _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw);53 _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw);
5454
55 _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const;55 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const;
5656
57 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {57 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
58 return __x.__p_ == __y.__p_;58 return __x.__p_ == __y.__p_;
...@@ -92,20 +92,20 @@ public:...@@ -92,20 +92,20 @@ public:
9292
93 // generating functions93 // generating functions
94 template <class _URNG>94 template <class _URNG>
95 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {95 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
96 return (*this)(__g, __p_);96 return (*this)(__g, __p_);
97 }97 }
98 template <class _URNG>98 template <class _URNG>
99 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);99 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
100100
101 // property functions101 // property functions
102 _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const { return __p_.probabilities(); }102 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const { return __p_.probabilities(); }
103103
104 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }104 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
105 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }105 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
106106
107 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }107 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
108 _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__p_.size(); }108 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__p_.size(); }
109109
110 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const discrete_distribution& __x, const discrete_distribution& __y) {110 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const discrete_distribution& __x, const discrete_distribution& __y) {
111 return __x.__p_ == __y.__p_;111 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/exponential_distribution.h+7-7
...@@ -43,7 +43,7 @@ public:...@@ -43,7 +43,7 @@ public:
4343
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __lambda = 1) : __lambda_(__lambda) {}44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __lambda = 1) : __lambda_(__lambda) {}
4545
46 _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __lambda_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __lambda_; }
4747
48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
49 return __x.__lambda_ == __y.__lambda_;49 return __x.__lambda_ == __y.__lambda_;
...@@ -67,20 +67,20 @@ public:...@@ -67,20 +67,20 @@ public:
6767
68 // generating functions68 // generating functions
69 template <class _URNG>69 template <class _URNG>
70 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {70 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
71 return (*this)(__g, __p_);71 return (*this)(__g, __p_);
72 }72 }
73 template <class _URNG>73 template <class _URNG>
74 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);74 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7575
76 // property functions76 // property functions
77 _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __p_.lambda(); }77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __p_.lambda(); }
7878
79 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
80 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }80 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8181
82 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
83 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
8484
85 friend _LIBCPP_HIDE_FROM_ABI bool85 friend _LIBCPP_HIDE_FROM_ABI bool
86 operator==(const exponential_distribution& __x, const exponential_distribution& __y) {86 operator==(const exponential_distribution& __x, const exponential_distribution& __y) {
lib/libcxx/include/__random/extreme_value_distribution.h+9-9
...@@ -43,8 +43,8 @@ public:...@@ -43,8 +43,8 @@ public:
4343
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}
4545
46 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
47 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }47 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
4848
49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
50 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;50 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
...@@ -70,21 +70,21 @@ public:...@@ -70,21 +70,21 @@ public:
7070
71 // generating functions71 // generating functions
72 template <class _URNG>72 template <class _URNG>
73 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {73 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
74 return (*this)(__g, __p_);74 return (*this)(__g, __p_);
75 }75 }
76 template <class _URNG>76 template <class _URNG>
77 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7878
79 // property functions79 // property functions
80 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
81 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
8282
83 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
84 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }84 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8585
86 _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
87 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }87 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
8888
89 friend _LIBCPP_HIDE_FROM_ABI bool89 friend _LIBCPP_HIDE_FROM_ABI bool
90 operator==(const extreme_value_distribution& __x, const extreme_value_distribution& __y) {90 operator==(const extreme_value_distribution& __x, const extreme_value_distribution& __y) {
lib/libcxx/include/__random/fisher_f_distribution.h+9-9
...@@ -42,8 +42,8 @@ public:...@@ -42,8 +42,8 @@ public:
4242
43 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __m = 1, result_type __n = 1) : __m_(__m), __n_(__n) {}43 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __m = 1, result_type __n = 1) : __m_(__m), __n_(__n) {}
4444
45 _LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }45 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }
46 _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
4747
48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
49 return __x.__m_ == __y.__m_ && __x.__n_ == __y.__n_;49 return __x.__m_ == __y.__m_ && __x.__n_ == __y.__n_;
...@@ -69,21 +69,21 @@ public:...@@ -69,21 +69,21 @@ public:
6969
70 // generating functions70 // generating functions
71 template <class _URNG>71 template <class _URNG>
72 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {72 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
73 return (*this)(__g, __p_);73 return (*this)(__g, __p_);
74 }74 }
75 template <class _URNG>75 template <class _URNG>
76 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7777
78 // property functions78 // property functions
79 _LIBCPP_HIDE_FROM_ABI result_type m() const { return __p_.m(); }79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __p_.m(); }
80 _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
8181
82 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
83 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }83 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8484
85 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
86 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
8787
88 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const fisher_f_distribution& __x, const fisher_f_distribution& __y) {88 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const fisher_f_distribution& __x, const fisher_f_distribution& __y) {
89 return __x.__p_ == __y.__p_;89 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/gamma_distribution.h+9-9
...@@ -45,8 +45,8 @@ public:...@@ -45,8 +45,8 @@ public:
45 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __alpha = 1, result_type __beta = 1)45 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __alpha = 1, result_type __beta = 1)
46 : __alpha_(__alpha), __beta_(__beta) {}46 : __alpha_(__alpha), __beta_(__beta) {}
4747
48 _LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __alpha_; }48 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __alpha_; }
49 _LIBCPP_HIDE_FROM_ABI result_type beta() const { return __beta_; }49 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type beta() const { return __beta_; }
5050
51 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {51 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
52 return __x.__alpha_ == __y.__alpha_ && __x.__beta_ == __y.__beta_;52 return __x.__alpha_ == __y.__alpha_ && __x.__beta_ == __y.__beta_;
...@@ -72,21 +72,21 @@ public:...@@ -72,21 +72,21 @@ public:
7272
73 // generating functions73 // generating functions
74 template <class _URNG>74 template <class _URNG>
75 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {75 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
76 return (*this)(__g, __p_);76 return (*this)(__g, __p_);
77 }77 }
78 template <class _URNG>78 template <class _URNG>
79 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
8080
81 // property functions81 // property functions
82 _LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __p_.alpha(); }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __p_.alpha(); }
83 _LIBCPP_HIDE_FROM_ABI result_type beta() const { return __p_.beta(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type beta() const { return __p_.beta(); }
8484
85 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
86 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }86 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8787
88 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }88 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
89 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
9090
91 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const gamma_distribution& __x, const gamma_distribution& __y) {91 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const gamma_distribution& __x, const gamma_distribution& __y) {
92 return __x.__p_ == __y.__p_;92 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/generate_canonical.h+1-1
...@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
27// generate_canonical27// generate_canonical
2828
29template <class _RealType, size_t __bits, class _URNG>29template <class _RealType, size_t __bits, class _URNG>
30_LIBCPP_HIDE_FROM_ABI _RealType generate_canonical(_URNG& __g) {30[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _RealType generate_canonical(_URNG& __g) {
31 const size_t __dt = numeric_limits<_RealType>::digits;31 const size_t __dt = numeric_limits<_RealType>::digits;
32 const size_t __b = __dt < __bits ? __dt : __bits;32 const size_t __b = __dt < __bits ? __dt : __bits;
33#ifdef _LIBCPP_CXX03_LANG33#ifdef _LIBCPP_CXX03_LANG
lib/libcxx/include/__random/geometric_distribution.h+7-7
...@@ -40,7 +40,7 @@ public:...@@ -40,7 +40,7 @@ public:
4040
41 _LIBCPP_HIDE_FROM_ABI explicit param_type(double __p = 0.5) : __p_(__p) {}41 _LIBCPP_HIDE_FROM_ABI explicit param_type(double __p = 0.5) : __p_(__p) {}
4242
43 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }43 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
4444
45 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {45 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
46 return __x.__p_ == __y.__p_;46 return __x.__p_ == __y.__p_;
...@@ -64,22 +64,22 @@ public:...@@ -64,22 +64,22 @@ public:
6464
65 // generating functions65 // generating functions
66 template <class _URNG>66 template <class _URNG>
67 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {67 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
68 return (*this)(__g, __p_);68 return (*this)(__g, __p_);
69 }69 }
70 template <class _URNG>70 template <class _URNG>
71 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {71 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
72 return negative_binomial_distribution<result_type>(1, __p.p())(__g);72 return negative_binomial_distribution<result_type>(1, __p.p())(__g);
73 }73 }
7474
75 // property functions75 // property functions
76 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
7777
78 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }78 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
79 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }79 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8080
81 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
82 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
8383
84 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const geometric_distribution& __x, const geometric_distribution& __y) {84 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const geometric_distribution& __x, const geometric_distribution& __y) {
85 return __x.__p_ == __y.__p_;85 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/independent_bits_engine.h+29-35
...@@ -82,8 +82,8 @@ public:...@@ -82,8 +82,8 @@ public:
82 static_assert(_Min < _Max, "independent_bits_engine invalid parameters");82 static_assert(_Min < _Max, "independent_bits_engine invalid parameters");
8383
84 // engine characteristics84 // engine characteristics
85 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
86 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
8787
88 // constructors and seeding functions88 // constructors and seeding functions
89 _LIBCPP_HIDE_FROM_ABI independent_bits_engine() {}89 _LIBCPP_HIDE_FROM_ABI independent_bits_engine() {}
...@@ -94,25 +94,47 @@ public:...@@ -94,25 +94,47 @@ public:
94 _LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}94 _LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
95 template <95 template <
96 class _Sseq,96 class _Sseq,
97 __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value && !is_convertible<_Sseq, _Engine>::value,97 __enable_if_t<__is_seed_sequence_v<_Sseq, independent_bits_engine> && !is_convertible<_Sseq, _Engine>::value,
98 int> = 0>98 int> = 0>
99 _LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(_Sseq& __q) : __e_(__q) {}99 _LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(_Sseq& __q) : __e_(__q) {}
100 _LIBCPP_HIDE_FROM_ABI void seed() { __e_.seed(); }100 _LIBCPP_HIDE_FROM_ABI void seed() { __e_.seed(); }
101 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd) { __e_.seed(__sd); }101 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd) { __e_.seed(__sd); }
102 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value, int> = 0>102 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, independent_bits_engine>, int> = 0>
103 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {103 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
104 __e_.seed(__q);104 __e_.seed(__q);
105 }105 }
106106
107 // generating functions107 // generating functions
108 _LIBCPP_HIDE_FROM_ABI result_type operator()() { return __eval(integral_constant<bool, _Rp != 0>()); }108 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
109 if _LIBCPP_CONSTEXPR (_Rp != 0) {
110 result_type __sp = 0;
111 for (size_t __k = 0; __k < __n0; ++__k) {
112 _Engine_result_type __u;
113 do {
114 __u = __e_() - _Engine::min();
115 } while (__u >= __y0);
116 __sp = static_cast<result_type>(__lshift<__w0>(__sp) + (__u & __mask0));
117 }
118 for (size_t __k = __n0; __k < __n; ++__k) {
119 _Engine_result_type __u;
120 do {
121 __u = __e_() - _Engine::min();
122 } while (__u >= __y1);
123 __sp = static_cast<result_type>(__lshift<__w0 + 1>(__sp) + (__u & __mask1));
124 }
125 return __sp;
126 } else {
127 return static_cast<result_type>(__e_() & __mask0);
128 }
129 }
130
109 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {131 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
110 for (; __z; --__z)132 for (; __z; --__z)
111 operator()();133 (void)operator()();
112 }134 }
113135
114 // property functions136 // property functions
115 _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }137 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
116138
117 template <class _Eng, size_t _Wp, class _UInt>139 template <class _Eng, size_t _Wp, class _UInt>
118 friend bool operator==(const independent_bits_engine<_Eng, _Wp, _UInt>& __x,140 friend bool operator==(const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
...@@ -131,9 +153,6 @@ public:...@@ -131,9 +153,6 @@ public:
131 operator>>(basic_istream<_CharT, _Traits>& __is, independent_bits_engine<_Eng, _Wp, _UInt>& __x);153 operator>>(basic_istream<_CharT, _Traits>& __is, independent_bits_engine<_Eng, _Wp, _UInt>& __x);
132154
133private:155private:
134 _LIBCPP_HIDE_FROM_ABI result_type __eval(false_type);
135 _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type);
136
137 template <size_t __count,156 template <size_t __count,
138 __enable_if_t<__count< _Dt, int> = 0> _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type __x) {157 __enable_if_t<__count< _Dt, int> = 0> _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type __x) {
139 return __x << __count;158 return __x << __count;
...@@ -145,31 +164,6 @@ private:...@@ -145,31 +164,6 @@ private:
145 }164 }
146};165};
147166
148template <class _Engine, size_t __w, class _UIntType>
149inline _UIntType independent_bits_engine<_Engine, __w, _UIntType>::__eval(false_type) {
150 return static_cast<result_type>(__e_() & __mask0);
151}
152
153template <class _Engine, size_t __w, class _UIntType>
154_UIntType independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) {
155 result_type __sp = 0;
156 for (size_t __k = 0; __k < __n0; ++__k) {
157 _Engine_result_type __u;
158 do {
159 __u = __e_() - _Engine::min();
160 } while (__u >= __y0);
161 __sp = static_cast<result_type>(__lshift<__w0>(__sp) + (__u & __mask0));
162 }
163 for (size_t __k = __n0; __k < __n; ++__k) {
164 _Engine_result_type __u;
165 do {
166 __u = __e_() - _Engine::min();
167 } while (__u >= __y1);
168 __sp = static_cast<result_type>(__lshift<__w0 + 1>(__sp) + (__u & __mask1));
169 }
170 return __sp;
171}
172
173template <class _Eng, size_t _Wp, class _UInt>167template <class _Eng, size_t _Wp, class _UInt>
174inline _LIBCPP_HIDE_FROM_ABI bool168inline _LIBCPP_HIDE_FROM_ABI bool
175operator==(const independent_bits_engine<_Eng, _Wp, _UInt>& __x, const independent_bits_engine<_Eng, _Wp, _UInt>& __y) {169operator==(const independent_bits_engine<_Eng, _Wp, _UInt>& __x, const independent_bits_engine<_Eng, _Wp, _UInt>& __y) {
lib/libcxx/include/__random/is_seed_sequence.h+2-4
...@@ -21,10 +21,8 @@...@@ -21,10 +21,8 @@
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2222
23template <class _Sseq, class _Engine>23template <class _Sseq, class _Engine>
24struct __is_seed_sequence {24inline const bool __is_seed_sequence_v =
25 static _LIBCPP_CONSTEXPR const bool value =25 !is_convertible<_Sseq, typename _Engine::result_type>::value && !is_same<__remove_cv_t<_Sseq>, _Engine>::value;
26 !is_convertible<_Sseq, typename _Engine::result_type>::value && !is_same<__remove_cv_t<_Sseq>, _Engine>::value;
27};
2826
29_LIBCPP_END_NAMESPACE_STD27_LIBCPP_END_NAMESPACE_STD
3028
lib/libcxx/include/__random/linear_congruential_engine.h+26-41
...@@ -254,8 +254,8 @@ public:...@@ -254,8 +254,8 @@ public:
254 static inline _LIBCPP_CONSTEXPR const result_type multiplier = __a;254 static inline _LIBCPP_CONSTEXPR const result_type multiplier = __a;
255 static inline _LIBCPP_CONSTEXPR const result_type increment = __c;255 static inline _LIBCPP_CONSTEXPR const result_type increment = __c;
256 static inline _LIBCPP_CONSTEXPR const result_type modulus = __m;256 static inline _LIBCPP_CONSTEXPR const result_type modulus = __m;
257 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }257 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
258 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }258 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
259 static inline _LIBCPP_CONSTEXPR const result_type default_seed = 1u;259 static inline _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
260260
261 // constructors and seeding functions261 // constructors and seeding functions
...@@ -265,28 +265,43 @@ public:...@@ -265,28 +265,43 @@ public:
265#else265#else
266 _LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(result_type __s = default_seed) { seed(__s); }266 _LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(result_type __s = default_seed) { seed(__s); }
267#endif267#endif
268 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>268 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, linear_congruential_engine>, int> = 0>
269 _LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(_Sseq& __q) {269 _LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(_Sseq& __q) {
270 seed(__q);270 seed(__q);
271 }271 }
272
272 _LIBCPP_HIDE_FROM_ABI void seed(result_type __s = default_seed) {273 _LIBCPP_HIDE_FROM_ABI void seed(result_type __s = default_seed) {
273 seed(integral_constant<bool, __m == 0>(), integral_constant<bool, __c == 0>(), __s);274 if _LIBCPP_CONSTEXPR (__m == 0) {
275 if _LIBCPP_CONSTEXPR (__c == 0)
276 __x_ = __s == 0 ? 1 : __s;
277 else
278 __x_ = __s;
279 } else {
280 if _LIBCPP_CONSTEXPR (__c == 0)
281 __x_ = __s % __m == 0 ? 1 : __s % __m;
282 else
283 __x_ = __s % __m;
284 }
274 }285 }
275 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>286
287 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, linear_congruential_engine>, int> = 0>
276 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {288 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
277 __seed(289 const _LIBCPP_CONSTEXPR unsigned __k =
278 __q,290 1 + (__m == 0 ? (sizeof(result_type) * __CHAR_BIT__ - 1) / 32 : (__m > 0x100000000ull));
279 integral_constant<unsigned,291 static_assert(__k <= 2);
280 1 + (__m == 0 ? (sizeof(result_type) * __CHAR_BIT__ - 1) / 32 : (__m > 0x100000000ull))>());292 uint32_t __ar[__k + 3];
293 __q.generate(__ar, __ar + __k + 3);
294 result_type __s = static_cast<result_type>((__ar[3] + (__k == 1 ? 0 : (uint64_t)__ar[4] << 32)) % __m);
295 __x_ = __c == 0 && __s == 0 ? result_type(1) : __s;
281 }296 }
282297
283 // generating functions298 // generating functions
284 _LIBCPP_HIDE_FROM_ABI result_type operator()() {299 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
285 return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _Mp>::next(__x_));300 return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _Mp>::next(__x_));
286 }301 }
287 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {302 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
288 for (; __z; --__z)303 for (; __z; --__z)
289 operator()();304 (void)operator()();
290 }305 }
291306
292 friend _LIBCPP_HIDE_FROM_ABI bool307 friend _LIBCPP_HIDE_FROM_ABI bool
...@@ -299,16 +314,6 @@ public:...@@ -299,16 +314,6 @@ public:
299 }314 }
300315
301private:316private:
302 _LIBCPP_HIDE_FROM_ABI void seed(true_type, true_type, result_type __s) { __x_ = __s == 0 ? 1 : __s; }
303 _LIBCPP_HIDE_FROM_ABI void seed(true_type, false_type, result_type __s) { __x_ = __s; }
304 _LIBCPP_HIDE_FROM_ABI void seed(false_type, true_type, result_type __s) { __x_ = __s % __m == 0 ? 1 : __s % __m; }
305 _LIBCPP_HIDE_FROM_ABI void seed(false_type, false_type, result_type __s) { __x_ = __s % __m; }
306
307 template <class _Sseq>
308 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
309 template <class _Sseq>
310 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
311
312 template <class _CharT, class _Traits, class _Up, _Up _Ap, _Up _Cp, _Up _Np>317 template <class _CharT, class _Traits, class _Up, _Up _Ap, _Up _Cp, _Up _Np>
313 friend basic_ostream<_CharT, _Traits>&318 friend basic_ostream<_CharT, _Traits>&
314 operator<<(basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&);319 operator<<(basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&);
...@@ -318,26 +323,6 @@ private:...@@ -318,26 +323,6 @@ private:
318 operator>>(basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);323 operator>>(basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
319};324};
320325
321template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
322template <class _Sseq>
323void linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q, integral_constant<unsigned, 1>) {
324 const unsigned __k = 1;
325 uint32_t __ar[__k + 3];
326 __q.generate(__ar, __ar + __k + 3);
327 result_type __s = static_cast<result_type>(__ar[3] % __m);
328 __x_ = __c == 0 && __s == 0 ? result_type(1) : __s;
329}
330
331template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
332template <class _Sseq>
333void linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q, integral_constant<unsigned, 2>) {
334 const unsigned __k = 2;
335 uint32_t __ar[__k + 3];
336 __q.generate(__ar, __ar + __k + 3);
337 result_type __s = static_cast<result_type>((__ar[3] + ((uint64_t)__ar[4] << 32)) % __m);
338 __x_ = __c == 0 && __s == 0 ? result_type(1) : __s;
339}
340
341template <class _CharT, class _Traits, class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>326template <class _CharT, class _Traits, class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
342inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&327inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
343operator<<(basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_UIntType, __a, __c, __m>& __x) {328operator<<(basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_UIntType, __a, __c, __m>& __x) {
lib/libcxx/include/__random/lognormal_distribution.h+9-9
...@@ -43,8 +43,8 @@ public:...@@ -43,8 +43,8 @@ public:
4343
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __m = 0, result_type __s = 1) : __m_(__m), __s_(__s) {}44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __m = 0, result_type __s = 1) : __m_(__m), __s_(__s) {}
4545
46 _LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }
47 _LIBCPP_HIDE_FROM_ABI result_type s() const { return __s_; }47 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type s() const { return __s_; }
4848
49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
50 return __x.__m_ == __y.__m_ && __x.__s_ == __y.__s_;50 return __x.__m_ == __y.__m_ && __x.__s_ == __y.__s_;
...@@ -68,28 +68,28 @@ public:...@@ -68,28 +68,28 @@ public:
6868
69 // generating functions69 // generating functions
70 template <class _URNG>70 template <class _URNG>
71 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {71 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
72 return std::exp(__nd_(__g));72 return std::exp(__nd_(__g));
73 }73 }
7474
75 template <class _URNG>75 template <class _URNG>
76 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
77 typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());77 typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());
78 return std::exp(__nd_(__g, __pn));78 return std::exp(__nd_(__g, __pn));
79 }79 }
8080
81 // property functions81 // property functions
82 _LIBCPP_HIDE_FROM_ABI result_type m() const { return __nd_.mean(); }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __nd_.mean(); }
83 _LIBCPP_HIDE_FROM_ABI result_type s() const { return __nd_.stddev(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type s() const { return __nd_.stddev(); }
8484
85 _LIBCPP_HIDE_FROM_ABI param_type param() const { return param_type(__nd_.mean(), __nd_.stddev()); }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return param_type(__nd_.mean(), __nd_.stddev()); }
86 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) {86 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) {
87 typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());87 typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());
88 __nd_.param(__pn);88 __nd_.param(__pn);
89 }89 }
9090
91 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }91 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
92 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }92 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
9393
94 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const lognormal_distribution& __x, const lognormal_distribution& __y) {94 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const lognormal_distribution& __x, const lognormal_distribution& __y) {
95 return __x.__nd_ == __y.__nd_;95 return __x.__nd_ == __y.__nd_;
lib/libcxx/include/__random/mersenne_twister_engine.h+73-62
...@@ -161,8 +161,8 @@ public:...@@ -161,8 +161,8 @@ public:
161 static inline _LIBCPP_CONSTEXPR const result_type tempering_c = __c;161 static inline _LIBCPP_CONSTEXPR const result_type tempering_c = __c;
162 static inline _LIBCPP_CONSTEXPR const size_t tempering_l = __l;162 static inline _LIBCPP_CONSTEXPR const size_t tempering_l = __l;
163 static inline _LIBCPP_CONSTEXPR const result_type initialization_multiplier = __f;163 static inline _LIBCPP_CONSTEXPR const result_type initialization_multiplier = __f;
164 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }164 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
165 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }165 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
166 static inline _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;166 static inline _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
167167
168 // constructors and seeding functions168 // constructors and seeding functions
...@@ -172,7 +172,7 @@ public:...@@ -172,7 +172,7 @@ public:
172#else172#else
173 _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(result_type __sd = default_seed) { seed(__sd); }173 _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(result_type __sd = default_seed) { seed(__sd); }
174#endif174#endif
175 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>175 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, mersenne_twister_engine>, int> = 0>
176 _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(_Sseq& __q) {176 _LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(_Sseq& __q) {
177 seed(__q);177 seed(__q);
178 }178 }
...@@ -181,21 +181,68 @@ public:...@@ -181,21 +181,68 @@ public:
181 for (size_t __i = 1; __i < __n; ++__i)181 for (size_t __i = 1; __i < __n; ++__i)
182 __x_[__i] = (__f * (__x_[__i - 1] ^ __rshift<__w - 2>(__x_[__i - 1])) + __i) & _Max;182 __x_[__i] = (__f * (__x_[__i - 1] ^ __rshift<__w - 2>(__x_[__i - 1])) + __i) & _Max;
183 __i_ = 0;183 __i_ = 0;
184#ifdef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
185 __update_all_states();
186#endif
184 }187 }
185 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>188 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, mersenne_twister_engine>, int> = 0>
186 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {189 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
187 __seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());190 const unsigned __k = 1 + (__w - 1) / 32;
191 static_assert(__k <= 2);
192 uint32_t __ar[__n * __k];
193 __q.generate(__ar, __ar + __n * __k);
194 for (size_t __i = 0; __i < __n; ++__i) {
195 if _LIBCPP_CONSTEXPR (__k == 1) {
196 __x_[__i] = static_cast<result_type>(__ar[__i] & _Max);
197 } else {
198 __x_[__i] = static_cast<result_type>((__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max);
199 }
200 }
201 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
202 __i_ = 0;
203 if ((__x_[0] & ~__mask) == 0) {
204 for (size_t __i = 1; __i < __n; ++__i)
205 if (__x_[__i] != 0)
206 return;
207 __x_[0] = result_type(1) << (__w - 1);
208 }
209#ifdef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
210 __update_all_states();
211#endif
188 }212 }
189213
190 // generating functions214 void __update_state(size_t __i, size_t __k) {
191 _LIBCPP_HIDE_FROM_ABI result_type operator()() {215 const size_t __j = (__i + 1) % __n;
192 const size_t __j = (__i_ + 1) % __n;
193 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);216 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
194 const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);217 const result_type __yp = (__x_[__i] & ~__mask) | (__x_[__j] & __mask);
195 const size_t __k = (__i_ + __m) % __n;218 __x_[__i] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
196 __x_[__i_] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));219 }
197 result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d);220
198 __i_ = __j;221 void __update_state(size_t __i) { __update_state(__i, (__i + __m) % __n); }
222
223 void __update_all_states() {
224 size_t __i = 0;
225 // This is split into two loops to help the compiler vectorize the code
226 for (; __i != (__n - __m); ++__i)
227 __update_state(__i);
228 for (size_t __j = 0; __i != __n; ++__i, ++__j)
229 __update_state(__i, __j);
230 }
231
232 // generating functions
233 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
234#ifdef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
235 result_type __val = __x_[__i_];
236 if (++__i_ == __n) [[__unlikely__]] {
237 __update_all_states();
238 __i_ = 0;
239 }
240#else
241 __update_state(__i_);
242 result_type __val = __x_[__i_];
243 __i_ = (__i_ + 1) % __n;
244#endif
245 result_type __z = __val ^ (__rshift<__u>(__val) & __d);
199 __z ^= __lshift<__s>(__z) & __b;246 __z ^= __lshift<__s>(__z) & __b;
200 __z ^= __lshift<__t>(__z) & __c;247 __z ^= __lshift<__t>(__z) & __c;
201 return __z ^ __rshift<__l>(__z);248 return __z ^ __rshift<__l>(__z);
...@@ -203,7 +250,7 @@ public:...@@ -203,7 +250,7 @@ public:
203250
204 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {251 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
205 for (; __z; --__z)252 for (; __z; --__z)
206 operator()();253 (void)operator()();
207 }254 }
208255
209 template <class _UInt,256 template <class _UInt,
...@@ -265,59 +312,23 @@ public:...@@ -265,59 +312,23 @@ public:
265 mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x);312 mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x);
266313
267private:314private:
268 template <class _Sseq>315 template <size_t __count>
269 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>) {316 _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type __x) {
270 const unsigned __k = 1;317 if _LIBCPP_CONSTEXPR (__count < __w) {
271 uint32_t __ar[__n * __k];318 return (__x << __count) & _Max;
272 __q.generate(__ar, __ar + __n * __k);319 } else {
273 for (size_t __i = 0; __i < __n; ++__i)320 return result_type(0);
274 __x_[__i] = static_cast<result_type>(__ar[__i] & _Max);
275 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
276 __i_ = 0;
277 if ((__x_[0] & ~__mask) == 0) {
278 for (size_t __i = 1; __i < __n; ++__i)
279 if (__x_[__i] != 0)
280 return;
281 __x_[0] = result_type(1) << (__w - 1);
282 }321 }
283 }322 }
284323
285 template <class _Sseq>324 template <size_t __count>
286 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>) {325 _LIBCPP_HIDE_FROM_ABI static result_type __rshift(result_type __x) {
287 const unsigned __k = 2;326 if _LIBCPP_CONSTEXPR (__count < _Dt) {
288 uint32_t __ar[__n * __k];327 return __x >> __count;
289 __q.generate(__ar, __ar + __n * __k);328 } else {
290 for (size_t __i = 0; __i < __n; ++__i)329 return result_type(0);
291 __x_[__i] = static_cast<result_type>((__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max);
292 const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
293 __i_ = 0;
294 if ((__x_[0] & ~__mask) == 0) {
295 for (size_t __i = 1; __i < __n; ++__i)
296 if (__x_[__i] != 0)
297 return;
298 __x_[0] = result_type(1) << (__w - 1);
299 }330 }
300 }331 }
301
302 template <size_t __count,
303 __enable_if_t<__count< __w, int> = 0> _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type __x) {
304 return (__x << __count) & _Max;
305 }
306
307 template <size_t __count, __enable_if_t<(__count >= __w), int> = 0>
308 _LIBCPP_HIDE_FROM_ABI static result_type __lshift(result_type) {
309 return result_type(0);
310 }
311
312 template <size_t __count,
313 __enable_if_t<__count< _Dt, int> = 0> _LIBCPP_HIDE_FROM_ABI static result_type __rshift(result_type __x) {
314 return __x >> __count;
315 }
316
317 template <size_t __count, __enable_if_t<(__count >= _Dt), int> = 0>
318 _LIBCPP_HIDE_FROM_ABI static result_type __rshift(result_type) {
319 return result_type(0);
320 }
321};332};
322333
323template <class _UInt,334template <class _UInt,
lib/libcxx/include/__random/negative_binomial_distribution.h+9-9
...@@ -44,8 +44,8 @@ public:...@@ -44,8 +44,8 @@ public:
4444
45 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __k = 1, double __p = 0.5) : __k_(__k), __p_(__p) {}45 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __k = 1, double __p = 0.5) : __k_(__k), __p_(__p) {}
4646
47 _LIBCPP_HIDE_FROM_ABI result_type k() const { return __k_; }47 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type k() const { return __k_; }
48 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }48 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
4949
50 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {50 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
51 return __x.__k_ == __y.__k_ && __x.__p_ == __y.__p_;51 return __x.__k_ == __y.__k_ && __x.__p_ == __y.__p_;
...@@ -70,21 +70,21 @@ public:...@@ -70,21 +70,21 @@ public:
7070
71 // generating functions71 // generating functions
72 template <class _URNG>72 template <class _URNG>
73 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {73 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
74 return (*this)(__g, __p_);74 return (*this)(__g, __p_);
75 }75 }
76 template <class _URNG>76 template <class _URNG>
77 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7878
79 // property functions79 // property functions
80 _LIBCPP_HIDE_FROM_ABI result_type k() const { return __p_.k(); }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type k() const { return __p_.k(); }
81 _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }81 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
8282
83 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
84 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }84 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8585
86 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
87 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }87 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
8888
89 friend _LIBCPP_HIDE_FROM_ABI bool89 friend _LIBCPP_HIDE_FROM_ABI bool
90 operator==(const negative_binomial_distribution& __x, const negative_binomial_distribution& __y) {90 operator==(const negative_binomial_distribution& __x, const negative_binomial_distribution& __y) {
lib/libcxx/include/__random/normal_distribution.h+9-9
...@@ -44,8 +44,8 @@ public:...@@ -44,8 +44,8 @@ public:
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __mean = 0, result_type __stddev = 1)44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __mean = 0, result_type __stddev = 1)
45 : __mean_(__mean), __stddev_(__stddev) {}45 : __mean_(__mean), __stddev_(__stddev) {}
4646
47 _LIBCPP_HIDE_FROM_ABI result_type mean() const { return __mean_; }47 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type mean() const { return __mean_; }
48 _LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __stddev_; }48 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __stddev_; }
4949
50 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {50 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
51 return __x.__mean_ == __y.__mean_ && __x.__stddev_ == __y.__stddev_;51 return __x.__mean_ == __y.__mean_ && __x.__stddev_ == __y.__stddev_;
...@@ -73,21 +73,21 @@ public:...@@ -73,21 +73,21 @@ public:
7373
74 // generating functions74 // generating functions
75 template <class _URNG>75 template <class _URNG>
76 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
77 return (*this)(__g, __p_);77 return (*this)(__g, __p_);
78 }78 }
79 template <class _URNG>79 template <class _URNG>
80 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
8181
82 // property functions82 // property functions
83 _LIBCPP_HIDE_FROM_ABI result_type mean() const { return __p_.mean(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type mean() const { return __p_.mean(); }
84 _LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __p_.stddev(); }84 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __p_.stddev(); }
8585
86 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
87 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }87 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8888
89 _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
90 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }90 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
9191
92 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const normal_distribution& __x, const normal_distribution& __y) {92 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const normal_distribution& __x, const normal_distribution& __y) {
93 return __x.__p_ == __y.__p_ && __x.__v_hot_ == __y.__v_hot_ && (!__x.__v_hot_ || __x.__v_ == __y.__v_);93 return __x.__p_ == __y.__p_ && __x.__v_hot_ == __y.__v_hot_ && (!__x.__v_hot_ || __x.__v_ == __y.__v_);
lib/libcxx/include/__random/piecewise_constant_distribution.h+9-9
...@@ -59,8 +59,8 @@ public:...@@ -59,8 +59,8 @@ public:
59 _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;59 _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
60 _LIBCPP_HIDE_FROM_ABI param_type& operator=(const param_type& __rhs);60 _LIBCPP_HIDE_FROM_ABI param_type& operator=(const param_type& __rhs);
6161
62 _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }62 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }
63 _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }63 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }
6464
65 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {65 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
66 return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;66 return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;
...@@ -109,21 +109,21 @@ public:...@@ -109,21 +109,21 @@ public:
109109
110 // generating functions110 // generating functions
111 template <class _URNG>111 template <class _URNG>
112 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {112 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
113 return (*this)(__g, __p_);113 return (*this)(__g, __p_);
114 }114 }
115 template <class _URNG>115 template <class _URNG>
116 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);116 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
117117
118 // property functions118 // property functions
119 _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }119 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }
120 _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }120 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }
121121
122 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }122 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
123 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }123 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
124124
125 _LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }125 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }
126 _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }126 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }
127127
128 friend _LIBCPP_HIDE_FROM_ABI bool128 friend _LIBCPP_HIDE_FROM_ABI bool
129 operator==(const piecewise_constant_distribution& __x, const piecewise_constant_distribution& __y) {129 operator==(const piecewise_constant_distribution& __x, const piecewise_constant_distribution& __y) {
lib/libcxx/include/__random/piecewise_linear_distribution.h+9-9
...@@ -60,8 +60,8 @@ public:...@@ -60,8 +60,8 @@ public:
60 _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;60 _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
61 _LIBCPP_HIDE_FROM_ABI param_type& operator=(const param_type& __rhs);61 _LIBCPP_HIDE_FROM_ABI param_type& operator=(const param_type& __rhs);
6262
63 _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }63 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }
64 _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }64 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }
6565
66 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {66 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
67 return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;67 return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;
...@@ -110,21 +110,21 @@ public:...@@ -110,21 +110,21 @@ public:
110110
111 // generating functions111 // generating functions
112 template <class _URNG>112 template <class _URNG>
113 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {113 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
114 return (*this)(__g, __p_);114 return (*this)(__g, __p_);
115 }115 }
116 template <class _URNG>116 template <class _URNG>
117 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);117 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
118118
119 // property functions119 // property functions
120 _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }120 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }
121 _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }121 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }
122122
123 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }123 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
124 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }124 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
125125
126 _LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }126 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }
127 _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }127 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }
128128
129 friend _LIBCPP_HIDE_FROM_ABI bool129 friend _LIBCPP_HIDE_FROM_ABI bool
130 operator==(const piecewise_linear_distribution& __x, const piecewise_linear_distribution& __y) {130 operator==(const piecewise_linear_distribution& __x, const piecewise_linear_distribution& __y) {
lib/libcxx/include/__random/poisson_distribution.h+7-7
...@@ -53,7 +53,7 @@ public:...@@ -53,7 +53,7 @@ public:
5353
54 _LIBCPP_HIDE_FROM_ABI explicit param_type(double __mean = 1.0);54 _LIBCPP_HIDE_FROM_ABI explicit param_type(double __mean = 1.0);
5555
56 _LIBCPP_HIDE_FROM_ABI double mean() const { return __mean_; }56 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double mean() const { return __mean_; }
5757
58 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {58 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
59 return __x.__mean_ == __y.__mean_;59 return __x.__mean_ == __y.__mean_;
...@@ -79,20 +79,20 @@ public:...@@ -79,20 +79,20 @@ public:
7979
80 // generating functions80 // generating functions
81 template <class _URNG>81 template <class _URNG>
82 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
83 return (*this)(__g, __p_);83 return (*this)(__g, __p_);
84 }84 }
85 template <class _URNG>85 template <class _URNG>
86 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
8787
88 // property functions88 // property functions
89 _LIBCPP_HIDE_FROM_ABI double mean() const { return __p_.mean(); }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double mean() const { return __p_.mean(); }
9090
91 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }91 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
92 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }92 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
9393
94 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }94 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
95 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }95 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
9696
97 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const poisson_distribution& __x, const poisson_distribution& __y) {97 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const poisson_distribution& __x, const poisson_distribution& __y) {
98 return __x.__p_ == __y.__p_;98 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/random_device.h+11-13
...@@ -19,27 +19,24 @@...@@ -19,27 +19,24 @@
19_LIBCPP_PUSH_MACROS19_LIBCPP_PUSH_MACROS
20#include <__undef_macros>20#include <__undef_macros>
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_HAS_RANDOM_DEVICE22#if _LIBCPP_HAS_RANDOM_DEVICE
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
26
26class _LIBCPP_EXPORTED_FROM_ABI random_device {27class _LIBCPP_EXPORTED_FROM_ABI random_device {
27# ifdef _LIBCPP_USING_DEV_RANDOM28# ifdef _LIBCPP_USING_DEV_RANDOM
28 int __f_;29 int __f_;
29# elif !defined(_LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT)30# elif !defined(_LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT)
30 _LIBCPP_DIAGNOSTIC_PUSH
31 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
32
33 // Apple platforms used to use the `_LIBCPP_USING_DEV_RANDOM` code path, and now31 // Apple platforms used to use the `_LIBCPP_USING_DEV_RANDOM` code path, and now
34 // use `arc4random()` as of this comment. In order to avoid breaking the ABI, we32 // use `arc4random()` as of this comment. In order to avoid breaking the ABI, we
35 // retain the same layout as before.33 // retain the same layout as before.
36# if defined(__APPLE__)34# if defined(__APPLE__)
37 int __padding_; // padding to fake the `__f_` field above35 [[__maybe_unused__]] int __padding_; // padding to fake the `__f_` field above
38# endif36# endif
3937
40 // ... vendors can add workarounds here if they switch to a different representation ...38 // ... vendors can add workarounds here if they switch to a different representation ...
4139
42 _LIBCPP_DIAGNOSTIC_POP
43# endif40# endif
4441
45public:42public:
...@@ -50,8 +47,8 @@ public:...@@ -50,8 +47,8 @@ public:
50 static _LIBCPP_CONSTEXPR const result_type _Min = 0;47 static _LIBCPP_CONSTEXPR const result_type _Min = 0;
51 static _LIBCPP_CONSTEXPR const result_type _Max = 0xFFFFFFFFu;48 static _LIBCPP_CONSTEXPR const result_type _Max = 0xFFFFFFFFu;
5249
53 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }50 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
54 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }51 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
5552
56 // constructors53 // constructors
57# ifndef _LIBCPP_CXX03_LANG54# ifndef _LIBCPP_CXX03_LANG
...@@ -63,19 +60,20 @@ public:...@@ -63,19 +60,20 @@ public:
63 ~random_device();60 ~random_device();
6461
65 // generating functions62 // generating functions
66 result_type operator()();63 [[__nodiscard__]] result_type operator()();
6764
68 // property functions65 // property functions
69 double entropy() const _NOEXCEPT;66 [[__nodiscard__]] double entropy() const _NOEXCEPT;
7067
71 random_device(const random_device&) = delete;68 random_device(const random_device&) = delete;
72 void operator=(const random_device&) = delete;69 void operator=(const random_device&) = delete;
73};70};
7471
75#endif // _LIBCPP_HAS_RANDOM_DEVICE72_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
76
77_LIBCPP_END_NAMESPACE_STD73_LIBCPP_END_NAMESPACE_STD
7874
75#endif // _LIBCPP_HAS_RANDOM_DEVICE
76
79_LIBCPP_POP_MACROS77_LIBCPP_POP_MACROS
8078
81#endif // _LIBCPP___RANDOM_RANDOM_DEVICE_H79#endif // _LIBCPP___RANDOM_RANDOM_DEVICE_H
lib/libcxx/include/__random/seed_seq.h+2-2
...@@ -56,7 +56,7 @@ public:...@@ -56,7 +56,7 @@ public:
56 _LIBCPP_HIDE_FROM_ABI void generate(_RandomAccessIterator __first, _RandomAccessIterator __last);56 _LIBCPP_HIDE_FROM_ABI void generate(_RandomAccessIterator __first, _RandomAccessIterator __last);
5757
58 // property functions58 // property functions
59 _LIBCPP_HIDE_FROM_ABI size_t size() const _NOEXCEPT { return __v_.size(); }59 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t size() const _NOEXCEPT { return __v_.size(); }
60 template <class _OutputIterator>60 template <class _OutputIterator>
61 _LIBCPP_HIDE_FROM_ABI void param(_OutputIterator __dest) const {61 _LIBCPP_HIDE_FROM_ABI void param(_OutputIterator __dest) const {
62 std::copy(__v_.begin(), __v_.end(), __dest);62 std::copy(__v_.begin(), __v_.end(), __dest);
...@@ -65,7 +65,7 @@ public:...@@ -65,7 +65,7 @@ public:
65 seed_seq(const seed_seq&) = delete;65 seed_seq(const seed_seq&) = delete;
66 void operator=(const seed_seq&) = delete;66 void operator=(const seed_seq&) = delete;
6767
68 _LIBCPP_HIDE_FROM_ABI static result_type _Tp(result_type __x) { return __x ^ (__x >> 27); }68 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static result_type _Tp(result_type __x) { return __x ^ (__x >> 27); }
6969
70private:70private:
71 template <class _InputIterator>71 template <class _InputIterator>
lib/libcxx/include/__random/shuffle_order_engine.h+23-33
...@@ -76,8 +76,8 @@ public:...@@ -76,8 +76,8 @@ public:
76 static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();76 static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
77#endif77#endif
78 static_assert(_Min < _Max, "shuffle_order_engine invalid parameters");78 static_assert(_Min < _Max, "shuffle_order_engine invalid parameters");
79 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
80 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
8181
82 static _LIBCPP_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull;82 static _LIBCPP_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull;
8383
...@@ -88,10 +88,9 @@ public:...@@ -88,10 +88,9 @@ public:
88 _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Engine&& __e) : __e_(std::move(__e)) { __init(); }88 _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Engine&& __e) : __e_(std::move(__e)) { __init(); }
89#endif // _LIBCPP_CXX03_LANG89#endif // _LIBCPP_CXX03_LANG
90 _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(result_type __sd) : __e_(__sd) { __init(); }90 _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(result_type __sd) : __e_(__sd) { __init(); }
91 template <91 template <class _Sseq,
92 class _Sseq,92 __enable_if_t<__is_seed_sequence_v<_Sseq, shuffle_order_engine> && !is_convertible<_Sseq, _Engine>::value,
93 __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value && !is_convertible<_Sseq, _Engine>::value,93 int> = 0>
94 int> = 0>
95 _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Sseq& __q) : __e_(__q) {94 _LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Sseq& __q) : __e_(__q) {
96 __init();95 __init();
97 }96 }
...@@ -103,21 +102,35 @@ public:...@@ -103,21 +102,35 @@ public:
103 __e_.seed(__sd);102 __e_.seed(__sd);
104 __init();103 __init();
105 }104 }
106 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value, int> = 0>105 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, shuffle_order_engine>, int> = 0>
107 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {106 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
108 __e_.seed(__q);107 __e_.seed(__q);
109 __init();108 __init();
110 }109 }
111110
112 // generating functions111 // generating functions
113 _LIBCPP_HIDE_FROM_ABI result_type operator()() { return __eval(integral_constant<bool, _Rp != 0>()); }112 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
113 if _LIBCPP_CONSTEXPR (_Rp != 0 || !(__k & 1)) {
114 using _Ratio = __uratio<__k, _Rp != 0 ? _Rp : 0x8000000000000000ull>;
115 if _LIBCPP_CONSTEXPR (_Ratio::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)) {
116 return __evalf<_Ratio::num, _Ratio::den>();
117 } else {
118 const size_t __j = static_cast<size_t>(_Ratio::num * (__y_ - _Min) / _Ratio::den);
119 __y_ = __v_[__j];
120 __v_[__j] = __e_();
121 return __y_;
122 }
123 } else
124 return __evalf<__k, 0>();
125 }
126
114 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {127 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
115 for (; __z; --__z)128 for (; __z; --__z)
116 operator()();129 (void)operator()();
117 }130 }
118131
119 // property functions132 // property functions
120 _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }133 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
121134
122private:135private:
123 template <class _Eng, size_t _Kp>136 template <class _Eng, size_t _Kp>
...@@ -140,29 +153,6 @@ private:...@@ -140,29 +153,6 @@ private:
140 __y_ = __e_();153 __y_ = __e_();
141 }154 }
142155
143 _LIBCPP_HIDE_FROM_ABI result_type __eval(false_type) { return __eval2(integral_constant<bool, __k & 1>()); }
144 _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type) { return __eval(__uratio<__k, _Rp>()); }
145
146 _LIBCPP_HIDE_FROM_ABI result_type __eval2(false_type) { return __eval(__uratio<__k / 2, 0x8000000000000000ull>()); }
147 _LIBCPP_HIDE_FROM_ABI result_type __eval2(true_type) { return __evalf<__k, 0>(); }
148
149 template <uint64_t _Np,
150 uint64_t _Dp,
151 __enable_if_t<(__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)), int> = 0>
152 _LIBCPP_HIDE_FROM_ABI result_type __eval(__uratio<_Np, _Dp>) {
153 return __evalf<__uratio<_Np, _Dp>::num, __uratio<_Np, _Dp>::den>();
154 }
155
156 template <uint64_t _Np,
157 uint64_t _Dp,
158 __enable_if_t<__uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min), int> = 0>
159 _LIBCPP_HIDE_FROM_ABI result_type __eval(__uratio<_Np, _Dp>) {
160 const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (__y_ - _Min) / __uratio<_Np, _Dp>::den);
161 __y_ = __v_[__j];
162 __v_[__j] = __e_();
163 return __y_;
164 }
165
166 template <uint64_t __n, uint64_t __d>156 template <uint64_t __n, uint64_t __d>
167 _LIBCPP_HIDE_FROM_ABI result_type __evalf() {157 _LIBCPP_HIDE_FROM_ABI result_type __evalf() {
168 const double __fp = __d == 0 ? __n / (2. * 0x8000000000000000ull) : __n / (double)__d;158 const double __fp = __d == 0 ? __n / (2. * 0x8000000000000000ull) : __n / (double)__d;
lib/libcxx/include/__random/student_t_distribution.h+7-7
...@@ -43,7 +43,7 @@ public:...@@ -43,7 +43,7 @@ public:
4343
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __n = 1) : __n_(__n) {}44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __n = 1) : __n_(__n) {}
4545
46 _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
4747
48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
49 return __x.__n_ == __y.__n_;49 return __x.__n_ == __y.__n_;
...@@ -68,20 +68,20 @@ public:...@@ -68,20 +68,20 @@ public:
6868
69 // generating functions69 // generating functions
70 template <class _URNG>70 template <class _URNG>
71 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {71 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
72 return (*this)(__g, __p_);72 return (*this)(__g, __p_);
73 }73 }
74 template <class _URNG>74 template <class _URNG>
75 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);75 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7676
77 // property functions77 // property functions
78 _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }78 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
7979
80 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
81 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }81 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8282
83 _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
84 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }84 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
8585
86 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const student_t_distribution& __x, const student_t_distribution& __y) {86 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const student_t_distribution& __x, const student_t_distribution& __y) {
87 return __x.__p_ == __y.__p_;87 return __x.__p_ == __y.__p_;
lib/libcxx/include/__random/subtract_with_carry_engine.h+31-60
...@@ -75,8 +75,8 @@ public:...@@ -75,8 +75,8 @@ public:
75 static inline _LIBCPP_CONSTEXPR const size_t word_size = __w;75 static inline _LIBCPP_CONSTEXPR const size_t word_size = __w;
76 static inline _LIBCPP_CONSTEXPR const size_t short_lag = __s;76 static inline _LIBCPP_CONSTEXPR const size_t short_lag = __s;
77 static inline _LIBCPP_CONSTEXPR const size_t long_lag = __r;77 static inline _LIBCPP_CONSTEXPR const size_t long_lag = __r;
78 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }78 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
79 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
80 static inline _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;80 static inline _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
8181
82 // constructors and seeding functions82 // constructors and seeding functions
...@@ -86,23 +86,46 @@ public:...@@ -86,23 +86,46 @@ public:
86#else86#else
87 _LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(result_type __sd = default_seed) { seed(__sd); }87 _LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(result_type __sd = default_seed) { seed(__sd); }
88#endif88#endif
89 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>89 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, subtract_with_carry_engine>, int> = 0>
90 _LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(_Sseq& __q) {90 _LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(_Sseq& __q) {
91 seed(__q);91 seed(__q);
92 }92 }
93
93 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed) {94 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed) {
94 seed(__sd, integral_constant<unsigned, 1 + (__w - 1) / 32>());95 linear_congruential_engine<result_type, 40014u, 0u, 2147483563u> __e(__sd == 0u ? default_seed : __sd);
96 for (size_t __i = 0; __i < __r; ++__i) {
97 if _LIBCPP_CONSTEXPR ((1 + (__w - 1) / 32) == 1) {
98 __x_[__i] = static_cast<result_type>(__e() & _Max);
99 } else {
100 result_type __e0 = __e();
101 __x_[__i] = static_cast<result_type>((__e0 + ((uint64_t)__e() << 32)) & _Max);
102 }
103 }
104 __c_ = __x_[__r - 1] == 0;
105 __i_ = 0;
95 }106 }
96 template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>107
108 template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, subtract_with_carry_engine>, int> = 0>
97 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {109 _LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
98 __seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());110 const unsigned __k = 1 + (__w - 1) / 32;
111 static_assert(__k <= 2);
112 uint32_t __ar[__r * __k];
113 __q.generate(__ar, __ar + __r * __k);
114 for (size_t __i = 0; __i < __r; ++__i) {
115 if _LIBCPP_CONSTEXPR (__k == 1)
116 __x_[__i] = static_cast<result_type>(__ar[__i] & _Max);
117 else
118 __x_[__i] = static_cast<result_type>((__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max);
119 }
120 __c_ = __x_[__r - 1] == 0;
121 __i_ = 0;
99 }122 }
100123
101 // generating functions124 // generating functions
102 _LIBCPP_HIDE_FROM_ABI result_type operator()();125 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()();
103 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {126 _LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
104 for (; __z; --__z)127 for (; __z; --__z)
105 operator()();128 (void)operator()();
106 }129 }
107130
108 template <class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>131 template <class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
...@@ -120,60 +143,8 @@ public:...@@ -120,60 +143,8 @@ public:
120 template <class _CharT, class _Traits, class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>143 template <class _CharT, class _Traits, class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
121 friend basic_istream<_CharT, _Traits>&144 friend basic_istream<_CharT, _Traits>&
122 operator>>(basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);145 operator>>(basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);
123
124private:
125 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd, integral_constant<unsigned, 1>);
126 _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd, integral_constant<unsigned, 2>);
127 template <class _Sseq>
128 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 1>);
129 template <class _Sseq>
130 _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
131};146};
132147
133template <class _UIntType, size_t __w, size_t __s, size_t __r>
134void subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, integral_constant<unsigned, 1>) {
135 linear_congruential_engine<result_type, 40014u, 0u, 2147483563u> __e(__sd == 0u ? default_seed : __sd);
136 for (size_t __i = 0; __i < __r; ++__i)
137 __x_[__i] = static_cast<result_type>(__e() & _Max);
138 __c_ = __x_[__r - 1] == 0;
139 __i_ = 0;
140}
141
142template <class _UIntType, size_t __w, size_t __s, size_t __r>
143void subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, integral_constant<unsigned, 2>) {
144 linear_congruential_engine<result_type, 40014u, 0u, 2147483563u> __e(__sd == 0u ? default_seed : __sd);
145 for (size_t __i = 0; __i < __r; ++__i) {
146 result_type __e0 = __e();
147 __x_[__i] = static_cast<result_type>((__e0 + ((uint64_t)__e() << 32)) & _Max);
148 }
149 __c_ = __x_[__r - 1] == 0;
150 __i_ = 0;
151}
152
153template <class _UIntType, size_t __w, size_t __s, size_t __r>
154template <class _Sseq>
155void subtract_with_carry_engine<_UIntType, __w, __s, __r>::__seed(_Sseq& __q, integral_constant<unsigned, 1>) {
156 const unsigned __k = 1;
157 uint32_t __ar[__r * __k];
158 __q.generate(__ar, __ar + __r * __k);
159 for (size_t __i = 0; __i < __r; ++__i)
160 __x_[__i] = static_cast<result_type>(__ar[__i] & _Max);
161 __c_ = __x_[__r - 1] == 0;
162 __i_ = 0;
163}
164
165template <class _UIntType, size_t __w, size_t __s, size_t __r>
166template <class _Sseq>
167void subtract_with_carry_engine<_UIntType, __w, __s, __r>::__seed(_Sseq& __q, integral_constant<unsigned, 2>) {
168 const unsigned __k = 2;
169 uint32_t __ar[__r * __k];
170 __q.generate(__ar, __ar + __r * __k);
171 for (size_t __i = 0; __i < __r; ++__i)
172 __x_[__i] = static_cast<result_type>((__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max);
173 __c_ = __x_[__r - 1] == 0;
174 __i_ = 0;
175}
176
177template <class _UIntType, size_t __w, size_t __s, size_t __r>148template <class _UIntType, size_t __w, size_t __s, size_t __r>
178_UIntType subtract_with_carry_engine<_UIntType, __w, __s, __r>::operator()() {149_UIntType subtract_with_carry_engine<_UIntType, __w, __s, __r>::operator()() {
179 const result_type& __xs = __x_[(__i_ + (__r - __s)) % __r];150 const result_type& __xs = __x_[(__i_ + (__r - __s)) % __r];
lib/libcxx/include/__random/uniform_int_distribution.h+9-9
...@@ -151,8 +151,8 @@ public:...@@ -151,8 +151,8 @@ public:
151 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = numeric_limits<result_type>::max())151 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = numeric_limits<result_type>::max())
152 : __a_(__a), __b_(__b) {}152 : __a_(__a), __b_(__b) {}
153153
154 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }154 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
155 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }155 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
156156
157 _LIBCPP_HIDE_FROM_ABI friend bool operator==(const param_type& __x, const param_type& __y) {157 _LIBCPP_HIDE_FROM_ABI friend bool operator==(const param_type& __x, const param_type& __y) {
158 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;158 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
...@@ -179,21 +179,21 @@ public:...@@ -179,21 +179,21 @@ public:
179179
180 // generating functions180 // generating functions
181 template <class _URNG>181 template <class _URNG>
182 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {182 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
183 return (*this)(__g, __p_);183 return (*this)(__g, __p_);
184 }184 }
185 template <class _URNG>185 template <class _URNG>
186 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);186 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
187187
188 // property functions188 // property functions
189 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }189 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
190 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }190 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
191191
192 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }192 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
193 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }193 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
194194
195 _LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }195 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }
196 _LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }196 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }
197197
198 _LIBCPP_HIDE_FROM_ABI friend bool198 _LIBCPP_HIDE_FROM_ABI friend bool
199 operator==(const uniform_int_distribution& __x, const uniform_int_distribution& __y) {199 operator==(const uniform_int_distribution& __x, const uniform_int_distribution& __y) {
lib/libcxx/include/__random/uniform_random_bit_generator.h+4-4
...@@ -23,10 +23,10 @@...@@ -23,10 +23,10 @@
23_LIBCPP_PUSH_MACROS23_LIBCPP_PUSH_MACROS
24#include <__undef_macros>24#include <__undef_macros>
2525
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28#if _LIBCPP_STD_VER >= 2026#if _LIBCPP_STD_VER >= 20
2927
28_LIBCPP_BEGIN_NAMESPACE_STD
29
30// [rand.req.urng]30// [rand.req.urng]
31template <class _Gen>31template <class _Gen>
32concept uniform_random_bit_generator = invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>> && requires {32concept uniform_random_bit_generator = invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>> && requires {
...@@ -35,10 +35,10 @@ concept uniform_random_bit_generator = invocable<_Gen&> && unsigned_integral<inv...@@ -35,10 +35,10 @@ concept uniform_random_bit_generator = invocable<_Gen&> && unsigned_integral<inv
35 requires bool_constant<(_Gen::min() < _Gen::max())>::value;35 requires bool_constant<(_Gen::min() < _Gen::max())>::value;
36};36};
3737
38#endif // _LIBCPP_STD_VER >= 20
39
40_LIBCPP_END_NAMESPACE_STD38_LIBCPP_END_NAMESPACE_STD
4139
40#endif // _LIBCPP_STD_VER >= 20
41
42_LIBCPP_POP_MACROS42_LIBCPP_POP_MACROS
4343
44#endif // _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H44#endif // _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
lib/libcxx/include/__random/uniform_real_distribution.h+9-9
...@@ -42,8 +42,8 @@ public:...@@ -42,8 +42,8 @@ public:
4242
43 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}43 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}
4444
45 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }45 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
46 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
4747
48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {48 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
49 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;49 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
...@@ -69,21 +69,21 @@ public:...@@ -69,21 +69,21 @@ public:
6969
70 // generating functions70 // generating functions
71 template <class _URNG>71 template <class _URNG>
72 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {72 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
73 return (*this)(__g, __p_);73 return (*this)(__g, __p_);
74 }74 }
75 template <class _URNG>75 template <class _URNG>
76 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);76 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
7777
78 // property functions78 // property functions
79 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }79 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
80 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }80 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
8181
82 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
83 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }83 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8484
85 _LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }
86 _LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }86 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }
8787
88 friend _LIBCPP_HIDE_FROM_ABI bool88 friend _LIBCPP_HIDE_FROM_ABI bool
89 operator==(const uniform_real_distribution& __x, const uniform_real_distribution& __y) {89 operator==(const uniform_real_distribution& __x, const uniform_real_distribution& __y) {
lib/libcxx/include/__random/weibull_distribution.h+9-9
...@@ -43,8 +43,8 @@ public:...@@ -43,8 +43,8 @@ public:
4343
44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 1, result_type __b = 1) : __a_(__a), __b_(__b) {}44 _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 1, result_type __b = 1) : __a_(__a), __b_(__b) {}
4545
46 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }46 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
47 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }47 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
4848
49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {49 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
50 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;50 return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
...@@ -70,23 +70,23 @@ public:...@@ -70,23 +70,23 @@ public:
7070
71 // generating functions71 // generating functions
72 template <class _URNG>72 template <class _URNG>
73 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {73 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
74 return (*this)(__g, __p_);74 return (*this)(__g, __p_);
75 }75 }
76 template <class _URNG>76 template <class _URNG>
77 _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {77 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
78 return __p.b() * std::pow(exponential_distribution<result_type>()(__g), 1 / __p.a());78 return __p.b() * std::pow(exponential_distribution<result_type>()(__g), 1 / __p.a());
79 }79 }
8080
81 // property functions81 // property functions
82 _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }82 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
83 _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }83 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
8484
85 _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }85 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
86 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }86 _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
8787
88 _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }88 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
89 _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }89 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
9090
91 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const weibull_distribution& __x, const weibull_distribution& __y) {91 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const weibull_distribution& __x, const weibull_distribution& __y) {
92 return __x.__p_ == __y.__p_;92 return __x.__p_ == __y.__p_;
lib/libcxx/include/__ranges/access.h+4-4
...@@ -27,10 +27,10 @@...@@ -27,10 +27,10 @@
27# pragma GCC system_header27# pragma GCC system_header
28#endif28#endif
2929
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32#if _LIBCPP_STD_VER >= 2030#if _LIBCPP_STD_VER >= 20
3331
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34namespace ranges {34namespace ranges {
35template <class _Tp>35template <class _Tp>
36concept __can_borrow = is_lvalue_reference_v<_Tp> || enable_borrowed_range<remove_cvref_t<_Tp>>;36concept __can_borrow = is_lvalue_reference_v<_Tp> || enable_borrowed_range<remove_cvref_t<_Tp>>;
...@@ -203,8 +203,8 @@ inline constexpr auto cend = __cend::__fn{};...@@ -203,8 +203,8 @@ inline constexpr auto cend = __cend::__fn{};
203} // namespace __cpo203} // namespace __cpo
204} // namespace ranges204} // namespace ranges
205205
206#endif // _LIBCPP_STD_VER >= 20
207
208_LIBCPP_END_NAMESPACE_STD206_LIBCPP_END_NAMESPACE_STD
209207
208#endif // _LIBCPP_STD_VER >= 20
209
210#endif // _LIBCPP___RANGES_ACCESS_H210#endif // _LIBCPP___RANGES_ACCESS_H
lib/libcxx/include/__ranges/adjacent_transform_view.h+20-19
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#include <__concepts/derived_from.h>19#include <__concepts/derived_from.h>
20#include <__concepts/equality_comparable.h>20#include <__concepts/equality_comparable.h>
21#include <__concepts/invocable.h>21#include <__concepts/invocable.h>
22#include <__concepts/referenceable.h>
22#include <__cstddef/size_t.h>23#include <__cstddef/size_t.h>
23#include <__functional/bind_back.h>24#include <__functional/bind_back.h>
24#include <__functional/invoke.h>25#include <__functional/invoke.h>
...@@ -45,7 +46,6 @@...@@ -45,7 +46,6 @@
45#include <__type_traits/decay.h>46#include <__type_traits/decay.h>
46#include <__type_traits/is_nothrow_constructible.h>47#include <__type_traits/is_nothrow_constructible.h>
47#include <__type_traits/is_object.h>48#include <__type_traits/is_object.h>
48#include <__type_traits/is_referenceable.h>
49#include <__type_traits/make_unsigned.h>49#include <__type_traits/make_unsigned.h>
50#include <__type_traits/maybe_const.h>50#include <__type_traits/maybe_const.h>
51#include <__utility/declval.h>51#include <__utility/declval.h>
...@@ -105,22 +105,22 @@ public:...@@ -105,22 +105,22 @@ public:
105 _LIBCPP_HIDE_FROM_ABI constexpr explicit adjacent_transform_view(_View __base, _Fn __fun)105 _LIBCPP_HIDE_FROM_ABI constexpr explicit adjacent_transform_view(_View __base, _Fn __fun)
106 : __inner_(std::move(__base)), __fun_(std::in_place, std::move(__fun)) {}106 : __inner_(std::move(__base)), __fun_(std::in_place, std::move(__fun)) {}
107107
108 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&108 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
109 requires copy_constructible<_View>109 requires copy_constructible<_View>
110 {110 {
111 return __inner_.base();111 return __inner_.base();
112 }112 }
113 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__inner_).base(); }113 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__inner_).base(); }
114114
115 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() { return __iterator<false>(*this, __inner_.begin()); }115 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() { return __iterator<false>(*this, __inner_.begin()); }
116116
117 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const117 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
118 requires range<const _InnerView> && regular_invocable<__apply_n<const _Fn&, _Np>, range_reference_t<const _View>>118 requires range<const _InnerView> && regular_invocable<__apply_n<const _Fn&, _Np>, range_reference_t<const _View>>
119 {119 {
120 return __iterator<true>(*this, __inner_.begin());120 return __iterator<true>(*this, __inner_.begin());
121 }121 }
122122
123 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {123 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
124 if constexpr (common_range<_InnerView>) {124 if constexpr (common_range<_InnerView>) {
125 return __iterator<false>(*this, __inner_.end());125 return __iterator<false>(*this, __inner_.end());
126 } else {126 } else {
...@@ -128,7 +128,7 @@ public:...@@ -128,7 +128,7 @@ public:
128 }128 }
129 }129 }
130130
131 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const131 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
132 requires range<const _InnerView> && regular_invocable<__apply_n<const _Fn&, _Np>, range_reference_t<const _View>>132 requires range<const _InnerView> && regular_invocable<__apply_n<const _Fn&, _Np>, range_reference_t<const _View>>
133 {133 {
134 if constexpr (common_range<const _InnerView>) {134 if constexpr (common_range<const _InnerView>) {
...@@ -138,13 +138,13 @@ public:...@@ -138,13 +138,13 @@ public:
138 }138 }
139 }139 }
140140
141 _LIBCPP_HIDE_FROM_ABI constexpr auto size()141 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
142 requires sized_range<_InnerView>142 requires sized_range<_InnerView>
143 {143 {
144 return __inner_.size();144 return __inner_.size();
145 }145 }
146146
147 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const147 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
148 requires sized_range<const _InnerView>148 requires sized_range<const _InnerView>
149 {149 {
150 return __inner_.size();150 return __inner_.size();
...@@ -202,7 +202,7 @@ public:...@@ -202,7 +202,7 @@ public:
202 requires _Const && convertible_to<__inner_iterator<false>, __inner_iterator<true>>202 requires _Const && convertible_to<__inner_iterator<false>, __inner_iterator<true>>
203 : __parent_(__i.__parent_), __inner_(std::move(__i.__inner_)) {}203 : __parent_(__i.__parent_), __inner_(std::move(__i.__inner_)) {}
204204
205 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const205 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
206 noexcept(__noexcept_dereference(make_index_sequence<_Np>{})) {206 noexcept(__noexcept_dereference(make_index_sequence<_Np>{})) {
207 return std::apply(207 return std::apply(
208 [&](const auto&... __iters) -> decltype(auto) { return std::invoke(*__parent_->__fun_, *__iters...); },208 [&](const auto&... __iters) -> decltype(auto) { return std::invoke(*__parent_->__fun_, *__iters...); },
...@@ -249,7 +249,7 @@ public:...@@ -249,7 +249,7 @@ public:
249 return *this;249 return *this;
250 }250 }
251251
252 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const252 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
253 requires random_access_range<_Base>253 requires random_access_range<_Base>
254 {254 {
255 return std::apply(255 return std::apply(
...@@ -291,25 +291,26 @@ public:...@@ -291,25 +291,26 @@ public:
291 return __x.__inner_ <=> __y.__inner_;291 return __x.__inner_ <=> __y.__inner_;
292 }292 }
293293
294 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)294 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
295 requires random_access_range<_Base>295 requires random_access_range<_Base>
296 {296 {
297 return __iterator(*__i.__parent_, __i.__inner_ + __n);297 return __iterator(*__i.__parent_, __i.__inner_ + __n);
298 }298 }
299299
300 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)300 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
301 requires random_access_range<_Base>301 requires random_access_range<_Base>
302 {302 {
303 return __iterator(*__i.__parent_, __i.__inner_ + __n);303 return __iterator(*__i.__parent_, __i.__inner_ + __n);
304 }304 }
305305
306 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)306 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
307 requires random_access_range<_Base>307 requires random_access_range<_Base>
308 {308 {
309 return __iterator(*__i.__parent_, __i.__inner_ - __n);309 return __iterator(*__i.__parent_, __i.__inner_ - __n);
310 }310 }
311311
312 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)312 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
313 operator-(const __iterator& __x, const __iterator& __y)
313 requires sized_sentinel_for<__inner_iterator<_Const>, __inner_iterator<_Const>>314 requires sized_sentinel_for<__inner_iterator<_Const>, __inner_iterator<_Const>>
314 {315 {
315 return __x.__inner_ - __y.__inner_;316 return __x.__inner_ - __y.__inner_;
...@@ -344,14 +345,14 @@ public:...@@ -344,14 +345,14 @@ public:
344345
345 template <bool _OtherConst>346 template <bool _OtherConst>
346 requires sized_sentinel_for<__inner_sentinel<_Const>, __inner_iterator<_OtherConst>>347 requires sized_sentinel_for<__inner_sentinel<_Const>, __inner_iterator<_OtherConst>>
347 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>348 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>
348 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {349 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
349 return __x.__inner_ - __y.__inner_;350 return __x.__inner_ - __y.__inner_;
350 }351 }
351352
352 template <bool _OtherConst>353 template <bool _OtherConst>
353 requires sized_sentinel_for<__inner_sentinel<_Const>, __inner_iterator<_OtherConst>>354 requires sized_sentinel_for<__inner_sentinel<_Const>, __inner_iterator<_OtherConst>>
354 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>355 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>
355 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {356 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
356 return __x.__inner_ - __y.__inner_;357 return __x.__inner_ - __y.__inner_;
357 }358 }
...@@ -364,14 +365,14 @@ template <size_t _Np>...@@ -364,14 +365,14 @@ template <size_t _Np>
364struct __fn : __range_adaptor_closure<__fn<_Np>> {365struct __fn : __range_adaptor_closure<__fn<_Np>> {
365 template <class _Range, class _Fn>366 template <class _Range, class _Fn>
366 requires(_Np == 0 && forward_range<_Range &&>)367 requires(_Np == 0 && forward_range<_Range &&>)
367 _LIBCPP_HIDE_FROM_ABI static constexpr auto368 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
368 operator()(_Range&&, _Fn&& __fn) noexcept(noexcept(views::zip_transform(std::forward<_Fn>(__fn))))369 operator()(_Range&&, _Fn&& __fn) noexcept(noexcept(views::zip_transform(std::forward<_Fn>(__fn))))
369 -> decltype(views::zip_transform(std::forward<_Fn>(__fn))) {370 -> decltype(views::zip_transform(std::forward<_Fn>(__fn))) {
370 return views::zip_transform(std::forward<_Fn>(__fn));371 return views::zip_transform(std::forward<_Fn>(__fn));
371 }372 }
372373
373 template <class _Range, class _Fn>374 template <class _Range, class _Fn>
374 _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range, _Fn&& __fn) noexcept(375 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range, _Fn&& __fn) noexcept(
375 noexcept(adjacent_transform_view<views::all_t<_Range&&>, decay_t<_Fn>, _Np>(376 noexcept(adjacent_transform_view<views::all_t<_Range&&>, decay_t<_Fn>, _Np>(
376 std::forward<_Range>(__range), std::forward<_Fn>(__fn))))377 std::forward<_Range>(__range), std::forward<_Fn>(__fn))))
377 -> decltype(adjacent_transform_view<views::all_t<_Range&&>, decay_t<_Fn>, _Np>(378 -> decltype(adjacent_transform_view<views::all_t<_Range&&>, decay_t<_Fn>, _Np>(
lib/libcxx/include/__ranges/adjacent_view.h+19-18
...@@ -81,26 +81,26 @@ public:...@@ -81,26 +81,26 @@ public:
8181
82 _LIBCPP_HIDE_FROM_ABI constexpr explicit adjacent_view(_View __base) : __base_(std::move(__base)) {}82 _LIBCPP_HIDE_FROM_ABI constexpr explicit adjacent_view(_View __base) : __base_(std::move(__base)) {}
8383
84 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
85 requires copy_constructible<_View>85 requires copy_constructible<_View>
86 {86 {
87 return __base_;87 return __base_;
88 }88 }
89 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
9089
91 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
91 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
92 requires(!__simple_view<_View>)92 requires(!__simple_view<_View>)
93 {93 {
94 return __iterator<false>(ranges::begin(__base_), ranges::end(__base_));94 return __iterator<false>(ranges::begin(__base_), ranges::end(__base_));
95 }95 }
9696
97 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
98 requires range<const _View> // LWG4482 This is under-constrained.98 requires range<const _View> // LWG4482 This is under-constrained.
99 {99 {
100 return __iterator<true>(ranges::begin(__base_), ranges::end(__base_));100 return __iterator<true>(ranges::begin(__base_), ranges::end(__base_));
101 }101 }
102102
103 _LIBCPP_HIDE_FROM_ABI constexpr auto end()103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
104 requires(!__simple_view<_View>)104 requires(!__simple_view<_View>)
105 {105 {
106 if constexpr (common_range<_View>) {106 if constexpr (common_range<_View>) {
...@@ -110,7 +110,7 @@ public:...@@ -110,7 +110,7 @@ public:
110 }110 }
111 }111 }
112112
113 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const113 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
114 requires range<const _View> // LWG4482 This is under-constrained.114 requires range<const _View> // LWG4482 This is under-constrained.
115 {115 {
116 if constexpr (common_range<const _View>) {116 if constexpr (common_range<const _View>) {
...@@ -120,7 +120,7 @@ public:...@@ -120,7 +120,7 @@ public:
120 }120 }
121 }121 }
122122
123 _LIBCPP_HIDE_FROM_ABI constexpr auto size()123 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
124 requires sized_range<_View>124 requires sized_range<_View>
125 {125 {
126 using _ST = decltype(ranges::size(__base_));126 using _ST = decltype(ranges::size(__base_));
...@@ -130,7 +130,7 @@ public:...@@ -130,7 +130,7 @@ public:
130 return static_cast<_ST>(__sz);130 return static_cast<_ST>(__sz);
131 }131 }
132132
133 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const133 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
134 requires sized_range<const _View>134 requires sized_range<const _View>
135 {135 {
136 using _ST = decltype(ranges::size(__base_));136 using _ST = decltype(ranges::size(__base_));
...@@ -205,7 +205,7 @@ public:...@@ -205,7 +205,7 @@ public:
205 requires _Const && convertible_to<iterator_t<_View>, iterator_t<const _View>>205 requires _Const && convertible_to<iterator_t<_View>, iterator_t<const _View>>
206 : __iterator(std::move(__i), make_index_sequence<_Np>{}) {}206 : __iterator(std::move(__i), make_index_sequence<_Np>{}) {}
207207
208 _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {208 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {
209 return std::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);209 return std::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);
210 }210 }
211211
...@@ -257,7 +257,7 @@ public:...@@ -257,7 +257,7 @@ public:
257 return *this;257 return *this;
258 }258 }
259259
260 _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const260 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const
261 requires random_access_range<_Base>261 requires random_access_range<_Base>
262 {262 {
263 return std::__tuple_transform([&](auto& __i) -> decltype(auto) { return __i[__n]; }, __current_);263 return std::__tuple_transform([&](auto& __i) -> decltype(auto) { return __i[__n]; }, __current_);
...@@ -297,7 +297,7 @@ public:...@@ -297,7 +297,7 @@ public:
297 return __x.__current_.back() <=> __y.__current_.back();297 return __x.__current_.back() <=> __y.__current_.back();
298 }298 }
299299
300 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)300 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
301 requires random_access_range<_Base>301 requires random_access_range<_Base>
302 {302 {
303 auto __r = __i;303 auto __r = __i;
...@@ -305,13 +305,13 @@ public:...@@ -305,13 +305,13 @@ public:
305 return __r;305 return __r;
306 }306 }
307307
308 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)308 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
309 requires random_access_range<_Base>309 requires random_access_range<_Base>
310 {310 {
311 return __i + __n;311 return __i + __n;
312 }312 }
313313
314 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)314 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
315 requires random_access_range<_Base>315 requires random_access_range<_Base>
316 {316 {
317 auto __r = __i;317 auto __r = __i;
...@@ -319,7 +319,8 @@ public:...@@ -319,7 +319,8 @@ public:
319 return __r;319 return __r;
320 }320 }
321321
322 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)322 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
323 operator-(const __iterator& __x, const __iterator& __y)
323 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>324 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
324 {325 {
325 return __x.__current_.back() - __y.__current_.back();326 return __x.__current_.back() - __y.__current_.back();
...@@ -366,14 +367,14 @@ public:...@@ -366,14 +367,14 @@ public:
366367
367 template <bool _OtherConst>368 template <bool _OtherConst>
368 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>369 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
369 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>370 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
370 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {371 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
371 return __x.__current_.back() - __y.__end_;372 return __x.__current_.back() - __y.__end_;
372 }373 }
373374
374 template <bool _OtherConst>375 template <bool _OtherConst>
375 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>376 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
376 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>377 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
377 operator-(const __sentinel& __y, const __iterator<_OtherConst>& __x) {378 operator-(const __sentinel& __y, const __iterator<_OtherConst>& __x) {
378 return __y.__end_ - __x.__current_.back();379 return __y.__end_ - __x.__current_.back();
379 }380 }
...@@ -389,12 +390,12 @@ template <size_t _Np>...@@ -389,12 +390,12 @@ template <size_t _Np>
389struct __fn : __range_adaptor_closure<__fn<_Np>> {390struct __fn : __range_adaptor_closure<__fn<_Np>> {
390 template <class _Range>391 template <class _Range>
391 requires(_Np == 0 && forward_range<_Range &&>)392 requires(_Np == 0 && forward_range<_Range &&>)
392 _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&&) noexcept {393 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&&) noexcept {
393 return empty_view<tuple<>>{};394 return empty_view<tuple<>>{};
394 }395 }
395396
396 template <class _Ranges>397 template <class _Ranges>
397 _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Ranges&& __range) noexcept(398 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Ranges&& __range) noexcept(
398 noexcept(adjacent_view<views::all_t<_Ranges&&>, _Np>(std::forward<_Ranges>(__range))))399 noexcept(adjacent_view<views::all_t<_Ranges&&>, _Np>(std::forward<_Ranges>(__range))))
399 -> decltype(adjacent_view<views::all_t<_Ranges&&>, _Np>(std::forward<_Ranges>(__range))) {400 -> decltype(adjacent_view<views::all_t<_Ranges&&>, _Np>(std::forward<_Ranges>(__range))) {
400 return adjacent_view<views::all_t<_Ranges&&>, _Np>(std::forward<_Ranges>(__range));401 return adjacent_view<views::all_t<_Ranges&&>, _Np>(std::forward<_Ranges>(__range));
lib/libcxx/include/__ranges/all.h+4-4
...@@ -29,10 +29,10 @@...@@ -29,10 +29,10 @@
29# pragma GCC system_header29# pragma GCC system_header
30#endif30#endif
3131
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34#if _LIBCPP_STD_VER >= 2032#if _LIBCPP_STD_VER >= 20
3533
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36namespace ranges::views {36namespace ranges::views {
3737
38namespace __all {38namespace __all {
...@@ -71,8 +71,8 @@ using all_t = decltype(views::all(std::declval<_Range>()));...@@ -71,8 +71,8 @@ using all_t = decltype(views::all(std::declval<_Range>()));
7171
72} // namespace ranges::views72} // namespace ranges::views
7373
74#endif // _LIBCPP_STD_VER >= 20
75
76_LIBCPP_END_NAMESPACE_STD74_LIBCPP_END_NAMESPACE_STD
7775
76#endif // _LIBCPP_STD_VER >= 20
77
78#endif // _LIBCPP___RANGES_ALL_H78#endif // _LIBCPP___RANGES_ALL_H
lib/libcxx/include/__ranges/chunk_by_view.h+1-1
...@@ -54,7 +54,7 @@ namespace ranges {...@@ -54,7 +54,7 @@ namespace ranges {
5454
55template <forward_range _View, indirect_binary_predicate<iterator_t<_View>, iterator_t<_View>> _Pred>55template <forward_range _View, indirect_binary_predicate<iterator_t<_View>, iterator_t<_View>> _Pred>
56 requires view<_View> && is_object_v<_Pred>56 requires view<_View> && is_object_v<_Pred>
57class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS chunk_by_view : public view_interface<chunk_by_view<_View, _Pred>> {57class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG chunk_by_view : public view_interface<chunk_by_view<_View, _Pred>> {
58 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();58 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
59 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;59 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;
6060
lib/libcxx/include/__ranges/concat_view.h created+651
...@@ -0,0 +1,651 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
11#define _LIBCPP___RANGES_CONCAT_VIEW_H
12
13#include <__assert>
14#include <__concepts/common_reference_with.h>
15#include <__concepts/constructible.h>
16#include <__concepts/convertible_to.h>
17#include <__concepts/copyable.h>
18#include <__concepts/derived_from.h>
19#include <__concepts/equality_comparable.h>
20#include <__concepts/swappable.h>
21#include <__config>
22#include <__iterator/concepts.h>
23#include <__iterator/default_sentinel.h>
24#include <__iterator/distance.h>
25#include <__iterator/incrementable_traits.h>
26#include <__iterator/iter_move.h>
27#include <__iterator/iter_swap.h>
28#include <__iterator/iterator_traits.h>
29#include <__iterator/next.h>
30#include <__ranges/access.h>
31#include <__ranges/all.h>
32#include <__ranges/concepts.h>
33#include <__ranges/movable_box.h>
34#include <__ranges/range_adaptor.h>
35#include <__ranges/size.h>
36#include <__ranges/view_interface.h>
37#include <__tuple/tuple_transform.h>
38#include <__type_traits/conditional.h>
39#include <__type_traits/decay.h>
40#include <__type_traits/is_nothrow_constructible.h>
41#include <__type_traits/make_unsigned.h>
42#include <__type_traits/maybe_const.h>
43#include <__utility/forward.h>
44#include <__utility/in_place.h>
45#include <__utility/move.h>
46#include <tuple>
47#include <variant>
48
49#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
50# pragma GCC system_header
51#endif
52
53_LIBCPP_PUSH_MACROS
54#include <__undef_macros>
55
56_LIBCPP_BEGIN_NAMESPACE_STD
57
58#if _LIBCPP_STD_VER >= 26
59
60namespace ranges {
61
62# ifdef __cpp_pack_indexing
63template <class... _Tp>
64using __extract_last _LIBCPP_NODEBUG = _Tp...[sizeof...(_Tp) - 1];
65# else
66template <class _Tp, class... _Tail>
67struct __extract_last_impl : __extract_last_impl<_Tail...> {};
68template <class _Tp>
69struct __extract_last_impl<_Tp> {
70 using type _LIBCPP_NODEBUG = _Tp;
71};
72
73template <class... _Tp>
74using __extract_last _LIBCPP_NODEBUG = __extract_last_impl<_Tp...>::type;
75# endif
76
77template <bool _Const, class... _Tp>
78struct __all_but_first_model_sized_range;
79
80template <bool _Const, class _Head, class... _Tail>
81struct __all_but_first_model_sized_range<_Const, _Head, _Tail...> {
82 static constexpr bool value = (sized_range<__maybe_const<_Const, _Tail>> && ...);
83};
84
85template <bool _Const, class... _Views>
86concept __all_random_access = (random_access_range<__maybe_const<_Const, _Views>> && ...);
87
88template <bool _Const, class... _Views>
89concept __all_bidirectional = (bidirectional_range<__maybe_const<_Const, _Views>> && ...);
90
91template <bool _Const, class... _Views>
92concept __all_forward = (forward_range<__maybe_const<_Const, _Views>> && ...);
93
94template <bool _Const, class _First, class... _Tail>
95struct __all_common_ignore_last {
96 static constexpr bool value =
97 common_range<__maybe_const<_Const, _First>> && __all_common_ignore_last<_Const, _Tail...>::value;
98};
99
100template <bool _Const, class _Tail>
101struct __all_common_ignore_last<_Const, _Tail> {
102 static constexpr bool value = true;
103};
104
105template <bool _Const, class... _Rs>
106concept __concat_is_random_access =
107 (__all_random_access<_Const, _Rs...>) && (__all_common_ignore_last<_Const, _Rs...>::value);
108
109template <bool _Const, class... _Rs>
110concept __concat_is_bidirectional =
111 (__all_bidirectional<_Const, _Rs...>) && (__all_common_ignore_last<_Const, _Rs...>::value);
112
113template <input_range... _Views>
114 requires((view<_Views> && ...) && (sizeof...(_Views) > 0) && __concatable<_Views...>)
115class concat_view : public view_interface<concat_view<_Views...>> {
116 tuple<_Views...> __views_;
117
118 template <bool _Const>
119 class __iterator;
120
121public:
122 _LIBCPP_HIDE_FROM_ABI constexpr concat_view() = default;
123
124 _LIBCPP_HIDE_FROM_ABI constexpr explicit concat_view(_Views... __views) : __views_(std::move(__views)...) {}
125
126 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator<false> begin()
127 requires(!(__simple_view<_Views> && ...))
128 {
129 __iterator<false> __it(this, in_place_index<0>, ranges::begin(std::get<0>(__views_)));
130 __it.template __satisfy<0>();
131 return __it;
132 }
133
134 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator<true> begin() const
135 requires((range<const _Views> && ...) && __concatable<const _Views...>)
136 {
137 __iterator<true> __it(this, in_place_index<0>, ranges::begin(std::get<0>(__views_)));
138 __it.template __satisfy<0>();
139 return __it;
140 }
141
142 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
143 requires(!(__simple_view<_Views> && ...))
144 {
145 if constexpr (__all_forward<false, _Views...> && common_range<__maybe_const<false, __extract_last<_Views...>>>) {
146 constexpr auto __n = sizeof...(_Views);
147 return __iterator<false>(this, in_place_index<__n - 1>, ranges::end(std::get<__n - 1>(__views_)));
148 } else {
149 return default_sentinel;
150 }
151 }
152
153 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
154 requires((range<const _Views> && ...) && __concatable<const _Views...>)
155 {
156 if constexpr (__all_forward<true, _Views...> && common_range<__maybe_const<true, __extract_last<_Views...>>>) {
157 constexpr auto __n = sizeof...(_Views);
158 return __iterator<true>(this, in_place_index<__n - 1>, ranges::end(std::get<__n - 1>(__views_)));
159 } else {
160 return default_sentinel;
161 }
162 }
163
164 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
165 requires(sized_range<_Views> && ...)
166 {
167 return std::apply(
168 [](auto... __sizes) { return (make_unsigned_t<common_type_t<decltype(__sizes)...>>(__sizes) + ...); },
169 std::__tuple_transform(ranges::size, __views_));
170 }
171
172 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
173 requires(sized_range<const _Views> && ...)
174 {
175 return std::apply(
176 [](auto... __sizes) { return (make_unsigned_t<common_type_t<decltype(__sizes)...>>(__sizes) + ...); },
177 std::__tuple_transform(ranges::size, __views_));
178 }
179};
180
181template <class... _Views>
182concat_view(_Views&&...) -> concat_view<views::all_t<_Views>...>;
183
184template <bool _Const, typename... _Views>
185struct __concat_view_iterator_category {};
186
187template <bool _Const, typename... _Views>
188 requires __all_forward<_Const, _Views...>
189struct __concat_view_iterator_category<_Const, _Views...> {
190private:
191 constexpr static bool __derive_pack_random_iterator =
192 (derived_from<typename iterator_traits<iterator_t<__maybe_const<_Const, _Views>>>::iterator_category,
193 random_access_iterator_tag> &&
194 ...);
195 constexpr static bool __derive_pack_bidirectional_iterator =
196 (derived_from<typename iterator_traits<iterator_t<__maybe_const<_Const, _Views>>>::iterator_category,
197 bidirectional_iterator_tag> &&
198 ...);
199 constexpr static bool __derive_pack_forward_iterator =
200 (derived_from<typename iterator_traits< iterator_t<__maybe_const<_Const, _Views>>>::iterator_category,
201 forward_iterator_tag> &&
202 ...);
203
204public:
205 using iterator_category =
206 _If<!is_reference_v<__concat_reference_t<__maybe_const<_Const, _Views>...>>,
207 input_iterator_tag,
208 _If<__derive_pack_random_iterator,
209 random_access_iterator_tag,
210 _If<__derive_pack_bidirectional_iterator,
211 bidirectional_iterator_tag,
212 _If<__derive_pack_forward_iterator, forward_iterator_tag, input_iterator_tag > > > >;
213};
214
215template <input_range... _Views>
216 requires((view<_Views> && ...) && (sizeof...(_Views) > 0) && __concatable<_Views...>)
217template <bool _Const>
218class concat_view<_Views...>::__iterator : public __concat_view_iterator_category<_Const, _Views...> {
219public:
220 using iterator_concept =
221 _If<__concat_is_random_access<_Const, _Views...>,
222 random_access_iterator_tag,
223 _If<__concat_is_bidirectional<_Const, _Views...>,
224 bidirectional_iterator_tag,
225 _If< __all_forward<_Const, _Views...>, forward_iterator_tag, input_iterator_tag > > >;
226 using value_type = __concat_value_t<__maybe_const<_Const, _Views>...>;
227 using difference_type = common_type_t<range_difference_t<__maybe_const<_Const, _Views>>...>;
228
229private:
230 using __base_iter _LIBCPP_NODEBUG = variant<iterator_t<__maybe_const<_Const, _Views>>...>;
231 __base_iter __it_;
232 __maybe_const<_Const, concat_view>* __parent_ = nullptr;
233
234 template <size_t _Idx>
235 _LIBCPP_HIDE_FROM_ABI constexpr void __satisfy() {
236 if constexpr (_Idx < (sizeof...(_Views) - 1)) {
237 if (std::get<_Idx>(__it_) == ranges::end(std::get<_Idx>(__parent_->__views_))) {
238 __it_.template emplace<_Idx + 1>(ranges::begin(std::get<_Idx + 1>(__parent_->__views_)));
239 __satisfy<_Idx + 1>();
240 }
241 }
242 }
243
244 template <size_t _Idx>
245 _LIBCPP_HIDE_FROM_ABI constexpr void __prev() {
246 if constexpr (_Idx == 0) {
247 --std::get<0>(__it_);
248 } else {
249 if (std::get<_Idx>(__it_) == ranges::begin(std::get<_Idx>(__parent_->__views_))) {
250 __it_.template emplace<_Idx - 1>(ranges::end(std::get<_Idx - 1>(__parent_->__views_)));
251 __prev<_Idx - 1>();
252 } else {
253 --std::get<_Idx>(__it_);
254 }
255 }
256 }
257
258 template <size_t _Idx>
259 _LIBCPP_HIDE_FROM_ABI constexpr void __advance_fwd(difference_type __offset, difference_type __steps) {
260 using __underlying_diff_type = iter_difference_t<variant_alternative_t<_Idx, __base_iter>>;
261 if constexpr (_Idx == sizeof...(_Views) - 1) {
262 std::get<_Idx>(__it_) += static_cast<__underlying_diff_type>(__steps);
263 } else {
264 auto __n_size = ranges::distance(std::get<_Idx>(__parent_->__views_));
265 if (__offset + __steps < __n_size) {
266 std::get<_Idx>(__it_) += static_cast<__underlying_diff_type>(__steps);
267 } else {
268 __it_.template emplace<_Idx + 1>(ranges::begin(std::get<_Idx + 1>(__parent_->__views_)));
269 __advance_fwd<_Idx + 1>(0, __offset + __steps - __n_size);
270 }
271 }
272 }
273
274 template <size_t _Idx>
275 _LIBCPP_HIDE_FROM_ABI constexpr void __advance_bwd(difference_type __offset, difference_type __steps) {
276 using __underlying_diff_type = iter_difference_t<variant_alternative_t<_Idx, __base_iter>>;
277 if constexpr (_Idx == 0) {
278 std::get<_Idx>(__it_) -= static_cast<__underlying_diff_type>(__steps);
279 } else {
280 if (__offset >= __steps) {
281 std::get<_Idx>(__it_) -= static_cast<__underlying_diff_type>(__steps);
282 } else {
283 auto __prev_size = ranges::distance(std::get<_Idx - 1>(__parent_->__views_));
284 __it_.template emplace<_Idx - 1>(ranges::end(std::get<_Idx - 1>(__parent_->__views_)));
285 __advance_bwd<_Idx - 1>(__prev_size, __steps - __offset);
286 }
287 }
288 }
289
290 template <typename _Func>
291 _LIBCPP_HIDE_FROM_ABI constexpr auto __invoke_at_index(_Func&& __func) const {
292 // TODO(GCC 16): Just capture `this` when GCC PR113563 and PR121008 are fixed.
293 return [&__func, &__view_iter = *this]<std::size_t _Is>(this auto&& __self) {
294 if (_Is == __view_iter.__it_.index()) {
295 return __func.template operator()<_Is>();
296 }
297 if constexpr (_Is + 1 < sizeof...(_Views)) {
298 return __self.template operator()<_Is + 1>();
299 }
300 __builtin_unreachable();
301 }.template operator()<0>();
302 }
303
304 template <size_t... _Is, typename _Func>
305 _LIBCPP_HIDE_FROM_ABI constexpr void __apply_at_index(size_t __index, _Func&& __func, index_sequence<_Is...>) const {
306 ((__index == _Is ? (static_cast<void>(__func(integral_constant<size_t, _Is>{})), 0) : 0), ...);
307 }
308
309 template <size_t _Idx, typename _Func>
310 _LIBCPP_HIDE_FROM_ABI constexpr void __apply_at_index(size_t __index, _Func&& __func) const {
311 __apply_at_index(__index, std::forward<_Func>(__func), make_index_sequence<_Idx>{});
312 }
313
314 template <class... _Args>
315 _LIBCPP_HIDE_FROM_ABI explicit constexpr __iterator(__maybe_const<_Const, concat_view>* __parent, _Args&&... __args)
316 requires constructible_from<__base_iter, _Args&&...>
317 : __it_(std::forward<_Args>(__args)...), __parent_(__parent) {}
318
319 friend class concat_view;
320 friend class __iterator<!_Const>;
321
322public:
323 _LIBCPP_HIDE_FROM_ABI __iterator() = default;
324
325 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
326 requires _Const && (convertible_to<iterator_t<_Views>, iterator_t<const _Views>> && ...)
327 : __it_([&__src = __i.__it_]<size_t... _Indices>(size_t __idx, index_sequence<_Indices...>) -> __base_iter {
328 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
329 !__src.valueless_by_exception(), "Trying to convert from a valueless iterator of concat_view.");
330 using __src_lref = decltype((__src));
331 using __construction_fptr = __base_iter (*)(__src_lref);
332 static constexpr __construction_fptr __vtable[]{[](__src_lref __src_var) -> __base_iter {
333 return __base_iter(in_place_index<_Indices>, std::__unchecked_get<_Indices>(std::move(__src_var)));
334 }...};
335 return __vtable[__idx](__src);
336 }(__i.__it_.index(), make_index_sequence<variant_size_v<__base_iter>>{})),
337 __parent_(__i.__parent_) {}
338
339 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const {
340 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
341 !__it_.valueless_by_exception(), "Trying to dereference a valueless iterator of concat_view.");
342 return __variant_detail::__visitation::__variant::__visit_value(
343 [](auto&& __it) -> __concat_reference_t<__maybe_const<_Const, _Views>...> { return *__it; }, __it_);
344 }
345
346 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
347 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
348 !__it_.valueless_by_exception(), "Trying to increment a valueless iterator of concat_view.");
349 size_t __active_index = __it_.index();
350 __apply_at_index<variant_size_v<decltype(__it_)>>(__active_index, [&](auto __index_constant) {
351 constexpr size_t __i = __index_constant.value;
352 ++std::__unchecked_get<__i>(__it_);
353 __satisfy<__i>();
354 });
355 return *this;
356 }
357
358 _LIBCPP_HIDE_FROM_ABI constexpr void operator++(int) { ++*this; }
359
360 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int)
361 requires(__all_forward<_Const, _Views...>)
362 {
363 auto __tmp = *this;
364 ++*this;
365 return __tmp;
366 }
367
368 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
369 requires __concat_is_bidirectional<_Const, _Views...>
370 {
371 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
372 !__it_.valueless_by_exception(), "Trying to decrement a valueless iterator of concat_view.");
373 size_t __active_index = __it_.index();
374 __apply_at_index<variant_size_v<decltype(__it_)>>(__active_index, [&](auto __index_constant) {
375 constexpr size_t __i = __index_constant.value;
376 __prev<__i>();
377 });
378 return *this;
379 }
380
381 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
382 requires __concat_is_bidirectional<_Const, _Views...>
383 {
384 auto __tmp = *this;
385 --*this;
386 return __tmp;
387 }
388
389 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
390 requires(equality_comparable<iterator_t<__maybe_const<_Const, _Views>>> && ...)
391 {
392 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
393 "Trying to compare a valueless iterator of concat_view.");
394 return __x.__it_ == __y.__it_;
395 }
396
397 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
398 requires __concat_is_random_access<_Const, _Views...>
399 {
400 return *((*this) + __n);
401 }
402
403 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __it, difference_type __n)
404 requires __concat_is_random_access<_Const, _Views...>
405 {
406 auto __temp = __it;
407 __temp += __n;
408 return __temp;
409 }
410
411 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __it)
412 requires __concat_is_random_access<_Const, _Views...>
413 {
414 return __it + __n;
415 }
416
417 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n)
418 requires __concat_is_random_access<_Const, _Views...>
419 {
420 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
421 !__it_.valueless_by_exception(), "Trying to increment a valueless iterator of concat_view.");
422 size_t __active_index = __it_.index();
423 if (__n > 0) {
424 __apply_at_index<tuple_size_v<decltype(__parent_->__views_)>>(__active_index, [&](auto __index_constant) {
425 constexpr size_t __i = __index_constant.value;
426 auto& __active_view = std::get<__i>(__parent_->__views_);
427 difference_type __idx = std::get<__i>(__it_) - ranges::begin(__active_view);
428 __advance_fwd<__i>(__idx, __n);
429 });
430
431 }
432
433 else if (__n < 0) {
434 __apply_at_index<tuple_size_v<decltype(__parent_->__views_)>>(__active_index, [&](auto __index_constant) {
435 constexpr size_t __i = __index_constant.value;
436 auto& __active_view = std::get<__i>(__parent_->__views_);
437 difference_type __idx = std::get<__i>(__it_) - ranges::begin(__active_view);
438 __advance_bwd<__i>(__idx, -__n);
439 });
440 }
441
442 return *this;
443 }
444
445 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __n)
446 requires __concat_is_random_access<_Const, _Views...>
447 {
448 *this += -__n;
449 return *this;
450 }
451
452 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __it, default_sentinel_t) {
453 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
454 !__it.__it_.valueless_by_exception(),
455 "Trying to compare a valueless iterator of concat_view with the default sentinel.");
456 constexpr auto __last_idx = sizeof...(_Views) - 1;
457 return __it.__it_.index() == __last_idx &&
458 std::__unchecked_get<__last_idx>(__it.__it_) == ranges::end(std::get<__last_idx>(__it.__parent_->__views_));
459 }
460
461 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
462 requires(__all_random_access<_Const, _Views> && ...)
463 {
464 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
465 "Trying to compare a valueless iterator of concat_view.");
466 return __x.__it_ < __y.__it_;
467 }
468
469 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
470 requires(__all_random_access<_Const, _Views> && ...)
471 {
472 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
473 "Trying to compare a valueless iterator of concat_view.");
474 return __x.__it_ > __y.__it_;
475 }
476
477 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
478 requires(__all_random_access<_Const, _Views> && ...)
479 {
480 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
481 "Trying to compare a valueless iterator of concat_view.");
482 return __x.__it_ <= __y.__it_;
483 }
484
485 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
486 requires(__all_random_access<_Const, _Views> && ...)
487 {
488 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
489 "Trying to compare a valueless iterator of concat_view.");
490 return __x.__it_ >= __y.__it_;
491 }
492
493 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
494 requires((__all_random_access<_Const, _Views> && ...) &&
495 (three_way_comparable<iterator_t<__maybe_const<_Const, _Views>>> && ...))
496 {
497 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
498 "Trying to compare a valueless iterator of concat_view.");
499 return __x.__it_ <=> __y.__it_;
500 }
501
502 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto) iter_move(const __iterator& __it) noexcept(
503
504 ((is_nothrow_invocable_v< decltype(ranges::iter_move), const iterator_t<__maybe_const<_Const, _Views>>& > &&
505 is_nothrow_convertible_v< range_rvalue_reference_t<__maybe_const<_Const, _Views>>,
506 __concat_rvalue_reference_t<__maybe_const<_Const, _Views>...> >) &&
507 ...))
508
509 {
510 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
511 !__it.__it_.valueless_by_exception(), "Trying to apply iter_move to a valueless iterator of concat_view.");
512 return __variant_detail::__visitation::__variant::__visit_value(
513 [](const auto& __i) -> __concat_rvalue_reference_t<__maybe_const<_Const, _Views>...> {
514 return ranges::iter_move(__i);
515 },
516 __it.__it_);
517 }
518
519 _LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const __iterator& __x, const __iterator& __y)
520
521 noexcept((noexcept(ranges::swap(*__x, *__y))) &&
522 (noexcept(ranges::iter_swap(std::declval<const iterator_t<__maybe_const<_Const, _Views>>>(),
523 std::declval<const iterator_t<__maybe_const<_Const, _Views>>>())) &&
524 ...))
525
526 requires swappable_with<iter_reference_t<__iterator>, iter_reference_t<__iterator>> &&
527 (... && indirectly_swappable<iterator_t<__maybe_const<_Const, _Views>>>)
528 {
529 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
530 !__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
531 "Trying to swap iterators of concat_view where at least one iterator is valueless.");
532 __variant_detail::__visitation::__variant::__visit_value(
533 [&](const auto& __it1, const auto& __it2) {
534 if constexpr (is_same_v<decltype(__it1), decltype(__it2)>) {
535 ranges::iter_swap(__it1, __it2);
536 } else {
537 ranges::swap(*__x, *__y);
538 }
539 },
540 __x.__it_,
541 __y.__it_);
542 }
543
544 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
545 operator-(const __iterator& __x, const __iterator& __y)
546 requires __concat_is_random_access<_Const, _Views...>
547 {
548 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
549 !__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
550 "Trying to subtract two iterators of concat_view where at least one iterator is valueless.");
551 return __x.__invoke_at_index([&]<std::size_t __index_x>() -> difference_type {
552 return __y.__invoke_at_index([&]<std::size_t __index_y>() -> difference_type {
553 if constexpr (__index_x > __index_y) {
554 auto __dx = ranges::distance(
555 ranges::begin(std::get<__index_x>(__x.__parent_->__views_)), std::get<__index_x>(__x.__it_));
556 auto __dy = ranges::distance(
557 std::get<__index_y>(__y.__it_), ranges::end(std::get<__index_y>(__y.__parent_->__views_)));
558 difference_type __s = [&]<std::size_t __start, std::size_t __end>(this auto&& __self) -> difference_type {
559 if constexpr (__start < __end) {
560 return ranges::size(std::get<__start>(__x.__parent_->__views_)) +
561 __self.template operator()<__start + 1, __end>();
562 }
563 return 0;
564 }.template operator()<__index_y + 1, __index_x>();
565 return __dy + __s + __dx;
566 } else if constexpr (__index_x < __index_y) {
567 return -(__y - __x);
568 } else {
569 return std::get<__index_x>(__x.__it_) - std::get<__index_y>(__y.__it_);
570 }
571 });
572 });
573 }
574
575 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __it, difference_type __n)
576 requires __concat_is_random_access<_Const, _Views...>
577 {
578 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
579 !__it.__it_.valueless_by_exception(), "Trying to subtract a valuess iterators of concat_view.");
580 auto __temp = __it;
581 __temp -= __n;
582 return __temp;
583 }
584
585 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
586 operator-(const __iterator& __x, default_sentinel_t)
587 requires(sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_Const, _Views>>> &&
588 ...) &&
589 (__all_but_first_model_sized_range<_Const, _Views...>::value)
590 {
591 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
592 !__x.__it_.valueless_by_exception(),
593 "Trying to subtract a valuess iterators of concat_view from the default sentinel.");
594 return __x.__invoke_at_index([&]<std::size_t __index_x>() -> difference_type {
595 auto __dx =
596 ranges::distance(std::get<__index_x>(__x.__it_), ranges::end(std::get<__index_x>(__x.__parent_->__views_)));
597 difference_type __s = [&]<std::size_t __start, std::size_t __end>(this auto&& __self) -> difference_type {
598 if constexpr (__start < __end) {
599 return ranges::size(std::get<__start>(__x.__parent_->__views_)) +
600 __self.template operator()<__start + 1, __end>();
601 }
602 return 0;
603 }.template operator()<__index_x + 1, sizeof...(_Views)>();
604 return -(__dx + __s);
605 });
606 }
607
608 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
609 operator-(default_sentinel_t, const __iterator& __x)
610 requires(sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_Const, _Views>>> &&
611 ...) &&
612 (__all_but_first_model_sized_range<_Const, _Views...>::value)
613 {
614 return -(__x - default_sentinel);
615 }
616};
617
618namespace views {
619namespace __concat {
620struct __fn {
621 template <input_range _Range>
622 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
623 operator()(_Range&& __range) noexcept(noexcept(views::all((std::forward<_Range>(__range)))))
624 -> decltype(views::all((std::forward<_Range>(__range)))) {
625 return views::all(std::forward<_Range>(__range));
626 }
627
628 template <class _FirstRange, class... _TailRanges>
629 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
630 operator()(_FirstRange&& __first, _TailRanges&&... __tail) noexcept(
631 noexcept(concat_view(std::forward<_FirstRange>(__first), std::forward<_TailRanges>(__tail)...)))
632 -> decltype(concat_view(std::forward<_FirstRange>(__first), std::forward<_TailRanges>(__tail)...)) {
633 return concat_view(std::forward<_FirstRange>(__first), std::forward<_TailRanges>(__tail)...);
634 }
635};
636} // namespace __concat
637
638inline namespace __cpo {
639inline constexpr auto concat = __concat::__fn{};
640} // namespace __cpo
641} // namespace views
642
643} // namespace ranges
644
645#endif // _LIBCPP_STD_VER >= 26
646
647_LIBCPP_END_NAMESPACE_STD
648
649_LIBCPP_POP_MACROS
650
651#endif // _LIBCPP___RANGES_CONCAT_VIEW_H
lib/libcxx/include/__ranges/concepts.h+4-4
...@@ -39,10 +39,10 @@...@@ -39,10 +39,10 @@
39# pragma GCC system_header39# pragma GCC system_header
40#endif40#endif
4141
42_LIBCPP_BEGIN_NAMESPACE_STD
43
44#if _LIBCPP_STD_VER >= 2042#if _LIBCPP_STD_VER >= 20
4543
44_LIBCPP_BEGIN_NAMESPACE_STD
45
46namespace ranges {46namespace ranges {
4747
48// [range.range]48// [range.range]
...@@ -175,8 +175,8 @@ concept __concatable = requires {...@@ -175,8 +175,8 @@ concept __concatable = requires {
175175
176} // namespace ranges176} // namespace ranges
177177
178#endif // _LIBCPP_STD_VER >= 20
179
180_LIBCPP_END_NAMESPACE_STD178_LIBCPP_END_NAMESPACE_STD
181179
180#endif // _LIBCPP_STD_VER >= 20
181
182#endif // _LIBCPP___RANGES_CONCEPTS_H182#endif // _LIBCPP___RANGES_CONCEPTS_H
lib/libcxx/include/__ranges/container_compatible_range.h+4-4
...@@ -18,16 +18,16 @@...@@ -18,16 +18,16 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2321#if _LIBCPP_STD_VER >= 23
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25template <class _Range, class _Tp>25template <class _Range, class _Tp>
26concept _ContainerCompatibleRange =26concept _ContainerCompatibleRange =
27 ranges::input_range<_Range> && convertible_to<ranges::range_reference_t<_Range>, _Tp>;27 ranges::input_range<_Range> && convertible_to<ranges::range_reference_t<_Range>, _Tp>;
2828
29#endif // _LIBCPP_STD_VER >= 23
30
31_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
3230
31#endif // _LIBCPP_STD_VER >= 23
32
33#endif // _LIBCPP___RANGES_CONTAINER_COMPATIBLE_RANGE_H33#endif // _LIBCPP___RANGES_CONTAINER_COMPATIBLE_RANGE_H
lib/libcxx/include/__ranges/dangling.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26namespace ranges {26namespace ranges {
27struct dangling {27struct dangling {
28 dangling() = default;28 dangling() = default;
...@@ -35,8 +35,8 @@ using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;...@@ -35,8 +35,8 @@ using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;
35// borrowed_subrange_t defined in <__ranges/subrange.h>35// borrowed_subrange_t defined in <__ranges/subrange.h>
36} // namespace ranges36} // namespace ranges
3737
38#endif // _LIBCPP_STD_VER >= 20
39
40_LIBCPP_END_NAMESPACE_STD38_LIBCPP_END_NAMESPACE_STD
4139
40#endif // _LIBCPP_STD_VER >= 20
41
42#endif // _LIBCPP___RANGES_DANGLING_H42#endif // _LIBCPP___RANGES_DANGLING_H
lib/libcxx/include/__ranges/data.h+6-6
...@@ -28,10 +28,10 @@...@@ -28,10 +28,10 @@
28# pragma GCC system_header28# pragma GCC system_header
29#endif29#endif
3030
31_LIBCPP_BEGIN_NAMESPACE_STD
32
33#if _LIBCPP_STD_VER >= 2031#if _LIBCPP_STD_VER >= 20
3432
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35// [range.prim.data]35// [range.prim.data]
3636
37namespace ranges {37namespace ranges {
...@@ -51,12 +51,12 @@ concept __ranges_begin_invocable = !__member_data<_Tp> && __can_borrow<_Tp> && r...@@ -51,12 +51,12 @@ concept __ranges_begin_invocable = !__member_data<_Tp> && __can_borrow<_Tp> && r
5151
52struct __fn {52struct __fn {
53 template <__member_data _Tp>53 template <__member_data _Tp>
54 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(__t.data())) {54 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(__t.data())) {
55 return __t.data();55 return __t.data();
56 }56 }
5757
58 template <__ranges_begin_invocable _Tp>58 template <__ranges_begin_invocable _Tp>
59 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
60 noexcept(noexcept(std::to_address(ranges::begin(__t)))) {60 noexcept(noexcept(std::to_address(ranges::begin(__t)))) {
61 return std::to_address(ranges::begin(__t));61 return std::to_address(ranges::begin(__t));
62 }62 }
...@@ -95,8 +95,8 @@ inline constexpr auto cdata = __cdata::__fn{};...@@ -95,8 +95,8 @@ inline constexpr auto cdata = __cdata::__fn{};
95} // namespace __cpo95} // namespace __cpo
96} // namespace ranges96} // namespace ranges
9797
98#endif // _LIBCPP_STD_VER >= 20
99
100_LIBCPP_END_NAMESPACE_STD98_LIBCPP_END_NAMESPACE_STD
10199
100#endif // _LIBCPP_STD_VER >= 20
101
102#endif // _LIBCPP___RANGES_DATA_H102#endif // _LIBCPP___RANGES_DATA_H
lib/libcxx/include/__ranges/drop_view.h+1-2
...@@ -74,8 +74,7 @@ public:...@@ -74,8 +74,7 @@ public:
74 requires default_initializable<_View>74 requires default_initializable<_View>
75 = default;75 = default;
7676
77 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX2377 _LIBCPP_HIDE_FROM_ABI constexpr explicit drop_view(_View __base, range_difference_t<_View> __count)
78 drop_view(_View __base, range_difference_t<_View> __count)
79 : __count_(__count), __base_(std::move(__base)) {78 : __count_(__count), __base_(std::move(__base)) {
80 _LIBCPP_ASSERT_UNCATEGORIZED(__count_ >= 0, "count must be greater than or equal to zero.");79 _LIBCPP_ASSERT_UNCATEGORIZED(__count_ >= 0, "count must be greater than or equal to zero.");
81 }80 }
lib/libcxx/include/__ranges/drop_while_view.h+2-2
...@@ -48,13 +48,13 @@ namespace ranges {...@@ -48,13 +48,13 @@ namespace ranges {
4848
49template <view _View, class _Pred>49template <view _View, class _Pred>
50 requires input_range<_View> && is_object_v<_Pred> && indirect_unary_predicate<const _Pred, iterator_t<_View>>50 requires input_range<_View> && is_object_v<_Pred> && indirect_unary_predicate<const _Pred, iterator_t<_View>>
51class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS drop_while_view : public view_interface<drop_while_view<_View, _Pred>> {51class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG drop_while_view : public view_interface<drop_while_view<_View, _Pred>> {
52public:52public:
53 _LIBCPP_HIDE_FROM_ABI drop_while_view()53 _LIBCPP_HIDE_FROM_ABI drop_while_view()
54 requires default_initializable<_View> && default_initializable<_Pred>54 requires default_initializable<_View> && default_initializable<_Pred>
55 = default;55 = default;
5656
57 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 drop_while_view(_View __base, _Pred __pred)57 _LIBCPP_HIDE_FROM_ABI constexpr explicit drop_while_view(_View __base, _Pred __pred)
58 : __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}58 : __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}
5959
60 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&60 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
lib/libcxx/include/__ranges/elements_of.h+4-4
...@@ -23,10 +23,10 @@...@@ -23,10 +23,10 @@
23_LIBCPP_PUSH_MACROS23_LIBCPP_PUSH_MACROS
24#include <__undef_macros>24#include <__undef_macros>
2525
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28#if _LIBCPP_STD_VER >= 2326#if _LIBCPP_STD_VER >= 23
2927
28_LIBCPP_BEGIN_NAMESPACE_STD
29
30namespace ranges {30namespace ranges {
3131
32template <range _Range, class _Allocator = allocator<byte>>32template <range _Range, class _Allocator = allocator<byte>>
...@@ -40,10 +40,10 @@ elements_of(_Range&&, _Allocator = _Allocator()) -> elements_of<_Range&&, _Alloc...@@ -40,10 +40,10 @@ elements_of(_Range&&, _Allocator = _Allocator()) -> elements_of<_Range&&, _Alloc
4040
41} // namespace ranges41} // namespace ranges
4242
43#endif // _LIBCPP_STD_VER >= 23
44
45_LIBCPP_END_NAMESPACE_STD43_LIBCPP_END_NAMESPACE_STD
4644
45#endif // _LIBCPP_STD_VER >= 23
46
47_LIBCPP_POP_MACROS47_LIBCPP_POP_MACROS
4848
49#endif // _LIBCPP___RANGES_ELEMENTS_OF_H49#endif // _LIBCPP___RANGES_ELEMENTS_OF_H
lib/libcxx/include/__ranges/elements_view.h+21-20
...@@ -77,57 +77,57 @@ public:...@@ -77,57 +77,57 @@ public:
7777
78 _LIBCPP_HIDE_FROM_ABI constexpr explicit elements_view(_View __base) : __base_(std::move(__base)) {}78 _LIBCPP_HIDE_FROM_ABI constexpr explicit elements_view(_View __base) : __base_(std::move(__base)) {}
7979
80 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&80 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
81 requires copy_constructible<_View>81 requires copy_constructible<_View>
82 {82 {
83 return __base_;83 return __base_;
84 }84 }
8585
86 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }86 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
8787
88 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()88 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
89 requires(!__simple_view<_View>)89 requires(!__simple_view<_View>)
90 {90 {
91 return __iterator</*_Const=*/false>(ranges::begin(__base_));91 return __iterator</*_Const=*/false>(ranges::begin(__base_));
92 }92 }
9393
94 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const94 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
95 requires range<const _View>95 requires range<const _View>
96 {96 {
97 return __iterator</*_Const=*/true>(ranges::begin(__base_));97 return __iterator</*_Const=*/true>(ranges::begin(__base_));
98 }98 }
9999
100 _LIBCPP_HIDE_FROM_ABI constexpr auto end()100 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
101 requires(!__simple_view<_View> && !common_range<_View>)101 requires(!__simple_view<_View> && !common_range<_View>)
102 {102 {
103 return __sentinel</*_Const=*/false>{ranges::end(__base_)};103 return __sentinel</*_Const=*/false>{ranges::end(__base_)};
104 }104 }
105105
106 _LIBCPP_HIDE_FROM_ABI constexpr auto end()106 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
107 requires(!__simple_view<_View> && common_range<_View>)107 requires(!__simple_view<_View> && common_range<_View>)
108 {108 {
109 return __iterator</*_Const=*/false>{ranges::end(__base_)};109 return __iterator</*_Const=*/false>{ranges::end(__base_)};
110 }110 }
111111
112 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const112 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
113 requires range<const _View>113 requires range<const _View>
114 {114 {
115 return __sentinel</*_Const=*/true>{ranges::end(__base_)};115 return __sentinel</*_Const=*/true>{ranges::end(__base_)};
116 }116 }
117117
118 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const118 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
119 requires common_range<const _View>119 requires common_range<const _View>
120 {120 {
121 return __iterator</*_Const=*/true>{ranges::end(__base_)};121 return __iterator</*_Const=*/true>{ranges::end(__base_)};
122 }122 }
123123
124 _LIBCPP_HIDE_FROM_ABI constexpr auto size()124 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
125 requires sized_range<_View>125 requires sized_range<_View>
126 {126 {
127 return ranges::size(__base_);127 return ranges::size(__base_);
128 }128 }
129129
130 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const130 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
131 requires sized_range<const _View>131 requires sized_range<const _View>
132 {132 {
133 return ranges::size(__base_);133 return ranges::size(__base_);
...@@ -211,11 +211,11 @@ public:...@@ -211,11 +211,11 @@ public:
211 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>211 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
212 : __current_(std::move(__i.__current_)) {}212 : __current_(std::move(__i.__current_)) {}
213213
214 _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __current_; }214 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __current_; }
215215
216 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() && { return std::move(__current_); }216 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() && { return std::move(__current_); }
217217
218 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return __get_element(__current_); }218 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return __get_element(__current_); }
219219
220 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {220 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
221 ++__current_;221 ++__current_;
...@@ -261,7 +261,7 @@ public:...@@ -261,7 +261,7 @@ public:
261 return *this;261 return *this;
262 }262 }
263263
264 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const264 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
265 requires random_access_range<_Base>265 requires random_access_range<_Base>
266 {266 {
267 return __get_element(__current_ + __n);267 return __get_element(__current_ + __n);
...@@ -303,25 +303,26 @@ public:...@@ -303,25 +303,26 @@ public:
303 return __x.__current_ <=> __y.__current_;303 return __x.__current_ <=> __y.__current_;
304 }304 }
305305
306 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __x, difference_type __y)306 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __x, difference_type __y)
307 requires random_access_range<_Base>307 requires random_access_range<_Base>
308 {308 {
309 return __iterator{__x} += __y;309 return __iterator{__x} += __y;
310 }310 }
311311
312 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __x, const __iterator& __y)312 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __x, const __iterator& __y)
313 requires random_access_range<_Base>313 requires random_access_range<_Base>
314 {314 {
315 return __y + __x;315 return __y + __x;
316 }316 }
317317
318 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __x, difference_type __y)318 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __x, difference_type __y)
319 requires random_access_range<_Base>319 requires random_access_range<_Base>
320 {320 {
321 return __iterator{__x} -= __y;321 return __iterator{__x} -= __y;
322 }322 }
323323
324 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)324 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
325 operator-(const __iterator& __x, const __iterator& __y)
325 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>326 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
326 {327 {
327 return __x.__current_ - __y.__current_;328 return __x.__current_ - __y.__current_;
...@@ -365,14 +366,14 @@ public:...@@ -365,14 +366,14 @@ public:
365366
366 template <bool _OtherConst>367 template <bool _OtherConst>
367 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>368 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
368 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>369 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
369 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {370 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
370 return __get_current(__x) - __y.__end_;371 return __get_current(__x) - __y.__end_;
371 }372 }
372373
373 template <bool _OtherConst>374 template <bool _OtherConst>
374 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>375 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
375 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>376 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
376 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {377 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
377 return __x.__end_ - __get_current(__y);378 return __x.__end_ - __get_current(__y);
378 }379 }
lib/libcxx/include/__ranges/empty.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2023#if _LIBCPP_STD_VER >= 20
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27// [range.prim.empty]27// [range.prim.empty]
2828
29namespace ranges {29namespace ranges {
...@@ -64,8 +64,8 @@ inline constexpr auto empty = __empty::__fn{};...@@ -64,8 +64,8 @@ inline constexpr auto empty = __empty::__fn{};
64} // namespace __cpo64} // namespace __cpo
65} // namespace ranges65} // namespace ranges
6666
67#endif // _LIBCPP_STD_VER >= 20
68
69_LIBCPP_END_NAMESPACE_STD67_LIBCPP_END_NAMESPACE_STD
7068
69#endif // _LIBCPP_STD_VER >= 20
70
71#endif // _LIBCPP___RANGES_EMPTY_H71#endif // _LIBCPP___RANGES_EMPTY_H
lib/libcxx/include/__ranges/enable_borrowed_range.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2023#if _LIBCPP_STD_VER >= 20
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27namespace ranges {27namespace ranges {
2828
29// [range.range], ranges29// [range.range], ranges
...@@ -33,8 +33,8 @@ inline constexpr bool enable_borrowed_range = false;...@@ -33,8 +33,8 @@ inline constexpr bool enable_borrowed_range = false;
3333
34} // namespace ranges34} // namespace ranges
3535
36#endif // _LIBCPP_STD_VER >= 20
37
38_LIBCPP_END_NAMESPACE_STD36_LIBCPP_END_NAMESPACE_STD
3937
38#endif // _LIBCPP_STD_VER >= 20
39
40#endif // _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H40#endif // _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
lib/libcxx/include/__ranges/enable_view.h+4-4
...@@ -20,10 +20,10 @@...@@ -20,10 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#if _LIBCPP_STD_VER >= 2023#if _LIBCPP_STD_VER >= 20
2624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27namespace ranges {27namespace ranges {
2828
29struct view_base {};29struct view_base {};
...@@ -43,8 +43,8 @@ inline constexpr bool enable_view = derived_from<_Tp, view_base> || requires {...@@ -43,8 +43,8 @@ inline constexpr bool enable_view = derived_from<_Tp, view_base> || requires {
4343
44} // namespace ranges44} // namespace ranges
4545
46#endif // _LIBCPP_STD_VER >= 20
47
48_LIBCPP_END_NAMESPACE_STD46_LIBCPP_END_NAMESPACE_STD
4947
48#endif // _LIBCPP_STD_VER >= 20
49
50#endif // _LIBCPP___RANGES_ENABLE_VIEW_H50#endif // _LIBCPP___RANGES_ENABLE_VIEW_H
lib/libcxx/include/__ranges/enumerate_view.h created+350
...@@ -0,0 +1,350 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___RANGES_ENUMERATE_VIEW_H
11#define _LIBCPP___RANGES_ENUMERATE_VIEW_H
12
13#include <__concepts/constructible.h>
14#include <__concepts/convertible_to.h>
15#include <__config>
16#include <__iterator/concepts.h>
17#include <__iterator/distance.h>
18#include <__iterator/iter_move.h>
19#include <__iterator/iterator_traits.h>
20#include <__ranges/access.h>
21#include <__ranges/all.h>
22#include <__ranges/concepts.h>
23#include <__ranges/enable_borrowed_range.h>
24#include <__ranges/range_adaptor.h>
25#include <__ranges/size.h>
26#include <__ranges/view_interface.h>
27#include <__type_traits/maybe_const.h>
28#include <__utility/forward.h>
29#include <__utility/move.h>
30#include <tuple>
31
32#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
33# pragma GCC system_header
34#endif
35
36_LIBCPP_PUSH_MACROS
37#include <__undef_macros>
38
39_LIBCPP_BEGIN_NAMESPACE_STD
40
41#if _LIBCPP_STD_VER >= 23
42
43namespace ranges {
44
45// [concept.object]
46
47template <class _Rp>
48concept __range_with_movable_references =
49 input_range<_Rp> && std::move_constructible<range_reference_t<_Rp>> &&
50 std::move_constructible<range_rvalue_reference_t<_Rp>>;
51
52// [range.enumerate.view]
53
54template <view _View>
55 requires __range_with_movable_references<_View>
56class enumerate_view : public view_interface<enumerate_view<_View>> {
57 _View __base_ = _View();
58
59 // [range.enumerate.iterator]
60 template <bool _Const>
61 class __iterator;
62
63 // [range.enumerate.sentinel]
64 template <bool _Const>
65 class __sentinel;
66
67public:
68 _LIBCPP_HIDE_FROM_ABI constexpr enumerate_view()
69 requires default_initializable<_View>
70 = default;
71 _LIBCPP_HIDE_FROM_ABI constexpr explicit enumerate_view(_View __base) : __base_(std::move(__base)) {}
72
73 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
74 requires(!__simple_view<_View>)
75 {
76 return __iterator<false>(ranges::begin(__base_), 0);
77 }
78 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
79 requires __range_with_movable_references<const _View>
80 {
81 return __iterator<true>(ranges::begin(__base_), 0);
82 }
83
84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
85 requires(!__simple_view<_View>)
86 {
87 if constexpr (forward_range<_View> && common_range<_View> && sized_range<_View>)
88 return __iterator<false>(ranges::end(__base_), ranges::distance(__base_));
89 else
90 return __sentinel<false>(ranges::end(__base_));
91 }
92 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
93 requires __range_with_movable_references<const _View>
94 {
95 if constexpr (forward_range<_View> && common_range<const _View> && sized_range<const _View>)
96 return __iterator<true>(ranges::end(__base_), ranges::distance(__base_));
97 else
98 return __sentinel<true>(ranges::end(__base_));
99 }
100
101 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
102 requires sized_range<_View>
103 {
104 return ranges::size(__base_);
105 }
106 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
107 requires sized_range<const _View>
108 {
109 return ranges::size(__base_);
110 }
111
112 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
113 requires copy_constructible<_View>
114 {
115 return __base_;
116 }
117 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
118};
119
120template <class _Range>
121enumerate_view(_Range&&) -> enumerate_view<views::all_t<_Range>>;
122
123// [range.enumerate.iterator]
124
125template <view _View>
126 requires __range_with_movable_references<_View>
127template <bool _Const>
128class enumerate_view<_View>::__iterator {
129 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
130
131 static consteval auto __get_iterator_concept() {
132 if constexpr (random_access_range<_Base>) {
133 return random_access_iterator_tag{};
134 } else if constexpr (bidirectional_range<_Base>) {
135 return bidirectional_iterator_tag{};
136 } else if constexpr (forward_range<_Base>) {
137 return forward_iterator_tag{};
138 } else {
139 return input_iterator_tag{};
140 }
141 }
142
143 friend class enumerate_view<_View>;
144
145public:
146 using iterator_category = input_iterator_tag;
147 using iterator_concept = decltype(__get_iterator_concept());
148 using difference_type = range_difference_t<_Base>;
149 using value_type = tuple<difference_type, range_value_t<_Base>>;
150
151private:
152 using __reference_type _LIBCPP_NODEBUG = tuple<difference_type, range_reference_t<_Base>>;
153
154 iterator_t<_Base> __current_ = iterator_t<_Base>();
155 difference_type __pos_ = 0;
156
157 _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(iterator_t<_Base> __current, difference_type __pos)
158 : __current_(std::move(__current)), __pos_(__pos) {}
159
160public:
161 _LIBCPP_HIDE_FROM_ABI __iterator()
162 requires default_initializable<iterator_t<_Base>>
163 = default;
164
165 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
166 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
167 : __current_(std::move(__i.__current_)), __pos_(__i.__pos_) {}
168
169 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __current_; }
170
171 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() && { return std::move(__current_); }
172
173 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr difference_type index() const noexcept { return __pos_; }
174
175 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const { return __reference_type(__pos_, *__current_); }
176
177 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
178 ++__current_;
179 ++__pos_;
180 return *this;
181 }
182
183 _LIBCPP_HIDE_FROM_ABI constexpr void operator++(int) { return ++*this; }
184
185 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int)
186 requires forward_range<_Base>
187 {
188 auto __temp = *this;
189 ++*this;
190 return __temp;
191 }
192
193 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
194 requires bidirectional_range<_Base>
195 {
196 --__current_;
197 --__pos_;
198 return *this;
199 }
200
201 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
202 requires bidirectional_range<_Base>
203 {
204 auto __temp = *this;
205 --*this;
206 return *__temp;
207 }
208
209 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n)
210 requires random_access_range<_Base>
211 {
212 __current_ += __n;
213 __pos_ += __n;
214 return *this;
215 }
216
217 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __n)
218 requires random_access_range<_Base>
219 {
220 __current_ -= __n;
221 __pos_ -= __n;
222 return *this;
223 }
224
225 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const
226 requires random_access_range<_Base>
227 {
228 return __reference_type(__pos_ + __n, __current_[__n]);
229 }
230
231 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) noexcept {
232 return __x.__pos_ == __y.__pos_;
233 }
234
235 _LIBCPP_HIDE_FROM_ABI friend constexpr strong_ordering
236 operator<=>(const __iterator& __x, const __iterator& __y) noexcept {
237 return __x.__pos_ <=> __y.__pos_;
238 }
239
240 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
241 requires random_access_range<_Base>
242 {
243 auto __temp = __i;
244 __temp += __n;
245 return __temp;
246 }
247
248 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
249 requires random_access_range<_Base>
250 {
251 return __i + __n;
252 }
253
254 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
255 requires random_access_range<_Base>
256 {
257 auto __temp = __i;
258 __temp -= __n;
259 return __temp;
260 }
261
262 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
263 operator-(const __iterator& __x, const __iterator& __y) noexcept {
264 return __x.__pos_ - __y.__pos_;
265 }
266
267 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto iter_move(const __iterator& __i) noexcept(
268 noexcept(ranges::iter_move(__i.__current_)) && is_nothrow_move_constructible_v<range_rvalue_reference_t<_Base>>) {
269 return tuple<difference_type, range_rvalue_reference_t<_Base>>(__i.__pos_, ranges::iter_move(__i.__current_));
270 }
271};
272
273// [range.enumerate.sentinel]
274
275template <view _View>
276 requires __range_with_movable_references<_View>
277template <bool _Const>
278class enumerate_view<_View>::__sentinel {
279 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
280
281 sentinel_t<_Base> __end_ = sentinel_t<_Base>();
282
283 _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}
284
285 friend class enumerate_view<_View>;
286
287public:
288 _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
289
290 _LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __other)
291 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
292 : __end_(std::move(__other.__end_)) {}
293
294 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }
295
296 template <bool _OtherConst>
297 requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
298 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
299 return __x.__current_ == __y.__end_;
300 }
301
302 template <bool _OtherConst>
303 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
304 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
305 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
306 return __x.__current_ - __y.__end_;
307 }
308
309 template <bool _OtherConst>
310 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
311 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
312 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
313 return __x.__end_ - __y.__current_;
314 }
315};
316
317template <class _View>
318constexpr bool enable_borrowed_range<enumerate_view<_View>> = enable_borrowed_range<_View>;
319
320namespace views {
321namespace __enumerate {
322
323// [range.enumerate.overview]
324
325struct __fn : __range_adaptor_closure<__fn> {
326 template <class _Range>
327 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
328 operator()(_Range&& __range) noexcept(noexcept(enumerate_view<views::all_t<_Range>>(std::forward<_Range>(__range))))
329 -> decltype(/*--------------------------*/ enumerate_view<views::all_t<_Range>>(std::forward<_Range>(__range))) {
330 return /*---------------------------------*/ enumerate_view<views::all_t<_Range>>(std::forward<_Range>(__range));
331 }
332};
333
334} // namespace __enumerate
335
336inline namespace __cpo {
337
338inline constexpr auto enumerate = __enumerate::__fn{};
339
340} // namespace __cpo
341} // namespace views
342} // namespace ranges
343
344#endif // _LIBCPP_STD_VER >= 23
345
346_LIBCPP_END_NAMESPACE_STD
347
348_LIBCPP_POP_MACROS
349
350#endif // _LIBCPP___RANGES_ENUMERATE_VIEW_H
lib/libcxx/include/__ranges/filter_view.h+2-2
...@@ -54,7 +54,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -54,7 +54,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
54namespace ranges {54namespace ranges {
55template <input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>55template <input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
56 requires view<_View> && is_object_v<_Pred>56 requires view<_View> && is_object_v<_Pred>
57class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS filter_view : public view_interface<filter_view<_View, _Pred>> {57class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG filter_view : public view_interface<filter_view<_View, _Pred>> {
58 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();58 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
59 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;59 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Pred> __pred_;
6060
...@@ -72,7 +72,7 @@ public:...@@ -72,7 +72,7 @@ public:
72 requires default_initializable<_View> && default_initializable<_Pred>72 requires default_initializable<_View> && default_initializable<_Pred>
73 = default;73 = default;
7474
75 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 filter_view(_View __base, _Pred __pred)75 _LIBCPP_HIDE_FROM_ABI constexpr explicit filter_view(_View __base, _Pred __pred)
76 : __base_(std::move(__base)), __pred_(in_place, std::move(__pred)) {}76 : __base_(std::move(__base)), __pred_(in_place, std::move(__pred)) {}
7777
78 template <class _Vp = _View>78 template <class _Vp = _View>
lib/libcxx/include/__ranges/from_range.h+4-4
...@@ -16,18 +16,18 @@...@@ -16,18 +16,18 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2319#if _LIBCPP_STD_VER >= 23
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23struct from_range_t {23struct from_range_t {
24 explicit from_range_t() = default;24 explicit from_range_t() = default;
25};25};
2626
27inline constexpr from_range_t from_range{};27inline constexpr from_range_t from_range{};
2828
29#endif // _LIBCPP_STD_VER >= 23
30
31_LIBCPP_END_NAMESPACE_STD29_LIBCPP_END_NAMESPACE_STD
3230
31#endif // _LIBCPP_STD_VER >= 23
32
33#endif // _LIBCPP___RANGES_FROM_RANGE_H33#endif // _LIBCPP___RANGES_FROM_RANGE_H
lib/libcxx/include/__ranges/iota_view.h+6-6
...@@ -316,8 +316,8 @@ public:...@@ -316,8 +316,8 @@ public:
316316
317 _LIBCPP_HIDE_FROM_ABI constexpr explicit iota_view(_Start __value) : __value_(std::move(__value)) {}317 _LIBCPP_HIDE_FROM_ABI constexpr explicit iota_view(_Start __value) : __value_(std::move(__value)) {}
318318
319 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23319 _LIBCPP_HIDE_FROM_ABI constexpr explicit iota_view(type_identity_t<_Start> __value,
320 iota_view(type_identity_t<_Start> __value, type_identity_t<_BoundSentinel> __bound_sentinel)320 type_identity_t<_BoundSentinel> __bound_sentinel)
321 : __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) {321 : __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) {
322 // Validate the precondition if possible.322 // Validate the precondition if possible.
323 if constexpr (totally_ordered_with<_Start, _BoundSentinel>) {323 if constexpr (totally_ordered_with<_Start, _BoundSentinel>) {
...@@ -326,15 +326,15 @@ public:...@@ -326,15 +326,15 @@ public:
326 }326 }
327 }327 }
328328
329 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __iterator __last)329 _LIBCPP_HIDE_FROM_ABI constexpr explicit iota_view(__iterator __first, __iterator __last)
330 requires same_as<_Start, _BoundSentinel>330 requires same_as<_Start, _BoundSentinel>
331 : iota_view(std::move(__first.__value_), std::move(__last.__value_)) {}331 : iota_view(std::move(__first.__value_), std::move(__last.__value_)) {}
332332
333 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, _BoundSentinel __last)333 _LIBCPP_HIDE_FROM_ABI constexpr explicit iota_view(__iterator __first, _BoundSentinel __last)
334 requires same_as<_BoundSentinel, unreachable_sentinel_t>334 requires same_as<_BoundSentinel, unreachable_sentinel_t>
335 : iota_view(std::move(__first.__value_), std::move(__last)) {}335 : iota_view(std::move(__first.__value_), std::move(__last)) {}
336336
337 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __sentinel __last)337 _LIBCPP_HIDE_FROM_ABI constexpr explicit iota_view(__iterator __first, __sentinel __last)
338 requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)338 requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)
339 : iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}339 : iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}
340340
...@@ -357,7 +357,7 @@ public:...@@ -357,7 +357,7 @@ public:
357357
358 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const358 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
359 requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||359 requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||
360 (integral<_Start> && integral<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>360 (__integer_like<_Start> && __integer_like<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>
361 {361 {
362 if constexpr (__integer_like<_Start> && __integer_like<_BoundSentinel>) {362 if constexpr (__integer_like<_Start> && __integer_like<_BoundSentinel>) {
363 return (__value_ < 0)363 return (__value_ < 0)
lib/libcxx/include/__ranges/istream_view.h+4-4
...@@ -46,12 +46,12 @@ public:...@@ -46,12 +46,12 @@ public:
46 _LIBCPP_HIDE_FROM_ABI constexpr explicit basic_istream_view(basic_istream<_CharT, _Traits>& __stream)46 _LIBCPP_HIDE_FROM_ABI constexpr explicit basic_istream_view(basic_istream<_CharT, _Traits>& __stream)
47 : __stream_(std::addressof(__stream)) {}47 : __stream_(std::addressof(__stream)) {}
4848
49 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {49 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
50 *__stream_ >> __value_;50 *__stream_ >> __value_;
51 return __iterator{*this};51 return __iterator{*this};
52 }52 }
5353
54 _LIBCPP_HIDE_FROM_ABI constexpr default_sentinel_t end() const noexcept { return default_sentinel; }54 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr default_sentinel_t end() const noexcept { return default_sentinel; }
5555
56private:56private:
57 basic_istream<_CharT, _Traits>* __stream_;57 basic_istream<_CharT, _Traits>* __stream_;
...@@ -82,7 +82,7 @@ public:...@@ -82,7 +82,7 @@ public:
8282
83 _LIBCPP_HIDE_FROM_ABI void operator++(int) { ++*this; }83 _LIBCPP_HIDE_FROM_ABI void operator++(int) { ++*this; }
8484
85 _LIBCPP_HIDE_FROM_ABI _Val& operator*() const { return __parent_->__value_; }85 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Val& operator*() const { return __parent_->__value_; }
8686
87 _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __iterator& __x, default_sentinel_t) {87 _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __iterator& __x, default_sentinel_t) {
88 return !*__x.__get_parent_stream();88 return !*__x.__get_parent_stream();
...@@ -113,7 +113,7 @@ struct __fn {...@@ -113,7 +113,7 @@ struct __fn {
113 template <class _Up, class _UnCVRef = remove_cvref_t<_Up>>113 template <class _Up, class _UnCVRef = remove_cvref_t<_Up>>
114 requires derived_from<_UnCVRef, basic_istream<typename _UnCVRef::char_type,114 requires derived_from<_UnCVRef, basic_istream<typename _UnCVRef::char_type,
115 typename _UnCVRef::traits_type>>115 typename _UnCVRef::traits_type>>
116 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Up&& __u) const116 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Up&& __u) const
117 noexcept(noexcept(basic_istream_view<_Tp, typename _UnCVRef::char_type,117 noexcept(noexcept(basic_istream_view<_Tp, typename _UnCVRef::char_type,
118 typename _UnCVRef::traits_type>(std::forward<_Up>(__u))))118 typename _UnCVRef::traits_type>(std::forward<_Up>(__u))))
119 -> decltype( basic_istream_view<_Tp, typename _UnCVRef::char_type,119 -> decltype( basic_istream_view<_Tp, typename _UnCVRef::char_type,
lib/libcxx/include/__ranges/join_view.h+8-8
...@@ -100,15 +100,15 @@ public:...@@ -100,15 +100,15 @@ public:
100100
101 _LIBCPP_HIDE_FROM_ABI constexpr explicit join_view(_View __base) : __base_(std::move(__base)) {}101 _LIBCPP_HIDE_FROM_ABI constexpr explicit join_view(_View __base) : __base_(std::move(__base)) {}
102102
103 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
104 requires copy_constructible<_View>104 requires copy_constructible<_View>
105 {105 {
106 return __base_;106 return __base_;
107 }107 }
108108
109 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }109 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
110110
111 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {111 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
112 if constexpr (forward_range<_View>) {112 if constexpr (forward_range<_View>) {
113 constexpr bool __use_const = __simple_view<_View> && is_reference_v<range_reference_t<_View>>;113 constexpr bool __use_const = __simple_view<_View> && is_reference_v<range_reference_t<_View>>;
114 return __iterator<__use_const>{*this, ranges::begin(__base_)};114 return __iterator<__use_const>{*this, ranges::begin(__base_)};
...@@ -119,14 +119,14 @@ public:...@@ -119,14 +119,14 @@ public:
119 }119 }
120120
121 template <class _V2 = _View>121 template <class _V2 = _View>
122 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const122 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
123 requires forward_range<const _V2> && is_reference_v<range_reference_t<const _V2>> &&123 requires forward_range<const _V2> && is_reference_v<range_reference_t<const _V2>> &&
124 input_range<range_reference_t<const _V2>>124 input_range<range_reference_t<const _V2>>
125 {125 {
126 return __iterator<true>{*this, ranges::begin(__base_)};126 return __iterator<true>{*this, ranges::begin(__base_)};
127 }127 }
128128
129 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {129 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
130 if constexpr (forward_range<_View> && is_reference_v<_InnerRange> && forward_range<_InnerRange> &&130 if constexpr (forward_range<_View> && is_reference_v<_InnerRange> && forward_range<_InnerRange> &&
131 common_range<_View> && common_range<_InnerRange>)131 common_range<_View> && common_range<_InnerRange>)
132 return __iterator<__simple_view<_View>>{*this, ranges::end(__base_)};132 return __iterator<__simple_view<_View>>{*this, ranges::end(__base_)};
...@@ -135,7 +135,7 @@ public:...@@ -135,7 +135,7 @@ public:
135 }135 }
136136
137 template <class _V2 = _View>137 template <class _V2 = _View>
138 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const138 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
139 requires forward_range<const _V2> && is_reference_v<range_reference_t<const _V2>> &&139 requires forward_range<const _V2> && is_reference_v<range_reference_t<const _V2>> &&
140 input_range<range_reference_t<const _V2>>140 input_range<range_reference_t<const _V2>>
141 {141 {
...@@ -276,7 +276,7 @@ public:...@@ -276,7 +276,7 @@ public:
276 requires _Const && convertible_to<iterator_t<_View>, _Outer> && convertible_to<iterator_t<_InnerRange>, _Inner>276 requires _Const && convertible_to<iterator_t<_View>, _Outer> && convertible_to<iterator_t<_InnerRange>, _Inner>
277 : __outer_(std::move(__i.__outer_)), __inner_(std::move(__i.__inner_)), __parent_(__i.__parent_) {}277 : __outer_(std::move(__i.__outer_)), __inner_(std::move(__i.__inner_)), __parent_(__i.__parent_) {}
278278
279 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return **__inner_; }279 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return **__inner_; }
280280
281 _LIBCPP_HIDE_FROM_ABI constexpr _Inner operator->() const281 _LIBCPP_HIDE_FROM_ABI constexpr _Inner operator->() const
282 requires __has_arrow<_Inner> && copyable<_Inner>282 requires __has_arrow<_Inner> && copyable<_Inner>
...@@ -339,7 +339,7 @@ public:...@@ -339,7 +339,7 @@ public:
339 return __x.__outer_ == __y.__outer_ && __x.__inner_ == __y.__inner_;339 return __x.__outer_ == __y.__outer_ && __x.__inner_ == __y.__inner_;
340 }340 }
341341
342 _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)342 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
343 iter_move(const __iterator& __i) noexcept(noexcept(ranges::iter_move(*__i.__inner_))) {343 iter_move(const __iterator& __i) noexcept(noexcept(ranges::iter_move(*__i.__inner_))) {
344 return ranges::iter_move(*__i.__inner_);344 return ranges::iter_move(*__i.__inner_);
345 }345 }
lib/libcxx/include/__ranges/join_with_view.h+2-3
...@@ -372,7 +372,7 @@ public:...@@ -372,7 +372,7 @@ public:
372 return __tmp;372 return __tmp;
373 }373 }
374374
375 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)375 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
376 requires __ref_is_glvalue && forward_range<_Base> && equality_comparable<_InnerIter>376 requires __ref_is_glvalue && forward_range<_Base> && equality_comparable<_InnerIter>
377 {377 {
378 return __x.__outer_it_ == __y.__outer_it_ && __x.__inner_it_ == __y.__inner_it_;378 return __x.__outer_it_ == __y.__outer_it_ && __x.__inner_it_ == __y.__inner_it_;
...@@ -420,8 +420,7 @@ public:...@@ -420,8 +420,7 @@ public:
420420
421 template <bool _OtherConst>421 template <bool _OtherConst>
422 requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>422 requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
423 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr bool423 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
424 operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
425 return __get_outer_of(__x) == __y.__end_;424 return __get_outer_of(__x) == __y.__end_;
426 }425 }
427};426};
lib/libcxx/include/__ranges/lazy_split_view.h+19-15
...@@ -86,23 +86,23 @@ public:...@@ -86,23 +86,23 @@ public:
86 requires default_initializable<_View> && default_initializable<_Pattern>86 requires default_initializable<_View> && default_initializable<_Pattern>
87 = default;87 = default;
8888
89 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 lazy_split_view(_View __base, _Pattern __pattern)89 _LIBCPP_HIDE_FROM_ABI constexpr explicit lazy_split_view(_View __base, _Pattern __pattern)
90 : __base_(std::move(__base)), __pattern_(std::move(__pattern)) {}90 : __base_(std::move(__base)), __pattern_(std::move(__pattern)) {}
9191
92 template <input_range _Range>92 template <input_range _Range>
93 requires constructible_from<_View, views::all_t<_Range>> &&93 requires constructible_from<_View, views::all_t<_Range>> &&
94 constructible_from<_Pattern, single_view<range_value_t<_Range>>>94 constructible_from<_Pattern, single_view<range_value_t<_Range>>>
95 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 lazy_split_view(_Range&& __r, range_value_t<_Range> __e)95 _LIBCPP_HIDE_FROM_ABI constexpr explicit lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
96 : __base_(views::all(std::forward<_Range>(__r))), __pattern_(views::single(std::move(__e))) {}96 : __base_(views::all(std::forward<_Range>(__r))), __pattern_(views::single(std::move(__e))) {}
9797
98 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&98 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
99 requires copy_constructible<_View>99 requires copy_constructible<_View>
100 {100 {
101 return __base_;101 return __base_;
102 }102 }
103 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
104104
105 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {105 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
106 if constexpr (forward_range<_View>) {106 if constexpr (forward_range<_View>) {
107 return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::begin(__base_)};107 return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::begin(__base_)};
108 } else {108 } else {
...@@ -111,19 +111,19 @@ public:...@@ -111,19 +111,19 @@ public:
111 }111 }
112 }112 }
113113
114 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const114 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
115 requires forward_range<_View> && forward_range<const _View>115 requires forward_range<_View> && forward_range<const _View>
116 {116 {
117 return __outer_iterator<true>{*this, ranges::begin(__base_)};117 return __outer_iterator<true>{*this, ranges::begin(__base_)};
118 }118 }
119119
120 _LIBCPP_HIDE_FROM_ABI constexpr auto end()120 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
121 requires forward_range<_View> && common_range<_View>121 requires forward_range<_View> && common_range<_View>
122 {122 {
123 return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::end(__base_)};123 return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::end(__base_)};
124 }124 }
125125
126 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {126 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
127 if constexpr (forward_range<_View> && forward_range<const _View> && common_range<const _View>) {127 if constexpr (forward_range<_View> && forward_range<const _View> && common_range<const _View>) {
128 return __outer_iterator<true>{*this, ranges::end(__base_)};128 return __outer_iterator<true>{*this, ranges::end(__base_)};
129 } else {129 } else {
...@@ -188,8 +188,10 @@ private:...@@ -188,8 +188,10 @@ private:
188 _LIBCPP_HIDE_FROM_ABI value_type() = default;188 _LIBCPP_HIDE_FROM_ABI value_type() = default;
189 _LIBCPP_HIDE_FROM_ABI constexpr explicit value_type(__outer_iterator __i) : __i_(std::move(__i)) {}189 _LIBCPP_HIDE_FROM_ABI constexpr explicit value_type(__outer_iterator __i) : __i_(std::move(__i)) {}
190190
191 _LIBCPP_HIDE_FROM_ABI constexpr __inner_iterator<_Const> begin() const { return __inner_iterator<_Const>{__i_}; }191 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __inner_iterator<_Const> begin() const {
192 _LIBCPP_HIDE_FROM_ABI constexpr default_sentinel_t end() const noexcept { return default_sentinel; }192 return __inner_iterator<_Const>{__i_};
193 }
194 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr default_sentinel_t end() const noexcept { return default_sentinel; }
193 };195 };
194196
195 _LIBCPP_HIDE_FROM_ABI __outer_iterator() = default;197 _LIBCPP_HIDE_FROM_ABI __outer_iterator() = default;
...@@ -206,7 +208,7 @@ private:...@@ -206,7 +208,7 @@ private:
206 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>208 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
207 : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}209 : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
208210
209 _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }211 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
210212
211 _LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator& operator++() {213 _LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator& operator++() {
212 const auto __end = ranges::end(__parent_->__base_);214 const auto __end = ranges::end(__parent_->__base_);
...@@ -342,14 +344,16 @@ private:...@@ -342,14 +344,16 @@ private:
342344
343 _LIBCPP_HIDE_FROM_ABI constexpr explicit __inner_iterator(__outer_iterator<_Const> __i) : __i_(std::move(__i)) {}345 _LIBCPP_HIDE_FROM_ABI constexpr explicit __inner_iterator(__outer_iterator<_Const> __i) : __i_(std::move(__i)) {}
344346
345 _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __i_.__current(); }347 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept {
346 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() &&348 return __i_.__current();
349 }
350 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() &&
347 requires forward_range<_View>351 requires forward_range<_View>
348 {352 {
349 return std::move(__i_.__current());353 return std::move(__i_.__current());
350 }354 }
351355
352 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return *__i_.__current(); }356 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return *__i_.__current(); }
353357
354 _LIBCPP_HIDE_FROM_ABI constexpr __inner_iterator& operator++() {358 _LIBCPP_HIDE_FROM_ABI constexpr __inner_iterator& operator++() {
355 __incremented_ = true;359 __incremented_ = true;
...@@ -385,7 +389,7 @@ private:...@@ -385,7 +389,7 @@ private:
385 return __x.__is_done();389 return __x.__is_done();
386 }390 }
387391
388 _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)392 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
389 iter_move(const __inner_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__outer_current()))) {393 iter_move(const __inner_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__outer_current()))) {
390 return ranges::iter_move(__i.__outer_current());394 return ranges::iter_move(__i.__outer_current());
391 }395 }
lib/libcxx/include/__ranges/owning_view.h+4-4
...@@ -30,10 +30,10 @@...@@ -30,10 +30,10 @@
30_LIBCPP_PUSH_MACROS30_LIBCPP_PUSH_MACROS
31#include <__undef_macros>31#include <__undef_macros>
3232
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35#if _LIBCPP_STD_VER >= 2033#if _LIBCPP_STD_VER >= 20
3634
35_LIBCPP_BEGIN_NAMESPACE_STD
36
37namespace ranges {37namespace ranges {
38template <range _Rp>38template <range _Rp>
39 requires movable<_Rp> && (!__is_std_initializer_list<remove_cvref_t<_Rp>>)39 requires movable<_Rp> && (!__is_std_initializer_list<remove_cvref_t<_Rp>>)
...@@ -107,10 +107,10 @@ inline constexpr bool enable_borrowed_range<owning_view<_Tp>> = enable_borrowed_...@@ -107,10 +107,10 @@ inline constexpr bool enable_borrowed_range<owning_view<_Tp>> = enable_borrowed_
107107
108} // namespace ranges108} // namespace ranges
109109
110#endif // _LIBCPP_STD_VER >= 20
111
112_LIBCPP_END_NAMESPACE_STD110_LIBCPP_END_NAMESPACE_STD
113111
112#endif // _LIBCPP_STD_VER >= 20
113
114_LIBCPP_POP_MACROS114_LIBCPP_POP_MACROS
115115
116#endif // _LIBCPP___RANGES_OWNING_VIEW_H116#endif // _LIBCPP___RANGES_OWNING_VIEW_H
lib/libcxx/include/__ranges/range_adaptor.h+4-4
...@@ -34,10 +34,10 @@...@@ -34,10 +34,10 @@
34_LIBCPP_PUSH_MACROS34_LIBCPP_PUSH_MACROS
35#include <__undef_macros>35#include <__undef_macros>
3636
37_LIBCPP_BEGIN_NAMESPACE_STD
38
39#if _LIBCPP_STD_VER >= 2037#if _LIBCPP_STD_VER >= 20
4038
39_LIBCPP_BEGIN_NAMESPACE_STD
40
41namespace ranges {41namespace ranges {
4242
43// CRTP base that one can derive from in order to be considered a range adaptor closure43// CRTP base that one can derive from in order to be considered a range adaptor closure
...@@ -90,10 +90,10 @@ class _LIBCPP_NO_SPECIALIZATIONS range_adaptor_closure : public __range_adaptor_...@@ -90,10 +90,10 @@ class _LIBCPP_NO_SPECIALIZATIONS range_adaptor_closure : public __range_adaptor_
9090
91} // namespace ranges91} // namespace ranges
9292
93#endif // _LIBCPP_STD_VER >= 20
94
95_LIBCPP_END_NAMESPACE_STD93_LIBCPP_END_NAMESPACE_STD
9694
95#endif // _LIBCPP_STD_VER >= 20
96
97_LIBCPP_POP_MACROS97_LIBCPP_POP_MACROS
9898
99#endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H99#endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H
lib/libcxx/include/__ranges/ref_view.h+4-4
...@@ -32,10 +32,10 @@...@@ -32,10 +32,10 @@
32# pragma GCC system_header32# pragma GCC system_header
33#endif33#endif
3434
35_LIBCPP_BEGIN_NAMESPACE_STD
36
37#if _LIBCPP_STD_VER >= 2035#if _LIBCPP_STD_VER >= 20
3836
37_LIBCPP_BEGIN_NAMESPACE_STD
38
39namespace ranges {39namespace ranges {
40template <range _Range>40template <range _Range>
41 requires is_object_v<_Range>41 requires is_object_v<_Range>
...@@ -82,8 +82,8 @@ template <class _Tp>...@@ -82,8 +82,8 @@ template <class _Tp>
82inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true;82inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true;
83} // namespace ranges83} // namespace ranges
8484
85#endif // _LIBCPP_STD_VER >= 20
86
87_LIBCPP_END_NAMESPACE_STD85_LIBCPP_END_NAMESPACE_STD
8886
87#endif // _LIBCPP_STD_VER >= 20
88
89#endif // _LIBCPP___RANGES_REF_VIEW_H89#endif // _LIBCPP___RANGES_REF_VIEW_H
lib/libcxx/include/__ranges/repeat_view.h+5-5
...@@ -40,10 +40,10 @@...@@ -40,10 +40,10 @@
40_LIBCPP_PUSH_MACROS40_LIBCPP_PUSH_MACROS
41#include <__undef_macros>41#include <__undef_macros>
4242
43_LIBCPP_BEGIN_NAMESPACE_STD
44
45#if _LIBCPP_STD_VER >= 2343#if _LIBCPP_STD_VER >= 23
4644
45_LIBCPP_BEGIN_NAMESPACE_STD
46
47namespace ranges {47namespace ranges {
4848
49template <class _Tp>49template <class _Tp>
...@@ -74,7 +74,7 @@ struct __fn;...@@ -74,7 +74,7 @@ struct __fn;
74template <move_constructible _Tp, semiregular _Bound = unreachable_sentinel_t>74template <move_constructible _Tp, semiregular _Bound = unreachable_sentinel_t>
75 requires(is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> &&75 requires(is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> &&
76 (__integer_like_with_usable_difference_type<_Bound> || same_as<_Bound, unreachable_sentinel_t>))76 (__integer_like_with_usable_difference_type<_Bound> || same_as<_Bound, unreachable_sentinel_t>))
77class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS repeat_view : public view_interface<repeat_view<_Tp, _Bound>> {77class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG repeat_view : public view_interface<repeat_view<_Tp, _Bound>> {
78 friend struct views::__take::__fn;78 friend struct views::__take::__fn;
79 friend struct views::__drop::__fn;79 friend struct views::__drop::__fn;
80 class __iterator;80 class __iterator;
...@@ -265,10 +265,10 @@ inline constexpr bool __is_repeat_specialization<repeat_view<_Tp, _Bound>> = tru...@@ -265,10 +265,10 @@ inline constexpr bool __is_repeat_specialization<repeat_view<_Tp, _Bound>> = tru
265265
266} // namespace ranges266} // namespace ranges
267267
268#endif // _LIBCPP_STD_VER >= 23
269
270_LIBCPP_END_NAMESPACE_STD268_LIBCPP_END_NAMESPACE_STD
271269
270#endif // _LIBCPP_STD_VER >= 23
271
272_LIBCPP_POP_MACROS272_LIBCPP_POP_MACROS
273273
274#endif // _LIBCPP___RANGES_REPEAT_VIEW_H274#endif // _LIBCPP___RANGES_REPEAT_VIEW_H
lib/libcxx/include/__ranges/reverse_view.h+8-8
...@@ -59,13 +59,13 @@ public:...@@ -59,13 +59,13 @@ public:
5959
60 _LIBCPP_HIDE_FROM_ABI constexpr explicit reverse_view(_View __view) : __base_(std::move(__view)) {}60 _LIBCPP_HIDE_FROM_ABI constexpr explicit reverse_view(_View __view) : __base_(std::move(__view)) {}
6161
62 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&62 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
63 requires copy_constructible<_View>63 requires copy_constructible<_View>
64 {64 {
65 return __base_;65 return __base_;
66 }66 }
6767
68 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }68 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
6969
70 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator<iterator_t<_View>> begin() {70 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator<iterator_t<_View>> begin() {
71 if constexpr (_UseCache)71 if constexpr (_UseCache)
...@@ -78,35 +78,35 @@ public:...@@ -78,35 +78,35 @@ public:
78 return __tmp;78 return __tmp;
79 }79 }
8080
81 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator<iterator_t<_View>> begin()81 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator<iterator_t<_View>> begin()
82 requires common_range<_View>82 requires common_range<_View>
83 {83 {
84 return std::make_reverse_iterator(ranges::end(__base_));84 return std::make_reverse_iterator(ranges::end(__base_));
85 }85 }
8686
87 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const87 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
88 requires common_range<const _View>88 requires common_range<const _View>
89 {89 {
90 return std::make_reverse_iterator(ranges::end(__base_));90 return std::make_reverse_iterator(ranges::end(__base_));
91 }91 }
9292
93 _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator<iterator_t<_View>> end() {93 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr reverse_iterator<iterator_t<_View>> end() {
94 return std::make_reverse_iterator(ranges::begin(__base_));94 return std::make_reverse_iterator(ranges::begin(__base_));
95 }95 }
9696
97 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
98 requires common_range<const _View>98 requires common_range<const _View>
99 {99 {
100 return std::make_reverse_iterator(ranges::begin(__base_));100 return std::make_reverse_iterator(ranges::begin(__base_));
101 }101 }
102102
103 _LIBCPP_HIDE_FROM_ABI constexpr auto size()103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
104 requires sized_range<_View>104 requires sized_range<_View>
105 {105 {
106 return ranges::size(__base_);106 return ranges::size(__base_);
107 }107 }
108108
109 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const109 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
110 requires sized_range<const _View>110 requires sized_range<const _View>
111 {111 {
112 return ranges::size(__base_);112 return ranges::size(__base_);
lib/libcxx/include/__ranges/single_view.h+1-1
...@@ -41,7 +41,7 @@ template <move_constructible _Tp>...@@ -41,7 +41,7 @@ template <move_constructible _Tp>
41template <copy_constructible _Tp>41template <copy_constructible _Tp>
42# endif42# endif
43 requires is_object_v<_Tp>43 requires is_object_v<_Tp>
44class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS single_view : public view_interface<single_view<_Tp>> {44class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG single_view : public view_interface<single_view<_Tp>> {
45 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Tp> __value_;45 _LIBCPP_NO_UNIQUE_ADDRESS __movable_box<_Tp> __value_;
4646
47public:47public:
lib/libcxx/include/__ranges/size.h+4-4
...@@ -29,10 +29,10 @@...@@ -29,10 +29,10 @@
29# pragma GCC system_header29# pragma GCC system_header
30#endif30#endif
3131
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34#if _LIBCPP_STD_VER >= 2032#if _LIBCPP_STD_VER >= 20
3533
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36namespace ranges {36namespace ranges {
37template <class>37template <class>
38inline constexpr bool disable_sized_range = false;38inline constexpr bool disable_sized_range = false;
...@@ -131,8 +131,8 @@ inline constexpr auto ssize = __ssize::__fn{};...@@ -131,8 +131,8 @@ inline constexpr auto ssize = __ssize::__fn{};
131} // namespace __cpo131} // namespace __cpo
132} // namespace ranges132} // namespace ranges
133133
134#endif // _LIBCPP_STD_VER >= 20
135
136_LIBCPP_END_NAMESPACE_STD134_LIBCPP_END_NAMESPACE_STD
137135
136#endif // _LIBCPP_STD_VER >= 20
137
138#endif // _LIBCPP___RANGES_SIZE_H138#endif // _LIBCPP___RANGES_SIZE_H
lib/libcxx/include/__ranges/split_view.h+8-9
...@@ -78,32 +78,31 @@ public:...@@ -78,32 +78,31 @@ public:
78 requires default_initializable<_View> && default_initializable<_Pattern>78 requires default_initializable<_View> && default_initializable<_Pattern>
79 = default;79 = default;
8080
81 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 split_view(_View __base, _Pattern __pattern)81 _LIBCPP_HIDE_FROM_ABI constexpr explicit split_view(_View __base, _Pattern __pattern)
82 : __base_(std::move(__base)), __pattern_(std::move((__pattern))) {}82 : __base_(std::move(__base)), __pattern_(std::move((__pattern))) {}
8383
84 template <forward_range _Range>84 template <forward_range _Range>
85 requires constructible_from<_View, views::all_t<_Range>> &&85 requires constructible_from<_View, views::all_t<_Range>> &&
86 constructible_from<_Pattern, single_view<range_value_t<_Range>>>86 constructible_from<_Pattern, single_view<range_value_t<_Range>>>
87 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX2387 _LIBCPP_HIDE_FROM_ABI constexpr explicit split_view(_Range&& __range, range_value_t<_Range> __elem)
88 split_view(_Range&& __range, range_value_t<_Range> __elem)
89 : __base_(views::all(std::forward<_Range>(__range))), __pattern_(views::single(std::move(__elem))) {}88 : __base_(views::all(std::forward<_Range>(__range))), __pattern_(views::single(std::move(__elem))) {}
9089
91 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
92 requires copy_constructible<_View>91 requires copy_constructible<_View>
93 {92 {
94 return __base_;93 return __base_;
95 }94 }
9695
97 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }96 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
9897
99 _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {98 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
100 if (!__cached_begin_.__has_value()) {99 if (!__cached_begin_.__has_value()) {
101 __cached_begin_.__emplace(__find_next(ranges::begin(__base_)));100 __cached_begin_.__emplace(__find_next(ranges::begin(__base_)));
102 }101 }
103 return {*this, ranges::begin(__base_), *__cached_begin_};102 return {*this, ranges::begin(__base_), *__cached_begin_};
104 }103 }
105104
106 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {105 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
107 if constexpr (common_range<_View>) {106 if constexpr (common_range<_View>) {
108 return __iterator{*this, ranges::end(__base_), {}};107 return __iterator{*this, ranges::end(__base_), {}};
109 } else {108 } else {
...@@ -142,9 +141,9 @@ public:...@@ -142,9 +141,9 @@ public:
142 split_view<_View, _Pattern>& __parent, iterator_t<_View> __current, subrange<iterator_t<_View>> __next)141 split_view<_View, _Pattern>& __parent, iterator_t<_View> __current, subrange<iterator_t<_View>> __next)
143 : __parent_(std::addressof(__parent)), __cur_(std::move(__current)), __next_(std::move(__next)) {}142 : __parent_(std::addressof(__parent)), __cur_(std::move(__current)), __next_(std::move(__next)) {}
144143
145 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> base() const { return __cur_; }144 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> base() const { return __cur_; }
146145
147 _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return {__cur_, __next_.begin()}; }146 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return {__cur_, __next_.begin()}; }
148147
149 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {148 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
150 __cur_ = __next_.begin();149 __cur_ = __next_.begin();
lib/libcxx/include/__ranges/stride_view.h created+410
...@@ -0,0 +1,410 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___RANGES_STRIDE_VIEW_H
11#define _LIBCPP___RANGES_STRIDE_VIEW_H
12
13#include <__assert>
14#include <__compare/three_way_comparable.h>
15#include <__concepts/constructible.h>
16#include <__concepts/convertible_to.h>
17#include <__concepts/derived_from.h>
18#include <__concepts/equality_comparable.h>
19#include <__config>
20#include <__functional/bind_back.h>
21#include <__iterator/advance.h>
22#include <__iterator/concepts.h>
23#include <__iterator/default_sentinel.h>
24#include <__iterator/distance.h>
25#include <__iterator/iter_move.h>
26#include <__iterator/iter_swap.h>
27#include <__iterator/iterator_traits.h>
28#include <__ranges/access.h>
29#include <__ranges/all.h>
30#include <__ranges/concepts.h>
31#include <__ranges/enable_borrowed_range.h>
32#include <__ranges/range_adaptor.h>
33#include <__ranges/view_interface.h>
34#include <__type_traits/make_unsigned.h>
35
36#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
37# pragma GCC system_header
38#endif
39
40_LIBCPP_PUSH_MACROS
41#include <__undef_macros>
42
43_LIBCPP_BEGIN_NAMESPACE_STD
44
45#if _LIBCPP_STD_VER >= 23
46
47namespace ranges {
48
49template <class _Value>
50_LIBCPP_HIDE_FROM_ABI constexpr _Value __div_ceil(_Value __left, _Value __right) {
51 _Value __r = __left / __right;
52 if (__left % __right) {
53 ++__r;
54 }
55 return __r;
56}
57
58template <input_range _View>
59 requires view<_View>
60class stride_view : public view_interface<stride_view<_View>> {
61 _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
62 range_difference_t<_View> __stride_ = 0;
63
64 template <bool _Const>
65 class __iterator;
66
67public:
68 _LIBCPP_HIDE_FROM_ABI constexpr explicit stride_view(_View __base, range_difference_t<_View> __stride)
69 : __base_(std::move(__base)), __stride_(__stride) {
70 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__stride > 0, "The value of stride must be greater than 0");
71 }
72
73 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
74 requires copy_constructible<_View>
75 {
76 return __base_;
77 }
78
79 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
80
81 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr range_difference_t<_View> stride() const noexcept { return __stride_; }
82
83 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
84 requires(!__simple_view<_View>)
85 {
86 return __iterator</*_Const=*/false>(this, ranges::begin(__base_), 0);
87 }
88
89 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
90 requires range<const _View>
91 {
92 return __iterator</*_Const=*/true>(this, ranges::begin(__base_), 0);
93 }
94
95 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
96 requires(!__simple_view<_View>)
97 {
98 if constexpr (common_range<_View> && sized_range<_View> && forward_range<_View>) {
99 auto __missing = (__stride_ - ranges::distance(__base_) % __stride_) % __stride_;
100 return __iterator</*_Const=*/false>(this, ranges::end(__base_), __missing);
101 } else if constexpr (common_range<_View> && !bidirectional_range<_View>) {
102 return __iterator</*_Const=*/false>(this, ranges::end(__base_), 0);
103 } else {
104 return default_sentinel;
105 }
106 }
107
108 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
109 requires(range<const _View>)
110 {
111 if constexpr (common_range<const _View> && sized_range<const _View> && forward_range<const _View>) {
112 auto __missing = (__stride_ - ranges::distance(__base_) % __stride_) % __stride_;
113 return __iterator</*_Const=*/true>(this, ranges::end(__base_), __missing);
114 } else if constexpr (common_range<const _View> && !bidirectional_range<const _View>) {
115 return __iterator</*_Const=*/true>(this, ranges::end(__base_), 0);
116 } else {
117 return default_sentinel;
118 }
119 }
120
121 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
122 requires sized_range<_View>
123 {
124 return std::__to_unsigned_like(ranges::__div_ceil(ranges::distance(__base_), __stride_));
125 }
126
127 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
128 requires sized_range<const _View>
129 {
130 return std::__to_unsigned_like(ranges::__div_ceil(ranges::distance(__base_), __stride_));
131 }
132}; // class stride_view
133
134template <class _Range>
135stride_view(_Range&&, range_difference_t<_Range>) -> stride_view<views::all_t<_Range>>;
136
137template <class _View>
138struct __stride_iterator_category {};
139
140template <forward_range _View>
141struct __stride_iterator_category<_View> {
142 using _Cat _LIBCPP_NODEBUG = typename iterator_traits<iterator_t<_View>>::iterator_category;
143 using iterator_category =
144 _If<derived_from<_Cat, random_access_iterator_tag>,
145 /* then */ random_access_iterator_tag,
146 /* else */ _Cat >;
147};
148
149template <input_range _View>
150 requires view<_View>
151template <bool _Const>
152class stride_view<_View>::__iterator : public __stride_iterator_category<__maybe_const<_Const, _View>> {
153 using _Parent _LIBCPP_NODEBUG = __maybe_const<_Const, stride_view<_View>>;
154 using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
155
156 _LIBCPP_NO_UNIQUE_ADDRESS iterator_t<_Base> __current_ = iterator_t<_Base>();
157 _LIBCPP_NO_UNIQUE_ADDRESS ranges::sentinel_t<_Base> __end_ = ranges::sentinel_t<_Base>();
158 range_difference_t<_Base> __stride_ = 0;
159 range_difference_t<_Base> __missing_ = 0;
160
161 friend stride_view;
162
163 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(
164 _Parent* __parent, ranges::iterator_t<_Base> __current, range_difference_t<_Base> __missing)
165 : __current_(std::move(__current)),
166 __end_(ranges::end(__parent->__base_)),
167 __stride_(__parent->__stride_),
168 __missing_(__missing) {}
169
170 static consteval auto __get_stride_view_iterator_concept() {
171 if constexpr (random_access_range<_Base>) {
172 return random_access_iterator_tag{};
173 } else if constexpr (bidirectional_range<_Base>) {
174 return bidirectional_iterator_tag{};
175 } else if constexpr (forward_range<_Base>) {
176 return forward_iterator_tag{};
177 } else {
178 return input_iterator_tag{};
179 }
180 }
181
182public:
183 using difference_type = range_difference_t<_Base>;
184 using value_type = range_value_t<_Base>;
185 using iterator_concept = decltype(__get_stride_view_iterator_concept());
186 // using iterator_category = inherited;
187
188 _LIBCPP_HIDE_FROM_ABI __iterator()
189 requires default_initializable<iterator_t<_Base>>
190 = default;
191
192 _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
193 requires _Const && convertible_to<ranges::iterator_t<_View>, iterator_t<_Base>> &&
194 convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
195 : __current_(std::move(__i.__current_)),
196 __end_(std::move(__i.__end_)),
197 __stride_(__i.__stride_),
198 __missing_(__i.__missing_) {}
199
200 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> const& base() const& noexcept { return __current_; }
201 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() && { return std::move(__current_); }
202
203 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const {
204 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__current_ != __end_, "Cannot dereference an iterator at the end.");
205 return *__current_;
206 }
207
208 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
209 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__current_ != __end_, "Cannot increment an iterator already at the end.");
210 __missing_ = ranges::advance(__current_, __stride_, __end_);
211 return *this;
212 }
213
214 _LIBCPP_HIDE_FROM_ABI constexpr void operator++(int) {
215 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__current_ != __end_, "Cannot increment an iterator already at the end.");
216 ++*this;
217 }
218 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int)
219 requires forward_range<_Base>
220 {
221 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__current_ != __end_, "Cannot increment an iterator already at the end.");
222 auto __tmp = *this;
223 ++*this;
224 return __tmp;
225 }
226
227 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
228 requires bidirectional_range<_Base>
229 {
230 ranges::advance(__current_, __missing_ - __stride_);
231 __missing_ = 0;
232 return *this;
233 }
234 _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
235 requires bidirectional_range<_Base>
236 {
237 auto __tmp = *this;
238 --*this;
239 return __tmp;
240 }
241
242 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n)
243 requires random_access_range<_Base>
244 {
245 if (__n > 0) {
246 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(ranges::distance(__current_, __end_) > __stride_ * (__n - 1),
247 "Advancing the iterator beyond the end is not allowed.");
248 ranges::advance(__current_, __stride_ * (__n - 1));
249 __missing_ = ranges::advance(__current_, __stride_, __end_);
250
251 } else if (__n < 0) {
252 ranges::advance(__current_, __stride_ * __n + __missing_);
253 __missing_ = 0;
254 }
255 return *this;
256 }
257
258 _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __n)
259 requires random_access_range<_Base>
260 {
261 return *this += -__n;
262 }
263
264 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
265 requires random_access_range<_Base>
266 {
267 return *(*this + __n);
268 }
269
270 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(__iterator const& __x, default_sentinel_t) {
271 return __x.__current_ == __x.__end_;
272 }
273
274 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(__iterator const& __x, __iterator const& __y)
275 requires equality_comparable<iterator_t<_Base>>
276 {
277 return __x.__current_ == __y.__current_;
278 }
279
280 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(__iterator const& __x, __iterator const& __y)
281 requires random_access_range<_Base>
282 {
283 return __x.__current_ < __y.__current_;
284 }
285
286 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>(__iterator const& __x, __iterator const& __y)
287 requires random_access_range<_Base>
288 {
289 return __y < __x;
290 }
291
292 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<=(__iterator const& __x, __iterator const& __y)
293 requires random_access_range<_Base>
294 {
295 return !(__y < __x);
296 }
297
298 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>=(__iterator const& __x, __iterator const& __y)
299 requires random_access_range<_Base>
300 {
301 return !(__x < __y);
302 }
303
304 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(__iterator const& __x, __iterator const& __y)
305 requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
306 {
307 return __x.__current_ <=> __y.__current_;
308 }
309
310 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator const& __i, difference_type __s)
311 requires random_access_range<_Base>
312 {
313 auto __r = __i;
314 __r += __s;
315 return __r;
316 }
317 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __s, __iterator const& __i)
318 requires random_access_range<_Base>
319 {
320 auto __r = __i;
321 __r += __s;
322 return __r;
323 }
324
325 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator const& __i, difference_type __s)
326 requires random_access_range<_Base>
327 {
328 auto __r = __i;
329 __r -= __s;
330 return __r;
331 }
332
333 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
334 operator-(__iterator const& __x, __iterator const& __y)
335 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
336 {
337 if constexpr (forward_range<_Base>) {
338 auto __n = __x.__current_ - __y.__current_;
339 return (__n + __x.__missing_ - __y.__missing_) / __x.__stride_;
340 }
341 auto __n = __x.__current_ - __y.__current_;
342 if (__n < 0) {
343 return -ranges::__div_ceil(-__n, __x.__stride_);
344 }
345 return ranges::__div_ceil(__n, __x.__stride_);
346 }
347
348 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
349 operator-(default_sentinel_t, __iterator const& __x)
350 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>>
351 {
352 return ranges::__div_ceil(__x.__end_ - __x.__current_, __x.__stride_);
353 }
354 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
355 operator-(__iterator const& __x, default_sentinel_t __y)
356 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>>
357 {
358 return -(__y - __x);
359 }
360
361 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_rvalue_reference_t<_Base>
362 iter_move(__iterator const& __it) noexcept(noexcept(ranges::iter_move(__it.__current_))) {
363 return ranges::iter_move(__it.__current_);
364 }
365
366 _LIBCPP_HIDE_FROM_ABI friend constexpr void
367 iter_swap(__iterator const& __x,
368 __iterator const& __y) noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
369 requires indirectly_swappable<iterator_t<_Base>>
370 {
371 return ranges::iter_swap(__x.__current_, __y.__current_);
372 }
373}; // class stride_view::__iterator
374
375template <class _Tp>
376inline constexpr bool enable_borrowed_range<stride_view<_Tp>> = enable_borrowed_range<_Tp>;
377
378namespace views {
379namespace __stride_view {
380struct __fn {
381 // clang-format off
382 template <viewable_range _Range>
383 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
384 constexpr auto operator()(_Range&& __range, range_difference_t<_Range> __n) const
385 noexcept(noexcept(stride_view{std::forward<_Range>(__range), __n}))
386 -> decltype( stride_view{std::forward<_Range>(__range), __n})
387 { return stride_view(std::forward<_Range>(__range), __n); }
388 // clang-format on
389
390 template <class _Np>
391 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Np&& __n) const {
392 return __pipeable(std::__bind_back(*this, std::forward<_Np>(__n)));
393 }
394};
395} // namespace __stride_view
396
397inline namespace __cpo {
398inline constexpr auto stride = __stride_view::__fn{};
399} // namespace __cpo
400} // namespace views
401
402} // namespace ranges
403
404#endif // _LIBCPP_STD_VER >= 23
405
406_LIBCPP_END_NAMESPACE_STD
407
408_LIBCPP_POP_MACROS
409
410#endif // _LIBCPP___RANGES_STRIDE_VIEW_H
lib/libcxx/include/__ranges/subrange.h+15-14
...@@ -49,10 +49,10 @@...@@ -49,10 +49,10 @@
49_LIBCPP_PUSH_MACROS49_LIBCPP_PUSH_MACROS
50#include <__undef_macros>50#include <__undef_macros>
5151
52_LIBCPP_BEGIN_NAMESPACE_STD
53
54#if _LIBCPP_STD_VER >= 2052#if _LIBCPP_STD_VER >= 20
5553
54_LIBCPP_BEGIN_NAMESPACE_STD
55
56namespace ranges {56namespace ranges {
57template <class _From, class _To>57template <class _From, class _To>
58concept __uses_nonqualification_pointer_conversion =58concept __uses_nonqualification_pointer_conversion =
...@@ -131,7 +131,7 @@ public:...@@ -131,7 +131,7 @@ public:
131 return _Pair(__begin_, __end_);131 return _Pair(__begin_, __end_);
132 }132 }
133133
134 _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() const134 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() const
135 requires copyable<_Iter>135 requires copyable<_Iter>
136 {136 {
137 return __begin_;137 return __begin_;
...@@ -143,11 +143,11 @@ public:...@@ -143,11 +143,11 @@ public:
143 return std::move(__begin_);143 return std::move(__begin_);
144 }144 }
145145
146 _LIBCPP_HIDE_FROM_ABI constexpr _Sent end() const { return __end_; }146 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Sent end() const { return __end_; }
147147
148 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { return __begin_ == __end_; }148 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { return __begin_ == __end_; }
149149
150 _LIBCPP_HIDE_FROM_ABI constexpr make_unsigned_t<iter_difference_t<_Iter>> size() const150 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr make_unsigned_t<iter_difference_t<_Iter>> size() const
151 requires(_Kind == subrange_kind::sized)151 requires(_Kind == subrange_kind::sized)
152 {152 {
153 if constexpr (_StoreSize)153 if constexpr (_StoreSize)
...@@ -201,11 +201,12 @@ template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>...@@ -201,11 +201,12 @@ template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>
201subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>) -> subrange<_Iter, _Sent, subrange_kind::sized>;201subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>) -> subrange<_Iter, _Sent, subrange_kind::sized>;
202202
203template <borrowed_range _Range>203template <borrowed_range _Range>
204subrange(_Range&&) -> subrange<iterator_t<_Range>,204subrange(_Range&&)
205 sentinel_t<_Range>,205 -> subrange<iterator_t<_Range>,
206 (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>)206 sentinel_t<_Range>,
207 ? subrange_kind::sized207 (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>)
208 : subrange_kind::unsized>;208 ? subrange_kind::sized
209 : subrange_kind::unsized>;
209210
210template <borrowed_range _Range>211template <borrowed_range _Range>
211subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>)212subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>)
...@@ -213,7 +214,7 @@ subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>)...@@ -213,7 +214,7 @@ subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>)
213214
214template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>215template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
215 requires((_Index == 0 && copyable<_Iter>) || _Index == 1)216 requires((_Index == 0 && copyable<_Iter>) || _Index == 1)
216_LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) {217[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) {
217 if constexpr (_Index == 0)218 if constexpr (_Index == 0)
218 return __subrange.begin();219 return __subrange.begin();
219 else220 else
...@@ -222,7 +223,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __...@@ -222,7 +223,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __
222223
223template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>224template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
224 requires(_Index < 2)225 requires(_Index < 2)
225_LIBCPP_HIDE_FROM_ABI constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) {226[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) {
226 if constexpr (_Index == 0)227 if constexpr (_Index == 0)
227 return __subrange.begin();228 return __subrange.begin();
228 else229 else
...@@ -265,10 +266,10 @@ struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> {...@@ -265,10 +266,10 @@ struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> {
265 using type _LIBCPP_NODEBUG = _Sp;266 using type _LIBCPP_NODEBUG = _Sp;
266};267};
267268
268#endif // _LIBCPP_STD_VER >= 20
269
270_LIBCPP_END_NAMESPACE_STD269_LIBCPP_END_NAMESPACE_STD
271270
271#endif // _LIBCPP_STD_VER >= 20
272
272_LIBCPP_POP_MACROS273_LIBCPP_POP_MACROS
273274
274#endif // _LIBCPP___RANGES_SUBRANGE_H275#endif // _LIBCPP___RANGES_SUBRANGE_H
lib/libcxx/include/__ranges/take_view.h+1-2
...@@ -69,8 +69,7 @@ public:...@@ -69,8 +69,7 @@ public:
69 requires default_initializable<_View>69 requires default_initializable<_View>
70 = default;70 = default;
7171
72 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX2372 _LIBCPP_HIDE_FROM_ABI constexpr explicit take_view(_View __base, range_difference_t<_View> __count)
73 take_view(_View __base, range_difference_t<_View> __count)
74 : __base_(std::move(__base)), __count_(__count) {73 : __base_(std::move(__base)), __count_(__count) {
75 _LIBCPP_ASSERT_UNCATEGORIZED(__count >= 0, "count has to be greater than or equal to zero");74 _LIBCPP_ASSERT_UNCATEGORIZED(__count >= 0, "count has to be greater than or equal to zero");
76 }75 }
lib/libcxx/include/__ranges/take_while_view.h+10-10
...@@ -46,7 +46,7 @@ namespace ranges {...@@ -46,7 +46,7 @@ namespace ranges {
4646
47template <view _View, class _Pred>47template <view _View, class _Pred>
48 requires input_range<_View> && is_object_v<_Pred> && indirect_unary_predicate<const _Pred, iterator_t<_View>>48 requires input_range<_View> && is_object_v<_Pred> && indirect_unary_predicate<const _Pred, iterator_t<_View>>
49class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS take_while_view : public view_interface<take_while_view<_View, _Pred>> {49class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG take_while_view : public view_interface<take_while_view<_View, _Pred>> {
50 template <bool>50 template <bool>
51 class __sentinel;51 class __sentinel;
5252
...@@ -58,38 +58,38 @@ public:...@@ -58,38 +58,38 @@ public:
58 requires default_initializable<_View> && default_initializable<_Pred>58 requires default_initializable<_View> && default_initializable<_Pred>
59 = default;59 = default;
6060
61 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 take_while_view(_View __base, _Pred __pred)61 _LIBCPP_HIDE_FROM_ABI constexpr explicit take_while_view(_View __base, _Pred __pred)
62 : __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}62 : __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}
6363
64 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&64 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
65 requires copy_constructible<_View>65 requires copy_constructible<_View>
66 {66 {
67 return __base_;67 return __base_;
68 }68 }
6969
70 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
7171
72 _LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }72 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }
7373
74 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()74 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
75 requires(!__simple_view<_View>)75 requires(!__simple_view<_View>)
76 {76 {
77 return ranges::begin(__base_);77 return ranges::begin(__base_);
78 }78 }
7979
80 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const80 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
81 requires range<const _View> && indirect_unary_predicate<const _Pred, iterator_t<const _View>>81 requires range<const _View> && indirect_unary_predicate<const _Pred, iterator_t<const _View>>
82 {82 {
83 return ranges::begin(__base_);83 return ranges::begin(__base_);
84 }84 }
8585
86 _LIBCPP_HIDE_FROM_ABI constexpr auto end()86 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
87 requires(!__simple_view<_View>)87 requires(!__simple_view<_View>)
88 {88 {
89 return __sentinel</*_Const=*/false>(ranges::end(__base_), std::addressof(*__pred_));89 return __sentinel</*_Const=*/false>(ranges::end(__base_), std::addressof(*__pred_));
90 }90 }
9191
92 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const92 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
93 requires range<const _View> && indirect_unary_predicate<const _Pred, iterator_t<const _View>>93 requires range<const _View> && indirect_unary_predicate<const _Pred, iterator_t<const _View>>
94 {94 {
95 return __sentinel</*_Const=*/true>(ranges::end(__base_), std::addressof(*__pred_));95 return __sentinel</*_Const=*/true>(ranges::end(__base_), std::addressof(*__pred_));
...@@ -120,7 +120,7 @@ public:...@@ -120,7 +120,7 @@ public:
120 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>120 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
121 : __end_(std::move(__s.__end_)), __pred_(__s.__pred_) {}121 : __end_(std::move(__s.__end_)), __pred_(__s.__pred_) {}
122122
123 _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }123 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }
124124
125 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const iterator_t<_Base>& __x, const __sentinel& __y) {125 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const iterator_t<_Base>& __x, const __sentinel& __y) {
126 return __x == __y.__end_ || !std::invoke(*__y.__pred_, *__x);126 return __x == __y.__end_ || !std::invoke(*__y.__pred_, *__x);
lib/libcxx/include/__ranges/transform_view.h+35-24
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include <__concepts/derived_from.h>16#include <__concepts/derived_from.h>
17#include <__concepts/equality_comparable.h>17#include <__concepts/equality_comparable.h>
18#include <__concepts/invocable.h>18#include <__concepts/invocable.h>
19#include <__concepts/referenceable.h>
19#include <__config>20#include <__config>
20#include <__functional/bind_back.h>21#include <__functional/bind_back.h>
21#include <__functional/invoke.h>22#include <__functional/invoke.h>
...@@ -37,7 +38,6 @@...@@ -37,7 +38,6 @@
37#include <__type_traits/is_nothrow_constructible.h>38#include <__type_traits/is_nothrow_constructible.h>
38#include <__type_traits/is_object.h>39#include <__type_traits/is_object.h>
39#include <__type_traits/is_reference.h>40#include <__type_traits/is_reference.h>
40#include <__type_traits/is_referenceable.h>
41#include <__type_traits/maybe_const.h>41#include <__type_traits/maybe_const.h>
42#include <__type_traits/remove_cvref.h>42#include <__type_traits/remove_cvref.h>
43#include <__utility/forward.h>43#include <__utility/forward.h>
...@@ -71,7 +71,7 @@ template <input_range _View, move_constructible _Fn>...@@ -71,7 +71,7 @@ template <input_range _View, move_constructible _Fn>
71template <input_range _View, copy_constructible _Fn>71template <input_range _View, copy_constructible _Fn>
72# endif72# endif
73 requires __transform_view_constraints<_View, _Fn>73 requires __transform_view_constraints<_View, _Fn>
74class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS transform_view : public view_interface<transform_view<_View, _Fn>> {74class _LIBCPP_LLVM18_NO_UNIQUE_ADDRESS_ABI_TAG transform_view : public view_interface<transform_view<_View, _Fn>> {
75 template <bool>75 template <bool>
76 class __iterator;76 class __iterator;
77 template <bool>77 template <bool>
...@@ -85,46 +85,56 @@ public:...@@ -85,46 +85,56 @@ public:
85 requires default_initializable<_View> && default_initializable<_Fn>85 requires default_initializable<_View> && default_initializable<_Fn>
86 = default;86 = default;
8787
88 _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 transform_view(_View __base, _Fn __func)88 _LIBCPP_HIDE_FROM_ABI constexpr explicit transform_view(_View __base, _Fn __func)
89 : __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {}89 : __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {}
9090
91 _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&91 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
92 requires copy_constructible<_View>92 requires copy_constructible<_View>
93 {93 {
94 return __base_;94 return __base_;
95 }95 }
96 _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
9796
98 _LIBCPP_HIDE_FROM_ABI constexpr __iterator<false> begin() { return __iterator<false>{*this, ranges::begin(__base_)}; }97 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
99 _LIBCPP_HIDE_FROM_ABI constexpr __iterator<true> begin() const98
99 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator<false> begin() {
100 return __iterator<false>{*this, ranges::begin(__base_)};
101 }
102
103 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator<true> begin() const
100 requires range<const _View> && __regular_invocable_with_range_ref<const _Fn&, const _View>104 requires range<const _View> && __regular_invocable_with_range_ref<const _Fn&, const _View>
101 {105 {
102 return __iterator<true>(*this, ranges::begin(__base_));106 return __iterator<true>(*this, ranges::begin(__base_));
103 }107 }
104108
105 _LIBCPP_HIDE_FROM_ABI constexpr __sentinel<false> end() { return __sentinel<false>(ranges::end(__base_)); }109 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __sentinel<false> end() {
106 _LIBCPP_HIDE_FROM_ABI constexpr __iterator<false> end()110 return __sentinel<false>(ranges::end(__base_));
111 }
112
113 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator<false> end()
107 requires common_range<_View>114 requires common_range<_View>
108 {115 {
109 return __iterator<false>(*this, ranges::end(__base_));116 return __iterator<false>(*this, ranges::end(__base_));
110 }117 }
111 _LIBCPP_HIDE_FROM_ABI constexpr __sentinel<true> end() const118
119 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __sentinel<true> end() const
112 requires range<const _View> && __regular_invocable_with_range_ref<const _Fn&, const _View>120 requires range<const _View> && __regular_invocable_with_range_ref<const _Fn&, const _View>
113 {121 {
114 return __sentinel<true>(ranges::end(__base_));122 return __sentinel<true>(ranges::end(__base_));
115 }123 }
116 _LIBCPP_HIDE_FROM_ABI constexpr __iterator<true> end() const124
125 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __iterator<true> end() const
117 requires common_range<const _View> && __regular_invocable_with_range_ref<const _Fn&, const _View>126 requires common_range<const _View> && __regular_invocable_with_range_ref<const _Fn&, const _View>
118 {127 {
119 return __iterator<true>(*this, ranges::end(__base_));128 return __iterator<true>(*this, ranges::end(__base_));
120 }129 }
121130
122 _LIBCPP_HIDE_FROM_ABI constexpr auto size()131 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
123 requires sized_range<_View>132 requires sized_range<_View>
124 {133 {
125 return ranges::size(__base_);134 return ranges::size(__base_);
126 }135 }
127 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const136
137 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
128 requires sized_range<const _View>138 requires sized_range<const _View>
129 {139 {
130 return ranges::size(__base_);140 return ranges::size(__base_);
...@@ -209,11 +219,11 @@ public:...@@ -209,11 +219,11 @@ public:
209 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>219 requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
210 : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}220 : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
211221
212 _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __current_; }222 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __current_; }
213223
214 _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() && { return std::move(__current_); }224 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() && { return std::move(__current_); }
215225
216 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const226 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
217 noexcept(noexcept(std::invoke(*__parent_->__func_, *__current_))) {227 noexcept(noexcept(std::invoke(*__parent_->__func_, *__current_))) {
218 return std::invoke(*__parent_->__func_, *__current_);228 return std::invoke(*__parent_->__func_, *__current_);
219 }229 }
...@@ -262,7 +272,7 @@ public:...@@ -262,7 +272,7 @@ public:
262 return *this;272 return *this;
263 }273 }
264274
265 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const275 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
266 noexcept(noexcept(std::invoke(*__parent_->__func_, __current_[__n])))276 noexcept(noexcept(std::invoke(*__parent_->__func_, __current_[__n])))
267 requires random_access_range<_Base>277 requires random_access_range<_Base>
268 {278 {
...@@ -305,25 +315,26 @@ public:...@@ -305,25 +315,26 @@ public:
305 return __x.__current_ <=> __y.__current_;315 return __x.__current_ <=> __y.__current_;
306 }316 }
307317
308 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n)318 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __i, difference_type __n)
309 requires random_access_range<_Base>319 requires random_access_range<_Base>
310 {320 {
311 return __iterator{*__i.__parent_, __i.__current_ + __n};321 return __iterator{*__i.__parent_, __i.__current_ + __n};
312 }322 }
313323
314 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i)324 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __i)
315 requires random_access_range<_Base>325 requires random_access_range<_Base>
316 {326 {
317 return __iterator{*__i.__parent_, __i.__current_ + __n};327 return __iterator{*__i.__parent_, __i.__current_ + __n};
318 }328 }
319329
320 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n)330 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __i, difference_type __n)
321 requires random_access_range<_Base>331 requires random_access_range<_Base>
322 {332 {
323 return __iterator{*__i.__parent_, __i.__current_ - __n};333 return __iterator{*__i.__parent_, __i.__current_ - __n};
324 }334 }
325335
326 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)336 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
337 operator-(const __iterator& __x, const __iterator& __y)
327 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>338 requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
328 {339 {
329 return __x.__current_ - __y.__current_;340 return __x.__current_ - __y.__current_;
...@@ -361,7 +372,7 @@ public:...@@ -361,7 +372,7 @@ public:
361 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>372 requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
362 : __end_(std::move(__i.__end_)) {}373 : __end_(std::move(__i.__end_)) {}
363374
364 _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }375 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }
365376
366 template <bool _OtherConst>377 template <bool _OtherConst>
367 requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>378 requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
...@@ -371,14 +382,14 @@ public:...@@ -371,14 +382,14 @@ public:
371382
372 template <bool _OtherConst>383 template <bool _OtherConst>
373 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>384 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
374 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>385 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
375 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {386 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
376 return __x.__current_ - __y.__end_;387 return __x.__current_ - __y.__end_;
377 }388 }
378389
379 template <bool _OtherConst>390 template <bool _OtherConst>
380 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>391 requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
381 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>392 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
382 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {393 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
383 return __x.__end_ - __y.__current_;394 return __x.__end_ - __y.__current_;
384 }395 }
lib/libcxx/include/__ranges/view_interface.h+4-4
...@@ -30,10 +30,10 @@...@@ -30,10 +30,10 @@
30# pragma GCC system_header30# pragma GCC system_header
31#endif31#endif
3232
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35#if _LIBCPP_STD_VER >= 2033#if _LIBCPP_STD_VER >= 20
3634
35_LIBCPP_BEGIN_NAMESPACE_STD
36
37namespace ranges {37namespace ranges {
3838
39template <class _Derived>39template <class _Derived>
...@@ -163,8 +163,8 @@ public:...@@ -163,8 +163,8 @@ public:
163163
164} // namespace ranges164} // namespace ranges
165165
166#endif // _LIBCPP_STD_VER >= 20
167
168_LIBCPP_END_NAMESPACE_STD166_LIBCPP_END_NAMESPACE_STD
169167
168#endif // _LIBCPP_STD_VER >= 20
169
170#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H170#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H
lib/libcxx/include/__ranges/views.h+2-1
...@@ -22,7 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,7 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
23namespace ranges {23namespace ranges {
2424
25namespace views {}25namespace views { // NOLINT(libcpp-avoid-empty-namespaces) // This is needed to declare the alias below.
26} // namespace views
2627
27} // namespace ranges28} // namespace ranges
2829
lib/libcxx/include/__ranges/zip_transform_view.h+18-17
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include <__concepts/derived_from.h>17#include <__concepts/derived_from.h>
18#include <__concepts/equality_comparable.h>18#include <__concepts/equality_comparable.h>
19#include <__concepts/invocable.h>19#include <__concepts/invocable.h>
20#include <__concepts/referenceable.h>
20#include <__functional/invoke.h>21#include <__functional/invoke.h>
21#include <__iterator/concepts.h>22#include <__iterator/concepts.h>
22#include <__iterator/incrementable_traits.h>23#include <__iterator/incrementable_traits.h>
...@@ -33,7 +34,6 @@...@@ -33,7 +34,6 @@
33#include <__type_traits/invoke.h>34#include <__type_traits/invoke.h>
34#include <__type_traits/is_object.h>35#include <__type_traits/is_object.h>
35#include <__type_traits/is_reference.h>36#include <__type_traits/is_reference.h>
36#include <__type_traits/is_referenceable.h>
37#include <__type_traits/maybe_const.h>37#include <__type_traits/maybe_const.h>
38#include <__type_traits/remove_cvref.h>38#include <__type_traits/remove_cvref.h>
39#include <__utility/forward.h>39#include <__utility/forward.h>
...@@ -79,15 +79,15 @@ public:...@@ -79,15 +79,15 @@ public:
79 _LIBCPP_HIDE_FROM_ABI constexpr explicit zip_transform_view(_Fn __fun, _Views... __views)79 _LIBCPP_HIDE_FROM_ABI constexpr explicit zip_transform_view(_Fn __fun, _Views... __views)
80 : __zip_(std::move(__views)...), __fun_(in_place, std::move(__fun)) {}80 : __zip_(std::move(__views)...), __fun_(in_place, std::move(__fun)) {}
8181
82 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() { return __iterator<false>(*this, __zip_.begin()); }82 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() { return __iterator<false>(*this, __zip_.begin()); }
8383
84 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
85 requires range<const _InnerView> && regular_invocable<const _Fn&, range_reference_t<const _Views>...>85 requires range<const _InnerView> && regular_invocable<const _Fn&, range_reference_t<const _Views>...>
86 {86 {
87 return __iterator<true>(*this, __zip_.begin());87 return __iterator<true>(*this, __zip_.begin());
88 }88 }
8989
90 _LIBCPP_HIDE_FROM_ABI constexpr auto end() {90 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
91 if constexpr (common_range<_InnerView>) {91 if constexpr (common_range<_InnerView>) {
92 return __iterator<false>(*this, __zip_.end());92 return __iterator<false>(*this, __zip_.end());
93 } else {93 } else {
...@@ -95,7 +95,7 @@ public:...@@ -95,7 +95,7 @@ public:
95 }95 }
96 }96 }
9797
98 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const98 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
99 requires range<const _InnerView> && regular_invocable<const _Fn&, range_reference_t<const _Views>...>99 requires range<const _InnerView> && regular_invocable<const _Fn&, range_reference_t<const _Views>...>
100 {100 {
101 if constexpr (common_range<const _InnerView>) {101 if constexpr (common_range<const _InnerView>) {
...@@ -105,13 +105,13 @@ public:...@@ -105,13 +105,13 @@ public:
105 }105 }
106 }106 }
107107
108 _LIBCPP_HIDE_FROM_ABI constexpr auto size()108 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
109 requires sized_range<_InnerView>109 requires sized_range<_InnerView>
110 {110 {
111 return __zip_.size();111 return __zip_.size();
112 }112 }
113113
114 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const114 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
115 requires sized_range<const _InnerView>115 requires sized_range<const _InnerView>
116 {116 {
117 return __zip_.size();117 return __zip_.size();
...@@ -184,7 +184,7 @@ public:...@@ -184,7 +184,7 @@ public:
184 requires _Const && convertible_to<__ziperator<false>, __ziperator<_Const>>184 requires _Const && convertible_to<__ziperator<false>, __ziperator<_Const>>
185 : __parent_(__i.__parent_), __inner_(std::move(__i.__inner_)) {}185 : __parent_(__i.__parent_), __inner_(std::move(__i.__inner_)) {}
186186
187 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const187 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
188 noexcept(noexcept(std::apply(__get_deref_and_invoke(), __zip_view_iterator_access::__get_underlying(__inner_)))) {188 noexcept(noexcept(std::apply(__get_deref_and_invoke(), __zip_view_iterator_access::__get_underlying(__inner_)))) {
189 return std::apply(__get_deref_and_invoke(), __zip_view_iterator_access::__get_underlying(__inner_));189 return std::apply(__get_deref_and_invoke(), __zip_view_iterator_access::__get_underlying(__inner_));
190 }190 }
...@@ -233,7 +233,7 @@ public:...@@ -233,7 +233,7 @@ public:
233 return *this;233 return *this;
234 }234 }
235235
236 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const236 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](difference_type __n) const
237 requires random_access_range<_Base>237 requires random_access_range<_Base>
238 {238 {
239 return std::apply(239 return std::apply(
...@@ -255,25 +255,26 @@ public:...@@ -255,25 +255,26 @@ public:
255 return __x.__inner_ <=> __y.__inner_;255 return __x.__inner_ <=> __y.__inner_;
256 }256 }
257257
258 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)258 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
259 requires random_access_range<_Base>259 requires random_access_range<_Base>
260 {260 {
261 return __iterator(*__i.__parent_, __i.__inner_ + __n);261 return __iterator(*__i.__parent_, __i.__inner_ + __n);
262 }262 }
263263
264 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)264 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
265 requires random_access_range<_Base>265 requires random_access_range<_Base>
266 {266 {
267 return __iterator(*__i.__parent_, __i.__inner_ + __n);267 return __iterator(*__i.__parent_, __i.__inner_ + __n);
268 }268 }
269269
270 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)270 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
271 requires random_access_range<_Base>271 requires random_access_range<_Base>
272 {272 {
273 return __iterator(*__i.__parent_, __i.__inner_ - __n);273 return __iterator(*__i.__parent_, __i.__inner_ - __n);
274 }274 }
275275
276 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)276 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
277 operator-(const __iterator& __x, const __iterator& __y)
277 requires sized_sentinel_for<__ziperator<_Const>, __ziperator<_Const>>278 requires sized_sentinel_for<__ziperator<_Const>, __ziperator<_Const>>
278 {279 {
279 return __x.__inner_ - __y.__inner_;280 return __x.__inner_ - __y.__inner_;
...@@ -307,14 +308,14 @@ public:...@@ -307,14 +308,14 @@ public:
307308
308 template <bool _OtherConst>309 template <bool _OtherConst>
309 requires sized_sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>310 requires sized_sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>
310 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>311 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>
311 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {312 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
312 return __x.__inner_ - __y.__inner_;313 return __x.__inner_ - __y.__inner_;
313 }314 }
314315
315 template <bool _OtherConst>316 template <bool _OtherConst>
316 requires sized_sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>317 requires sized_sentinel_for<__zentinel<_Const>, __ziperator<_OtherConst>>
317 _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>318 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _InnerView>>
318 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {319 operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
319 return __x.__inner_ - __y.__inner_;320 return __x.__inner_ - __y.__inner_;
320 }321 }
...@@ -327,14 +328,14 @@ struct __fn {...@@ -327,14 +328,14 @@ struct __fn {
327 template <class _Fn>328 template <class _Fn>
328 requires(move_constructible<decay_t<_Fn>> && regular_invocable<decay_t<_Fn>&> &&329 requires(move_constructible<decay_t<_Fn>> && regular_invocable<decay_t<_Fn>&> &&
329 is_object_v<invoke_result_t<decay_t<_Fn>&>>)330 is_object_v<invoke_result_t<decay_t<_Fn>&>>)
330 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&&) const331 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&&) const
331 noexcept(noexcept(auto(views::empty<decay_t<invoke_result_t<decay_t<_Fn>&>>>))) {332 noexcept(noexcept(auto(views::empty<decay_t<invoke_result_t<decay_t<_Fn>&>>>))) {
332 return views::empty<decay_t<invoke_result_t<decay_t<_Fn>&>>>;333 return views::empty<decay_t<invoke_result_t<decay_t<_Fn>&>>>;
333 }334 }
334335
335 template <class _Fn, class... _Ranges>336 template <class _Fn, class... _Ranges>
336 requires(sizeof...(_Ranges) > 0)337 requires(sizeof...(_Ranges) > 0)
337 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&& __fun, _Ranges&&... __rs) const338 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&& __fun, _Ranges&&... __rs) const
338 noexcept(noexcept(zip_transform_view(std::forward<_Fn>(__fun), std::forward<_Ranges>(__rs)...)))339 noexcept(noexcept(zip_transform_view(std::forward<_Fn>(__fun), std::forward<_Ranges>(__rs)...)))
339 -> decltype(zip_transform_view(std::forward<_Fn>(__fun), std::forward<_Ranges>(__rs)...)) {340 -> decltype(zip_transform_view(std::forward<_Fn>(__fun), std::forward<_Ranges>(__rs)...)) {
340 return zip_transform_view(std::forward<_Fn>(__fun), std::forward<_Ranges>(__rs)...);341 return zip_transform_view(std::forward<_Fn>(__fun), std::forward<_Ranges>(__rs)...);
lib/libcxx/include/__ranges/zip_view.h+18-15
...@@ -134,19 +134,19 @@ public:...@@ -134,19 +134,19 @@ public:
134134
135 _LIBCPP_HIDE_FROM_ABI constexpr explicit zip_view(_Views... __views) : __views_(std::move(__views)...) {}135 _LIBCPP_HIDE_FROM_ABI constexpr explicit zip_view(_Views... __views) : __views_(std::move(__views)...) {}
136136
137 _LIBCPP_HIDE_FROM_ABI constexpr auto begin()137 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin()
138 requires(!(__simple_view<_Views> && ...))138 requires(!(__simple_view<_Views> && ...))
139 {139 {
140 return __iterator<false>(std::__tuple_transform(ranges::begin, __views_));140 return __iterator<false>(std::__tuple_transform(ranges::begin, __views_));
141 }141 }
142142
143 _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const143 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
144 requires(range<const _Views> && ...)144 requires(range<const _Views> && ...)
145 {145 {
146 return __iterator<true>(std::__tuple_transform(ranges::begin, __views_));146 return __iterator<true>(std::__tuple_transform(ranges::begin, __views_));
147 }147 }
148148
149 _LIBCPP_HIDE_FROM_ABI constexpr auto end()149 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
150 requires(!(__simple_view<_Views> && ...))150 requires(!(__simple_view<_Views> && ...))
151 {151 {
152 if constexpr (!__zip_is_common<_Views...>) {152 if constexpr (!__zip_is_common<_Views...>) {
...@@ -158,7 +158,7 @@ public:...@@ -158,7 +158,7 @@ public:
158 }158 }
159 }159 }
160160
161 _LIBCPP_HIDE_FROM_ABI constexpr auto end() const161 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const
162 requires(range<const _Views> && ...)162 requires(range<const _Views> && ...)
163 {163 {
164 if constexpr (!__zip_is_common<const _Views...>) {164 if constexpr (!__zip_is_common<const _Views...>) {
...@@ -170,7 +170,7 @@ public:...@@ -170,7 +170,7 @@ public:
170 }170 }
171 }171 }
172172
173 _LIBCPP_HIDE_FROM_ABI constexpr auto size()173 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size()
174 requires(sized_range<_Views> && ...)174 requires(sized_range<_Views> && ...)
175 {175 {
176 return std::apply(176 return std::apply(
...@@ -181,7 +181,7 @@ public:...@@ -181,7 +181,7 @@ public:
181 std::__tuple_transform(ranges::size, __views_));181 std::__tuple_transform(ranges::size, __views_));
182 }182 }
183183
184 _LIBCPP_HIDE_FROM_ABI constexpr auto size() const184 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
185 requires(sized_range<const _Views> && ...)185 requires(sized_range<const _Views> && ...)
186 {186 {
187 return std::apply(187 return std::apply(
...@@ -267,7 +267,7 @@ public:...@@ -267,7 +267,7 @@ public:
267 requires _Const && (convertible_to<iterator_t<_Views>, iterator_t<__maybe_const<_Const, _Views>>> && ...)267 requires _Const && (convertible_to<iterator_t<_Views>, iterator_t<__maybe_const<_Const, _Views>>> && ...)
268 : __current_(std::move(__i.__current_)) {}268 : __current_(std::move(__i.__current_)) {}
269269
270 _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {270 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator*() const {
271 return std::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);271 return std::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);
272 }272 }
273273
...@@ -315,7 +315,7 @@ public:...@@ -315,7 +315,7 @@ public:
315 return *this;315 return *this;
316 }316 }
317317
318 _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const318 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](difference_type __n) const
319 requires __zip_all_random_access<_Const, _Views...>319 requires __zip_all_random_access<_Const, _Views...>
320 {320 {
321 return std::__tuple_transform(321 return std::__tuple_transform(
...@@ -338,7 +338,7 @@ public:...@@ -338,7 +338,7 @@ public:
338 return __x.__current_ <=> __y.__current_;338 return __x.__current_ <=> __y.__current_;
339 }339 }
340340
341 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)341 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __i, difference_type __n)
342 requires __zip_all_random_access<_Const, _Views...>342 requires __zip_all_random_access<_Const, _Views...>
343 {343 {
344 auto __r = __i;344 auto __r = __i;
...@@ -346,13 +346,13 @@ public:...@@ -346,13 +346,13 @@ public:
346 return __r;346 return __r;
347 }347 }
348348
349 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)349 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, const __iterator& __i)
350 requires __zip_all_random_access<_Const, _Views...>350 requires __zip_all_random_access<_Const, _Views...>
351 {351 {
352 return __i + __n;352 return __i + __n;
353 }353 }
354354
355 _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)355 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __i, difference_type __n)
356 requires __zip_all_random_access<_Const, _Views...>356 requires __zip_all_random_access<_Const, _Views...>
357 {357 {
358 auto __r = __i;358 auto __r = __i;
...@@ -360,7 +360,8 @@ public:...@@ -360,7 +360,8 @@ public:
360 return __r;360 return __r;
361 }361 }
362362
363 _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)363 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
364 operator-(const __iterator& __x, const __iterator& __y)
364 requires(sized_sentinel_for<iterator_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_Const, _Views>>> &&365 requires(sized_sentinel_for<iterator_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_Const, _Views>>> &&
365 ...)366 ...)
366 {367 {
...@@ -374,7 +375,7 @@ public:...@@ -374,7 +375,7 @@ public:
374 __diffs);375 __diffs);
375 }376 }
376377
377 _LIBCPP_HIDE_FROM_ABI friend constexpr auto iter_move(const __iterator& __i) noexcept(378 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto iter_move(const __iterator& __i) noexcept(
378 (noexcept(ranges::iter_move(std::declval<const iterator_t<__maybe_const<_Const, _Views>>&>())) && ...) &&379 (noexcept(ranges::iter_move(std::declval<const iterator_t<__maybe_const<_Const, _Views>>&>())) && ...) &&
379 (is_nothrow_move_constructible_v<range_rvalue_reference_t<__maybe_const<_Const, _Views>>> && ...)) {380 (is_nothrow_move_constructible_v<range_rvalue_reference_t<__maybe_const<_Const, _Views>>> && ...)) {
380 return std::__tuple_transform(ranges::iter_move, __i.__current_);381 return std::__tuple_transform(ranges::iter_move, __i.__current_);
...@@ -426,6 +427,7 @@ public:...@@ -426,6 +427,7 @@ public:
426 requires(427 requires(
427 sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&428 sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&
428 ...)429 ...)
430 [[nodiscard]]
429 _LIBCPP_HIDE_FROM_ABI friend constexpr common_type_t<range_difference_t<__maybe_const<_OtherConst, _Views>>...>431 _LIBCPP_HIDE_FROM_ABI friend constexpr common_type_t<range_difference_t<__maybe_const<_OtherConst, _Views>>...>
430 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {432 operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
431 const auto __diffs = ranges::__tuple_zip_transform(minus<>(), __iter_current(__x), __y.__end_);433 const auto __diffs = ranges::__tuple_zip_transform(minus<>(), __iter_current(__x), __y.__end_);
...@@ -443,6 +445,7 @@ public:...@@ -443,6 +445,7 @@ public:
443 requires(445 requires(
444 sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&446 sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&
445 ...)447 ...)
448 [[nodiscard]]
446 _LIBCPP_HIDE_FROM_ABI friend constexpr common_type_t<range_difference_t<__maybe_const<_OtherConst, _Views>>...>449 _LIBCPP_HIDE_FROM_ABI friend constexpr common_type_t<range_difference_t<__maybe_const<_OtherConst, _Views>>...>
447 operator-(const __sentinel& __y, const __iterator<_OtherConst>& __x) {450 operator-(const __sentinel& __y, const __iterator<_OtherConst>& __x) {
448 return -(__x - __y);451 return -(__x - __y);
...@@ -456,10 +459,10 @@ namespace views {...@@ -456,10 +459,10 @@ namespace views {
456namespace __zip {459namespace __zip {
457460
458struct __fn {461struct __fn {
459 _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()() noexcept { return empty_view<tuple<>>{}; }462 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()() noexcept { return empty_view<tuple<>>{}; }
460463
461 template <class... _Ranges>464 template <class... _Ranges>
462 _LIBCPP_HIDE_FROM_ABI static constexpr auto465 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
463 operator()(_Ranges&&... __rs) noexcept(noexcept(zip_view<all_t<_Ranges&&>...>(std::forward<_Ranges>(__rs)...)))466 operator()(_Ranges&&... __rs) noexcept(noexcept(zip_view<all_t<_Ranges&&>...>(std::forward<_Ranges>(__rs)...)))
464 -> decltype(zip_view<all_t<_Ranges&&>...>(std::forward<_Ranges>(__rs)...)) {467 -> decltype(zip_view<all_t<_Ranges&&>...>(std::forward<_Ranges>(__rs)...)) {
465 return zip_view<all_t<_Ranges>...>(std::forward<_Ranges>(__rs)...);468 return zip_view<all_t<_Ranges>...>(std::forward<_Ranges>(__rs)...);
lib/libcxx/include/__split_buffer+131-16
...@@ -25,6 +25,7 @@...@@ -25,6 +25,7 @@
25#include <__memory/compressed_pair.h>25#include <__memory/compressed_pair.h>
26#include <__memory/pointer_traits.h>26#include <__memory/pointer_traits.h>
27#include <__memory/swap_allocator.h>27#include <__memory/swap_allocator.h>
28#include <__memory/uninitialized_algorithms.h>
28#include <__type_traits/conditional.h>29#include <__type_traits/conditional.h>
29#include <__type_traits/enable_if.h>30#include <__type_traits/enable_if.h>
30#include <__type_traits/integral_constant.h>31#include <__type_traits/integral_constant.h>
...@@ -156,10 +157,8 @@ public:...@@ -156,10 +157,8 @@ public:
156157
157 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT { return *(__end_ - 1); }158 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT { return *(__end_ - 1); }
158159
159 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(160 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
160 __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type, __split_buffer_pointer_layout>,161 __swap_without_allocator(__split_buffer_pointer_layout& __other) _NOEXCEPT {
161 value_type,
162 allocator_type>& __other) _NOEXCEPT {
163 std::swap(__front_cap_, __other.__front_cap_);162 std::swap(__front_cap_, __other.__front_cap_);
164 std::swap(__begin_, __other.__begin_);163 std::swap(__begin_, __other.__begin_);
165 std::swap(__back_cap_, __other.__back_cap_);164 std::swap(__back_cap_, __other.__back_cap_);
...@@ -190,6 +189,65 @@ public:...@@ -190,6 +189,65 @@ public:
190 __back_cap_ = __other.__back_cap_;189 __back_cap_ = __other.__back_cap_;
191 }190 }
192191
192 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
193 __swap_layouts(pointer& __begin, pointer& __end, pointer& __back_capacity) {
194 using std::swap;
195 swap(__begin_, __begin);
196 swap(__end_, __end);
197 swap(__back_cap_, __back_capacity);
198 }
199
200 /// Relocates the objects in the range `[__first, __last)` to the front of the buffer, then swaps
201 /// `__first`, `__last`, and `__capacity` with `__begin_`, `__end_`, and `__back_cap_`,
202 /// respectively.
203 ///
204 /// Precondition: `__front_spare() == __last - __first`.
205 /// Exceptions: This function has a strong exception guarantee.
206 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
207 __relocate(pointer& __first, pointer& __last, pointer& __capacity) {
208 auto __size = __last - __first;
209 auto __new_begin = __begin_ - __size;
210 std::__uninitialized_allocator_relocate(
211 __alloc_, std::__to_address(__first), std::__to_address(__last), std::__to_address(__new_begin));
212 __begin_ = __new_begin;
213 __last = __first;
214
215 __swap_layouts(__first, __last, __capacity);
216 __front_cap_ = __begin_;
217 }
218
219 /// Relocates the objects in the range `[__first, __pivot)` to the front of the buffer, the
220 /// objects in `[__pivot, __last)` into the back of the buffer, then swaps `__first`, `__last`,
221 /// and `__capacity` with `__begin_`, `__end_`, and `__back_cap_`, respectively.
222 ///
223 /// Preconditions:
224 /// * `__front_spare() == __pivot - __first`
225 /// * `__back_spare() == __last - __pivot`
226 /// Exceptions: This function has a strong exception guarantee if `__first == __pivot` or
227 /// `__last == __pivot`.
228 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer
229 __relocate_with_pivot(pointer __pivot, pointer& __first, pointer& __last, pointer& __capacity) {
230 pointer __result = __begin_;
231
232 // Relocate [__p, __last) first to avoid having a hole in [__first, __last)
233 // in case something in [__first, __p) throws.
234 std::__uninitialized_allocator_relocate(
235 __alloc_, std::__to_address(__pivot), std::__to_address(__last), std::__to_address(__end_));
236 auto __relocated_so_far = __last - __pivot;
237 __end_ += __relocated_so_far;
238 __last = __pivot; // The objects in [__p, __last) have been destroyed by relocating them.
239
240 auto __new_begin = __begin_ - (__pivot - __first);
241 std::__uninitialized_allocator_relocate(
242 __alloc_, std::__to_address(__first), std::__to_address(__pivot), std::__to_address(__new_begin));
243 __begin_ = __new_begin;
244
245 __last = __first; // All the objects have been destroyed by relocating them.
246 __swap_layouts(__first, __last, __capacity);
247 __front_cap_ = __begin_;
248 return __result;
249 }
250
193private:251private:
194 pointer __front_cap_ = nullptr;252 pointer __front_cap_ = nullptr;
195 pointer __begin_ = nullptr;253 pointer __begin_ = nullptr;
...@@ -263,25 +321,19 @@ public:...@@ -263,25 +321,19 @@ public:
263321
264 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void322 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
265 __set_valid_range(pointer __new_begin, pointer __new_end) _NOEXCEPT {323 __set_valid_range(pointer __new_begin, pointer __new_end) _NOEXCEPT {
266 // Size-based __split_buffers track their size directly: we need to explicitly update the size
267 // when the front is adjusted.
268 __size_ -= __new_begin - __begin_;
269 __begin_ = __new_begin;324 __begin_ = __new_begin;
270 __set_sentinel(__new_end);325 __set_sentinel(__new_end);
271 }326 }
272327
273 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void328 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
274 __set_valid_range(pointer __new_begin, size_type __new_size) _NOEXCEPT {329 __set_valid_range(pointer __new_begin, size_type __new_size) _NOEXCEPT {
275 // Size-based __split_buffers track their size directly: we need to explicitly update the size
276 // when the front is adjusted.
277 __size_ -= __new_begin - __begin_;
278 __begin_ = __new_begin;330 __begin_ = __new_begin;
279 __set_sentinel(__new_size);331 __set_sentinel(__new_size);
280 }332 }
281333
282 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(pointer __new_end) _NOEXCEPT {334 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(pointer __new_end) _NOEXCEPT {
283 _LIBCPP_ASSERT_INTERNAL(__front_cap_ <= __new_end, "__new_end cannot precede __front_cap_");335 _LIBCPP_ASSERT_INTERNAL(__front_cap_ <= __new_end, "__new_end cannot precede __front_cap_");
284 __size_ += __new_end - end();336 __size_ = __new_end - __begin_;
285 }337 }
286338
287 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(size_type __new_size) _NOEXCEPT {339 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_sentinel(size_type __new_size) _NOEXCEPT {
...@@ -312,10 +364,8 @@ public:...@@ -312,10 +364,8 @@ public:
312 return __begin_[__size_ - 1];364 return __begin_[__size_ - 1];
313 }365 }
314366
315 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(367 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
316 __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type, __split_buffer_pointer_layout>,368 __swap_without_allocator(__split_buffer_size_layout& __other) _NOEXCEPT {
317 value_type,
318 allocator_type>& __other) _NOEXCEPT {
319 std::swap(__front_cap_, __other.__front_cap_);369 std::swap(__front_cap_, __other.__front_cap_);
320 std::swap(__begin_, __other.__begin_);370 std::swap(__begin_, __other.__begin_);
321 std::swap(__cap_, __other.__cap_);371 std::swap(__cap_, __other.__cap_);
...@@ -346,6 +396,68 @@ public:...@@ -346,6 +396,68 @@ public:
346 __size_ = __other.__size_;396 __size_ = __other.__size_;
347 }397 }
348398
399 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
400 __swap_layouts(pointer& __begin, size_type& __size, size_type& __capacity) {
401 using std::swap;
402 swap(__begin_, __begin);
403 swap(__size_, __size);
404 swap(__cap_, __capacity);
405 }
406
407 /// Relocates the objects in the range `[__first, __first + __n)` to the front of the buffer, then
408 /// swaps `__first`, `__n`, and `__capacity` with `__begin_`, `__size_`, and `__capacity_`,
409 /// respectively.
410 ///
411 /// Precondition: `__front_spare() == __n`.
412 /// Exceptions: This function has a strong exception guarantee.
413 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
414 __relocate(pointer& __first, size_type& __n, size_type& __capacity) {
415 auto __new_begin = __begin_ - __n;
416 auto __last = __first + __n;
417 std::__uninitialized_allocator_relocate(
418 __alloc_, std::__to_address(__first), std::__to_address(__last), std::__to_address(__new_begin));
419 __set_valid_range(__new_begin, end());
420 __n = 0;
421
422 __swap_layouts(__first, __n, __capacity);
423 __front_cap_ = __begin_;
424 }
425
426 /// Relocates the objects in the range `[__first, __pivot)` to the front of the buffer, the
427 /// objects in `[__pivot, __first + __n)` to the back of the buffer, then swaps `__first`, `__n`,
428 /// and `__capacity` with `__begin_`, `__size_`, and `__capacity_`, respectively.
429 ///
430 /// Preconditions:
431 /// * `__front_spare() == __pivot - __first`
432 /// * `__back_spare() == __last - __pivot`
433 /// Exceptions: This function has a strong exception guarantee if `__first == __pivot` or
434 /// `__first + __n == __pivot`.
435 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer
436 __relocate_with_pivot(pointer __pivot, pointer& __first, size_type& __n, size_type& __capacity) {
437 pointer __result = __begin_;
438 pointer __last = __first + __n;
439
440 // We relocate elements in reverse order to ensure that a throwing relocation operation leaves the
441 // buffer in a valid state.
442 std::__uninitialized_allocator_relocate(
443 __alloc_, std::__to_address(__pivot), std::__to_address(__last), std::__to_address(end()));
444
445 auto const __relocated_so_far = __last - __pivot;
446 __size_ += __relocated_so_far;
447 __n -= __relocated_so_far; // The objects in [__pivot, __last) have been destroyed by relocating them.
448
449 auto __new_begin = __begin_ - __n;
450 std::__uninitialized_allocator_relocate(
451 __alloc_, std::__to_address(__first), std::__to_address(__pivot), std::__to_address(__new_begin));
452 __begin_ = __new_begin;
453 __size_ += __n;
454 __n = 0; // All the objects have been destroyed by relocating them.
455
456 __swap_layouts(__first, __n, __capacity);
457 __front_cap_ = __begin_;
458 return __result;
459 }
460
349private:461private:
350 pointer __front_cap_ = nullptr;462 pointer __front_cap_ = nullptr;
351 pointer __begin_ = nullptr;463 pointer __begin_ = nullptr;
...@@ -452,11 +564,14 @@ public:...@@ -452,11 +564,14 @@ public:
452 using __base_type::__get_allocator;564 using __base_type::__get_allocator;
453 using __base_type::__raw_capacity;565 using __base_type::__raw_capacity;
454 using __base_type::__raw_sentinel;566 using __base_type::__raw_sentinel;
567 using __base_type::__relocate;
568 using __base_type::__relocate_with_pivot;
455 using __base_type::__reset;569 using __base_type::__reset;
456 using __base_type::__set_capacity;570 using __base_type::__set_capacity;
457 using __base_type::__set_data;571 using __base_type::__set_data;
458 using __base_type::__set_sentinel;572 using __base_type::__set_sentinel;
459 using __base_type::__set_valid_range;573 using __base_type::__set_valid_range;
574 using __base_type::__swap_layouts;
460575
461 using typename __base_type::__alloc_traits;576 using typename __base_type::__alloc_traits;
462 using typename __base_type::allocator_type;577 using typename __base_type::allocator_type;
...@@ -585,7 +700,7 @@ public:...@@ -585,7 +700,7 @@ public:
585700
586 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void701 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
587 __swap_without_allocator(__split_buffer<value_type, allocator_type, _Layout>& __other) _NOEXCEPT {702 __swap_without_allocator(__split_buffer<value_type, allocator_type, _Layout>& __other) _NOEXCEPT {
588 __base_type::__swap_without_allocator(__other);703 __base_type::__swap_without_allocator(static_cast<__base_type&>(__other));
589 }704 }
590705
591private:706private:
lib/libcxx/include/__stop_token/atomic_unique_lock.h+8-7
...@@ -10,25 +10,26 @@...@@ -10,25 +10,26 @@
10#ifndef _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H10#ifndef _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H
11#define _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H11#define _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H
1212
13#include <__bit/popcount.h>13#include <__atomic/atomic.h>
14#include <__atomic/memory_order.h>
15#include <__bit/has_single_bit.h>
14#include <__config>16#include <__config>
15#include <atomic>
1617
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header19# pragma GCC system_header
19#endif20#endif
2021
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2423
24_LIBCPP_BEGIN_NAMESPACE_STD
25
25// This class implements an RAII unique_lock without a mutex.26// This class implements an RAII unique_lock without a mutex.
26// It uses std::atomic<State>,27// It uses std::atomic<State>,
27// where State contains a lock bit and might contain other data,28// where State contains a lock bit and might contain other data,
28// and LockedBit is the value of State when the lock bit is set, e.g 1 << 229// and LockedBit is the value of State when the lock bit is set, e.g 1 << 2
29template <class _State, _State _LockedBit>30template <class _State, _State _LockedBit>
30class __atomic_unique_lock {31class __atomic_unique_lock {
31 static_assert(std::__popcount(static_cast<unsigned long long>(_LockedBit)) == 1,32 static_assert(std::has_single_bit(static_cast<unsigned long long>(_LockedBit)),
32 "LockedBit must be an integer where only one bit is set");33 "LockedBit must be an integer where only one bit is set");
3334
34 std::atomic<_State>& __state_;35 std::atomic<_State>& __state_;
...@@ -133,8 +134,8 @@ private:...@@ -133,8 +134,8 @@ private:
133 _LIBCPP_HIDE_FROM_ABI static constexpr auto __set_locked_bit = [](_State __state) { return __state | _LockedBit; };134 _LIBCPP_HIDE_FROM_ABI static constexpr auto __set_locked_bit = [](_State __state) { return __state | _LockedBit; };
134};135};
135136
136#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
137
138_LIBCPP_END_NAMESPACE_STD137_LIBCPP_END_NAMESPACE_STD
139138
139#endif // _LIBCPP_STD_VER >= 20
140
140#endif // _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H141#endif // _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H
lib/libcxx/include/__stop_token/intrusive_list_view.h+4-4
...@@ -17,10 +17,10 @@...@@ -17,10 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
2321
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <class _Derived>24template <class _Derived>
25struct __intrusive_node_base {25struct __intrusive_node_base {
26 _Derived* __next_ = nullptr;26 _Derived* __next_ = nullptr;
...@@ -78,8 +78,8 @@ private:...@@ -78,8 +78,8 @@ private:
78 _Node* __head_ = nullptr;78 _Node* __head_ = nullptr;
79};79};
8080
81#endif // _LIBCPP_STD_VER >= 20
82
83_LIBCPP_END_NAMESPACE_STD81_LIBCPP_END_NAMESPACE_STD
8482
83#endif // _LIBCPP_STD_VER >= 20
84
85#endif // _LIBCPP___STOP_TOKEN_INTRUSIVE_LIST_VIEW_H85#endif // _LIBCPP___STOP_TOKEN_INTRUSIVE_LIST_VIEW_H
lib/libcxx/include/__stop_token/intrusive_shared_ptr.h+4-5
...@@ -10,7 +10,6 @@...@@ -10,7 +10,6 @@
10#ifndef _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H10#ifndef _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H
11#define _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H11#define _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H
1212
13#include <__atomic/atomic.h>
14#include <__atomic/memory_order.h>13#include <__atomic/memory_order.h>
15#include <__config>14#include <__config>
16#include <__cstddef/nullptr_t.h>15#include <__cstddef/nullptr_t.h>
...@@ -26,10 +25,10 @@...@@ -26,10 +25,10 @@
26_LIBCPP_PUSH_MACROS25_LIBCPP_PUSH_MACROS
27#include <__undef_macros>26#include <__undef_macros>
2827
29_LIBCPP_BEGIN_NAMESPACE_STD
30
31#if _LIBCPP_STD_VER >= 2028#if _LIBCPP_STD_VER >= 20
3229
30_LIBCPP_BEGIN_NAMESPACE_STD
31
33// For intrusive_shared_ptr to work with a type T, specialize __intrusive_shared_ptr_traits<T> and implement32// For intrusive_shared_ptr to work with a type T, specialize __intrusive_shared_ptr_traits<T> and implement
34// the following function:33// the following function:
35//34//
...@@ -126,10 +125,10 @@ private:...@@ -126,10 +125,10 @@ private:
126 }125 }
127};126};
128127
129#endif // _LIBCPP_STD_VER >= 20
130
131_LIBCPP_END_NAMESPACE_STD128_LIBCPP_END_NAMESPACE_STD
132129
130#endif // _LIBCPP_STD_VER >= 20
131
133_LIBCPP_POP_MACROS132_LIBCPP_POP_MACROS
134133
135#endif // _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H134#endif // _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H
lib/libcxx/include/__stop_token/stop_callback.h+4-4
...@@ -29,10 +29,10 @@...@@ -29,10 +29,10 @@
29_LIBCPP_PUSH_MACROS29_LIBCPP_PUSH_MACROS
30#include <__undef_macros>30#include <__undef_macros>
3131
32_LIBCPP_BEGIN_NAMESPACE_STD
33
34#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS32#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
3533
34_LIBCPP_BEGIN_NAMESPACE_STD
35
36template <class _Callback>36template <class _Callback>
37class stop_callback : private __stop_callback_base {37class stop_callback : private __stop_callback_base {
38 static_assert(invocable<_Callback>,38 static_assert(invocable<_Callback>,
...@@ -93,10 +93,10 @@ private:...@@ -93,10 +93,10 @@ private:
93template <class _Callback>93template <class _Callback>
94stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;94stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
9595
96#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
97
98_LIBCPP_END_NAMESPACE_STD96_LIBCPP_END_NAMESPACE_STD
9997
98#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
99
100_LIBCPP_POP_MACROS100_LIBCPP_POP_MACROS
101101
102#endif // _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H102#endif // _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H
lib/libcxx/include/__stop_token/stop_state.h+6-5
...@@ -11,21 +11,22 @@...@@ -11,21 +11,22 @@
11#define _LIBCPP___STOP_TOKEN_STOP_STATE_H11#define _LIBCPP___STOP_TOKEN_STOP_STATE_H
1212
13#include <__assert>13#include <__assert>
14#include <__atomic/atomic.h>
15#include <__atomic/memory_order.h>
14#include <__config>16#include <__config>
15#include <__stop_token/atomic_unique_lock.h>17#include <__stop_token/atomic_unique_lock.h>
16#include <__stop_token/intrusive_list_view.h>18#include <__stop_token/intrusive_list_view.h>
17#include <__thread/id.h>19#include <__thread/id.h>
18#include <atomic>
19#include <cstdint>20#include <cstdint>
2021
21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
22# pragma GCC system_header23# pragma GCC system_header
23#endif24#endif
2425
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS26#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
2827
28_LIBCPP_BEGIN_NAMESPACE_STD
29
29struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {30struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {
30 using __callback_fn_t _LIBCPP_NODEBUG = void(__stop_callback_base*) noexcept;31 using __callback_fn_t _LIBCPP_NODEBUG = void(__stop_callback_base*) noexcept;
31 _LIBCPP_HIDE_FROM_ABI explicit __stop_callback_base(__callback_fn_t* __callback_fn) : __callback_fn_(__callback_fn) {}32 _LIBCPP_HIDE_FROM_ABI explicit __stop_callback_base(__callback_fn_t* __callback_fn) : __callback_fn_(__callback_fn) {}
...@@ -229,8 +230,8 @@ struct __intrusive_shared_ptr_traits<__stop_state> {...@@ -229,8 +230,8 @@ struct __intrusive_shared_ptr_traits<__stop_state> {
229 }230 }
230};231};
231232
232#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
233
234_LIBCPP_END_NAMESPACE_STD233_LIBCPP_END_NAMESPACE_STD
235234
235#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
236
236#endif // _LIBCPP___STOP_TOKEN_STOP_STATE_H237#endif // _LIBCPP___STOP_TOKEN_STOP_STATE_H
lib/libcxx/include/__stop_token/stop_token.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS21#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25class stop_token {25class stop_token {
26public:26public:
27 _LIBCPP_HIDE_FROM_ABI stop_token() noexcept = default;27 _LIBCPP_HIDE_FROM_ABI stop_token() noexcept = default;
...@@ -56,8 +56,8 @@ private:...@@ -56,8 +56,8 @@ private:
56 _LIBCPP_HIDE_FROM_ABI explicit stop_token(const __intrusive_shared_ptr<__stop_state>& __state) : __state_(__state) {}56 _LIBCPP_HIDE_FROM_ABI explicit stop_token(const __intrusive_shared_ptr<__stop_state>& __state) : __state_(__state) {}
57};57};
5858
59#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
60
61_LIBCPP_END_NAMESPACE_STD59_LIBCPP_END_NAMESPACE_STD
6260
61#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
62
63#endif // _LIBCPP___STOP_TOKEN_STOP_TOKEN_H63#endif // _LIBCPP___STOP_TOKEN_STOP_TOKEN_H
lib/libcxx/include/__support/xlocale/__nop_locale_mgmt.h deleted-33
...@@ -1,33 +0,0 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
11#define _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
12
13#include <__config>
14
15// Patch over lack of extended locale support
16typedef void* locale_t;
17
18inline _LIBCPP_HIDE_FROM_ABI locale_t duplocale(locale_t) { return nullptr; }
19
20inline _LIBCPP_HIDE_FROM_ABI void freelocale(locale_t) {}
21
22inline _LIBCPP_HIDE_FROM_ABI locale_t newlocale(int, const char*, locale_t) { return nullptr; }
23
24#define LC_COLLATE_MASK (1 << LC_COLLATE)
25#define LC_CTYPE_MASK (1 << LC_CTYPE)
26#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
27#define LC_MONETARY_MASK (1 << LC_MONETARY)
28#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
29#define LC_TIME_MASK (1 << LC_TIME)
30#define LC_ALL_MASK \
31 (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_MESSAGES_MASK)
32
33#endif // _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
lib/libcxx/include/__support/xlocale/__strtonum_fallback.h deleted-37
...@@ -1,37 +0,0 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// These are reimplementations of some extended locale functions ( *_l ) that
10// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
11// others). The unifying aspect in this case is that all of these functions
12// convert strings to some numeric type.
13//===----------------------------------------------------------------------===//
14
15#ifndef _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
16#define _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
17
18#include <__config>
19#include <stdlib.h>
20
21#if _LIBCPP_HAS_WIDE_CHARACTERS
22# include <wchar.h>
23#endif
24
25inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
26 return ::strtof(__nptr, __endptr);
27}
28
29inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t) {
30 return ::strtod(__nptr, __endptr);
31}
32
33inline _LIBCPP_HIDE_FROM_ABI long double strtold_l(const char* __nptr, char** __endptr, locale_t) {
34 return ::strtold(__nptr, __endptr);
35}
36
37#endif // _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
lib/libcxx/include/__system_error/error_category.h+2
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23class error_condition;24class error_condition;
24class _LIBCPP_EXPORTED_FROM_ABI error_code;25class _LIBCPP_EXPORTED_FROM_ABI error_code;
...@@ -70,6 +71,7 @@ public:...@@ -70,6 +71,7 @@ public:
70[[__gnu__::__const__]] [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;71[[__gnu__::__const__]] [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
71[[__gnu__::__const__]] [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;72[[__gnu__::__const__]] [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
7273
74_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
73_LIBCPP_END_NAMESPACE_STD75_LIBCPP_END_NAMESPACE_STD
7476
75#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H77#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H
lib/libcxx/include/__system_error/error_code.h+2
...@@ -24,6 +24,7 @@...@@ -24,6 +24,7 @@
24#endif24#endif
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2728
28template <class _Tp>29template <class _Tp>
29struct is_error_code_enum : public false_type {};30struct is_error_code_enum : public false_type {};
...@@ -137,6 +138,7 @@ struct hash<error_code> : public __unary_function<error_code, size_t> {...@@ -137,6 +138,7 @@ struct hash<error_code> : public __unary_function<error_code, size_t> {
137 }138 }
138};139};
139140
141_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
140_LIBCPP_END_NAMESPACE_STD142_LIBCPP_END_NAMESPACE_STD
141143
142#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H144#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H
lib/libcxx/include/__system_error/error_condition.h+2
...@@ -23,6 +23,7 @@...@@ -23,6 +23,7 @@
23#endif23#endif
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
26_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2627
27template <class _Tp>28template <class _Tp>
28struct is_error_condition_enum : public false_type {};29struct is_error_condition_enum : public false_type {};
...@@ -124,6 +125,7 @@ struct hash<error_condition> : public __unary_function<error_condition, size_t>...@@ -124,6 +125,7 @@ struct hash<error_condition> : public __unary_function<error_condition, size_t>
124 }125 }
125};126};
126127
128_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
127_LIBCPP_END_NAMESPACE_STD129_LIBCPP_END_NAMESPACE_STD
128130
129#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H131#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H
lib/libcxx/include/__system_error/system_error.h+2
...@@ -22,6 +22,7 @@...@@ -22,6 +22,7 @@
22#endif22#endif
2323
24_LIBCPP_BEGIN_NAMESPACE_STD24_LIBCPP_BEGIN_NAMESPACE_STD
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2526
26class _LIBCPP_EXPORTED_FROM_ABI system_error : public runtime_error {27class _LIBCPP_EXPORTED_FROM_ABI system_error : public runtime_error {
27 error_code __ec_;28 error_code __ec_;
...@@ -52,6 +53,7 @@ public:...@@ -52,6 +53,7 @@ public:
52#endif53#endif
53}54}
5455
56_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
55_LIBCPP_END_NAMESPACE_STD57_LIBCPP_END_NAMESPACE_STD
5658
57#endif // _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H59#endif // _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
lib/libcxx/include/__system_error/throw_system_error.h+2
...@@ -17,9 +17,11 @@...@@ -17,9 +17,11 @@
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
20_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2021
21[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void __throw_system_error(int __ev, const char* __what_arg);22[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void __throw_system_error(int __ev, const char* __what_arg);
2223
24_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
23_LIBCPP_END_NAMESPACE_STD25_LIBCPP_END_NAMESPACE_STD
2426
25#endif // _LIBCPP___SYSTEM_ERROR_THROW_SYSTEM_ERROR_H27#endif // _LIBCPP___SYSTEM_ERROR_THROW_SYSTEM_ERROR_H
lib/libcxx/include/__thread/formatter.h+1-8
...@@ -51,20 +51,13 @@ public:...@@ -51,20 +51,13 @@ public:
51 // On Linux systems pthread_t is an unsigned long long.51 // On Linux systems pthread_t is an unsigned long long.
52 // On Apple systems pthread_t is a pointer type.52 // On Apple systems pthread_t is a pointer type.
53 //53 //
54 // Note the output should match what the stream operator does. Since54 // Note the output should match what the stream operator does.
55 // the ostream operator has been shipped years before this formatter
56 // was added to the Standard, this formatter does what the stream
57 // operator does. This may require platform specific changes.
5855
59 using _Tp = decltype(__get_underlying_id(__id));56 using _Tp = decltype(__get_underlying_id(__id));
60 using _Cp = conditional_t<integral<_Tp>, _Tp, conditional_t<is_pointer_v<_Tp>, uintptr_t, void>>;57 using _Cp = conditional_t<integral<_Tp>, _Tp, conditional_t<is_pointer_v<_Tp>, uintptr_t, void>>;
61 static_assert(!is_same_v<_Cp, void>, "unsupported thread::id type, please file a bug report");58 static_assert(!is_same_v<_Cp, void>, "unsupported thread::id type, please file a bug report");
6259
63 __format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);60 __format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
64 if constexpr (is_pointer_v<_Tp>) {
65 __specs.__std_.__alternate_form_ = true;
66 __specs.__std_.__type_ = __format_spec::__type::__hexadecimal_lower_case;
67 }
68 return __formatter::__format_integer(reinterpret_cast<_Cp>(__get_underlying_id(__id)), __ctx, __specs);61 return __formatter::__format_integer(reinterpret_cast<_Cp>(__get_underlying_id(__id)), __ctx, __specs);
69 }62 }
7063
lib/libcxx/include/__thread/id.h+4-3
...@@ -20,9 +20,10 @@...@@ -20,9 +20,10 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#endif
2222
23#if _LIBCPP_HAS_THREADS
24
23_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
2426
25#if _LIBCPP_HAS_THREADS
26class __thread_id;27class __thread_id;
2728
28namespace this_thread {29namespace this_thread {
...@@ -114,8 +115,8 @@ inline _LIBCPP_HIDE_FROM_ABI __thread_id get_id() _NOEXCEPT { return __libcpp_th...@@ -114,8 +115,8 @@ inline _LIBCPP_HIDE_FROM_ABI __thread_id get_id() _NOEXCEPT { return __libcpp_th
114115
115} // namespace this_thread116} // namespace this_thread
116117
117#endif // _LIBCPP_HAS_THREADS
118
119_LIBCPP_END_NAMESPACE_STD118_LIBCPP_END_NAMESPACE_STD
120119
120#endif // _LIBCPP_HAS_THREADS
121
121#endif // _LIBCPP___THREAD_ID_H122#endif // _LIBCPP___THREAD_ID_H
lib/libcxx/include/__thread/support/pthread.h+16-3
...@@ -144,7 +144,9 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_execute_once(__libcpp_exec_once_flag*...@@ -144,7 +144,9 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_execute_once(__libcpp_exec_once_flag*
144//144//
145// Thread id145// Thread id
146//146//
147#if defined(__MVS__)147#if _LIBCPP_LIBC_LLVM_LIBC
148typedef pthread_id_np_t __libcpp_thread_id;
149#elif defined(__MVS__)
148typedef unsigned long long __libcpp_thread_id;150typedef unsigned long long __libcpp_thread_id;
149#else151#else
150typedef pthread_t __libcpp_thread_id;152typedef pthread_t __libcpp_thread_id;
...@@ -163,11 +165,18 @@ inline _LIBCPP_HIDE_FROM_ABI bool __libcpp_thread_id_less(__libcpp_thread_id __t...@@ -163,11 +165,18 @@ inline _LIBCPP_HIDE_FROM_ABI bool __libcpp_thread_id_less(__libcpp_thread_id __t
163//165//
164// Thread166// Thread
165//167//
166#define _LIBCPP_NULL_THREAD ((__libcpp_thread_t()))168#if defined(PTHREAD_NULL)
169# define _LIBCPP_NULL_THREAD PTHREAD_NULL
170#else
171# define _LIBCPP_NULL_THREAD ((__libcpp_thread_t()))
172#endif
167typedef pthread_t __libcpp_thread_t;173typedef pthread_t __libcpp_thread_t;
168174
169inline _LIBCPP_HIDE_FROM_ABI __libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t* __t) {175inline _LIBCPP_HIDE_FROM_ABI __libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t* __t) {
170#if defined(__MVS__)176#if _LIBCPP_LIBC_LLVM_LIBC
177 __libcpp_thread_id __id;
178 return pthread_getunique_np(__t, &__id) ? 0 : __id;
179#elif defined(__MVS__)
171 return __t->__;180 return __t->__;
172#else181#else
173 return *__t;182 return *__t;
...@@ -183,8 +192,12 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_thread_create(__libcpp_thread_t* __t,...@@ -183,8 +192,12 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_thread_create(__libcpp_thread_t* __t,
183}192}
184193
185inline _LIBCPP_HIDE_FROM_ABI __libcpp_thread_id __libcpp_thread_get_current_id() {194inline _LIBCPP_HIDE_FROM_ABI __libcpp_thread_id __libcpp_thread_get_current_id() {
195#if _LIBCPP_LIBC_LLVM_LIBC
196 return pthread_getthreadid_np();
197#else
186 const __libcpp_thread_t __current_thread = pthread_self();198 const __libcpp_thread_t __current_thread = pthread_self();
187 return __libcpp_thread_get_id(&__current_thread);199 return __libcpp_thread_get_id(&__current_thread);
200#endif
188}201}
189202
190inline _LIBCPP_HIDE_FROM_ABI int __libcpp_thread_join(__libcpp_thread_t* __t) { return pthread_join(*__t, nullptr); }203inline _LIBCPP_HIDE_FROM_ABI int __libcpp_thread_join(__libcpp_thread_t* __t) { return pthread_join(*__t, nullptr); }
lib/libcxx/include/__thread/support/windows.h+2
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23using __libcpp_timespec_t = ::timespec;24using __libcpp_timespec_t = ::timespec;
2425
...@@ -126,6 +127,7 @@ _LIBCPP_EXPORTED_FROM_ABI void* __libcpp_tls_get(__libcpp_tls_key __key);...@@ -126,6 +127,7 @@ _LIBCPP_EXPORTED_FROM_ABI void* __libcpp_tls_get(__libcpp_tls_key __key);
126127
127_LIBCPP_EXPORTED_FROM_ABI int __libcpp_tls_set(__libcpp_tls_key __key, void* __p);128_LIBCPP_EXPORTED_FROM_ABI int __libcpp_tls_set(__libcpp_tls_key __key, void* __p);
128129
130_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
129_LIBCPP_END_NAMESPACE_STD131_LIBCPP_END_NAMESPACE_STD
130132
131#endif // _LIBCPP___THREAD_SUPPORT_WINDOWS_H133#endif // _LIBCPP___THREAD_SUPPORT_WINDOWS_H
lib/libcxx/include/__thread/this_thread.h+2
...@@ -32,7 +32,9 @@ namespace this_thread {...@@ -32,7 +32,9 @@ namespace this_thread {
3232
33#if _LIBCPP_HAS_THREADS33#if _LIBCPP_HAS_THREADS
3434
35_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
35_LIBCPP_EXPORTED_FROM_ABI void sleep_for(const chrono::nanoseconds& __ns);36_LIBCPP_EXPORTED_FROM_ABI void sleep_for(const chrono::nanoseconds& __ns);
37_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
3638
37template <class _Rep, class _Period>39template <class _Rep, class _Period>
38_LIBCPP_HIDE_FROM_ABI void sleep_for(const chrono::duration<_Rep, _Period>& __d) {40_LIBCPP_HIDE_FROM_ABI void sleep_for(const chrono::duration<_Rep, _Period>& __d) {
lib/libcxx/include/__thread/thread.h+23-14
...@@ -11,12 +11,13 @@...@@ -11,12 +11,13 @@
11#define _LIBCPP___THREAD_THREAD_H11#define _LIBCPP___THREAD_THREAD_H
1212
13#include <__assert>13#include <__assert>
14#include <__charconv/to_chars_integral.h>
14#include <__condition_variable/condition_variable.h>15#include <__condition_variable/condition_variable.h>
15#include <__config>16#include <__config>
16#include <__exception/terminate.h>17#include <__exception/terminate.h>
17#include <__functional/hash.h>18#include <__functional/hash.h>
18#include <__functional/unary_function.h>19#include <__functional/unary_function.h>
19#include <__locale>20#include <__fwd/ostream.h>
20#include <__memory/addressof.h>21#include <__memory/addressof.h>
21#include <__memory/unique_ptr.h>22#include <__memory/unique_ptr.h>
22#include <__mutex/mutex.h>23#include <__mutex/mutex.h>
...@@ -27,15 +28,16 @@...@@ -27,15 +28,16 @@
27#include <__type_traits/enable_if.h>28#include <__type_traits/enable_if.h>
28#include <__type_traits/invoke.h>29#include <__type_traits/invoke.h>
29#include <__type_traits/is_constructible.h>30#include <__type_traits/is_constructible.h>
31#include <__type_traits/is_integral.h>
32#include <__type_traits/is_pointer.h>
30#include <__type_traits/is_same.h>33#include <__type_traits/is_same.h>
31#include <__type_traits/remove_cvref.h>34#include <__type_traits/remove_cvref.h>
35#include <__utility/exchange.h>
32#include <__utility/forward.h>36#include <__utility/forward.h>
37#include <cstdint>
38#include <limits>
33#include <tuple>39#include <tuple>
3440
35#if _LIBCPP_HAS_LOCALIZATION
36# include <sstream>
37#endif
38
39#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)41#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
40# pragma GCC system_header42# pragma GCC system_header
41#endif43#endif
...@@ -44,6 +46,7 @@ _LIBCPP_PUSH_MACROS...@@ -44,6 +46,7 @@ _LIBCPP_PUSH_MACROS
44#include <__undef_macros>46#include <__undef_macros>
4547
46_LIBCPP_BEGIN_NAMESPACE_STD48_LIBCPP_BEGIN_NAMESPACE_STD
49_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4750
48#if _LIBCPP_HAS_THREADS51#if _LIBCPP_HAS_THREADS
4952
...@@ -144,13 +147,19 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {...@@ -144,13 +147,19 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {
144 //147 //
145 // Since various flags in the output stream can affect how the148 // Since various flags in the output stream can affect how the
146 // thread id is represented (e.g. numpunct or showbase), we149 // thread id is represented (e.g. numpunct or showbase), we
147 // use a temporary stream instead and just output the thread150 // use `to_chars` directly and output the id as a string.
148 // id representation as a string.151
152 static_assert(is_pointer<__libcpp_thread_id>::value || is_integral<__libcpp_thread_id>::value);
153
154 using __int_type = __conditional_t<is_pointer<__libcpp_thread_id>::value, uintptr_t, __libcpp_thread_id>;
149155
150 basic_ostringstream<_CharT, _Traits> __sstr;156 static const size_t __buffer_size = numeric_limits<__int_type>::digits10 + 2;
151 __sstr.imbue(locale::classic());157 char __buffer[__buffer_size];
152 __sstr << __id.__id_;158 auto __ret =
153 return __os << __sstr.str();159 std::__to_chars_integral(__buffer, __buffer + __buffer_size - 1, reinterpret_cast<__int_type>(__id.__id_), 10);
160 _LIBCPP_ASSERT_INTERNAL(__ret.__ec == std::errc(), "to_chars failed!");
161 *__ret.__ptr = '\0';
162 return __os << __buffer;
154}163}
155# endif // _LIBCPP_HAS_LOCALIZATION164# endif // _LIBCPP_HAS_LOCALIZATION
156165
...@@ -236,13 +245,12 @@ public:...@@ -236,13 +245,12 @@ public:
236# endif245# endif
237 ~thread();246 ~thread();
238247
239 _LIBCPP_HIDE_FROM_ABI thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) { __t.__t_ = _LIBCPP_NULL_THREAD; }248 _LIBCPP_HIDE_FROM_ABI thread(thread&& __t) _NOEXCEPT : __t_(std::__exchange(__t.__t_, __libcpp_thread_t())) {}
240249
241 _LIBCPP_HIDE_FROM_ABI thread& operator=(thread&& __t) _NOEXCEPT {250 _LIBCPP_HIDE_FROM_ABI thread& operator=(thread&& __t) _NOEXCEPT {
242 if (!__libcpp_thread_isnull(&__t_))251 if (!__libcpp_thread_isnull(&__t_))
243 terminate();252 terminate();
244 __t_ = __t.__t_;253 __t_ = std::__exchange(__t.__t_, __libcpp_thread_t());
245 __t.__t_ = _LIBCPP_NULL_THREAD;
246 return *this;254 return *this;
247 }255 }
248256
...@@ -261,6 +269,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x...@@ -261,6 +269,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x
261269
262#endif // _LIBCPP_HAS_THREADS270#endif // _LIBCPP_HAS_THREADS
263271
272_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
264_LIBCPP_END_NAMESPACE_STD273_LIBCPP_END_NAMESPACE_STD
265274
266_LIBCPP_POP_MACROS275_LIBCPP_POP_MACROS
lib/libcxx/include/__tree+472-361
...@@ -113,7 +113,7 @@ __root, have a non-null __parent_ field....@@ -113,7 +113,7 @@ __root, have a non-null __parent_ field.
113// Returns: true if __x is a left child of its parent, else false113// Returns: true if __x is a left child of its parent, else false
114// Precondition: __x != nullptr.114// Precondition: __x != nullptr.
115template <class _NodePtr>115template <class _NodePtr>
116inline _LIBCPP_HIDE_FROM_ABI bool __tree_is_left_child(_NodePtr __x) _NOEXCEPT {116inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __tree_is_left_child(_NodePtr __x) _NOEXCEPT {
117 return __x == __x->__parent_->__left_;117 return __x == __x->__parent_->__left_;
118}118}
119119
...@@ -121,7 +121,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool __tree_is_left_child(_NodePtr __x) _NOEXCEPT {...@@ -121,7 +121,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool __tree_is_left_child(_NodePtr __x) _NOEXCEPT {
121// __x is a proper subtree, returns the black height (null counts as 1). If121// __x is a proper subtree, returns the black height (null counts as 1). If
122// __x is an improper subtree, returns 0.122// __x is an improper subtree, returns 0.
123template <class _NodePtr>123template <class _NodePtr>
124unsigned __tree_sub_invariant(_NodePtr __x) {124_LIBCPP_CONSTEXPR_SINCE_CXX26 unsigned __tree_sub_invariant(_NodePtr __x) {
125 if (__x == nullptr)125 if (__x == nullptr)
126 return 1;126 return 1;
127 // parent consistency checked by caller127 // parent consistency checked by caller
...@@ -153,7 +153,7 @@ unsigned __tree_sub_invariant(_NodePtr __x) {...@@ -153,7 +153,7 @@ unsigned __tree_sub_invariant(_NodePtr __x) {
153// __root == nullptr is a proper tree. Returns true if __root is a proper153// __root == nullptr is a proper tree. Returns true if __root is a proper
154// red black tree, else returns false.154// red black tree, else returns false.
155template <class _NodePtr>155template <class _NodePtr>
156_LIBCPP_HIDE_FROM_ABI bool __tree_invariant(_NodePtr __root) {156_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __tree_invariant(_NodePtr __root) {
157 if (__root == nullptr)157 if (__root == nullptr)
158 return true;158 return true;
159 // check __x->__parent_ consistency159 // check __x->__parent_ consistency
...@@ -170,7 +170,7 @@ _LIBCPP_HIDE_FROM_ABI bool __tree_invariant(_NodePtr __root) {...@@ -170,7 +170,7 @@ _LIBCPP_HIDE_FROM_ABI bool __tree_invariant(_NodePtr __root) {
170170
171// Returns: pointer to the left-most node under __x.171// Returns: pointer to the left-most node under __x.
172template <class _NodePtr>172template <class _NodePtr>
173inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_min(_NodePtr __x) _NOEXCEPT {173inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodePtr __tree_min(_NodePtr __x) _NOEXCEPT {
174 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Root node shouldn't be null");174 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Root node shouldn't be null");
175 while (__x->__left_ != nullptr)175 while (__x->__left_ != nullptr)
176 __x = __x->__left_;176 __x = __x->__left_;
...@@ -179,7 +179,7 @@ inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_min(_NodePtr __x) _NOEXCEPT {...@@ -179,7 +179,7 @@ inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_min(_NodePtr __x) _NOEXCEPT {
179179
180// Returns: pointer to the right-most node under __x.180// Returns: pointer to the right-most node under __x.
181template <class _NodePtr>181template <class _NodePtr>
182inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_max(_NodePtr __x) _NOEXCEPT {182inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodePtr __tree_max(_NodePtr __x) _NOEXCEPT {
183 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Root node shouldn't be null");183 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Root node shouldn't be null");
184 while (__x->__right_ != nullptr)184 while (__x->__right_ != nullptr)
185 __x = __x->__right_;185 __x = __x->__right_;
...@@ -188,7 +188,7 @@ inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_max(_NodePtr __x) _NOEXCEPT {...@@ -188,7 +188,7 @@ inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_max(_NodePtr __x) _NOEXCEPT {
188188
189// Returns: pointer to the next in-order node after __x.189// Returns: pointer to the next in-order node after __x.
190template <class _NodePtr>190template <class _NodePtr>
191_LIBCPP_HIDE_FROM_ABI _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT {191_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT {
192 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");192 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
193 if (__x->__right_ != nullptr)193 if (__x->__right_ != nullptr)
194 return std::__tree_min(__x->__right_);194 return std::__tree_min(__x->__right_);
...@@ -203,23 +203,23 @@ _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT {...@@ -203,23 +203,23 @@ _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT {
203// to the actual root of the tree through a __left_ pointer. Incrementing the end() pointer is UB, so we can assume that203// to the actual root of the tree through a __left_ pointer. Incrementing the end() pointer is UB, so we can assume that
204// never happens.204// never happens.
205template <class _EndNodePtr, class _NodePtr>205template <class _EndNodePtr, class _NodePtr>
206inline _LIBCPP_HIDE_FROM_ABI _EndNodePtr __tree_next_iter(_NodePtr __x) _NOEXCEPT {206inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _EndNodePtr __tree_next_iter(_NodePtr __x) _NOEXCEPT {
207 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");207 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
208 if (__x->__right_ != nullptr)208 if (__x->__right_ != nullptr)
209 return static_cast<_EndNodePtr>(std::__tree_min(__x->__right_));209 return std::__static_fancy_pointer_cast<_EndNodePtr>(std::__tree_min(__x->__right_));
210 while (!std::__tree_is_left_child(__x))210 while (!std::__tree_is_left_child(__x))
211 __x = __x->__parent_unsafe();211 __x = __x->__parent_unsafe();
212 return static_cast<_EndNodePtr>(__x->__parent_);212 return std::__static_fancy_pointer_cast<_EndNodePtr>(__x->__parent_);
213}213}
214214
215// Returns: pointer to the previous in-order node before __x.215// Returns: pointer to the previous in-order node before __x.
216// Note: __x may be the end node.216// Note: __x may be the end node.
217template <class _NodePtr, class _EndNodePtr>217template <class _NodePtr, class _EndNodePtr>
218inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_prev_iter(_EndNodePtr __x) _NOEXCEPT {218inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodePtr __tree_prev_iter(_EndNodePtr __x) _NOEXCEPT {
219 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");219 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
220 if (__x->__left_ != nullptr)220 if (__x->__left_ != nullptr)
221 return std::__tree_max(__x->__left_);221 return std::__tree_max(__x->__left_);
222 _NodePtr __xx = static_cast<_NodePtr>(__x);222 _NodePtr __xx = std::__static_fancy_pointer_cast<_NodePtr>(__x);
223 while (std::__tree_is_left_child(__xx))223 while (std::__tree_is_left_child(__xx))
224 __xx = __xx->__parent_unsafe();224 __xx = __xx->__parent_unsafe();
225 return __xx->__parent_unsafe();225 return __xx->__parent_unsafe();
...@@ -227,7 +227,7 @@ inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_prev_iter(_EndNodePtr __x) _NOEXCEP...@@ -227,7 +227,7 @@ inline _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_prev_iter(_EndNodePtr __x) _NOEXCEP
227227
228// Returns: pointer to a node which has no children228// Returns: pointer to a node which has no children
229template <class _NodePtr>229template <class _NodePtr>
230_LIBCPP_HIDE_FROM_ABI _NodePtr __tree_leaf(_NodePtr __x) _NOEXCEPT {230_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodePtr __tree_leaf(_NodePtr __x) _NOEXCEPT {
231 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");231 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
232 while (true) {232 while (true) {
233 if (__x->__left_ != nullptr) {233 if (__x->__left_ != nullptr) {
...@@ -246,7 +246,7 @@ _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_leaf(_NodePtr __x) _NOEXCEPT {...@@ -246,7 +246,7 @@ _LIBCPP_HIDE_FROM_ABI _NodePtr __tree_leaf(_NodePtr __x) _NOEXCEPT {
246// Effects: Makes __x->__right_ the subtree root with __x as its left child246// Effects: Makes __x->__right_ the subtree root with __x as its left child
247// while preserving in-order order.247// while preserving in-order order.
248template <class _NodePtr>248template <class _NodePtr>
249_LIBCPP_HIDE_FROM_ABI void __tree_left_rotate(_NodePtr __x) _NOEXCEPT {249_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree_left_rotate(_NodePtr __x) _NOEXCEPT {
250 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");250 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
251 _LIBCPP_ASSERT_INTERNAL(__x->__right_ != nullptr, "node should have a right child");251 _LIBCPP_ASSERT_INTERNAL(__x->__right_ != nullptr, "node should have a right child");
252 _NodePtr __y = __x->__right_;252 _NodePtr __y = __x->__right_;
...@@ -265,7 +265,7 @@ _LIBCPP_HIDE_FROM_ABI void __tree_left_rotate(_NodePtr __x) _NOEXCEPT {...@@ -265,7 +265,7 @@ _LIBCPP_HIDE_FROM_ABI void __tree_left_rotate(_NodePtr __x) _NOEXCEPT {
265// Effects: Makes __x->__left_ the subtree root with __x as its right child265// Effects: Makes __x->__left_ the subtree root with __x as its right child
266// while preserving in-order order.266// while preserving in-order order.
267template <class _NodePtr>267template <class _NodePtr>
268_LIBCPP_HIDE_FROM_ABI void __tree_right_rotate(_NodePtr __x) _NOEXCEPT {268_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree_right_rotate(_NodePtr __x) _NOEXCEPT {
269 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");269 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
270 _LIBCPP_ASSERT_INTERNAL(__x->__left_ != nullptr, "node should have a left child");270 _LIBCPP_ASSERT_INTERNAL(__x->__left_ != nullptr, "node should have a left child");
271 _NodePtr __y = __x->__left_;271 _NodePtr __y = __x->__left_;
...@@ -289,7 +289,8 @@ _LIBCPP_HIDE_FROM_ABI void __tree_right_rotate(_NodePtr __x) _NOEXCEPT {...@@ -289,7 +289,8 @@ _LIBCPP_HIDE_FROM_ABI void __tree_right_rotate(_NodePtr __x) _NOEXCEPT {
289// Postcondition: __tree_invariant(end_node->__left_) == true. end_node->__left_289// Postcondition: __tree_invariant(end_node->__left_) == true. end_node->__left_
290// may be different than the value passed in as __root.290// may be different than the value passed in as __root.
291template <class _NodePtr>291template <class _NodePtr>
292_LIBCPP_HIDE_FROM_ABI void __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT {292_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
293__tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT {
293 _LIBCPP_ASSERT_INTERNAL(__root != nullptr, "Root of the tree shouldn't be null");294 _LIBCPP_ASSERT_INTERNAL(__root != nullptr, "Root of the tree shouldn't be null");
294 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Can't attach null node to a leaf");295 _LIBCPP_ASSERT_INTERNAL(__x != nullptr, "Can't attach null node to a leaf");
295 __x->__is_black_ = __x == __root;296 __x->__is_black_ = __x == __root;
...@@ -345,7 +346,7 @@ _LIBCPP_HIDE_FROM_ABI void __tree_balance_after_insert(_NodePtr __root, _NodePtr...@@ -345,7 +346,7 @@ _LIBCPP_HIDE_FROM_ABI void __tree_balance_after_insert(_NodePtr __root, _NodePtr
345// nor any of its children refer to __z. end_node->__left_346// nor any of its children refer to __z. end_node->__left_
346// may be different than the value passed in as __root.347// may be different than the value passed in as __root.
347template <class _NodePtr>348template <class _NodePtr>
348_LIBCPP_HIDE_FROM_ABI void __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT {349_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT {
349 _LIBCPP_ASSERT_INTERNAL(__root != nullptr, "Root node should not be null");350 _LIBCPP_ASSERT_INTERNAL(__root != nullptr, "Root node should not be null");
350 _LIBCPP_ASSERT_INTERNAL(__z != nullptr, "The node to remove should not be null");351 _LIBCPP_ASSERT_INTERNAL(__z != nullptr, "The node to remove should not be null");
351 _LIBCPP_ASSERT_INTERNAL(std::__tree_invariant(__root), "The tree invariants should hold");352 _LIBCPP_ASSERT_INTERNAL(std::__tree_invariant(__root), "The tree invariants should hold");
...@@ -560,7 +561,7 @@ public:...@@ -560,7 +561,7 @@ public:
560 using pointer = _Pointer;561 using pointer = _Pointer;
561 pointer __left_;562 pointer __left_;
562563
563 _LIBCPP_HIDE_FROM_ABI __tree_end_node() _NOEXCEPT : __left_() {}564 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_end_node() _NOEXCEPT : __left_() {}
564};565};
565566
566template <class _VoidPtr>567template <class _VoidPtr>
...@@ -573,9 +574,13 @@ public:...@@ -573,9 +574,13 @@ public:
573 __end_node_pointer __parent_;574 __end_node_pointer __parent_;
574 bool __is_black_;575 bool __is_black_;
575576
576 _LIBCPP_HIDE_FROM_ABI pointer __parent_unsafe() const { return static_cast<pointer>(__parent_); }577 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pointer __parent_unsafe() const {
578 return std::__static_fancy_pointer_cast<pointer>(__parent_);
579 }
577580
578 _LIBCPP_HIDE_FROM_ABI void __set_parent(pointer __p) { __parent_ = static_cast<__end_node_pointer>(__p); }581 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __set_parent(pointer __p) {
582 __parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__p);
583 }
579584
580 _LIBCPP_HIDE_FROM_ABI __tree_node_base() = default;585 _LIBCPP_HIDE_FROM_ABI __tree_node_base() = default;
581 __tree_node_base(__tree_node_base const&) = delete;586 __tree_node_base(__tree_node_base const&) = delete;
...@@ -598,7 +603,7 @@ private:...@@ -598,7 +603,7 @@ private:
598 };603 };
599604
600public:605public:
601 _LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value() { return __value_; }606 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_value_type& __get_value() { return __value_; }
602#else607#else
603608
604private:609private:
...@@ -609,9 +614,10 @@ public:...@@ -609,9 +614,10 @@ public:
609#endif614#endif
610615
611 template <class _Alloc, class... _Args>616 template <class _Alloc, class... _Args>
612 _LIBCPP_HIDE_FROM_ABI explicit __tree_node(_Alloc& __na, _Args&&... __args) {617 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_node(_Alloc& __na, _Args&&... __args) {
613 allocator_traits<_Alloc>::construct(__na, std::addressof(__get_value()), std::forward<_Args>(__args)...);618 allocator_traits<_Alloc>::construct(__na, std::addressof(__get_value()), std::forward<_Args>(__args)...);
614 }619 }
620
615 ~__tree_node() = delete;621 ~__tree_node() = delete;
616 __tree_node(__tree_node const&) = delete;622 __tree_node(__tree_node const&) = delete;
617 __tree_node& operator=(__tree_node const&) = delete;623 __tree_node& operator=(__tree_node const&) = delete;
...@@ -631,14 +637,15 @@ private:...@@ -631,14 +637,15 @@ private:
631public:637public:
632 bool __value_constructed;638 bool __value_constructed;
633639
634 _LIBCPP_HIDE_FROM_ABI __tree_node_destructor(const __tree_node_destructor&) = default;640 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_node_destructor(const __tree_node_destructor&) = default;
635 __tree_node_destructor& operator=(const __tree_node_destructor&) = delete;641 __tree_node_destructor& operator=(const __tree_node_destructor&) = delete;
636642
637 _LIBCPP_HIDE_FROM_ABI explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT643 _LIBCPP_HIDE_FROM_ABI
644 _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT
638 : __na_(__na),645 : __na_(__na),
639 __value_constructed(__val) {}646 __value_constructed(__val) {}
640647
641 _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT {648 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void operator()(pointer __p) _NOEXCEPT {
642 if (__value_constructed)649 if (__value_constructed)
643 __alloc_traits::destroy(__na_, std::addressof(__p->__get_value()));650 __alloc_traits::destroy(__na_, std::addressof(__p->__get_value()));
644 if (__p)651 if (__p)
...@@ -663,7 +670,8 @@ template <class _Reference, class _Break, class _NodePtr, class _Func, class _Pr...@@ -663,7 +670,8 @@ template <class _Reference, class _Break, class _NodePtr, class _Func, class _Pr
663#ifndef _LIBCPP_COMPILER_GCC // This function is recursive, so GCC complains about always_inline.670#ifndef _LIBCPP_COMPILER_GCC // This function is recursive, so GCC complains about always_inline.
664_LIBCPP_HIDE_FROM_ABI671_LIBCPP_HIDE_FROM_ABI
665#endif672#endif
666bool __tree_iterate_from_root(_Break __break, _NodePtr __root, _Func& __func, _Proj& __proj) {673_LIBCPP_CONSTEXPR_SINCE_CXX26 bool
674__tree_iterate_from_root(_Break __break, _NodePtr __root, _Func& __func, _Proj& __proj) {
667 if (__root->__left_) {675 if (__root->__left_) {
668 if (std::__tree_iterate_from_root<_Reference>(__break, static_cast<_NodePtr>(__root->__left_), __func, __proj))676 if (std::__tree_iterate_from_root<_Reference>(__break, static_cast<_NodePtr>(__root->__left_), __func, __proj))
669 return true;677 return true;
...@@ -678,7 +686,7 @@ bool __tree_iterate_from_root(_Break __break, _NodePtr __root, _Func& __func, _P...@@ -678,7 +686,7 @@ bool __tree_iterate_from_root(_Break __break, _NodePtr __root, _Func& __func, _P
678686
679// Do an in-order traversal of the tree from __first to __last.687// Do an in-order traversal of the tree from __first to __last.
680template <class _NodeIter, class _Func, class _Proj>688template <class _NodeIter, class _Func, class _Proj>
681_LIBCPP_HIDE_FROM_ABI void689_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
682__tree_iterate_subrange(_NodeIter __first_it, _NodeIter __last_it, _Func& __func, _Proj& __proj) {690__tree_iterate_subrange(_NodeIter __first_it, _NodeIter __last_it, _Func& __func, _Proj& __proj) {
683 using _NodePtr = typename _NodeIter::__node_pointer;691 using _NodePtr = typename _NodeIter::__node_pointer;
684 using _Reference = typename _NodeIter::reference;692 using _Reference = typename _NodeIter::reference;
...@@ -722,51 +730,57 @@ public:...@@ -722,51 +730,57 @@ public:
722 using reference = value_type&;730 using reference = value_type&;
723 using pointer = __rebind_pointer_t<_NodePtr, value_type>;731 using pointer = __rebind_pointer_t<_NodePtr, value_type>;
724732
725 _LIBCPP_HIDE_FROM_ABI __tree_iterator() _NOEXCEPT : __ptr_(nullptr) {}733 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_iterator() _NOEXCEPT : __ptr_(nullptr) {}
726734
727 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__get_value(); }735 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator*() const { return __get_np()->__get_value(); }
728 _LIBCPP_HIDE_FROM_ABI pointer operator->() const {736 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pointer operator->() const {
729 return pointer_traits<pointer>::pointer_to(__get_np()->__get_value());737 return pointer_traits<pointer>::pointer_to(__get_np()->__get_value());
730 }738 }
731739
732 _LIBCPP_HIDE_FROM_ABI __tree_iterator& operator++() {740 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_iterator& operator++() {
733 __ptr_ = std::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_));741 __ptr_ = std::__tree_next_iter<__end_node_pointer>(std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr_));
734 return *this;742 return *this;
735 }743 }
736 _LIBCPP_HIDE_FROM_ABI __tree_iterator operator++(int) {744 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_iterator operator++(int) {
737 __tree_iterator __t(*this);745 __tree_iterator __t(*this);
738 ++(*this);746 ++(*this);
739 return __t;747 return __t;
740 }748 }
741749
742 _LIBCPP_HIDE_FROM_ABI __tree_iterator& operator--() {750 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_iterator& operator--() {
743 __ptr_ = static_cast<__end_node_pointer>(std::__tree_prev_iter<__node_base_pointer>(__ptr_));751 __ptr_ = std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_prev_iter<__node_base_pointer>(__ptr_));
744 return *this;752 return *this;
745 }753 }
746 _LIBCPP_HIDE_FROM_ABI __tree_iterator operator--(int) {754 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_iterator operator--(int) {
747 __tree_iterator __t(*this);755 __tree_iterator __t(*this);
748 --(*this);756 --(*this);
749 return __t;757 return __t;
750 }758 }
751759
752 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const __tree_iterator& __x, const __tree_iterator& __y) {760 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
761 operator==(const __tree_iterator& __x, const __tree_iterator& __y) {
753 return __x.__ptr_ == __y.__ptr_;762 return __x.__ptr_ == __y.__ptr_;
754 }763 }
755 friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const __tree_iterator& __x, const __tree_iterator& __y) {764 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
765 operator!=(const __tree_iterator& __x, const __tree_iterator& __y) {
756 return !(__x == __y);766 return !(__x == __y);
757 }767 }
758768
759private:769private:
760 _LIBCPP_HIDE_FROM_ABI explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}770 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_iterator(__node_pointer __p) _NOEXCEPT
761 _LIBCPP_HIDE_FROM_ABI explicit __tree_iterator(__end_node_pointer __p) _NOEXCEPT : __ptr_(__p) {}771 : __ptr_(std::__static_fancy_pointer_cast<__end_node_pointer>(__p)) {}
762 _LIBCPP_HIDE_FROM_ABI __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); }772 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_iterator(__end_node_pointer __p) _NOEXCEPT
773 : __ptr_(__p) {}
774 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __get_np() const {
775 return std::__static_fancy_pointer_cast<__node_pointer>(__ptr_);
776 }
763 template <class, class, class>777 template <class, class, class>
764 friend class __tree;778 friend class __tree;
765 template <class, class, class>779 template <class, class, class>
766 friend class __tree_const_iterator;780 friend class __tree_const_iterator;
767781
768 template <class _NodeIter, class _Func, class _Proj>782 template <class _NodeIter, class _Func, class _Proj>
769 friend void __tree_iterate_subrange(_NodeIter, _NodeIter, _Func&, _Proj&);783 _LIBCPP_CONSTEXPR_SINCE_CXX26 friend void __tree_iterate_subrange(_NodeIter, _NodeIter, _Func&, _Proj&);
770};784};
771785
772#ifndef _LIBCPP_CXX03_LANG786#ifndef _LIBCPP_CXX03_LANG
...@@ -780,7 +794,8 @@ struct __specialized_algorithm<...@@ -780,7 +794,8 @@ struct __specialized_algorithm<
780 using __iterator _LIBCPP_NODEBUG = __tree_iterator<_Tp, _NodePtr, _DiffType>;794 using __iterator _LIBCPP_NODEBUG = __tree_iterator<_Tp, _NodePtr, _DiffType>;
781795
782 template <class _Func, class _Proj>796 template <class _Func, class _Proj>
783 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Func& __func, _Proj& __proj) {797 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
798 operator()(__iterator __first, __iterator __last, _Func& __func, _Proj& __proj) {
784 std::__tree_iterate_subrange(__first, __last, __func, __proj);799 std::__tree_iterate_subrange(__first, __last, __func, __proj);
785 }800 }
786};801};
...@@ -804,54 +819,61 @@ public:...@@ -804,54 +819,61 @@ public:
804 using pointer = __rebind_pointer_t<_NodePtr, const value_type>;819 using pointer = __rebind_pointer_t<_NodePtr, const value_type>;
805 using __non_const_iterator _LIBCPP_NODEBUG = __tree_iterator<_Tp, __node_pointer, difference_type>;820 using __non_const_iterator _LIBCPP_NODEBUG = __tree_iterator<_Tp, __node_pointer, difference_type>;
806821
807 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator() _NOEXCEPT : __ptr_(nullptr) {}822 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator() _NOEXCEPT : __ptr_(nullptr) {}
808823
809 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}824 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT
825 : __ptr_(__p.__ptr_) {}
810826
811 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return __get_np()->__get_value(); }827 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator*() const { return __get_np()->__get_value(); }
812 _LIBCPP_HIDE_FROM_ABI pointer operator->() const {828 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pointer operator->() const {
813 return pointer_traits<pointer>::pointer_to(__get_np()->__get_value());829 return pointer_traits<pointer>::pointer_to(__get_np()->__get_value());
814 }830 }
815831
816 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator& operator++() {832 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator& operator++() {
817 __ptr_ = std::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_));833 __ptr_ = std::__tree_next_iter<__end_node_pointer>(std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr_));
818 return *this;834 return *this;
819 }835 }
820836
821 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator operator++(int) {837 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator operator++(int) {
822 __tree_const_iterator __t(*this);838 __tree_const_iterator __t(*this);
823 ++(*this);839 ++(*this);
824 return __t;840 return __t;
825 }841 }
826842
827 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator& operator--() {843 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator& operator--() {
828 __ptr_ = static_cast<__end_node_pointer>(std::__tree_prev_iter<__node_base_pointer>(__ptr_));844 __ptr_ = std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_prev_iter<__node_base_pointer>(__ptr_));
829 return *this;845 return *this;
830 }846 }
831847
832 _LIBCPP_HIDE_FROM_ABI __tree_const_iterator operator--(int) {848 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator operator--(int) {
833 __tree_const_iterator __t(*this);849 __tree_const_iterator __t(*this);
834 --(*this);850 --(*this);
835 return __t;851 return __t;
836 }852 }
837853
838 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const __tree_const_iterator& __x, const __tree_const_iterator& __y) {854 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
855 operator==(const __tree_const_iterator& __x, const __tree_const_iterator& __y) {
839 return __x.__ptr_ == __y.__ptr_;856 return __x.__ptr_ == __y.__ptr_;
840 }857 }
841 friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const __tree_const_iterator& __x, const __tree_const_iterator& __y) {858 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
859 operator!=(const __tree_const_iterator& __x, const __tree_const_iterator& __y) {
842 return !(__x == __y);860 return !(__x == __y);
843 }861 }
844862
845private:863private:
846 _LIBCPP_HIDE_FROM_ABI explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}864 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
847 _LIBCPP_HIDE_FROM_ABI explicit __tree_const_iterator(__end_node_pointer __p) _NOEXCEPT : __ptr_(__p) {}865 : __ptr_(std::__static_fancy_pointer_cast<__end_node_pointer>(__p)) {}
848 _LIBCPP_HIDE_FROM_ABI __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); }866 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_const_iterator(__end_node_pointer __p) _NOEXCEPT
867 : __ptr_(std::__static_fancy_pointer_cast<__end_node_pointer>(__p)) {}
868 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __get_np() const {
869 return std::__static_fancy_pointer_cast<__node_pointer>(__ptr_);
870 }
849871
850 template <class, class, class>872 template <class, class, class>
851 friend class __tree;873 friend class __tree;
852874
853 template <class _NodeIter, class _Func, class _Proj>875 template <class _NodeIter, class _Func, class _Proj>
854 friend void __tree_iterate_subrange(_NodeIter, _NodeIter, _Func&, _Proj&);876 _LIBCPP_CONSTEXPR_SINCE_CXX26 friend void __tree_iterate_subrange(_NodeIter, _NodeIter, _Func&, _Proj&);
855};877};
856878
857#ifndef _LIBCPP_CXX03_LANG879#ifndef _LIBCPP_CXX03_LANG
...@@ -865,7 +887,8 @@ struct __specialized_algorithm<...@@ -865,7 +887,8 @@ struct __specialized_algorithm<
865 using __iterator _LIBCPP_NODEBUG = __tree_const_iterator<_Tp, _NodePtr, _DiffType>;887 using __iterator _LIBCPP_NODEBUG = __tree_const_iterator<_Tp, _NodePtr, _DiffType>;
866888
867 template <class _Func, class _Proj>889 template <class _Func, class _Proj>
868 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Func& __func, _Proj& __proj) {890 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
891 operator()(__iterator __first, __iterator __last, _Func& __func, _Proj& __proj) {
869 std::__tree_iterate_subrange(__first, __last, __func, __proj);892 std::__tree_iterate_subrange(__first, __last, __func, __proj);
870 }893 }
871};894};
...@@ -927,98 +950,114 @@ private:...@@ -927,98 +950,114 @@ private:
927 _LIBCPP_COMPRESSED_PAIR(size_type, __size_, value_compare, __value_comp_);950 _LIBCPP_COMPRESSED_PAIR(size_type, __size_, value_compare, __value_comp_);
928951
929public:952public:
930 _LIBCPP_HIDE_FROM_ABI __end_node_pointer __end_node() _NOEXCEPT {953 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer __end_node() _NOEXCEPT {
931 return pointer_traits<__end_node_pointer>::pointer_to(__end_node_);954 return pointer_traits<__end_node_pointer>::pointer_to(__end_node_);
932 }955 }
933 _LIBCPP_HIDE_FROM_ABI __end_node_pointer __end_node() const _NOEXCEPT {956 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer __end_node() const _NOEXCEPT {
934 return pointer_traits<__end_node_pointer>::pointer_to(const_cast<__end_node_t&>(__end_node_));957 return pointer_traits<__end_node_pointer>::pointer_to(const_cast<__end_node_t&>(__end_node_));
935 }958 }
936 _LIBCPP_HIDE_FROM_ABI __node_allocator& __node_alloc() _NOEXCEPT { return __node_alloc_; }959 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_allocator& __node_alloc() _NOEXCEPT {
960 return __node_alloc_;
961 }
937962
938private:963private:
939 _LIBCPP_HIDE_FROM_ABI const __node_allocator& __node_alloc() const _NOEXCEPT { return __node_alloc_; }964 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const __node_allocator& __node_alloc() const _NOEXCEPT {
965 return __node_alloc_;
966 }
940967
941public:968public:
942 _LIBCPP_HIDE_FROM_ABI allocator_type __alloc() const _NOEXCEPT { return allocator_type(__node_alloc()); }969 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type __alloc() const _NOEXCEPT {
970 return allocator_type(__node_alloc());
971 }
943972
944 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }973 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT { return __size_; }
945 _LIBCPP_HIDE_FROM_ABI value_compare& value_comp() _NOEXCEPT { return __value_comp_; }974 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare& value_comp() _NOEXCEPT { return __value_comp_; }
946 _LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT { return __value_comp_; }975 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const value_compare& value_comp() const _NOEXCEPT {
976 return __value_comp_;
977 }
947978
948public:979public:
949 _LIBCPP_HIDE_FROM_ABI __node_pointer __root() const _NOEXCEPT {980 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __root() const _NOEXCEPT {
950 return static_cast<__node_pointer>(__end_node()->__left_);981 return std::__static_fancy_pointer_cast<__node_pointer>(__end_node()->__left_);
951 }982 }
952983
953 _LIBCPP_HIDE_FROM_ABI __node_base_pointer* __root_ptr() const _NOEXCEPT {984 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer* __root_ptr() const _NOEXCEPT {
954 return std::addressof(__end_node()->__left_);985 return std::addressof(__end_node()->__left_);
955 }986 }
956987
957 using iterator = __tree_iterator<_Tp, __node_pointer, difference_type>;988 using iterator = __tree_iterator<_Tp, __node_pointer, difference_type>;
958 using const_iterator = __tree_const_iterator<_Tp, __node_pointer, difference_type>;989 using const_iterator = __tree_const_iterator<_Tp, __node_pointer, difference_type>;
959990
960 _LIBCPP_HIDE_FROM_ABI explicit __tree(const value_compare& __comp) _NOEXCEPT_(991 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree(const value_compare& __comp) _NOEXCEPT_(
961 is_nothrow_default_constructible<__node_allocator>::value&& is_nothrow_copy_constructible<value_compare>::value)992 is_nothrow_default_constructible<__node_allocator>::value&& is_nothrow_copy_constructible<value_compare>::value)
962 : __size_(0), __value_comp_(__comp) {993 : __size_(0), __value_comp_(__comp) {
963 __begin_node_ = __end_node();994 __begin_node_ = __end_node();
964 }995 }
965996
966 _LIBCPP_HIDE_FROM_ABI explicit __tree(const allocator_type& __a)997 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree(const allocator_type& __a)
967 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {998 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {
968 __begin_node_ = __end_node();999 __begin_node_ = __end_node();
969 }1000 }
9701001
971 _LIBCPP_HIDE_FROM_ABI __tree(const value_compare& __comp, const allocator_type& __a)1002 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree(const value_compare& __comp, const allocator_type& __a)
972 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(__comp) {1003 : __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(__comp) {
973 __begin_node_ = __end_node();1004 __begin_node_ = __end_node();
974 }1005 }
9751006
976 _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __t);1007 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree(const __tree& __t);
9771008
978 _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __other, const allocator_type& __alloc)1009 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree(const __tree& __other, const allocator_type& __alloc)
979 : __begin_node_(__end_node()), __node_alloc_(__alloc), __size_(0), __value_comp_(__other.value_comp()) {1010 : __begin_node_(__end_node()), __node_alloc_(__alloc), __size_(0), __value_comp_(__other.value_comp()) {
980 if (__other.size() == 0)1011 if (__other.size() == 0)
981 return;1012 return;
9821013
983 *__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__other.__root()));1014 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_construct_tree(__other.__root()));
984 __root()->__parent_ = __end_node();1015 __root()->__parent_ = __end_node();
985 __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));1016 __begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
986 __size_ = __other.size();1017 __size_ = __other.size();
987 }1018 }
9881019
989 _LIBCPP_HIDE_FROM_ABI __tree& operator=(const __tree& __t);1020 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree& operator=(const __tree& __t);
990 template <class _ForwardIterator>1021 template <class _ForwardIterator>
991 _LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);1022 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
992 _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(1023 __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
1024 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree(__tree&& __t) _NOEXCEPT_(
993 is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value);1025 is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value);
994 _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a);1026 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree(__tree&& __t, const allocator_type& __a);
9951027
996 _LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t)1028 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree& operator=(__tree&& __t)
997 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&1029 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
998 ((__node_traits::propagate_on_container_move_assignment::value &&1030 ((__node_traits::propagate_on_container_move_assignment::value &&
999 is_nothrow_move_assignable<__node_allocator>::value) ||1031 is_nothrow_move_assignable<__node_allocator>::value) ||
1000 allocator_traits<__node_allocator>::is_always_equal::value)) {1032 allocator_traits<__node_allocator>::is_always_equal::value)) {
1001 __move_assign(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());1033 __move_assign(__t,
1034 integral_constant<bool,
1035 __node_traits::propagate_on_container_move_assignment::value ||
1036 __node_traits::is_always_equal::value>());
1002 return *this;1037 return *this;
1003 }1038 }
10041039
1005 _LIBCPP_HIDE_FROM_ABI ~__tree() {1040 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~__tree() {
1006 static_assert(is_copy_constructible<value_compare>::value, "Comparator must be copy-constructible.");1041 static_assert(is_copy_constructible<value_compare>::value, "Comparator must be copy-constructible.");
1007 destroy(__root());1042 destroy(__root());
1008 }1043 }
10091044
1010 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return iterator(__begin_node_); }1045 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT { return iterator(__begin_node_); }
1011 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return const_iterator(__begin_node_); }1046 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT {
1012 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(__end_node()); }1047 return const_iterator(__begin_node_);
1013 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(__end_node()); }1048 }
1049 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT { return iterator(__end_node()); }
1050 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT {
1051 return const_iterator(__end_node());
1052 }
10141053
1015 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {1054 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
1016 return std::min<size_type>(__node_traits::max_size(__node_alloc()), numeric_limits<difference_type >::max());1055 return std::min<size_type>(__node_traits::max_size(__node_alloc()), numeric_limits<difference_type >::max());
1017 }1056 }
10181057
1019 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;1058 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() _NOEXCEPT;
10201059
1021 _LIBCPP_HIDE_FROM_ABI void swap(__tree& __t)1060 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(__tree& __t)
1022#if _LIBCPP_STD_VER <= 111061#if _LIBCPP_STD_VER <= 11
1023 _NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&1062 _NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
1024 (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));1063 (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));
...@@ -1027,21 +1066,22 @@ public:...@@ -1027,21 +1066,22 @@ public:
1027#endif1066#endif
10281067
1029 template <class... _Args>1068 template <class... _Args>
1030 _LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args);1069 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __emplace_multi(_Args&&... __args);
10311070
1032 template <class... _Args>1071 template <class... _Args>
1033 _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);1072 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1073 __emplace_hint_multi(const_iterator __p, _Args&&... __args);
10341074
1035 template <class... _Args>1075 template <class... _Args>
1036 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_unique(_Args&&... __args) {1076 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> __emplace_unique(_Args&&... __args) {
1037 return std::__try_key_extraction<key_type>(1077 return std::__try_key_extraction<key_type, value_type>(
1038 [this](const key_type& __key, _Args&&... __args2) {1078 [this](const key_type& __key, _Args&&... __args2) {
1039 auto [__parent, __child] = __find_equal(__key);1079 auto [__parent, __child] = __find_equal(__key);
1040 __node_pointer __r = static_cast<__node_pointer>(__child);1080 __node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
1041 bool __inserted = false;1081 bool __inserted = false;
1042 if (__child == nullptr) {1082 if (__child == nullptr) {
1043 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);1083 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
1044 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1084 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1045 __r = __h.release();1085 __r = __h.release();
1046 __inserted = true;1086 __inserted = true;
1047 }1087 }
...@@ -1050,10 +1090,10 @@ public:...@@ -1050,10 +1090,10 @@ public:
1050 [this](_Args&&... __args2) {1090 [this](_Args&&... __args2) {
1051 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);1091 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
1052 auto [__parent, __child] = __find_equal(__h->__get_value());1092 auto [__parent, __child] = __find_equal(__h->__get_value());
1053 __node_pointer __r = static_cast<__node_pointer>(__child);1093 __node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
1054 bool __inserted = false;1094 bool __inserted = false;
1055 if (__child == nullptr) {1095 if (__child == nullptr) {
1056 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1096 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1057 __r = __h.release();1097 __r = __h.release();
1058 __inserted = true;1098 __inserted = true;
1059 }1099 }
...@@ -1063,16 +1103,17 @@ public:...@@ -1063,16 +1103,17 @@ public:
1063 }1103 }
10641104
1065 template <class... _Args>1105 template <class... _Args>
1066 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace_hint_unique(const_iterator __p, _Args&&... __args) {1106 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
1067 return std::__try_key_extraction<key_type>(1107 __emplace_hint_unique(const_iterator __p, _Args&&... __args) {
1108 return std::__try_key_extraction<key_type, value_type>(
1068 [this, __p](const key_type& __key, _Args&&... __args2) {1109 [this, __p](const key_type& __key, _Args&&... __args2) {
1069 __node_base_pointer __dummy;1110 __node_base_pointer __dummy;
1070 auto [__parent, __child] = __find_equal(__p, __dummy, __key);1111 auto [__parent, __child] = __find_equal(__p, __dummy, __key);
1071 __node_pointer __r = static_cast<__node_pointer>(__child);1112 __node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
1072 bool __inserted = false;1113 bool __inserted = false;
1073 if (__child == nullptr) {1114 if (__child == nullptr) {
1074 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);1115 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
1075 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1116 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1076 __r = __h.release();1117 __r = __h.release();
1077 __inserted = true;1118 __inserted = true;
1078 }1119 }
...@@ -1082,9 +1123,9 @@ public:...@@ -1082,9 +1123,9 @@ public:
1082 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);1123 __node_holder __h = __construct_node(std::forward<_Args>(__args2)...);
1083 __node_base_pointer __dummy;1124 __node_base_pointer __dummy;
1084 auto [__parent, __child] = __find_equal(__p, __dummy, __h->__get_value());1125 auto [__parent, __child] = __find_equal(__p, __dummy, __h->__get_value());
1085 __node_pointer __r = static_cast<__node_pointer>(__child);1126 __node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
1086 if (__child == nullptr) {1127 if (__child == nullptr) {
1087 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));1128 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1088 __r = __h.release();1129 __r = __h.release();
1089 }1130 }
1090 return pair<iterator, bool>(iterator(__r), __child == nullptr);1131 return pair<iterator, bool>(iterator(__r), __child == nullptr);
...@@ -1093,77 +1134,83 @@ public:...@@ -1093,77 +1134,83 @@ public:
1093 }1134 }
10941135
1095 template <class _InIter, class _Sent>1136 template <class _InIter, class _Sent>
1096 _LIBCPP_HIDE_FROM_ABI void __insert_range_multi(_InIter __first, _Sent __last) {1137 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __insert_range_multi(_InIter __first, _Sent __last) {
1097 if (__first == __last)1138 if (__first == __last)
1098 return;1139 return;
10991140
1100 if (__root() == nullptr) { // Make sure we always have a root node1141 if (__root() == nullptr) { // Make sure we always have a root node
1101 __insert_node_at(1142 __insert_node_at(__end_node(),
1102 __end_node(), __end_node()->__left_, static_cast<__node_base_pointer>(__construct_node(*__first).release()));1143 __end_node()->__left_,
1144 std::__static_fancy_pointer_cast<__node_base_pointer>(__construct_node(*__first).release()));
1103 ++__first;1145 ++__first;
1104 }1146 }
11051147
1106 auto __max_node = static_cast<__node_pointer>(std::__tree_max(static_cast<__node_base_pointer>(__root())));1148 auto __max_node = std::__static_fancy_pointer_cast<__node_pointer>(
1149 std::__tree_max(std::__static_fancy_pointer_cast<__node_base_pointer>(__root())));
11071150
1108 for (; __first != __last; ++__first) {1151 for (; __first != __last; ++__first) {
1109 __node_holder __nd = __construct_node(*__first);1152 __node_holder __nd = __construct_node(*__first);
1110 // Always check the max node first. This optimizes for sorted ranges inserted at the end.1153 // Always check the max node first. This optimizes for sorted ranges inserted at the end.
1111 if (!value_comp()(__nd->__get_value(), __max_node->__get_value())) { // __node >= __max_val1154 if (!value_comp()(__nd->__get_value(), __max_node->__get_value())) { // __node >= __max_val
1112 __insert_node_at(static_cast<__end_node_pointer>(__max_node),1155 __insert_node_at(std::__static_fancy_pointer_cast<__end_node_pointer>(__max_node),
1113 __max_node->__right_,1156 __max_node->__right_,
1114 static_cast<__node_base_pointer>(__nd.get()));1157 std::__static_fancy_pointer_cast<__node_base_pointer>(__nd.get()));
1115 __max_node = __nd.release();1158 __max_node = __nd.release();
1116 } else {1159 } else {
1117 __end_node_pointer __parent;1160 __end_node_pointer __parent;
1118 __node_base_pointer& __child = __find_leaf_high(__parent, __nd->__get_value());1161 __node_base_pointer& __child = __find_leaf_high(__parent, __nd->__get_value());
1119 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));1162 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__nd.release()));
1120 }1163 }
1121 }1164 }
1122 }1165 }
11231166
1124 template <class _InIter, class _Sent>1167 template <class _InIter, class _Sent>
1125 _LIBCPP_HIDE_FROM_ABI void __insert_range_unique(_InIter __first, _Sent __last) {1168 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __insert_range_unique(_InIter __first, _Sent __last) {
1126 if (__first == __last)1169 if (__first == __last)
1127 return;1170 return;
11281171
1129 if (__root() == nullptr) {1172 if (__root() == nullptr) {
1130 __insert_node_at(1173 __insert_node_at(__end_node(),
1131 __end_node(), __end_node()->__left_, static_cast<__node_base_pointer>(__construct_node(*__first).release()));1174 __end_node()->__left_,
1175 std::__static_fancy_pointer_cast<__node_base_pointer>(__construct_node(*__first).release()));
1132 ++__first;1176 ++__first;
1133 }1177 }
11341178
1135 auto __max_node = static_cast<__node_pointer>(std::__tree_max(static_cast<__node_base_pointer>(__root())));1179 auto __max_node = std::__static_fancy_pointer_cast<__node_pointer>(
1180 std::__tree_max(std::__static_fancy_pointer_cast<__node_base_pointer>(__root())));
11361181
1137 using __reference = decltype(*__first);1182 using __reference = decltype(*__first);
11381183
1139 for (; __first != __last; ++__first) {1184 for (; __first != __last; ++__first) {
1140 std::__try_key_extraction<key_type>(1185 std::__try_key_extraction<key_type, value_type>(
1141 [this, &__max_node](const key_type& __key, __reference&& __val) {1186 [this, &__max_node](const key_type& __key, __reference&& __val) {
1142 if (value_comp()(__max_node->__get_value(), __key)) { // __key > __max_node1187 if (value_comp()(__max_node->__get_value(), __key)) { // __key > __max_node
1143 __node_holder __nd = __construct_node(std::forward<__reference>(__val));1188 __node_holder __nd = __construct_node(std::forward<__reference>(__val));
1144 __insert_node_at(static_cast<__end_node_pointer>(__max_node),1189 __insert_node_at(std::__static_fancy_pointer_cast<__end_node_pointer>(__max_node),
1145 __max_node->__right_,1190 __max_node->__right_,
1146 static_cast<__node_base_pointer>(__nd.get()));1191 std::__static_fancy_pointer_cast<__node_base_pointer>(__nd.get()));
1147 __max_node = __nd.release();1192 __max_node = __nd.release();
1148 } else {1193 } else {
1149 auto [__parent, __child] = __find_equal(__key);1194 auto [__parent, __child] = __find_equal(__key);
1150 if (__child == nullptr) {1195 if (__child == nullptr) {
1151 __node_holder __nd = __construct_node(std::forward<__reference>(__val));1196 __node_holder __nd = __construct_node(std::forward<__reference>(__val));
1152 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));1197 __insert_node_at(
1198 __parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__nd.release()));
1153 }1199 }
1154 }1200 }
1155 },1201 },
1156 [this, &__max_node](__reference&& __val) {1202 [this, &__max_node](__reference&& __val) {
1157 __node_holder __nd = __construct_node(std::forward<__reference>(__val));1203 __node_holder __nd = __construct_node(std::forward<__reference>(__val));
1158 if (value_comp()(__max_node->__get_value(), __nd->__get_value())) { // __node > __max_node1204 if (value_comp()(__max_node->__get_value(), __nd->__get_value())) { // __node > __max_node
1159 __insert_node_at(static_cast<__end_node_pointer>(__max_node),1205 __insert_node_at(std::__static_fancy_pointer_cast<__end_node_pointer>(__max_node),
1160 __max_node->__right_,1206 __max_node->__right_,
1161 static_cast<__node_base_pointer>(__nd.get()));1207 std::__static_fancy_pointer_cast<__node_base_pointer>(__nd.get()));
1162 __max_node = __nd.release();1208 __max_node = __nd.release();
1163 } else {1209 } else {
1164 auto [__parent, __child] = __find_equal(__nd->__get_value());1210 auto [__parent, __child] = __find_equal(__nd->__get_value());
1165 if (__child == nullptr) {1211 if (__child == nullptr) {
1166 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));1212 __insert_node_at(
1213 __parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__nd.release()));
1167 }1214 }
1168 }1215 }
1169 },1216 },
...@@ -1171,62 +1218,67 @@ public:...@@ -1171,62 +1218,67 @@ public:
1171 }1218 }
1172 }1219 }
11731220
1174 _LIBCPP_HIDE_FROM_ABI iterator __remove_node_pointer(__node_pointer) _NOEXCEPT;1221 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __remove_node_pointer(__node_pointer) _NOEXCEPT;
11751222
1176#if _LIBCPP_STD_VER >= 171223#if _LIBCPP_STD_VER >= 17
1177 template <class _NodeHandle, class _InsertReturnType>1224 template <class _NodeHandle, class _InsertReturnType>
1178 _LIBCPP_HIDE_FROM_ABI _InsertReturnType __node_handle_insert_unique(_NodeHandle&&);1225 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _InsertReturnType __node_handle_insert_unique(_NodeHandle&&);
1179 template <class _NodeHandle>1226 template <class _NodeHandle>
1180 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_unique(const_iterator, _NodeHandle&&);1227 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1228 __node_handle_insert_unique(const_iterator, _NodeHandle&&);
1181 template <class _Comp2>1229 template <class _Comp2>
1182 _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_unique(__tree<_Tp, _Comp2, _Allocator>& __source);1230 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1231 __node_handle_merge_unique(__tree<_Tp, _Comp2, _Allocator>& __source);
11831232
1184 template <class _NodeHandle>1233 template <class _NodeHandle>
1185 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(_NodeHandle&&);1234 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __node_handle_insert_multi(_NodeHandle&&);
1186 template <class _NodeHandle>1235 template <class _NodeHandle>
1187 _LIBCPP_HIDE_FROM_ABI iterator __node_handle_insert_multi(const_iterator, _NodeHandle&&);1236 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1237 __node_handle_insert_multi(const_iterator, _NodeHandle&&);
1188 template <class _Comp2>1238 template <class _Comp2>
1189 _LIBCPP_HIDE_FROM_ABI void __node_handle_merge_multi(__tree<_Tp, _Comp2, _Allocator>& __source);1239 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1240 __node_handle_merge_multi(__tree<_Tp, _Comp2, _Allocator>& __source);
11901241
1191 template <class _NodeHandle>1242 template <class _NodeHandle>
1192 _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(key_type const&);1243 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodeHandle __node_handle_extract(key_type const&);
1193 template <class _NodeHandle>1244 template <class _NodeHandle>
1194 _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(const_iterator);1245 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodeHandle __node_handle_extract(const_iterator);
1195#endif1246#endif
11961247
1197 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);1248 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __p);
1198 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);1249 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __f, const_iterator __l);
1199 template <class _Key>1250 template <class _Key>
1200 _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);1251 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __erase_unique(const _Key& __k);
1201 template <class _Key>1252 template <class _Key>
1202 _LIBCPP_HIDE_FROM_ABI size_type __erase_multi(const _Key& __k);1253 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __erase_multi(const _Key& __k);
12031254
1204 _LIBCPP_HIDE_FROM_ABI void1255 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1205 __insert_node_at(__end_node_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT;1256 __insert_node_at(__end_node_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT;
12061257
1207 template <class _Key>1258 template <class _Key>
1208 _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __key) {1259 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Key& __key) {
1209 auto [__, __match] = __find_equal(__key);1260 auto [__dummy, __match] = __find_equal(__key);
1210 if (__match == nullptr)1261 if (__match == nullptr)
1211 return end();1262 return end();
1212 return iterator(static_cast<__node_pointer>(__match));1263 return iterator(std::__static_fancy_pointer_cast<__node_pointer>(__match));
1213 }1264 }
12141265
1215 template <class _Key>1266 template <class _Key>
1216 _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __key) const {1267 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Key& __key) const {
1217 auto [__, __match] = __find_equal(__key);1268 auto [__dummy, __match] = __find_equal(__key);
1218 if (__match == nullptr)1269 if (__match == nullptr)
1219 return end();1270 return end();
1220 return const_iterator(static_cast<__node_pointer>(__match));1271 return const_iterator(std::__static_fancy_pointer_cast<__node_pointer>(__match));
1221 }1272 }
12221273
1223 template <class _Key>1274 template <class _Key>
1224 _LIBCPP_HIDE_FROM_ABI size_type __count_unique(const _Key& __k) const;1275 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __count_unique(const _Key& __k) const;
1225 template <class _Key>1276 template <class _Key>
1226 _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const;1277 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __count_multi(const _Key& __k) const;
12271278
1228 template <bool _LowerBound, class _Key>1279 template <bool _LowerBound, class _Key>
1229 _LIBCPP_HIDE_FROM_ABI __end_node_pointer __lower_upper_bound_unique_impl(const _Key& __v) const {1280 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer
1281 __lower_upper_bound_unique_impl(const _Key& __v) const {
1230 auto __rt = __root();1282 auto __rt = __root();
1231 auto __result = __end_node();1283 auto __result = __end_node();
1232 auto __comp = __lazy_synth_three_way_comparator<_Compare, _Key, value_type>(value_comp());1284 auto __comp = __lazy_synth_three_way_comparator<_Compare, _Key, value_type>(value_comp());
...@@ -1234,14 +1286,15 @@ public:...@@ -1234,14 +1286,15 @@ public:
1234 auto __comp_res = __comp(__v, __rt->__get_value());1286 auto __comp_res = __comp(__v, __rt->__get_value());
12351287
1236 if (__comp_res.__less()) {1288 if (__comp_res.__less()) {
1237 __result = static_cast<__end_node_pointer>(__rt);1289 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
1238 __rt = static_cast<__node_pointer>(__rt->__left_);1290 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
1239 } else if (__comp_res.__greater()) {1291 } else if (__comp_res.__greater()) {
1240 __rt = static_cast<__node_pointer>(__rt->__right_);1292 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
1241 } else if _LIBCPP_CONSTEXPR (_LowerBound) {1293 } else if _LIBCPP_CONSTEXPR (_LowerBound) {
1242 return static_cast<__end_node_pointer>(__rt);1294 return std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
1243 } else {1295 } else {
1244 return __rt->__right_ ? static_cast<__end_node_pointer>(std::__tree_min(__rt->__right_)) : __result;1296 return __rt->__right_ ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__rt->__right_))
1297 : __result;
1245 }1298 }
1246 }1299 }
1247 return __result;1300 return __result;
...@@ -1282,7 +1335,7 @@ public:...@@ -1282,7 +1335,7 @@ public:
1282#endif // _LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND1335#endif // _LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND
12831336
1284 template <class _Key>1337 template <class _Key>
1285 _LIBCPP_HIDE_FROM_ABI iterator __lower_bound_unique(const _Key& __v) {1338 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __lower_bound_unique(const _Key& __v) {
1286#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)1339#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1287 return iterator(__lower_bound_unique_compat_impl(__v));1340 return iterator(__lower_bound_unique_compat_impl(__v));
1288#else1341#else
...@@ -1291,7 +1344,7 @@ public:...@@ -1291,7 +1344,7 @@ public:
1291 }1344 }
12921345
1293 template <class _Key>1346 template <class _Key>
1294 _LIBCPP_HIDE_FROM_ABI const_iterator __lower_bound_unique(const _Key& __v) const {1347 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator __lower_bound_unique(const _Key& __v) const {
1295#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)1348#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1296 return const_iterator(__lower_bound_unique_compat_impl(__v));1349 return const_iterator(__lower_bound_unique_compat_impl(__v));
1297#else1350#else
...@@ -1300,7 +1353,7 @@ public:...@@ -1300,7 +1353,7 @@ public:
1300 }1353 }
13011354
1302 template <class _Key>1355 template <class _Key>
1303 _LIBCPP_HIDE_FROM_ABI iterator __upper_bound_unique(const _Key& __v) {1356 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __upper_bound_unique(const _Key& __v) {
1304#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)1357#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1305 return iterator(__upper_bound_unique_compat_impl(__v));1358 return iterator(__upper_bound_unique_compat_impl(__v));
1306#else1359#else
...@@ -1309,7 +1362,7 @@ public:...@@ -1309,7 +1362,7 @@ public:
1309 }1362 }
13101363
1311 template <class _Key>1364 template <class _Key>
1312 _LIBCPP_HIDE_FROM_ABI const_iterator __upper_bound_unique(const _Key& __v) const {1365 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator __upper_bound_unique(const _Key& __v) const {
1313#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)1366#if defined(_LIBCPP_ENABLE_LEGACY_TREE_LOWER_UPPER_BOUND)
1314 return iterator(__upper_bound_unique_compat_impl(__v));1367 return iterator(__upper_bound_unique_compat_impl(__v));
1315#else1368#else
...@@ -1319,117 +1372,138 @@ public:...@@ -1319,117 +1372,138 @@ public:
13191372
1320private:1373private:
1321 template <class _Key>1374 template <class _Key>
1322 _LIBCPP_HIDE_FROM_ABI iterator1375 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1323 __lower_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result);1376 __lower_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result);
13241377
1325 template <class _Key>1378 template <class _Key>
1326 _LIBCPP_HIDE_FROM_ABI const_iterator1379 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1327 __lower_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;1380 __lower_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;
13281381
1329public:1382public:
1330 template <class _Key>1383 template <class _Key>
1331 _LIBCPP_HIDE_FROM_ABI iterator __lower_bound_multi(const _Key& __v) {1384 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __lower_bound_multi(const _Key& __v) {
1332 return __lower_bound_multi(__v, __root(), __end_node());1385 return __lower_bound_multi(__v, __root(), __end_node());
1333 }1386 }
1334 template <class _Key>1387 template <class _Key>
1335 _LIBCPP_HIDE_FROM_ABI const_iterator __lower_bound_multi(const _Key& __v) const {1388 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator __lower_bound_multi(const _Key& __v) const {
1336 return __lower_bound_multi(__v, __root(), __end_node());1389 return __lower_bound_multi(__v, __root(), __end_node());
1337 }1390 }
13381391
1339 template <class _Key>1392 template <class _Key>
1340 _LIBCPP_HIDE_FROM_ABI iterator __upper_bound_multi(const _Key& __v) {1393 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __upper_bound_multi(const _Key& __v) {
1341 return __upper_bound_multi(__v, __root(), __end_node());1394 return __upper_bound_multi(__v, __root(), __end_node());
1342 }1395 }
13431396
1344 template <class _Key>1397 template <class _Key>
1345 _LIBCPP_HIDE_FROM_ABI const_iterator __upper_bound_multi(const _Key& __v) const {1398 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator __upper_bound_multi(const _Key& __v) const {
1346 return __upper_bound_multi(__v, __root(), __end_node());1399 return __upper_bound_multi(__v, __root(), __end_node());
1347 }1400 }
13481401
1349private:1402private:
1350 template <class _Key>1403 template <class _Key>
1351 _LIBCPP_HIDE_FROM_ABI iterator1404 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1352 __upper_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result);1405 __upper_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result);
13531406
1354 template <class _Key>1407 template <class _Key>
1355 _LIBCPP_HIDE_FROM_ABI const_iterator1408 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1356 __upper_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;1409 __upper_bound_multi(const _Key& __v, __node_pointer __root, __end_node_pointer __result) const;
13571410
1358public:1411public:
1359 template <class _Key>1412 template <class _Key>
1360 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> __equal_range_unique(const _Key& __k);1413 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> __equal_range_unique(const _Key& __k);
1361 template <class _Key>1414 template <class _Key>
1362 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> __equal_range_unique(const _Key& __k) const;1415 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
1416 __equal_range_unique(const _Key& __k) const;
13631417
1364 template <class _Key>1418 template <class _Key>
1365 _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> __equal_range_multi(const _Key& __k);1419 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> __equal_range_multi(const _Key& __k);
1366 template <class _Key>1420 template <class _Key>
1367 _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> __equal_range_multi(const _Key& __k) const;1421 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
1422 __equal_range_multi(const _Key& __k) const;
13681423
1369 using _Dp _LIBCPP_NODEBUG = __tree_node_destructor<__node_allocator>;1424 using _Dp _LIBCPP_NODEBUG = __tree_node_destructor<__node_allocator>;
1370 using __node_holder _LIBCPP_NODEBUG = unique_ptr<__node, _Dp>;1425 using __node_holder _LIBCPP_NODEBUG = unique_ptr<__node, _Dp>;
13711426
1372 _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT;1427 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_holder remove(const_iterator __p) _NOEXCEPT;
13731428
1374 // FIXME: Make this function const qualified. Unfortunately doing so1429 // FIXME: Make this function const qualified. Unfortunately doing so
1375 // breaks existing code which uses non-const callable comparators.1430 // breaks existing code which uses non-const callable comparators.
1376 template <class _Key>1431 template <class _Key>
1377 _LIBCPP_HIDE_FROM_ABI pair<__end_node_pointer, __node_base_pointer&> __find_equal(const _Key& __v);1432 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<__end_node_pointer, __node_base_pointer&>
1433 __find_equal(const _Key& __v);
13781434
1379 template <class _Key>1435 template <class _Key>
1380 _LIBCPP_HIDE_FROM_ABI pair<__end_node_pointer, __node_base_pointer&> __find_equal(const _Key& __v) const {1436 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<__end_node_pointer, __node_base_pointer&>
1437 __find_equal(const _Key& __v) const {
1381 return const_cast<__tree*>(this)->__find_equal(__v);1438 return const_cast<__tree*>(this)->__find_equal(__v);
1382 }1439 }
13831440
1384 template <class _Key>1441 template <class _Key>
1385 _LIBCPP_HIDE_FROM_ABI pair<__end_node_pointer, __node_base_pointer&>1442 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<__end_node_pointer, __node_base_pointer&>
1386 __find_equal(const_iterator __hint, __node_base_pointer& __dummy, const _Key& __v);1443 __find_equal(const_iterator __hint, __node_base_pointer& __dummy, const _Key& __v);
13871444
1388 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __tree& __t) {1445 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const __tree& __t) {
1389 __copy_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_copy_assignment::value>());1446 __copy_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_copy_assignment::value>());
1390 }1447 }
13911448
1392 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __tree& __t, true_type) {1449 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const __tree& __t, true_type) {
1393 if (__node_alloc() != __t.__node_alloc())1450 if (__node_alloc() != __t.__node_alloc())
1394 clear();1451 clear();
1395 __node_alloc() = __t.__node_alloc();1452 __node_alloc() = __t.__node_alloc();
1396 }1453 }
1397 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __tree&, false_type) {}1454 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const __tree&, false_type) {}
13981455
1399private:1456private:
1400 _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_leaf_low(__end_node_pointer& __parent, const value_type& __v);1457 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer&
1458 __find_leaf_low(__end_node_pointer& __parent, const value_type& __v);
14011459
1402 _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_leaf_high(__end_node_pointer& __parent, const value_type& __v);1460 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer&
1461 __find_leaf_high(__end_node_pointer& __parent, const value_type& __v);
14031462
1404 _LIBCPP_HIDE_FROM_ABI __node_base_pointer&1463 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer&
1405 __find_leaf(const_iterator __hint, __end_node_pointer& __parent, const value_type& __v);1464 __find_leaf(const_iterator __hint, __end_node_pointer& __parent, const value_type& __v);
14061465
1407 template <class... _Args>1466 template <class... _Args>
1408 _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&&... __args);1467 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_holder __construct_node(_Args&&... __args);
14091468
1410 // TODO: Make this _LIBCPP_HIDE_FROM_ABI1469 // TODO: Make this _LIBCPP_HIDE_FROM_ABI
1411 _LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT { (__tree_deleter(__node_alloc_))(__nd); }1470 _LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_SINCE_CXX26 void destroy(__node_pointer __nd) _NOEXCEPT {
1471 (__tree_deleter(__node_alloc_))(__nd);
1472 }
14121473
1413 _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);1474 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign(__tree& __t, false_type);
1414 _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(1475 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign(__tree& __t, true_type) _NOEXCEPT_(
1415 is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value);1476 is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value);
14161477
1417 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t)1478 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(__tree& __t)
1418 _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||1479 _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
1419 is_nothrow_move_assignable<__node_allocator>::value) {1480 is_nothrow_move_assignable<__node_allocator>::value) {
1420 __move_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());1481 __move_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
1421 }1482 }
14221483
1423 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t, true_type)1484 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(__tree& __t, true_type)
1424 _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) {1485 _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) {
1425 __node_alloc() = std::move(__t.__node_alloc());1486 __node_alloc() = std::move(__t.__node_alloc());
1426 }1487 }
1427 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}1488 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
14281489
1429 template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>1490 template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>
1430 _LIBCPP_HIDE_FROM_ABI static void __assign_value(__get_node_value_type_t<value_type>& __lhs, _From&& __rhs) {1491 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
1492 __assign_value(__get_node_value_type_t<value_type>& __lhs, _From&& __rhs) {
1431 using __key_type = __remove_const_t<typename value_type::first_type>;1493 using __key_type = __remove_const_t<typename value_type::first_type>;
14321494
1495#if _LIBCPP_STD_VER >= 26
1496 if constexpr (std::is_copy_constructible_v<decltype(__rhs.first)>) {
1497 // We need to replace the `const key_type` subobject by reconstruction during constant evaluation to avoid
1498 // undefined behavior. Currently, there is no constexpr-friend way to replacing a move-only key subobject.
1499 if consteval {
1500 std::destroy_at(std::addressof(__lhs));
1501 std::construct_at(std::addressof(__lhs), __rhs.first, std::forward<_From>(__rhs).second);
1502 return;
1503 }
1504 }
1505#endif
1506
1433 // This is technically UB, since the object was constructed as `const`.1507 // This is technically UB, since the object was constructed as `const`.
1434 // Clang doesn't optimize on this currently though.1508 // Clang doesn't optimize on this currently though.
1435 const_cast<__key_type&>(__lhs.first) = const_cast<__copy_cvref_t<_From, __key_type>&&>(__rhs.first);1509 const_cast<__key_type&>(__lhs.first) = const_cast<__copy_cvref_t<_From, __key_type>&&>(__rhs.first);
...@@ -1437,7 +1511,7 @@ private:...@@ -1437,7 +1511,7 @@ private:
1437 }1511 }
14381512
1439 template <class _To, class _From, class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type_v<_ValueT>, int> = 0>1513 template <class _To, class _From, class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type_v<_ValueT>, int> = 0>
1440 _LIBCPP_HIDE_FROM_ABI static void __assign_value(_To& __lhs, _From&& __rhs) {1514 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void __assign_value(_To& __lhs, _From&& __rhs) {
1441 __lhs = std::forward<_From>(__rhs);1515 __lhs = std::forward<_From>(__rhs);
1442 }1516 }
14431517
...@@ -1447,24 +1521,23 @@ private:...@@ -1447,24 +1521,23 @@ private:
1447 public:1521 public:
1448 using pointer = __node_pointer;1522 using pointer = __node_pointer;
14491523
1450 _LIBCPP_HIDE_FROM_ABI __tree_deleter(__node_allocator& __alloc) : __alloc_(__alloc) {}1524 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_deleter(__node_allocator& __alloc) : __alloc_(__alloc) {}
14511525
1452#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function1526#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1453 _LIBCPP_HIDE_FROM_ABI1527 _LIBCPP_HIDE_FROM_ABI
1454#endif1528#endif
1455 void1529 _LIBCPP_CONSTEXPR_SINCE_CXX26 void operator()(__node_pointer __ptr) {
1456 operator()(__node_pointer __ptr) {
1457 if (!__ptr)1530 if (!__ptr)
1458 return;1531 return;
14591532
1460 (*this)(static_cast<__node_pointer>(__ptr->__left_));1533 (*this)(std::__static_fancy_pointer_cast<__node_pointer>(__ptr->__left_));
14611534
1462 auto __right = __ptr->__right_;1535 auto __right = __ptr->__right_;
14631536
1464 __node_traits::destroy(__alloc_, std::addressof(__ptr->__get_value()));1537 __node_traits::destroy(__alloc_, std::addressof(__ptr->__get_value()));
1465 __node_traits::deallocate(__alloc_, __ptr, 1);1538 __node_traits::deallocate(__alloc_, __ptr, 1);
14661539
1467 (*this)(static_cast<__node_pointer>(__right));1540 (*this)(std::__static_fancy_pointer_cast<__node_pointer>(__right));
1468 }1541 }
1469 };1542 };
14701543
...@@ -1476,41 +1549,54 @@ private:...@@ -1476,41 +1549,54 @@ private:
1476#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function1549#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1477 _LIBCPP_HIDE_FROM_ABI1550 _LIBCPP_HIDE_FROM_ABI
1478#endif1551#endif
1479 __node_pointer __construct_from_tree(__node_pointer __src, _NodeConstructor __construct) {1552 _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer
1553 __construct_from_tree(__node_pointer __src, _NodeConstructor __construct) {
1480 if (!__src)1554 if (!__src)
1481 return nullptr;1555 return nullptr;
14821556
1483 __node_holder __new_node = __construct(__src->__get_value());1557 __node_holder __new_node = __construct(__src->__get_value());
14841558
1485 unique_ptr<__node, __tree_deleter> __left(1559 unique_ptr<__node, __tree_deleter> __left(
1486 __construct_from_tree(static_cast<__node_pointer>(__src->__left_), __construct), __node_alloc_);1560 __construct_from_tree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__left_), __construct),
1487 __node_pointer __right = __construct_from_tree(static_cast<__node_pointer>(__src->__right_), __construct);1561 __node_alloc_);
1562 __node_pointer __right =
1563 __construct_from_tree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__right_), __construct);
14881564
1489 __node_pointer __new_node_ptr = __new_node.release();1565 __node_pointer __new_node_ptr = __new_node.release();
14901566
1491 __new_node_ptr->__is_black_ = __src->__is_black_;1567 __new_node_ptr->__is_black_ = __src->__is_black_;
1492 __new_node_ptr->__left_ = static_cast<__node_base_pointer>(__left.release());1568 __new_node_ptr->__left_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__left.release());
1493 __new_node_ptr->__right_ = static_cast<__node_base_pointer>(__right);1569 __new_node_ptr->__right_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__right);
1494 if (__new_node_ptr->__left_)1570 if (__new_node_ptr->__left_)
1495 __new_node_ptr->__left_->__parent_ = static_cast<__end_node_pointer>(__new_node_ptr);1571 __new_node_ptr->__left_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__new_node_ptr);
1496 if (__new_node_ptr->__right_)1572 if (__new_node_ptr->__right_)
1497 __new_node_ptr->__right_->__parent_ = static_cast<__end_node_pointer>(__new_node_ptr);1573 __new_node_ptr->__right_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__new_node_ptr);
1498 return __new_node_ptr;1574 return __new_node_ptr;
1499 }1575 }
15001576
1501 _LIBCPP_HIDE_FROM_ABI __node_pointer __copy_construct_tree(__node_pointer __src) {1577 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __copy_construct_tree(__node_pointer __src) {
1502 return __construct_from_tree(__src, [this](const value_type& __val) { return __construct_node(__val); });1578 return __construct_from_tree(__src, [this](const value_type& __val) { return __construct_node(__val); });
1503 }1579 }
15041580
1505 template <class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>1581 template <class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>
1506 _LIBCPP_HIDE_FROM_ABI __node_pointer __move_construct_tree(__node_pointer __src) {1582 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __move_construct_tree(__node_pointer __src) {
1507 return __construct_from_tree(__src, [this](value_type& __val) {1583 return __construct_from_tree(__src, [this](value_type& __val) {
1584
1585#if _LIBCPP_STD_VER >= 26
1586 // We need to replace the `const key_type` subobject by reconstruction during constant evaluation to avoid
1587 // undefined behavior. Currently, there is no constexpr-friend way to replacing a move-only key subobject.
1588 if constexpr (std::is_copy_constructible_v<decltype(__val.first)>) {
1589 if consteval {
1590 return __construct_node(__val.first, std::move(__val.second));
1591 }
1592 }
1593#endif
1508 return __construct_node(const_cast<key_type&&>(__val.first), std::move(__val.second));1594 return __construct_node(const_cast<key_type&&>(__val.first), std::move(__val.second));
1509 });1595 });
1510 }1596 }
15111597
1512 template <class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type_v<_ValueT>, int> = 0>1598 template <class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type_v<_ValueT>, int> = 0>
1513 _LIBCPP_HIDE_FROM_ABI __node_pointer __move_construct_tree(__node_pointer __src) {1599 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __move_construct_tree(__node_pointer __src) {
1514 return __construct_from_tree(__src, [this](value_type& __val) { return __construct_node(std::move(__val)); });1600 return __construct_from_tree(__src, [this](value_type& __val) { return __construct_node(std::move(__val)); });
1515 }1601 }
15161602
...@@ -1521,7 +1607,7 @@ private:...@@ -1521,7 +1607,7 @@ private:
1521#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function1607#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1522 _LIBCPP_HIDE_FROM_ABI1608 _LIBCPP_HIDE_FROM_ABI
1523#endif1609#endif
1524 __node_pointer __assign_from_tree(1610 _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __assign_from_tree(
1525 __node_pointer __dest, __node_pointer __src, _Assignment __assign, _ConstructionAlg __construct_subtree) {1611 __node_pointer __dest, __node_pointer __src, _Assignment __assign, _ConstructionAlg __construct_subtree) {
1526 if (!__src) {1612 if (!__src) {
1527 destroy(__dest);1613 destroy(__dest);
...@@ -1533,36 +1619,37 @@ private:...@@ -1533,36 +1619,37 @@ private:
15331619
1534 // If we already have a left node in the destination tree, reuse it and copy-assign recursively1620 // If we already have a left node in the destination tree, reuse it and copy-assign recursively
1535 if (__dest->__left_) {1621 if (__dest->__left_) {
1536 __dest->__left_ = static_cast<__node_base_pointer>(__assign_from_tree(1622 __dest->__left_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__assign_from_tree(
1537 static_cast<__node_pointer>(__dest->__left_),1623 std::__static_fancy_pointer_cast<__node_pointer>(__dest->__left_),
1538 static_cast<__node_pointer>(__src->__left_),1624 std::__static_fancy_pointer_cast<__node_pointer>(__src->__left_),
1539 __assign,1625 __assign,
1540 __construct_subtree));1626 __construct_subtree));
15411627
1542 // Otherwise, we must create new nodes; copy-construct from here on1628 // Otherwise, we must create new nodes; copy-construct from here on
1543 } else if (__src->__left_) {1629 } else if (__src->__left_) {
1544 auto __new_left = __construct_subtree(static_cast<__node_pointer>(__src->__left_));1630 auto __new_left = __construct_subtree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__left_));
1545 __dest->__left_ = static_cast<__node_base_pointer>(__new_left);1631 __dest->__left_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__new_left);
1546 __new_left->__parent_ = static_cast<__end_node_pointer>(__dest);1632 __new_left->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__dest);
1547 }1633 }
15481634
1549 // Identical to the left case above, just for the right nodes1635 // Identical to the left case above, just for the right nodes
1550 if (__dest->__right_) {1636 if (__dest->__right_) {
1551 __dest->__right_ = static_cast<__node_base_pointer>(__assign_from_tree(1637 __dest->__right_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__assign_from_tree(
1552 static_cast<__node_pointer>(__dest->__right_),1638 std::__static_fancy_pointer_cast<__node_pointer>(__dest->__right_),
1553 static_cast<__node_pointer>(__src->__right_),1639 std::__static_fancy_pointer_cast<__node_pointer>(__src->__right_),
1554 __assign,1640 __assign,
1555 __construct_subtree));1641 __construct_subtree));
1556 } else if (__src->__right_) {1642 } else if (__src->__right_) {
1557 auto __new_right = __construct_subtree(static_cast<__node_pointer>(__src->__right_));1643 auto __new_right = __construct_subtree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__right_));
1558 __dest->__right_ = static_cast<__node_base_pointer>(__new_right);1644 __dest->__right_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__new_right);
1559 __new_right->__parent_ = static_cast<__end_node_pointer>(__dest);1645 __new_right->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__dest);
1560 }1646 }
15611647
1562 return __dest;1648 return __dest;
1563 }1649 }
15641650
1565 _LIBCPP_HIDE_FROM_ABI __node_pointer __copy_assign_tree(__node_pointer __dest, __node_pointer __src) {1651 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer
1652 __copy_assign_tree(__node_pointer __dest, __node_pointer __src) {
1566 return __assign_from_tree(1653 return __assign_from_tree(
1567 __dest,1654 __dest,
1568 __src,1655 __src,
...@@ -1570,7 +1657,8 @@ private:...@@ -1570,7 +1657,8 @@ private:
1570 [this](__node_pointer __nd) { return __copy_construct_tree(__nd); });1657 [this](__node_pointer __nd) { return __copy_construct_tree(__nd); });
1571 }1658 }
15721659
1573 _LIBCPP_HIDE_FROM_ABI __node_pointer __move_assign_tree(__node_pointer __dest, __node_pointer __src) {1660 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer
1661 __move_assign_tree(__node_pointer __dest, __node_pointer __src) {
1574 return __assign_from_tree(1662 return __assign_from_tree(
1575 __dest,1663 __dest,
1576 __src,1664 __src,
...@@ -1589,7 +1677,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<__tree<_Tp...@@ -1589,7 +1677,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<__tree<_Tp
1589 using __node_pointer _LIBCPP_NODEBUG = typename __tree<_Tp, _Compare, _Allocator>::__node_pointer;1677 using __node_pointer _LIBCPP_NODEBUG = typename __tree<_Tp, _Compare, _Allocator>::__node_pointer;
15901678
1591 template <class _Tree, class _Func, class _Proj>1679 template <class _Tree, class _Func, class _Proj>
1592 _LIBCPP_HIDE_FROM_ABI static auto operator()(_Tree&& __range, _Func __func, _Proj __proj) {1680 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto
1681 operator()(_Tree&& __range, _Func __func, _Proj __proj) {
1593 if (__range.size() != 0)1682 if (__range.size() != 0)
1594 std::__tree_iterate_from_root<__copy_cvref_t<_Tree, typename __remove_cvref_t<_Tree>::value_type>>(1683 std::__tree_iterate_from_root<__copy_cvref_t<_Tree, typename __remove_cvref_t<_Tree>::value_type>>(
1595 [](__node_pointer) { return false; }, __range.__root(), __func, __proj);1684 [](__node_pointer) { return false; }, __range.__root(), __func, __proj);
...@@ -1599,7 +1688,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<__tree<_Tp...@@ -1599,7 +1688,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<__tree<_Tp
1599#endif1688#endif
16001689
1601template <class _Tp, class _Compare, class _Allocator>1690template <class _Tp, class _Compare, class _Allocator>
1602__tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t) {1691_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>&
1692__tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t) {
1603 if (this == std::addressof(__t))1693 if (this == std::addressof(__t))
1604 return *this;1694 return *this;
16051695
...@@ -1607,21 +1697,22 @@ __tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(...@@ -1607,21 +1697,22 @@ __tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(
1607 __copy_assign_alloc(__t);1697 __copy_assign_alloc(__t);
16081698
1609 if (__size_ != 0) {1699 if (__size_ != 0) {
1610 *__root_ptr() = static_cast<__node_base_pointer>(__copy_assign_tree(__root(), __t.__root()));1700 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_assign_tree(__root(), __t.__root()));
1611 } else {1701 } else {
1612 *__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));1702 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
1613 if (__root())1703 if (__root())
1614 __root()->__parent_ = __end_node();1704 __root()->__parent_ = __end_node();
1615 }1705 }
1616 __begin_node_ =1706 __begin_node_ = __end_node()->__left_
1617 __end_node()->__left_ ? static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_)) : __end_node();1707 ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_))
1708 : __end_node();
1618 __size_ = __t.size();1709 __size_ = __t.size();
16191710
1620 return *this;1711 return *this;
1621}1712}
16221713
1623template <class _Tp, class _Compare, class _Allocator>1714template <class _Tp, class _Compare, class _Allocator>
1624__tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)1715_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
1625 : __begin_node_(__end_node()),1716 : __begin_node_(__end_node()),
1626 __node_alloc_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),1717 __node_alloc_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),
1627 __size_(0),1718 __size_(0),
...@@ -1629,14 +1720,14 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)...@@ -1629,14 +1720,14 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
1629 if (__t.size() == 0)1720 if (__t.size() == 0)
1630 return;1721 return;
16311722
1632 *__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));1723 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
1633 __root()->__parent_ = __end_node();1724 __root()->__parent_ = __end_node();
1634 __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));1725 __begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1635 __size_ = __t.size();1726 __size_ = __t.size();
1636}1727}
16371728
1638template <class _Tp, class _Compare, class _Allocator>1729template <class _Tp, class _Compare, class _Allocator>
1639__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(1730_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(
1640 is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value)1731 is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value)
1641 : __begin_node_(std::move(__t.__begin_node_)),1732 : __begin_node_(std::move(__t.__begin_node_)),
1642 __end_node_(std::move(__t.__end_node_)),1733 __end_node_(std::move(__t.__end_node_)),
...@@ -1646,7 +1737,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(...@@ -1646,7 +1737,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(
1646 if (__size_ == 0)1737 if (__size_ == 0)
1647 __begin_node_ = __end_node();1738 __begin_node_ = __end_node();
1648 else {1739 else {
1649 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());1740 __end_node()->__left_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__end_node());
1650 __t.__begin_node_ = __t.__end_node();1741 __t.__begin_node_ = __t.__end_node();
1651 __t.__end_node()->__left_ = nullptr;1742 __t.__end_node()->__left_ = nullptr;
1652 __t.__size_ = 0;1743 __t.__size_ = 0;
...@@ -1654,7 +1745,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(...@@ -1654,7 +1745,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(
1654}1745}
16551746
1656template <class _Tp, class _Compare, class _Allocator>1747template <class _Tp, class _Compare, class _Allocator>
1657__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)1748_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
1658 : __begin_node_(__end_node()),1749 : __begin_node_(__end_node()),
1659 __node_alloc_(__node_allocator(__a)),1750 __node_alloc_(__node_allocator(__a)),
1660 __size_(0),1751 __size_(0),
...@@ -1664,24 +1755,24 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __...@@ -1664,24 +1755,24 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __
1664 if (__a == __t.__alloc()) {1755 if (__a == __t.__alloc()) {
1665 __begin_node_ = __t.__begin_node_;1756 __begin_node_ = __t.__begin_node_;
1666 __end_node()->__left_ = __t.__end_node()->__left_;1757 __end_node()->__left_ = __t.__end_node()->__left_;
1667 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());1758 __end_node()->__left_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__end_node());
1668 __size_ = __t.__size_;1759 __size_ = __t.__size_;
1669 __t.__begin_node_ = __t.__end_node();1760 __t.__begin_node_ = __t.__end_node();
1670 __t.__end_node()->__left_ = nullptr;1761 __t.__end_node()->__left_ = nullptr;
1671 __t.__size_ = 0;1762 __t.__size_ = 0;
1672 } else {1763 } else {
1673 *__root_ptr() = static_cast<__node_base_pointer>(__move_construct_tree(__t.__root()));1764 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__move_construct_tree(__t.__root()));
1674 __root()->__parent_ = __end_node();1765 __root()->__parent_ = __end_node();
1675 __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));1766 __begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1676 __size_ = __t.size();1767 __size_ = __t.size();
1677 __t.clear(); // Ensure that __t is in a valid state after moving out the keys1768 __t.clear(); // Ensure that __t is in a valid state after moving out the keys
1678 }1769 }
1679}1770}
16801771
1681template <class _Tp, class _Compare, class _Allocator>1772template <class _Tp, class _Compare, class _Allocator>
1682void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)1773_LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
1683 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value) {1774 _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value) {
1684 destroy(static_cast<__node_pointer>(__end_node()->__left_));1775 destroy(std::__static_fancy_pointer_cast<__node_pointer>(__end_node()->__left_));
1685 __begin_node_ = __t.__begin_node_;1776 __begin_node_ = __t.__begin_node_;
1686 __end_node_ = __t.__end_node_;1777 __end_node_ = __t.__end_node_;
1687 __move_assign_alloc(__t);1778 __move_assign_alloc(__t);
...@@ -1690,7 +1781,7 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)...@@ -1690,7 +1781,7 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
1690 if (__size_ == 0)1781 if (__size_ == 0)
1691 __begin_node_ = __end_node();1782 __begin_node_ = __end_node();
1692 else {1783 else {
1693 __end_node()->__left_->__parent_ = static_cast<__end_node_pointer>(__end_node());1784 __end_node()->__left_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__end_node());
1694 __t.__begin_node_ = __t.__end_node();1785 __t.__begin_node_ = __t.__end_node();
1695 __t.__end_node()->__left_ = nullptr;1786 __t.__end_node()->__left_ = nullptr;
1696 __t.__size_ = 0;1787 __t.__size_ = 0;
...@@ -1698,27 +1789,28 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)...@@ -1698,27 +1789,28 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
1698}1789}
16991790
1700template <class _Tp, class _Compare, class _Allocator>1791template <class _Tp, class _Compare, class _Allocator>
1701void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) {1792_LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) {
1702 if (__node_alloc() == __t.__node_alloc()) {1793 if (__node_alloc() == __t.__node_alloc()) {
1703 __move_assign(__t, true_type());1794 __move_assign(__t, true_type());
1704 } else {1795 } else {
1705 value_comp() = std::move(__t.value_comp());1796 value_comp() = std::move(__t.value_comp());
1706 if (__size_ != 0) {1797 if (__size_ != 0) {
1707 *__root_ptr() = static_cast<__node_base_pointer>(__move_assign_tree(__root(), __t.__root()));1798 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__move_assign_tree(__root(), __t.__root()));
1708 } else {1799 } else {
1709 *__root_ptr() = static_cast<__node_base_pointer>(__move_construct_tree(__t.__root()));1800 *__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__move_construct_tree(__t.__root()));
1710 if (__root())1801 if (__root())
1711 __root()->__parent_ = __end_node();1802 __root()->__parent_ = __end_node();
1712 }1803 }
1713 __begin_node_ =1804 __begin_node_ = __end_node()->__left_
1714 __end_node()->__left_ ? static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_)) : __end_node();1805 ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_))
1806 : __end_node();
1715 __size_ = __t.size();1807 __size_ = __t.size();
1716 __t.clear(); // Ensure that __t is in a valid state after moving out the keys1808 __t.clear(); // Ensure that __t is in a valid state after moving out the keys
1717 }1809 }
1718}1810}
17191811
1720template <class _Tp, class _Compare, class _Allocator>1812template <class _Tp, class _Compare, class _Allocator>
1721void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)1813_LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1722#if _LIBCPP_STD_VER <= 111814#if _LIBCPP_STD_VER <= 11
1723 _NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&1815 _NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
1724 (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))1816 (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))
...@@ -1743,7 +1835,7 @@ void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)...@@ -1743,7 +1835,7 @@ void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1743}1835}
17441836
1745template <class _Tp, class _Compare, class _Allocator>1837template <class _Tp, class _Compare, class _Allocator>
1746void __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT {1838_LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT {
1747 destroy(__root());1839 destroy(__root());
1748 __size_ = 0;1840 __size_ = 0;
1749 __begin_node_ = __end_node();1841 __begin_node_ = __end_node();
...@@ -1754,23 +1846,23 @@ void __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT {...@@ -1754,23 +1846,23 @@ void __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT {
1754// Set __parent to parent of null leaf1846// Set __parent to parent of null leaf
1755// Return reference to null leaf1847// Return reference to null leaf
1756template <class _Tp, class _Compare, class _Allocator>1848template <class _Tp, class _Compare, class _Allocator>
1757typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&1849_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
1758__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__end_node_pointer& __parent, const value_type& __v) {1850__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__end_node_pointer& __parent, const value_type& __v) {
1759 __node_pointer __nd = __root();1851 __node_pointer __nd = __root();
1760 if (__nd != nullptr) {1852 if (__nd != nullptr) {
1761 while (true) {1853 while (true) {
1762 if (value_comp()(__nd->__get_value(), __v)) {1854 if (value_comp()(__nd->__get_value(), __v)) {
1763 if (__nd->__right_ != nullptr)1855 if (__nd->__right_ != nullptr)
1764 __nd = static_cast<__node_pointer>(__nd->__right_);1856 __nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__right_);
1765 else {1857 else {
1766 __parent = static_cast<__end_node_pointer>(__nd);1858 __parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__nd);
1767 return __nd->__right_;1859 return __nd->__right_;
1768 }1860 }
1769 } else {1861 } else {
1770 if (__nd->__left_ != nullptr)1862 if (__nd->__left_ != nullptr)
1771 __nd = static_cast<__node_pointer>(__nd->__left_);1863 __nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__left_);
1772 else {1864 else {
1773 __parent = static_cast<__end_node_pointer>(__nd);1865 __parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__nd);
1774 return __parent->__left_;1866 return __parent->__left_;
1775 }1867 }
1776 }1868 }
...@@ -1784,23 +1876,23 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__end_node_pointer& __parent,...@@ -1784,23 +1876,23 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__end_node_pointer& __parent,
1784// Set __parent to parent of null leaf1876// Set __parent to parent of null leaf
1785// Return reference to null leaf1877// Return reference to null leaf
1786template <class _Tp, class _Compare, class _Allocator>1878template <class _Tp, class _Compare, class _Allocator>
1787typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&1879_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
1788__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__end_node_pointer& __parent, const value_type& __v) {1880__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__end_node_pointer& __parent, const value_type& __v) {
1789 __node_pointer __nd = __root();1881 __node_pointer __nd = __root();
1790 if (__nd != nullptr) {1882 if (__nd != nullptr) {
1791 while (true) {1883 while (true) {
1792 if (value_comp()(__v, __nd->__get_value())) {1884 if (value_comp()(__v, __nd->__get_value())) {
1793 if (__nd->__left_ != nullptr)1885 if (__nd->__left_ != nullptr)
1794 __nd = static_cast<__node_pointer>(__nd->__left_);1886 __nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__left_);
1795 else {1887 else {
1796 __parent = static_cast<__end_node_pointer>(__nd);1888 __parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__nd);
1797 return __parent->__left_;1889 return __parent->__left_;
1798 }1890 }
1799 } else {1891 } else {
1800 if (__nd->__right_ != nullptr)1892 if (__nd->__right_ != nullptr)
1801 __nd = static_cast<__node_pointer>(__nd->__right_);1893 __nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__right_);
1802 else {1894 else {
1803 __parent = static_cast<__end_node_pointer>(__nd);1895 __parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__nd);
1804 return __nd->__right_;1896 return __nd->__right_;
1805 }1897 }
1806 }1898 }
...@@ -1817,7 +1909,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__end_node_pointer& __parent...@@ -1817,7 +1909,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__end_node_pointer& __parent
1817// Set __parent to parent of null leaf1909// Set __parent to parent of null leaf
1818// Return reference to null leaf1910// Return reference to null leaf
1819template <class _Tp, class _Compare, class _Allocator>1911template <class _Tp, class _Compare, class _Allocator>
1820typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Compare, _Allocator>::__find_leaf(1912_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
1913__tree<_Tp, _Compare, _Allocator>::__find_leaf(
1821 const_iterator __hint, __end_node_pointer& __parent, const value_type& __v) {1914 const_iterator __hint, __end_node_pointer& __parent, const value_type& __v) {
1822 if (__hint == end() || !value_comp()(*__hint, __v)) // check before1915 if (__hint == end() || !value_comp()(*__hint, __v)) // check before
1823 {1916 {
...@@ -1826,11 +1919,11 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Co...@@ -1826,11 +1919,11 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Co
1826 if (__prior == begin() || !value_comp()(__v, *--__prior)) {1919 if (__prior == begin() || !value_comp()(__v, *--__prior)) {
1827 // *prev(__hint) <= __v <= *__hint1920 // *prev(__hint) <= __v <= *__hint
1828 if (__hint.__ptr_->__left_ == nullptr) {1921 if (__hint.__ptr_->__left_ == nullptr) {
1829 __parent = static_cast<__end_node_pointer>(__hint.__ptr_);1922 __parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__hint.__ptr_);
1830 return __parent->__left_;1923 return __parent->__left_;
1831 } else {1924 } else {
1832 __parent = static_cast<__end_node_pointer>(__prior.__ptr_);1925 __parent = std::__static_fancy_pointer_cast<__end_node_pointer>(__prior.__ptr_);
1833 return static_cast<__node_base_pointer>(__prior.__ptr_)->__right_;1926 return std::__static_fancy_pointer_cast<__node_base_pointer>(__prior.__ptr_)->__right_;
1834 }1927 }
1835 }1928 }
1836 // __v < *prev(__hint)1929 // __v < *prev(__hint)
...@@ -1845,8 +1938,9 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Co...@@ -1845,8 +1938,9 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Co
1845// If __v doesn't exist, return the parent of the null leaf and a reference to the pointer to the null leaf.1938// If __v doesn't exist, return the parent of the null leaf and a reference to the pointer to the null leaf.
1846template <class _Tp, class _Compare, class _Allocator>1939template <class _Tp, class _Compare, class _Allocator>
1847template <class _Key>1940template <class _Key>
1848_LIBCPP_HIDE_FROM_ABI pair<typename __tree<_Tp, _Compare, _Allocator>::__end_node_pointer,1941_LIBCPP_HIDE_FROM_ABI
1849 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&>1942_LIBCPP_CONSTEXPR_SINCE_CXX26 pair<typename __tree<_Tp, _Compare, _Allocator>::__end_node_pointer,
1943 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&>
1850__tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {1944__tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {
1851 using _Pair = pair<__end_node_pointer, __node_base_pointer&>;1945 using _Pair = pair<__end_node_pointer, __node_base_pointer&>;
18521946
...@@ -1858,27 +1952,27 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {...@@ -1858,27 +1952,27 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {
1858 }1952 }
18591953
1860 __node_base_pointer* __node_ptr = __root_ptr();1954 __node_base_pointer* __node_ptr = __root_ptr();
1861 auto&& __transparent = std::__as_transparent<_Key>(value_comp());1955 auto&& __transparent = std::__as_transparent<key_type>(value_comp());
1862 auto __comp =1956 auto __comp =
1863 __lazy_synth_three_way_comparator<__make_transparent_t<_Key, _Compare>, _Key, value_type>(__transparent);1957 __lazy_synth_three_way_comparator<__make_transparent_t<key_type, _Compare>, _Key, value_type>(__transparent);
18641958
1865 while (true) {1959 while (true) {
1866 auto __comp_res = __comp(__v, __nd->__get_value());1960 auto __comp_res = __comp(__v, __nd->__get_value());
18671961
1868 if (__comp_res.__less()) {1962 if (__comp_res.__less()) {
1869 if (__nd->__left_ == nullptr)1963 if (__nd->__left_ == nullptr)
1870 return _Pair(static_cast<__end_node_pointer>(__nd), __nd->__left_);1964 return _Pair(std::__static_fancy_pointer_cast<__end_node_pointer>(__nd), __nd->__left_);
18711965
1872 __node_ptr = std::addressof(__nd->__left_);1966 __node_ptr = std::addressof(__nd->__left_);
1873 __nd = static_cast<__node_pointer>(__nd->__left_);1967 __nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__left_);
1874 } else if (__comp_res.__greater()) {1968 } else if (__comp_res.__greater()) {
1875 if (__nd->__right_ == nullptr)1969 if (__nd->__right_ == nullptr)
1876 return _Pair(static_cast<__end_node_pointer>(__nd), __nd->__right_);1970 return _Pair(std::__static_fancy_pointer_cast<__end_node_pointer>(__nd), __nd->__right_);
18771971
1878 __node_ptr = std::addressof(__nd->__right_);1972 __node_ptr = std::addressof(__nd->__right_);
1879 __nd = static_cast<__node_pointer>(__nd->__right_);1973 __nd = std::__static_fancy_pointer_cast<__node_pointer>(__nd->__right_);
1880 } else {1974 } else {
1881 return _Pair(static_cast<__end_node_pointer>(__nd), *__node_ptr);1975 return _Pair(std::__static_fancy_pointer_cast<__end_node_pointer>(__nd), *__node_ptr);
1882 }1976 }
1883 }1977 }
1884}1978}
...@@ -1891,8 +1985,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {...@@ -1891,8 +1985,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {
1891// If __v doesn't exist, return the parent of the null leaf and a reference to the pointer to the null leaf.1985// If __v doesn't exist, return the parent of the null leaf and a reference to the pointer to the null leaf.
1892template <class _Tp, class _Compare, class _Allocator>1986template <class _Tp, class _Compare, class _Allocator>
1893template <class _Key>1987template <class _Key>
1894_LIBCPP_HIDE_FROM_ABI pair<typename __tree<_Tp, _Compare, _Allocator>::__end_node_pointer,1988_LIBCPP_HIDE_FROM_ABI
1895 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&>1989_LIBCPP_CONSTEXPR_SINCE_CXX26 pair<typename __tree<_Tp, _Compare, _Allocator>::__end_node_pointer,
1990 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&>
1896__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_base_pointer& __dummy, const _Key& __v) {1991__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_base_pointer& __dummy, const _Key& __v) {
1897 using _Pair = pair<__end_node_pointer, __node_base_pointer&>;1992 using _Pair = pair<__end_node_pointer, __node_base_pointer&>;
18981993
...@@ -1903,7 +1998,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_ba...@@ -1903,7 +1998,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_ba
1903 // *prev(__hint) < __v < *__hint1998 // *prev(__hint) < __v < *__hint
1904 if (__hint.__ptr_->__left_ == nullptr)1999 if (__hint.__ptr_->__left_ == nullptr)
1905 return _Pair(__hint.__ptr_, __hint.__ptr_->__left_);2000 return _Pair(__hint.__ptr_, __hint.__ptr_->__left_);
1906 return _Pair(__prior.__ptr_, static_cast<__node_pointer>(__prior.__ptr_)->__right_);2001 return _Pair(__prior.__ptr_, std::__static_fancy_pointer_cast<__node_pointer>(__prior.__ptr_)->__right_);
1907 }2002 }
1908 // __v <= *prev(__hint)2003 // __v <= *prev(__hint)
1909 return __find_equal(__v);2004 return __find_equal(__v);
...@@ -1915,7 +2010,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_ba...@@ -1915,7 +2010,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_ba
1915 if (__next == end() || value_comp()(__v, *__next)) {2010 if (__next == end() || value_comp()(__v, *__next)) {
1916 // *__hint < __v < *std::next(__hint)2011 // *__hint < __v < *std::next(__hint)
1917 if (__hint.__get_np()->__right_ == nullptr)2012 if (__hint.__get_np()->__right_ == nullptr)
1918 return _Pair(__hint.__ptr_, static_cast<__node_pointer>(__hint.__ptr_)->__right_);2013 return _Pair(__hint.__ptr_, std::__static_fancy_pointer_cast<__node_pointer>(__hint.__ptr_)->__right_);
1919 return _Pair(__next.__ptr_, __next.__ptr_->__left_);2014 return _Pair(__next.__ptr_, __next.__ptr_->__left_);
1920 }2015 }
1921 // *next(__hint) <= __v2016 // *next(__hint) <= __v
...@@ -1923,12 +2018,12 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_ba...@@ -1923,12 +2018,12 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, __node_ba
1923 }2018 }
19242019
1925 // else __v == *__hint2020 // else __v == *__hint
1926 __dummy = static_cast<__node_base_pointer>(__hint.__ptr_);2021 __dummy = std::__static_fancy_pointer_cast<__node_base_pointer>(__hint.__ptr_);
1927 return _Pair(__hint.__ptr_, __dummy);2022 return _Pair(__hint.__ptr_, __dummy);
1928}2023}
19292024
1930template <class _Tp, class _Compare, class _Allocator>2025template <class _Tp, class _Compare, class _Allocator>
1931void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(2026_LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(
1932 __end_node_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT {2027 __end_node_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT {
1933 __new_node->__left_ = nullptr;2028 __new_node->__left_ = nullptr;
1934 __new_node->__right_ = nullptr;2029 __new_node->__right_ = nullptr;
...@@ -1936,14 +2031,14 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(...@@ -1936,14 +2031,14 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(
1936 // __new_node->__is_black_ is initialized in __tree_balance_after_insert2031 // __new_node->__is_black_ is initialized in __tree_balance_after_insert
1937 __child = __new_node;2032 __child = __new_node;
1938 if (__begin_node_->__left_ != nullptr)2033 if (__begin_node_->__left_ != nullptr)
1939 __begin_node_ = static_cast<__end_node_pointer>(__begin_node_->__left_);2034 __begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__begin_node_->__left_);
1940 std::__tree_balance_after_insert(__end_node()->__left_, __child);2035 std::__tree_balance_after_insert(__end_node()->__left_, __child);
1941 ++__size_;2036 ++__size_;
1942}2037}
19432038
1944template <class _Tp, class _Compare, class _Allocator>2039template <class _Tp, class _Compare, class _Allocator>
1945template <class... _Args>2040template <class... _Args>
1946typename __tree<_Tp, _Compare, _Allocator>::__node_holder2041_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_holder
1947__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {2042__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
1948 __node_allocator& __na = __node_alloc();2043 __node_allocator& __na = __node_alloc();
1949 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));2044 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
...@@ -1954,42 +2049,42 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {...@@ -1954,42 +2049,42 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
19542049
1955template <class _Tp, class _Compare, class _Allocator>2050template <class _Tp, class _Compare, class _Allocator>
1956template <class... _Args>2051template <class... _Args>
1957typename __tree<_Tp, _Compare, _Allocator>::iterator2052typename __tree<_Tp, _Compare, _Allocator>::iterator _LIBCPP_CONSTEXPR_SINCE_CXX26
1958__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args) {2053__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args) {
1959 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);2054 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1960 __end_node_pointer __parent;2055 __end_node_pointer __parent;
1961 __node_base_pointer& __child = __find_leaf_high(__parent, __h->__get_value());2056 __node_base_pointer& __child = __find_leaf_high(__parent, __h->__get_value());
1962 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));2057 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1963 return iterator(static_cast<__node_pointer>(__h.release()));2058 return iterator(std::__static_fancy_pointer_cast<__node_pointer>(__h.release()));
1964}2059}
19652060
1966template <class _Tp, class _Compare, class _Allocator>2061template <class _Tp, class _Compare, class _Allocator>
1967template <class... _Args>2062template <class... _Args>
1968typename __tree<_Tp, _Compare, _Allocator>::iterator2063typename __tree<_Tp, _Compare, _Allocator>::iterator _LIBCPP_CONSTEXPR_SINCE_CXX26
1969__tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p, _Args&&... __args) {2064__tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p, _Args&&... __args) {
1970 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);2065 __node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1971 __end_node_pointer __parent;2066 __end_node_pointer __parent;
1972 __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__get_value());2067 __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__get_value());
1973 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));2068 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1974 return iterator(static_cast<__node_pointer>(__h.release()));2069 return iterator(std::__static_fancy_pointer_cast<__node_pointer>(__h.release()));
1975}2070}
19762071
1977template <class _Tp, class _Compare, class _Allocator>2072template <class _Tp, class _Compare, class _Allocator>
1978typename __tree<_Tp, _Compare, _Allocator>::iterator2073typename __tree<_Tp, _Compare, _Allocator>::iterator _LIBCPP_CONSTEXPR_SINCE_CXX26
1979__tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _NOEXCEPT {2074__tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _NOEXCEPT {
1980 iterator __r(__ptr);2075 iterator __r(__ptr);
1981 ++__r;2076 ++__r;
1982 if (__begin_node_ == __ptr)2077 if (__begin_node_ == __ptr)
1983 __begin_node_ = __r.__ptr_;2078 __begin_node_ = __r.__ptr_;
1984 --__size_;2079 --__size_;
1985 std::__tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__ptr));2080 std::__tree_remove(__end_node()->__left_, std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr));
1986 return __r;2081 return __r;
1987}2082}
19882083
1989#if _LIBCPP_STD_VER >= 172084#if _LIBCPP_STD_VER >= 17
1990template <class _Tp, class _Compare, class _Allocator>2085template <class _Tp, class _Compare, class _Allocator>
1991template <class _NodeHandle, class _InsertReturnType>2086template <class _NodeHandle, class _InsertReturnType>
1992_LIBCPP_HIDE_FROM_ABI _InsertReturnType2087_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _InsertReturnType
1993__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __nh) {2088__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __nh) {
1994 if (__nh.empty())2089 if (__nh.empty())
1995 return _InsertReturnType{end(), false, _NodeHandle()};2090 return _InsertReturnType{end(), false, _NodeHandle()};
...@@ -1997,16 +2092,17 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __n...@@ -1997,16 +2092,17 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(_NodeHandle&& __n
1997 __node_pointer __ptr = __nh.__ptr_;2092 __node_pointer __ptr = __nh.__ptr_;
1998 auto [__parent, __child] = __find_equal(__ptr->__get_value());2093 auto [__parent, __child] = __find_equal(__ptr->__get_value());
1999 if (__child != nullptr)2094 if (__child != nullptr)
2000 return _InsertReturnType{iterator(static_cast<__node_pointer>(__child)), false, std::move(__nh)};2095 return _InsertReturnType{
2096 iterator(std::__static_fancy_pointer_cast<__node_pointer>(__child)), false, std::move(__nh)};
20012097
2002 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2098 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr));
2003 __nh.__release_ptr();2099 __nh.__release_ptr();
2004 return _InsertReturnType{iterator(__ptr), true, _NodeHandle()};2100 return _InsertReturnType{iterator(__ptr), true, _NodeHandle()};
2005}2101}
20062102
2007template <class _Tp, class _Compare, class _Allocator>2103template <class _Tp, class _Compare, class _Allocator>
2008template <class _NodeHandle>2104template <class _NodeHandle>
2009_LIBCPP_HIDE_FROM_ABI typename __tree<_Tp, _Compare, _Allocator>::iterator2105_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::iterator
2010__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __hint, _NodeHandle&& __nh) {2106__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __hint, _NodeHandle&& __nh) {
2011 if (__nh.empty())2107 if (__nh.empty())
2012 return end();2108 return end();
...@@ -2014,9 +2110,9 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __...@@ -2014,9 +2110,9 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __
2014 __node_pointer __ptr = __nh.__ptr_;2110 __node_pointer __ptr = __nh.__ptr_;
2015 __node_base_pointer __dummy;2111 __node_base_pointer __dummy;
2016 auto [__parent, __child] = __find_equal(__hint, __dummy, __ptr->__get_value());2112 auto [__parent, __child] = __find_equal(__hint, __dummy, __ptr->__get_value());
2017 __node_pointer __r = static_cast<__node_pointer>(__child);2113 __node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
2018 if (__child == nullptr) {2114 if (__child == nullptr) {
2019 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2115 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr));
2020 __r = __ptr;2116 __r = __ptr;
2021 __nh.__release_ptr();2117 __nh.__release_ptr();
2022 }2118 }
...@@ -2025,7 +2121,8 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __...@@ -2025,7 +2121,8 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __
20252121
2026template <class _Tp, class _Compare, class _Allocator>2122template <class _Tp, class _Compare, class _Allocator>
2027template <class _NodeHandle>2123template <class _NodeHandle>
2028_LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key) {2124_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodeHandle
2125__tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key) {
2029 iterator __it = __lower_bound_multi(__key);2126 iterator __it = __lower_bound_multi(__key);
2030 if (__it == end() || __value_comp_(__key, *__it))2127 if (__it == end() || __value_comp_(__key, *__it))
2031 return _NodeHandle();2128 return _NodeHandle();
...@@ -2034,7 +2131,8 @@ _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_hand...@@ -2034,7 +2131,8 @@ _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_hand
20342131
2035template <class _Tp, class _Compare, class _Allocator>2132template <class _Tp, class _Compare, class _Allocator>
2036template <class _NodeHandle>2133template <class _NodeHandle>
2037_LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(const_iterator __p) {2134_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _NodeHandle
2135__tree<_Tp, _Compare, _Allocator>::__node_handle_extract(const_iterator __p) {
2038 __node_pointer __np = __p.__get_np();2136 __node_pointer __np = __p.__get_np();
2039 __remove_node_pointer(__np);2137 __remove_node_pointer(__np);
2040 return _NodeHandle(__np, __alloc());2138 return _NodeHandle(__np, __alloc());
...@@ -2042,7 +2140,7 @@ _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_hand...@@ -2042,7 +2140,7 @@ _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_hand
20422140
2043template <class _Tp, class _Compare, class _Allocator>2141template <class _Tp, class _Compare, class _Allocator>
2044template <class _Comp2>2142template <class _Comp2>
2045_LIBCPP_HIDE_FROM_ABI void2143_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2046__tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(__tree<_Tp, _Comp2, _Allocator>& __source) {2144__tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(__tree<_Tp, _Comp2, _Allocator>& __source) {
2047 for (iterator __i = __source.begin(); __i != __source.end();) {2145 for (iterator __i = __source.begin(); __i != __source.end();) {
2048 __node_pointer __src_ptr = __i.__get_np();2146 __node_pointer __src_ptr = __i.__get_np();
...@@ -2051,27 +2149,27 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(__tree<_Tp, _Comp2...@@ -2051,27 +2149,27 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(__tree<_Tp, _Comp2
2051 if (__child != nullptr)2149 if (__child != nullptr)
2052 continue;2150 continue;
2053 __source.__remove_node_pointer(__src_ptr);2151 __source.__remove_node_pointer(__src_ptr);
2054 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__src_ptr));2152 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__src_ptr));
2055 }2153 }
2056}2154}
20572155
2058template <class _Tp, class _Compare, class _Allocator>2156template <class _Tp, class _Compare, class _Allocator>
2059template <class _NodeHandle>2157template <class _NodeHandle>
2060_LIBCPP_HIDE_FROM_ABI typename __tree<_Tp, _Compare, _Allocator>::iterator2158_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::iterator
2061__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh) {2159__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh) {
2062 if (__nh.empty())2160 if (__nh.empty())
2063 return end();2161 return end();
2064 __node_pointer __ptr = __nh.__ptr_;2162 __node_pointer __ptr = __nh.__ptr_;
2065 __end_node_pointer __parent;2163 __end_node_pointer __parent;
2066 __node_base_pointer& __child = __find_leaf_high(__parent, __ptr->__get_value());2164 __node_base_pointer& __child = __find_leaf_high(__parent, __ptr->__get_value());
2067 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2165 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr));
2068 __nh.__release_ptr();2166 __nh.__release_ptr();
2069 return iterator(__ptr);2167 return iterator(__ptr);
2070}2168}
20712169
2072template <class _Tp, class _Compare, class _Allocator>2170template <class _Tp, class _Compare, class _Allocator>
2073template <class _NodeHandle>2171template <class _NodeHandle>
2074_LIBCPP_HIDE_FROM_ABI typename __tree<_Tp, _Compare, _Allocator>::iterator2172_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::iterator
2075__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __hint, _NodeHandle&& __nh) {2173__tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __hint, _NodeHandle&& __nh) {
2076 if (__nh.empty())2174 if (__nh.empty())
2077 return end();2175 return end();
...@@ -2079,14 +2177,14 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __h...@@ -2079,14 +2177,14 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(const_iterator __h
2079 __node_pointer __ptr = __nh.__ptr_;2177 __node_pointer __ptr = __nh.__ptr_;
2080 __end_node_pointer __parent;2178 __end_node_pointer __parent;
2081 __node_base_pointer& __child = __find_leaf(__hint, __parent, __ptr->__get_value());2179 __node_base_pointer& __child = __find_leaf(__hint, __parent, __ptr->__get_value());
2082 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr));2180 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__ptr));
2083 __nh.__release_ptr();2181 __nh.__release_ptr();
2084 return iterator(__ptr);2182 return iterator(__ptr);
2085}2183}
20862184
2087template <class _Tp, class _Compare, class _Allocator>2185template <class _Tp, class _Compare, class _Allocator>
2088template <class _Comp2>2186template <class _Comp2>
2089_LIBCPP_HIDE_FROM_ABI void2187_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2090__tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(__tree<_Tp, _Comp2, _Allocator>& __source) {2188__tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(__tree<_Tp, _Comp2, _Allocator>& __source) {
2091 for (iterator __i = __source.begin(); __i != __source.end();) {2189 for (iterator __i = __source.begin(); __i != __source.end();) {
2092 __node_pointer __src_ptr = __i.__get_np();2190 __node_pointer __src_ptr = __i.__get_np();
...@@ -2094,14 +2192,14 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(__tree<_Tp, _Comp2,...@@ -2094,14 +2192,14 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(__tree<_Tp, _Comp2,
2094 __node_base_pointer& __child = __find_leaf_high(__parent, __src_ptr->__get_value());2192 __node_base_pointer& __child = __find_leaf_high(__parent, __src_ptr->__get_value());
2095 ++__i;2193 ++__i;
2096 __source.__remove_node_pointer(__src_ptr);2194 __source.__remove_node_pointer(__src_ptr);
2097 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__src_ptr));2195 __insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__src_ptr));
2098 }2196 }
2099}2197}
2100
2101#endif // _LIBCPP_STD_VER >= 172198#endif // _LIBCPP_STD_VER >= 17
21022199
2103template <class _Tp, class _Compare, class _Allocator>2200template <class _Tp, class _Compare, class _Allocator>
2104typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p) {2201_LIBCPP_CONSTEXPR_SINCE_CXX26
2202 typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p) {
2105 __node_pointer __np = __p.__get_np();2203 __node_pointer __np = __p.__get_np();
2106 iterator __r = __remove_node_pointer(__np);2204 iterator __r = __remove_node_pointer(__np);
2107 __node_allocator& __na = __node_alloc();2205 __node_allocator& __na = __node_alloc();
...@@ -2111,7 +2209,7 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allo...@@ -2111,7 +2209,7 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allo
2111}2209}
21122210
2113template <class _Tp, class _Compare, class _Allocator>2211template <class _Tp, class _Compare, class _Allocator>
2114typename __tree<_Tp, _Compare, _Allocator>::iterator2212_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::iterator
2115__tree<_Tp, _Compare, _Allocator>::erase(const_iterator __f, const_iterator __l) {2213__tree<_Tp, _Compare, _Allocator>::erase(const_iterator __f, const_iterator __l) {
2116 while (__f != __l)2214 while (__f != __l)
2117 __f = erase(__f);2215 __f = erase(__f);
...@@ -2120,7 +2218,7 @@ __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __f, const_iterator __l)...@@ -2120,7 +2218,7 @@ __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __f, const_iterator __l)
21202218
2121template <class _Tp, class _Compare, class _Allocator>2219template <class _Tp, class _Compare, class _Allocator>
2122template <class _Key>2220template <class _Key>
2123typename __tree<_Tp, _Compare, _Allocator>::size_type2221_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::size_type
2124__tree<_Tp, _Compare, _Allocator>::__erase_unique(const _Key& __k) {2222__tree<_Tp, _Compare, _Allocator>::__erase_unique(const _Key& __k) {
2125 iterator __i = find(__k);2223 iterator __i = find(__k);
2126 if (__i == end())2224 if (__i == end())
...@@ -2131,7 +2229,7 @@ __tree<_Tp, _Compare, _Allocator>::__erase_unique(const _Key& __k) {...@@ -2131,7 +2229,7 @@ __tree<_Tp, _Compare, _Allocator>::__erase_unique(const _Key& __k) {
21312229
2132template <class _Tp, class _Compare, class _Allocator>2230template <class _Tp, class _Compare, class _Allocator>
2133template <class _Key>2231template <class _Key>
2134typename __tree<_Tp, _Compare, _Allocator>::size_type2232_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::size_type
2135__tree<_Tp, _Compare, _Allocator>::__erase_multi(const _Key& __k) {2233__tree<_Tp, _Compare, _Allocator>::__erase_multi(const _Key& __k) {
2136 pair<iterator, iterator> __p = __equal_range_multi(__k);2234 pair<iterator, iterator> __p = __equal_range_multi(__k);
2137 size_type __r = 0;2235 size_type __r = 0;
...@@ -2142,16 +2240,16 @@ __tree<_Tp, _Compare, _Allocator>::__erase_multi(const _Key& __k) {...@@ -2142,16 +2240,16 @@ __tree<_Tp, _Compare, _Allocator>::__erase_multi(const _Key& __k) {
21422240
2143template <class _Tp, class _Compare, class _Allocator>2241template <class _Tp, class _Compare, class _Allocator>
2144template <class _Key>2242template <class _Key>
2145typename __tree<_Tp, _Compare, _Allocator>::size_type2243_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::size_type
2146__tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {2244__tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {
2147 __node_pointer __rt = __root();2245 __node_pointer __rt = __root();
2148 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());2246 auto __comp = __lazy_synth_three_way_comparator<value_compare, _Key, value_type>(value_comp());
2149 while (__rt != nullptr) {2247 while (__rt != nullptr) {
2150 auto __comp_res = __comp(__k, __rt->__get_value());2248 auto __comp_res = __comp(__k, __rt->__get_value());
2151 if (__comp_res.__less()) {2249 if (__comp_res.__less()) {
2152 __rt = static_cast<__node_pointer>(__rt->__left_);2250 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
2153 } else if (__comp_res.__greater())2251 } else if (__comp_res.__greater())
2154 __rt = static_cast<__node_pointer>(__rt->__right_);2252 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
2155 else2253 else
2156 return 1;2254 return 1;
2157 }2255 }
...@@ -2160,7 +2258,7 @@ __tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {...@@ -2160,7 +2258,7 @@ __tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {
21602258
2161template <class _Tp, class _Compare, class _Allocator>2259template <class _Tp, class _Compare, class _Allocator>
2162template <class _Key>2260template <class _Key>
2163typename __tree<_Tp, _Compare, _Allocator>::size_type2261_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::size_type
2164__tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const {2262__tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const {
2165 __end_node_pointer __result = __end_node();2263 __end_node_pointer __result = __end_node();
2166 __node_pointer __rt = __root();2264 __node_pointer __rt = __root();
...@@ -2168,78 +2266,85 @@ __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const {...@@ -2168,78 +2266,85 @@ __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const {
2168 while (__rt != nullptr) {2266 while (__rt != nullptr) {
2169 auto __comp_res = __comp(__k, __rt->__get_value());2267 auto __comp_res = __comp(__k, __rt->__get_value());
2170 if (__comp_res.__less()) {2268 if (__comp_res.__less()) {
2171 __result = static_cast<__end_node_pointer>(__rt);2269 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2172 __rt = static_cast<__node_pointer>(__rt->__left_);2270 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
2173 } else if (__comp_res.__greater())2271 } else if (__comp_res.__greater())
2174 __rt = static_cast<__node_pointer>(__rt->__right_);2272 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
2175 else2273 else
2176 return std::distance(2274 return std::distance(
2177 __lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),2275 __lower_bound_multi(__k,
2178 __upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));2276 std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_),
2277 std::__static_fancy_pointer_cast<__end_node_pointer>(__rt)),
2278 __upper_bound_multi(__k, std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_), __result));
2179 }2279 }
2180 return 0;2280 return 0;
2181}2281}
21822282
2183template <class _Tp, class _Compare, class _Allocator>2283template <class _Tp, class _Compare, class _Allocator>
2184template <class _Key>2284template <class _Key>
2185typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound_multi(2285_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::iterator
2286__tree<_Tp, _Compare, _Allocator>::__lower_bound_multi(
2186 const _Key& __v, __node_pointer __root, __end_node_pointer __result) {2287 const _Key& __v, __node_pointer __root, __end_node_pointer __result) {
2187 while (__root != nullptr) {2288 while (__root != nullptr) {
2188 if (!value_comp()(__root->__get_value(), __v)) {2289 if (!value_comp()(__root->__get_value(), __v)) {
2189 __result = static_cast<__end_node_pointer>(__root);2290 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__root);
2190 __root = static_cast<__node_pointer>(__root->__left_);2291 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__left_);
2191 } else2292 } else
2192 __root = static_cast<__node_pointer>(__root->__right_);2293 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__right_);
2193 }2294 }
2194 return iterator(__result);2295 return iterator(__result);
2195}2296}
21962297
2197template <class _Tp, class _Compare, class _Allocator>2298template <class _Tp, class _Compare, class _Allocator>
2198template <class _Key>2299template <class _Key>
2199typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound_multi(2300_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::const_iterator
2301__tree<_Tp, _Compare, _Allocator>::__lower_bound_multi(
2200 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {2302 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {
2201 while (__root != nullptr) {2303 while (__root != nullptr) {
2202 if (!value_comp()(__root->__get_value(), __v)) {2304 if (!value_comp()(__root->__get_value(), __v)) {
2203 __result = static_cast<__end_node_pointer>(__root);2305 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__root);
2204 __root = static_cast<__node_pointer>(__root->__left_);2306 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__left_);
2205 } else2307 } else
2206 __root = static_cast<__node_pointer>(__root->__right_);2308 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__right_);
2207 }2309 }
2208 return const_iterator(__result);2310 return const_iterator(__result);
2209}2311}
22102312
2211template <class _Tp, class _Compare, class _Allocator>2313template <class _Tp, class _Compare, class _Allocator>
2212template <class _Key>2314template <class _Key>
2213typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound_multi(2315_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::iterator
2316__tree<_Tp, _Compare, _Allocator>::__upper_bound_multi(
2214 const _Key& __v, __node_pointer __root, __end_node_pointer __result) {2317 const _Key& __v, __node_pointer __root, __end_node_pointer __result) {
2215 while (__root != nullptr) {2318 while (__root != nullptr) {
2216 if (value_comp()(__v, __root->__get_value())) {2319 if (value_comp()(__v, __root->__get_value())) {
2217 __result = static_cast<__end_node_pointer>(__root);2320 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__root);
2218 __root = static_cast<__node_pointer>(__root->__left_);2321 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__left_);
2219 } else2322 } else
2220 __root = static_cast<__node_pointer>(__root->__right_);2323 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__right_);
2221 }2324 }
2222 return iterator(__result);2325 return iterator(__result);
2223}2326}
22242327
2225template <class _Tp, class _Compare, class _Allocator>2328template <class _Tp, class _Compare, class _Allocator>
2226template <class _Key>2329template <class _Key>
2227typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound_multi(2330_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::const_iterator
2331__tree<_Tp, _Compare, _Allocator>::__upper_bound_multi(
2228 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {2332 const _Key& __v, __node_pointer __root, __end_node_pointer __result) const {
2229 while (__root != nullptr) {2333 while (__root != nullptr) {
2230 if (value_comp()(__v, __root->__get_value())) {2334 if (value_comp()(__v, __root->__get_value())) {
2231 __result = static_cast<__end_node_pointer>(__root);2335 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__root);
2232 __root = static_cast<__node_pointer>(__root->__left_);2336 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__left_);
2233 } else2337 } else
2234 __root = static_cast<__node_pointer>(__root->__right_);2338 __root = std::__static_fancy_pointer_cast<__node_pointer>(__root->__right_);
2235 }2339 }
2236 return const_iterator(__result);2340 return const_iterator(__result);
2237}2341}
22382342
2239template <class _Tp, class _Compare, class _Allocator>2343template <class _Tp, class _Compare, class _Allocator>
2240template <class _Key>2344template <class _Key>
2241pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>2345_LIBCPP_CONSTEXPR_SINCE_CXX26
2242__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) {2346 pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>
2347 __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) {
2243 using _Pp = pair<iterator, iterator>;2348 using _Pp = pair<iterator, iterator>;
2244 __end_node_pointer __result = __end_node();2349 __end_node_pointer __result = __end_node();
2245 __node_pointer __rt = __root();2350 __node_pointer __rt = __root();
...@@ -2247,22 +2352,23 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) {...@@ -2247,22 +2352,23 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) {
2247 while (__rt != nullptr) {2352 while (__rt != nullptr) {
2248 auto __comp_res = __comp(__k, __rt->__get_value());2353 auto __comp_res = __comp(__k, __rt->__get_value());
2249 if (__comp_res.__less()) {2354 if (__comp_res.__less()) {
2250 __result = static_cast<__end_node_pointer>(__rt);2355 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2251 __rt = static_cast<__node_pointer>(__rt->__left_);2356 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
2252 } else if (__comp_res.__greater())2357 } else if (__comp_res.__greater())
2253 __rt = static_cast<__node_pointer>(__rt->__right_);2358 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
2254 else2359 else
2255 return _Pp(iterator(__rt),2360 return _Pp(iterator(__rt),
2256 iterator(__rt->__right_ != nullptr ? static_cast<__end_node_pointer>(std::__tree_min(__rt->__right_))2361 iterator(__rt->__right_ != nullptr
2257 : __result));2362 ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__rt->__right_))
2363 : __result));
2258 }2364 }
2259 return _Pp(iterator(__result), iterator(__result));2365 return _Pp(iterator(__result), iterator(__result));
2260}2366}
22612367
2262template <class _Tp, class _Compare, class _Allocator>2368template <class _Tp, class _Compare, class _Allocator>
2263template <class _Key>2369template <class _Key>
2264pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,2370_LIBCPP_CONSTEXPR_SINCE_CXX26 pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,
2265 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>2371 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>
2266__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {2372__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {
2267 using _Pp = pair<const_iterator, const_iterator>;2373 using _Pp = pair<const_iterator, const_iterator>;
2268 __end_node_pointer __result = __end_node();2374 __end_node_pointer __result = __end_node();
...@@ -2271,23 +2377,25 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {...@@ -2271,23 +2377,25 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {
2271 while (__rt != nullptr) {2377 while (__rt != nullptr) {
2272 auto __comp_res = __comp(__k, __rt->__get_value());2378 auto __comp_res = __comp(__k, __rt->__get_value());
2273 if (__comp_res.__less()) {2379 if (__comp_res.__less()) {
2274 __result = static_cast<__end_node_pointer>(__rt);2380 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2275 __rt = static_cast<__node_pointer>(__rt->__left_);2381 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
2276 } else if (__comp_res.__greater())2382 } else if (__comp_res.__greater())
2277 __rt = static_cast<__node_pointer>(__rt->__right_);2383 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
2278 else2384 else
2279 return _Pp(2385 return _Pp(
2280 const_iterator(__rt),2386 const_iterator(__rt),
2281 const_iterator(2387 const_iterator(__rt->__right_ != nullptr
2282 __rt->__right_ != nullptr ? static_cast<__end_node_pointer>(std::__tree_min(__rt->__right_)) : __result));2388 ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__rt->__right_))
2389 : __result));
2283 }2390 }
2284 return _Pp(const_iterator(__result), const_iterator(__result));2391 return _Pp(const_iterator(__result), const_iterator(__result));
2285}2392}
22862393
2287template <class _Tp, class _Compare, class _Allocator>2394template <class _Tp, class _Compare, class _Allocator>
2288template <class _Key>2395template <class _Key>
2289pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>2396_LIBCPP_CONSTEXPR_SINCE_CXX26
2290__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) {2397 pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator>
2398 __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) {
2291 using _Pp = pair<iterator, iterator>;2399 using _Pp = pair<iterator, iterator>;
2292 __end_node_pointer __result = __end_node();2400 __end_node_pointer __result = __end_node();
2293 __node_pointer __rt = __root();2401 __node_pointer __rt = __root();
...@@ -2295,22 +2403,23 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) {...@@ -2295,22 +2403,23 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) {
2295 while (__rt != nullptr) {2403 while (__rt != nullptr) {
2296 auto __comp_res = __comp(__k, __rt->__get_value());2404 auto __comp_res = __comp(__k, __rt->__get_value());
2297 if (__comp_res.__less()) {2405 if (__comp_res.__less()) {
2298 __result = static_cast<__end_node_pointer>(__rt);2406 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2299 __rt = static_cast<__node_pointer>(__rt->__left_);2407 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
2300 } else if (__comp_res.__greater())2408 } else if (__comp_res.__greater())
2301 __rt = static_cast<__node_pointer>(__rt->__right_);2409 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
2302 else2410 else
2303 return _Pp(2411 return _Pp(__lower_bound_multi(__k,
2304 __lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),2412 std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_),
2305 __upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));2413 std::__static_fancy_pointer_cast<__end_node_pointer>(__rt)),
2414 __upper_bound_multi(__k, std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_), __result));
2306 }2415 }
2307 return _Pp(iterator(__result), iterator(__result));2416 return _Pp(iterator(__result), iterator(__result));
2308}2417}
23092418
2310template <class _Tp, class _Compare, class _Allocator>2419template <class _Tp, class _Compare, class _Allocator>
2311template <class _Key>2420template <class _Key>
2312pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,2421_LIBCPP_CONSTEXPR_SINCE_CXX26 pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,
2313 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>2422 typename __tree<_Tp, _Compare, _Allocator>::const_iterator>
2314__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {2423__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {
2315 using _Pp = pair<const_iterator, const_iterator>;2424 using _Pp = pair<const_iterator, const_iterator>;
2316 __end_node_pointer __result = __end_node();2425 __end_node_pointer __result = __end_node();
...@@ -2319,35 +2428,37 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {...@@ -2319,35 +2428,37 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {
2319 while (__rt != nullptr) {2428 while (__rt != nullptr) {
2320 auto __comp_res = __comp(__k, __rt->__get_value());2429 auto __comp_res = __comp(__k, __rt->__get_value());
2321 if (__comp_res.__less()) {2430 if (__comp_res.__less()) {
2322 __result = static_cast<__end_node_pointer>(__rt);2431 __result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2323 __rt = static_cast<__node_pointer>(__rt->__left_);2432 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
2324 } else if (__comp_res.__greater())2433 } else if (__comp_res.__greater())
2325 __rt = static_cast<__node_pointer>(__rt->__right_);2434 __rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
2326 else2435 else
2327 return _Pp(2436 return _Pp(__lower_bound_multi(__k,
2328 __lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),2437 std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_),
2329 __upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));2438 std::__static_fancy_pointer_cast<__end_node_pointer>(__rt)),
2439 __upper_bound_multi(__k, std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_), __result));
2330 }2440 }
2331 return _Pp(const_iterator(__result), const_iterator(__result));2441 return _Pp(const_iterator(__result), const_iterator(__result));
2332}2442}
23332443
2334template <class _Tp, class _Compare, class _Allocator>2444template <class _Tp, class _Compare, class _Allocator>
2335typename __tree<_Tp, _Compare, _Allocator>::__node_holder2445_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_holder
2336__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT {2446__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT {
2337 __node_pointer __np = __p.__get_np();2447 __node_pointer __np = __p.__get_np();
2338 if (__begin_node_ == __p.__ptr_) {2448 if (__begin_node_ == __p.__ptr_) {
2339 if (__np->__right_ != nullptr)2449 if (__np->__right_ != nullptr)
2340 __begin_node_ = static_cast<__end_node_pointer>(__np->__right_);2450 __begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__np->__right_);
2341 else2451 else
2342 __begin_node_ = static_cast<__end_node_pointer>(__np->__parent_);2452 __begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__np->__parent_);
2343 }2453 }
2344 --__size_;2454 --__size_;
2345 std::__tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__np));2455 std::__tree_remove(__end_node()->__left_, std::__static_fancy_pointer_cast<__node_base_pointer>(__np));
2346 return __node_holder(__np, _Dp(__node_alloc(), true));2456 return __node_holder(__np, _Dp(__node_alloc(), true));
2347}2457}
23482458
2349template <class _Tp, class _Compare, class _Allocator>2459template <class _Tp, class _Compare, class _Allocator>
2350inline _LIBCPP_HIDE_FROM_ABI void swap(__tree<_Tp, _Compare, _Allocator>& __x, __tree<_Tp, _Compare, _Allocator>& __y)2460inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2461swap(__tree<_Tp, _Compare, _Allocator>& __x, __tree<_Tp, _Compare, _Allocator>& __y)
2351 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {2462 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
2352 __x.swap(__y);2463 __x.swap(__y);
2353}2464}
lib/libcxx/include/__tuple/make_tuple_types.h deleted-80
...@@ -1,80 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
10#define _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__fwd/array.h>
15#include <__fwd/tuple.h>
16#include <__tuple/tuple_element.h>
17#include <__tuple/tuple_indices.h>
18#include <__tuple/tuple_size.h>
19#include <__tuple/tuple_types.h>
20#include <__type_traits/copy_cvref.h>
21#include <__type_traits/remove_cvref.h>
22#include <__type_traits/remove_reference.h>
23
24#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25# pragma GCC system_header
26#endif
27
28#ifndef _LIBCPP_CXX03_LANG
29
30_LIBCPP_BEGIN_NAMESPACE_STD
31
32// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
33// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
34// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
35// lvalue_reference type, then __tuple_types<_Types&...> is the result.
36
37template <class _TupleTypes, class _TupleIndices>
38struct __make_tuple_types_flat;
39
40template <template <class...> class _Tuple, class... _Types, size_t... _Idx>
41struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
42 // Specialization for pair, tuple, and __tuple_types
43 template <class _Tp>
44 using __apply_quals _LIBCPP_NODEBUG = __tuple_types<__copy_cvref_t<_Tp, __type_pack_element<_Idx, _Types...>>...>;
45};
46
47template <class _Vt, size_t _Np, size_t... _Idx>
48struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
49 template <size_t>
50 using __value_type _LIBCPP_NODEBUG = _Vt;
51 template <class _Tp>
52 using __apply_quals _LIBCPP_NODEBUG = __tuple_types<__copy_cvref_t<_Tp, __value_type<_Idx>>...>;
53};
54
55template <class _Tp,
56 size_t _Ep = tuple_size<__libcpp_remove_reference_t<_Tp> >::value,
57 size_t _Sp = 0,
58 bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
59struct __make_tuple_types {
60 static_assert(_Sp <= _Ep, "__make_tuple_types input error");
61 using _RawTp _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
62 using _Maker _LIBCPP_NODEBUG = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
63 using type _LIBCPP_NODEBUG = typename _Maker::template __apply_quals<_Tp>;
64};
65
66template <class... _Types, size_t _Ep>
67struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
68 using type _LIBCPP_NODEBUG = __tuple_types<_Types...>;
69};
70
71template <class... _Types, size_t _Ep>
72struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
73 using type _LIBCPP_NODEBUG = __tuple_types<_Types...>;
74};
75
76_LIBCPP_END_NAMESPACE_STD
77
78#endif // _LIBCPP_CXX03_LANG
79
80#endif // _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
lib/libcxx/include/__tuple/sfinae_helpers.h+6-5
...@@ -15,10 +15,10 @@...@@ -15,10 +15,10 @@
15# pragma GCC system_header15# pragma GCC system_header
16#endif16#endif
1717
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20#ifndef _LIBCPP_CXX03_LANG18#ifndef _LIBCPP_CXX03_LANG
2119
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22struct __check_tuple_constructor_fail {22struct __check_tuple_constructor_fail {
23 static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return false; }23 static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return false; }
24 static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return false; }24 static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return false; }
...@@ -35,9 +35,8 @@ struct __check_tuple_constructor_fail {...@@ -35,9 +35,8 @@ struct __check_tuple_constructor_fail {
35 return false;35 return false;
36 }36 }
37};37};
38#endif // !defined(_LIBCPP_CXX03_LANG)
3938
40#if _LIBCPP_STD_VER >= 1739# if _LIBCPP_STD_VER >= 17
4140
42template <bool _CanCopy, bool _CanMove>41template <bool _CanCopy, bool _CanMove>
43struct __sfinae_ctor_base {};42struct __sfinae_ctor_base {};
...@@ -92,8 +91,10 @@ struct __sfinae_assign_base<false, true> {...@@ -92,8 +91,10 @@ struct __sfinae_assign_base<false, true> {
92 __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;91 __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
93 __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;92 __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
94};93};
95#endif // _LIBCPP_STD_VER >= 1794# endif // _LIBCPP_STD_VER >= 17
9695
97_LIBCPP_END_NAMESPACE_STD96_LIBCPP_END_NAMESPACE_STD
9897
98#endif // !defined(_LIBCPP_CXX03_LANG)
99
99#endif // _LIBCPP___TUPLE_SFINAE_HELPERS_H100#endif // _LIBCPP___TUPLE_SFINAE_HELPERS_H
lib/libcxx/include/__tuple/tuple_indices.h deleted-37
...@@ -1,37 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TUPLE_MAKE_TUPLE_INDICES_H
10#define _LIBCPP___TUPLE_MAKE_TUPLE_INDICES_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__utility/integer_sequence.h>
15
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header
18#endif
19
20#ifndef _LIBCPP_CXX03_LANG
21
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24template <size_t...>
25struct __tuple_indices {};
26
27template <size_t _Ep, size_t _Sp = 0>
28struct __make_tuple_indices {
29 static_assert(_Sp <= _Ep, "__make_tuple_indices input error");
30 typedef __make_indices_imp<_Ep, _Sp> type;
31};
32
33_LIBCPP_END_NAMESPACE_STD
34
35#endif // _LIBCPP_CXX03_LANG
36
37#endif // _LIBCPP___TUPLE_MAKE_TUPLE_INDICES_H
lib/libcxx/include/__tuple/tuple_like.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 2022#if _LIBCPP_STD_VER >= 20
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <class _Tp>26template <class _Tp>
27inline constexpr bool __is_ranges_subrange_v = false;27inline constexpr bool __is_ranges_subrange_v = false;
2828
...@@ -35,8 +35,8 @@ concept __tuple_like = __tuple_like_no_subrange<_Tp> || __is_ranges_subrange_v<r...@@ -35,8 +35,8 @@ concept __tuple_like = __tuple_like_no_subrange<_Tp> || __is_ranges_subrange_v<r
35// As of writing this comment every use of `pair-like` in the standard excludes `ranges::subrange`, so35// As of writing this comment every use of `pair-like` in the standard excludes `ranges::subrange`, so
36// you most likely want to use `__pair_like_no_subrange` if you're looking for `pair-like`.36// you most likely want to use `__pair_like_no_subrange` if you're looking for `pair-like`.
3737
38#endif // _LIBCPP_STD_VER >= 20
39
40_LIBCPP_END_NAMESPACE_STD38_LIBCPP_END_NAMESPACE_STD
4139
40#endif // _LIBCPP_STD_VER >= 20
41
42#endif // _LIBCPP___TUPLE_TUPLE_LIKE_H42#endif // _LIBCPP___TUPLE_TUPLE_LIKE_H
lib/libcxx/include/__tuple/tuple_like_ext.h deleted-52
...@@ -1,52 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
10#define _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__fwd/array.h>
15#include <__fwd/pair.h>
16#include <__fwd/tuple.h>
17#include <__tuple/tuple_types.h>
18#include <__type_traits/integral_constant.h>
19
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21# pragma GCC system_header
22#endif
23
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26template <class _Tp>
27struct __tuple_like_ext : false_type {};
28
29template <class _Tp>
30struct __tuple_like_ext<const _Tp> : public __tuple_like_ext<_Tp> {};
31template <class _Tp>
32struct __tuple_like_ext<volatile _Tp> : public __tuple_like_ext<_Tp> {};
33template <class _Tp>
34struct __tuple_like_ext<const volatile _Tp> : public __tuple_like_ext<_Tp> {};
35
36#ifndef _LIBCPP_CXX03_LANG
37template <class... _Tp>
38struct __tuple_like_ext<tuple<_Tp...> > : true_type {};
39#endif
40
41template <class _T1, class _T2>
42struct __tuple_like_ext<pair<_T1, _T2> > : true_type {};
43
44template <class _Tp, size_t _Size>
45struct __tuple_like_ext<array<_Tp, _Size> > : true_type {};
46
47template <class... _Tp>
48struct __tuple_like_ext<__tuple_types<_Tp...> > : true_type {};
49
50_LIBCPP_END_NAMESPACE_STD
51
52#endif // _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
lib/libcxx/include/__tuple/tuple_like_no_subrange.h+4-4
...@@ -22,10 +22,10 @@...@@ -22,10 +22,10 @@
22# pragma GCC system_header22# pragma GCC system_header
23#endif23#endif
2424
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27#if _LIBCPP_STD_VER >= 2025#if _LIBCPP_STD_VER >= 20
2826
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29template <class _Tp>29template <class _Tp>
30inline constexpr bool __tuple_like_no_subrange_impl = false;30inline constexpr bool __tuple_like_no_subrange_impl = false;
3131
...@@ -54,8 +54,8 @@ concept __tuple_like_no_subrange = __tuple_like_no_subrange_impl<remove_cvref_t<...@@ -54,8 +54,8 @@ concept __tuple_like_no_subrange = __tuple_like_no_subrange_impl<remove_cvref_t<
54template <class _Tp>54template <class _Tp>
55concept __pair_like_no_subrange = __tuple_like_no_subrange<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;55concept __pair_like_no_subrange = __tuple_like_no_subrange<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;
5656
57#endif // _LIBCPP_STD_VER >= 20
58
59_LIBCPP_END_NAMESPACE_STD57_LIBCPP_END_NAMESPACE_STD
6058
59#endif // _LIBCPP_STD_VER >= 20
60
61#endif // _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H61#endif // _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H
lib/libcxx/include/__tuple/tuple_types.h deleted-25
...@@ -1,25 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TUPLE_TUPLE_TYPES_H
10#define _LIBCPP___TUPLE_TUPLE_TYPES_H
11
12#include <__config>
13
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header
16#endif
17
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20template <class... _Tp>
21struct __tuple_types {};
22
23_LIBCPP_END_NAMESPACE_STD
24
25#endif // _LIBCPP___TUPLE_TUPLE_TYPES_H
lib/libcxx/include/__type_traits/add_pointer.h+3-28
...@@ -10,9 +10,6 @@...@@ -10,9 +10,6 @@
10#define _LIBCPP___TYPE_TRAITS_ADD_POINTER_H10#define _LIBCPP___TYPE_TRAITS_ADD_POINTER_H
1111
12#include <__config>12#include <__config>
13#include <__type_traits/is_referenceable.h>
14#include <__type_traits/is_void.h>
15#include <__type_traits/remove_reference.h>
1613
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header15# pragma GCC system_header
...@@ -20,40 +17,18 @@...@@ -20,40 +17,18 @@
2017
21_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
2219
23#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS)
24
25template <class _Tp>20template <class _Tp>
26struct _LIBCPP_NO_SPECIALIZATIONS add_pointer {21struct _LIBCPP_NO_SPECIALIZATIONS add_pointer {
27 using type _LIBCPP_NODEBUG = __add_pointer(_Tp);22 using type _LIBCPP_NODEBUG = __add_pointer(_Tp);
28};23};
2924
30# ifdef _LIBCPP_COMPILER_GCC25#ifdef _LIBCPP_COMPILER_GCC
31template <class _Tp>26template <class _Tp>
32using __add_pointer_t _LIBCPP_NODEBUG = typename add_pointer<_Tp>::type;27using __add_pointer_t _LIBCPP_NODEBUG = typename add_pointer<_Tp>::type;
33# else
34template <class _Tp>
35using __add_pointer_t _LIBCPP_NODEBUG = __add_pointer(_Tp);
36# endif
37
38#else28#else
39template <class _Tp, bool = __is_referenceable_v<_Tp> || is_void<_Tp>::value>
40struct __add_pointer_impl {
41 using type _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tp>*;
42};
43template <class _Tp>
44struct __add_pointer_impl<_Tp, false> {
45 using type _LIBCPP_NODEBUG = _Tp;
46};
47
48template <class _Tp>29template <class _Tp>
49using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;30using __add_pointer_t _LIBCPP_NODEBUG = __add_pointer(_Tp);
5031#endif
51template <class _Tp>
52struct _LIBCPP_NO_SPECIALIZATIONS add_pointer {
53 using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
54};
55
56#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS)
5732
58#if _LIBCPP_STD_VER >= 1433#if _LIBCPP_STD_VER >= 14
59template <class _Tp>34template <class _Tp>
lib/libcxx/include/__type_traits/aligned_union.h+10-13
...@@ -19,25 +19,22 @@...@@ -19,25 +19,22 @@
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2121
22template <size_t _I0, size_t... _In>22template <class _Arg0, class... _Args>
23struct __static_max;23union __union {
2424 _ALIGNAS(_LIBCPP_PREFERRED_ALIGNOF(_Arg0)) _Arg0 __arg;
25template <size_t _I0>25 __union<_Args...> __u;
26struct __static_max<_I0> {
27 static const size_t value = _I0;
28};26};
2927
30template <size_t _I0, size_t _I1, size_t... _In>28template <class _Arg>
31struct __static_max<_I0, _I1, _In...> {29union __union<_Arg> {
32 static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value : __static_max<_I1, _In...>::value;30 _ALIGNAS(_LIBCPP_PREFERRED_ALIGNOF(_Arg)) _Arg __arg;
33};31};
3432
35template <size_t _Len, class _Type0, class... _Types>33template <size_t _Len, class _Type0, class... _Types>
36struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_union {34struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_NO_SPECIALIZATIONS aligned_union {
37 static const size_t alignment_value =35 using _Union _LIBCPP_NODEBUG = __union<char[_Len], _Type0, _Types...>;
38 __static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0), _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value;36 static const size_t alignment_value = _LIBCPP_ALIGNOF(_Union);
39 static const size_t __len = __static_max<_Len, sizeof(_Type0), sizeof(_Types)...>::value;37 using type _LIBCPP_NODEBUG = typename aligned_storage<sizeof(_Union), alignment_value>::type;
40 typedef typename aligned_storage<__len, alignment_value>::type type;
41};38};
4239
43#if _LIBCPP_STD_VER >= 1440#if _LIBCPP_STD_VER >= 14
lib/libcxx/include/__type_traits/can_extract_key.h deleted-53
...@@ -1,53 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_CAN_EXTRACT_KEY_H
10#define _LIBCPP___TYPE_TRAITS_CAN_EXTRACT_KEY_H
11
12#include <__config>
13#include <__fwd/pair.h>
14#include <__type_traits/conditional.h>
15#include <__type_traits/integral_constant.h>
16#include <__type_traits/is_same.h>
17#include <__type_traits/remove_const.h>
18#include <__type_traits/remove_const_ref.h>
19
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21# pragma GCC system_header
22#endif
23
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26// These traits are used in __tree and __hash_table
27struct __extract_key_fail_tag {};
28struct __extract_key_self_tag {};
29struct __extract_key_first_tag {};
30
31template <class _ValTy, class _Key, class _RawValTy = __remove_const_ref_t<_ValTy> >
32struct __can_extract_key
33 : __conditional_t<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag, __extract_key_fail_tag> {};
34
35template <class _Pair, class _Key, class _First, class _Second>
36struct __can_extract_key<_Pair, _Key, pair<_First, _Second> >
37 : __conditional_t<_IsSame<__remove_const_t<_First>, _Key>::value, __extract_key_first_tag, __extract_key_fail_tag> {
38};
39
40// __can_extract_map_key uses true_type/false_type instead of the tags.
41// It returns true if _Key != _ContainerValueTy (the container is a map not a set)
42// and _ValTy == _Key.
43template <class _ValTy, class _Key, class _ContainerValueTy, class _RawValTy = __remove_const_ref_t<_ValTy> >
44struct __can_extract_map_key : integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {};
45
46// This specialization returns __extract_key_fail_tag for non-map containers
47// because _Key == _ContainerValueTy
48template <class _ValTy, class _Key, class _RawValTy>
49struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy> : false_type {};
50
51_LIBCPP_END_NAMESPACE_STD
52
53#endif // _LIBCPP___TYPE_TRAITS_CAN_EXTRACT_KEY_H
lib/libcxx/include/__type_traits/common_reference.h+5-3
...@@ -24,10 +24,12 @@...@@ -24,10 +24,12 @@
24# pragma GCC system_header24# pragma GCC system_header
25#endif25#endif
2626
27#if _LIBCPP_STD_VER >= 20
28
27_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
2830
29// common_reference31// common_reference
30#if _LIBCPP_STD_VER >= 2032
31// Let COND_RES(X, Y) be:33// Let COND_RES(X, Y) be:
32template <class _Xp, class _Yp>34template <class _Xp, class _Yp>
33using __cond_res _LIBCPP_NODEBUG = decltype(false ? std::declval<_Xp (&)()>()() : std::declval<_Yp (&)()>()());35using __cond_res _LIBCPP_NODEBUG = decltype(false ? std::declval<_Xp (&)()>()() : std::declval<_Yp (&)()>()());
...@@ -195,8 +197,8 @@ _LIBCPP_DIAGNOSTIC_POP...@@ -195,8 +197,8 @@ _LIBCPP_DIAGNOSTIC_POP
195template <class...>197template <class...>
196struct _LIBCPP_NO_SPECIALIZATIONS common_reference {};198struct _LIBCPP_NO_SPECIALIZATIONS common_reference {};
197199
198#endif // _LIBCPP_STD_VER >= 20
199
200_LIBCPP_END_NAMESPACE_STD200_LIBCPP_END_NAMESPACE_STD
201201
202#endif // _LIBCPP_STD_VER >= 20
203
202#endif // _LIBCPP___TYPE_TRAITS_COMMON_REFERENCE_H204#endif // _LIBCPP___TYPE_TRAITS_COMMON_REFERENCE_H
lib/libcxx/include/__type_traits/conditional.h+2-12
...@@ -35,20 +35,10 @@ struct _IfImpl<false> {...@@ -35,20 +35,10 @@ struct _IfImpl<false> {
35template <bool _Cond, class _IfRes, class _ElseRes>35template <bool _Cond, class _IfRes, class _ElseRes>
36using _If _LIBCPP_NODEBUG = typename _IfImpl<_Cond>::template _Select<_IfRes, _ElseRes>;36using _If _LIBCPP_NODEBUG = typename _IfImpl<_Cond>::template _Select<_IfRes, _ElseRes>;
3737
38template <bool _Bp, class _If, class _Then>38template <bool _Bp, class _IfRes, class _ElseRes>
39struct _LIBCPP_NO_SPECIALIZATIONS conditional {39struct _LIBCPP_NO_SPECIALIZATIONS conditional {
40 using type _LIBCPP_NODEBUG = _If;40 using type _LIBCPP_NODEBUG = _If<_Bp, _IfRes, _ElseRes>;
41};
42
43_LIBCPP_DIAGNOSTIC_PUSH
44#if __has_warning("-Winvalid-specialization")
45_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
46#endif
47template <class _If, class _Then>
48struct conditional<false, _If, _Then> {
49 using type _LIBCPP_NODEBUG = _Then;
50};41};
51_LIBCPP_DIAGNOSTIC_POP
5242
53#if _LIBCPP_STD_VER >= 1443#if _LIBCPP_STD_VER >= 14
54template <bool _Bp, class _IfRes, class _ElseRes>44template <bool _Bp, class _IfRes, class _ElseRes>
lib/libcxx/include/__type_traits/conjunction.h+1-1
...@@ -34,7 +34,7 @@ false_type __and_helper(...);...@@ -34,7 +34,7 @@ false_type __and_helper(...);
34//34//
35// However, `_And<_Pred...>` itself will evaluate its result immediately (without having to35// However, `_And<_Pred...>` itself will evaluate its result immediately (without having to
36// be instantiated) since it is an alias, unlike `conjunction<_Pred...>`, which is a struct.36// be instantiated) since it is an alias, unlike `conjunction<_Pred...>`, which is a struct.
37// If you want to defer the evaluation of `_And<_Pred...>` itself, use `_Lazy<_And, _Pred...>`.37// If you want to defer the evaluation, use `conjunction{,_v}<_Pred...>`.
38template <class... _Pred>38template <class... _Pred>
39using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));39using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));
4040
lib/libcxx/include/__type_traits/dependent_type.h deleted-25
...@@ -1,25 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_DEPENDENT_TYPE_H
10#define _LIBCPP___TYPE_TRAITS_DEPENDENT_TYPE_H
11
12#include <__config>
13
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header
16#endif
17
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20template <class _Tp, bool>
21struct __dependent_type : public _Tp {};
22
23_LIBCPP_END_NAMESPACE_STD
24
25#endif // _LIBCPP___TYPE_TRAITS_DEPENDENT_TYPE_H
lib/libcxx/include/__type_traits/disjunction.h+1-2
...@@ -38,8 +38,7 @@ struct _OrImpl<false> {...@@ -38,8 +38,7 @@ struct _OrImpl<false> {
38//38//
39// However, `_Or<_Pred...>` itself will evaluate its result immediately (without having to39// However, `_Or<_Pred...>` itself will evaluate its result immediately (without having to
40// be instantiated) since it is an alias, unlike `disjunction<_Pred...>`, which is a struct.40// be instantiated) since it is an alias, unlike `disjunction<_Pred...>`, which is a struct.
41// If you want to defer the evaluation of `_Or<_Pred...>` itself, use `_Lazy<_Or, _Pred...>`41// If you want to defer the evaluation , use `disjunction{,_v}<_Pred...>`.
42// or `disjunction<_Pred...>` directly.
43template <class... _Args>42template <class... _Args>
44using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;43using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
4544
lib/libcxx/include/__type_traits/has_unique_object_representation.h+4-4
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 1719#if _LIBCPP_STD_VER >= 17
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class _Tp>23template <class _Tp>
24struct _LIBCPP_NO_SPECIALIZATIONS has_unique_object_representations24struct _LIBCPP_NO_SPECIALIZATIONS has_unique_object_representations
25 : integral_constant<bool, __has_unique_object_representations(_Tp)> {};25 : integral_constant<bool, __has_unique_object_representations(_Tp)> {};
...@@ -28,8 +28,8 @@ template <class _Tp>...@@ -28,8 +28,8 @@ template <class _Tp>
28_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool has_unique_object_representations_v =28_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool has_unique_object_representations_v =
29 __has_unique_object_representations(_Tp);29 __has_unique_object_representations(_Tp);
3030
31#endif
32
33_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
3432
33#endif // _LIBCPP_STD_VER >= 17
34
35#endif // _LIBCPP___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H35#endif // _LIBCPP___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H
lib/libcxx/include/__type_traits/integer_traits.h+26-29
...@@ -10,6 +10,11 @@...@@ -10,6 +10,11 @@
10#define _LIBCPP___TYPE_TRAITS_INTEGER_TRAITS_H10#define _LIBCPP___TYPE_TRAITS_INTEGER_TRAITS_H
1111
12#include <__config>12#include <__config>
13#include <__type_traits/is_integral.h>
14#include <__type_traits/is_same.h>
15#include <__type_traits/is_signed.h>
16#include <__type_traits/is_unqualified.h>
17#include <__type_traits/is_unsigned.h>
1318
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header20# pragma GCC system_header
...@@ -17,43 +22,35 @@...@@ -17,43 +22,35 @@
1722
18_LIBCPP_BEGIN_NAMESPACE_STD23_LIBCPP_BEGIN_NAMESPACE_STD
1924
20// This trait is to determine whether a type is a /signed integer type/25// /signed integer type/ and /unsigned integer type/ per [basic.fundamental]
21// See [basic.fundamental]/p126// /p1-2: specific unqualified types plus extended integer types. bool and
27// character types are integral but excluded. cv-qualified versions are
28// distinct types ([basic.type.qualifier]) and so excluded.
29
22template <class _Tp>30template <class _Tp>
23inline const bool __is_signed_integer_v = false;31inline const bool __is_character_v = false;
24template <>
25inline const bool __is_signed_integer_v<signed char> = true;
26template <>32template <>
27inline const bool __is_signed_integer_v<signed short> = true;33inline const bool __is_character_v<char> = true;
28template <>34template <>
29inline const bool __is_signed_integer_v<signed int> = true;35inline const bool __is_character_v<wchar_t> = true;
36#if _LIBCPP_HAS_CHAR8_T
30template <>37template <>
31inline const bool __is_signed_integer_v<signed long> = true;38inline const bool __is_character_v<char8_t> = true;
39#endif
32template <>40template <>
33inline const bool __is_signed_integer_v<signed long long> = true;41inline const bool __is_character_v<char16_t> = true;
34#if _LIBCPP_HAS_INT128
35template <>42template <>
36inline const bool __is_signed_integer_v<__int128_t> = true;43inline const bool __is_character_v<char32_t> = true;
37#endif
3844
39// This trait is to determine whether a type is an /unsigned integer type/
40// See [basic.fundamental]/p2
41template <class _Tp>45template <class _Tp>
42inline const bool __is_unsigned_integer_v = false;46inline const bool __is_signed_integer_v =
43template <>47 is_integral<_Tp>::value && is_signed<_Tp>::value && !__is_character_v<_Tp> && !is_same<_Tp, bool>::value &&
44inline const bool __is_unsigned_integer_v<unsigned char> = true;48 __is_unqualified_v<_Tp>;
45template <>49
46inline const bool __is_unsigned_integer_v<unsigned short> = true;50template <class _Tp>
47template <>51inline const bool __is_unsigned_integer_v =
48inline const bool __is_unsigned_integer_v<unsigned int> = true;52 is_integral<_Tp>::value && is_unsigned<_Tp>::value && !__is_character_v<_Tp> && !is_same<_Tp, bool>::value &&
49template <>53 __is_unqualified_v<_Tp>;
50inline const bool __is_unsigned_integer_v<unsigned long> = true;
51template <>
52inline const bool __is_unsigned_integer_v<unsigned long long> = true;
53#if _LIBCPP_HAS_INT128
54template <>
55inline const bool __is_unsigned_integer_v<__uint128_t> = true;
56#endif
5754
58#if _LIBCPP_STD_VER >= 2055#if _LIBCPP_STD_VER >= 20
59template <class _Tp>56template <class _Tp>
lib/libcxx/include/__type_traits/integral_constant.h+1-1
...@@ -24,7 +24,7 @@ struct _LIBCPP_NO_SPECIALIZATIONS integral_constant {...@@ -24,7 +24,7 @@ struct _LIBCPP_NO_SPECIALIZATIONS integral_constant {
24 typedef integral_constant type;24 typedef integral_constant type;
25 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT { return value; }25 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT { return value; }
26#if _LIBCPP_STD_VER >= 1426#if _LIBCPP_STD_VER >= 14
27 _LIBCPP_HIDE_FROM_ABI constexpr value_type operator()() const _NOEXCEPT { return value; }27 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator()() const _NOEXCEPT { return value; }
28#endif28#endif
29};29};
3030
lib/libcxx/include/__type_traits/is_bounded_array.h deleted-36
...@@ -1,36 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
10#define _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
11
12#include <__config>
13#include <__type_traits/integral_constant.h>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21template <class _Tp>
22inline const bool __is_bounded_array_v = __is_bounded_array(_Tp);
23
24#if _LIBCPP_STD_VER >= 20
25
26template <class _Tp>
27struct _LIBCPP_NO_SPECIALIZATIONS is_bounded_array : bool_constant<__is_bounded_array(_Tp)> {};
28
29template <class _Tp>
30_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
31
32#endif
33
34_LIBCPP_END_NAMESPACE_STD
35
36#endif // _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
lib/libcxx/include/__type_traits/is_constant_evaluated.h+1-1
...@@ -18,7 +18,7 @@...@@ -18,7 +18,7 @@
18_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
1919
20#if _LIBCPP_STD_VER >= 2020#if _LIBCPP_STD_VER >= 20
21_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_constant_evaluated() noexcept {21[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_constant_evaluated() noexcept {
22 return __builtin_is_constant_evaluated();22 return __builtin_is_constant_evaluated();
23}23}
24#endif24#endif
lib/libcxx/include/__type_traits/is_implicit_lifetime.h+4-2
...@@ -16,9 +16,10 @@...@@ -16,9 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19#if _LIBCPP_STD_VER >= 23
20
19_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2022
21#if _LIBCPP_STD_VER >= 23
22# if __has_builtin(__builtin_is_implicit_lifetime)23# if __has_builtin(__builtin_is_implicit_lifetime)
2324
24template <class _Tp>25template <class _Tp>
...@@ -28,8 +29,9 @@ template <class _Tp>...@@ -28,8 +29,9 @@ template <class _Tp>
28_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Tp);29_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Tp);
2930
30# endif31# endif
31#endif
3232
33_LIBCPP_END_NAMESPACE_STD33_LIBCPP_END_NAMESPACE_STD
3434
35#endif // _LIBCPP_STD_VER >= 23
36
35#endif // _LIBCPP___TYPE_TRAITS_IS_IMPLICIT_LIFETIME_H37#endif // _LIBCPP___TYPE_TRAITS_IS_IMPLICIT_LIFETIME_H
lib/libcxx/include/__type_traits/is_implicitly_default_constructible.h+4-2
...@@ -17,9 +17,10 @@...@@ -17,9 +17,10 @@
17# pragma GCC system_header17# pragma GCC system_header
18#endif18#endif
1919
20#ifndef _LIBCPP_CXX03_LANG
21
20_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
2123
22#ifndef _LIBCPP_CXX03_LANG
23// First of all, we can't implement this check in C++03 mode because the {}24// First of all, we can't implement this check in C++03 mode because the {}
24// default initialization syntax isn't valid.25// default initialization syntax isn't valid.
25// Second, we implement the trait in a funny manner with two defaulted template26// Second, we implement the trait in a funny manner with two defaulted template
...@@ -39,8 +40,9 @@ template <class _Tp>...@@ -39,8 +40,9 @@ template <class _Tp>
39struct __is_implicitly_default_constructible<_Tp,40struct __is_implicitly_default_constructible<_Tp,
40 decltype(std::__test_implicit_default_constructible<_Tp const&>({})),41 decltype(std::__test_implicit_default_constructible<_Tp const&>({})),
41 false_type> : false_type {};42 false_type> : false_type {};
42#endif // !C++03
4343
44_LIBCPP_END_NAMESPACE_STD44_LIBCPP_END_NAMESPACE_STD
4545
46#endif // _LIBCPP_CXX03_LANG
47
46#endif // _LIBCPP___TYPE_TRAITS_IS_IMPLICITLY_DEFAULT_CONSTRUCTIBLE_H48#endif // _LIBCPP___TYPE_TRAITS_IS_IMPLICITLY_DEFAULT_CONSTRUCTIBLE_H
lib/libcxx/include/__type_traits/is_literal_type.h+4-2
...@@ -16,9 +16,10 @@...@@ -16,9 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
20
19_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2022
21#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
22template <class _Tp>23template <class _Tp>
23struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS is_literal_type24struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS is_literal_type
24 : integral_constant<bool, __is_literal_type(_Tp)> {};25 : integral_constant<bool, __is_literal_type(_Tp)> {};
...@@ -27,8 +28,9 @@ struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS is_literal_type...@@ -27,8 +28,9 @@ struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS is_literal_type
27template <class _Tp>28template <class _Tp>
28_LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_literal_type_v = __is_literal_type(_Tp);29_LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_literal_type_v = __is_literal_type(_Tp);
29# endif // _LIBCPP_STD_VER >= 1730# endif // _LIBCPP_STD_VER >= 17
30#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
3131
32_LIBCPP_END_NAMESPACE_STD32_LIBCPP_END_NAMESPACE_STD
3333
34#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
35
34#endif // _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE36#endif // _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE
lib/libcxx/include/__type_traits/is_primary_template.h deleted-32
...@@ -1,32 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
10#define _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
11
12#include <__config>
13#include <__type_traits/enable_if.h>
14#include <__type_traits/is_same.h>
15#include <__type_traits/is_valid_expansion.h>
16
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header
19#endif
20
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class _Tp>
24using __test_for_primary_template _LIBCPP_NODEBUG =
25 __enable_if_t<_IsSame<_Tp, typename _Tp::__primary_template>::value>;
26
27template <class _Tp>
28using __is_primary_template _LIBCPP_NODEBUG = _IsValidExpansion<__test_for_primary_template, _Tp>;
29
30_LIBCPP_END_NAMESPACE_STD
31
32#endif // _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
lib/libcxx/include/__type_traits/is_referenceable.h deleted-34
...@@ -1,34 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
10#define _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
11
12#include <__config>
13#include <__type_traits/void_t.h>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21template <class _Tp, class = void>
22inline const bool __is_referenceable_v = false;
23
24template <class _Tp>
25inline const bool __is_referenceable_v<_Tp, __void_t<_Tp&> > = true;
26
27#if _LIBCPP_STD_VER >= 20
28template <class _Tp>
29concept __referenceable = __is_referenceable_v<_Tp>;
30#endif
31
32_LIBCPP_END_NAMESPACE_STD
33
34#endif // _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
lib/libcxx/include/__type_traits/is_replaceable.h deleted-61
...@@ -1,61 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_REPLACEABLE_H
10#define _LIBCPP___TYPE_TRAITS_IS_REPLACEABLE_H
11
12#include <__config>
13#include <__type_traits/enable_if.h>
14#include <__type_traits/integral_constant.h>
15#include <__type_traits/is_same.h>
16#include <__type_traits/is_trivially_copyable.h>
17
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19# pragma GCC system_header
20#endif
21
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24// A type is replaceable if, with `x` and `y` being different objects, `x = std::move(y)` is equivalent to:
25//
26// std::destroy_at(&x)
27// std::construct_at(&x, std::move(y))
28//
29// This allows turning a move-assignment into a sequence of destroy + move-construct, which
30// is often more efficient. This is especially relevant when the move-construct is in fact
31// part of a trivial relocation from somewhere else, in which case there is a huge win.
32//
33// Note that this requires language support in order to be really effective, but we
34// currently emulate the base template with something very conservative.
35template <class _Tp, class = void>
36struct __is_replaceable : is_trivially_copyable<_Tp> {};
37
38template <class _Tp>
39struct __is_replaceable<_Tp, __enable_if_t<is_same<_Tp, typename _Tp::__replaceable>::value> > : true_type {};
40
41template <class _Tp>
42inline const bool __is_replaceable_v = __is_replaceable<_Tp>::value;
43
44// Determines whether an allocator member of a container is replaceable.
45//
46// First, we require the allocator type to be considered replaceable. If not, then something fishy might be
47// happening. Assuming the allocator type is replaceable, we conclude replaceability of the allocator as a
48// member of the container if the allocator always compares equal (in which case propagation doesn't matter),
49// or if the allocator always propagates on assignment, which is required in order for move construction and
50// assignment to be equivalent.
51template <class _AllocatorTraits>
52struct __container_allocator_is_replaceable
53 : integral_constant<bool,
54 __is_replaceable_v<typename _AllocatorTraits::allocator_type> &&
55 (_AllocatorTraits::is_always_equal::value ||
56 (_AllocatorTraits::propagate_on_container_move_assignment::value &&
57 _AllocatorTraits::propagate_on_container_copy_assignment::value))> {};
58
59_LIBCPP_END_NAMESPACE_STD
60
61#endif // _LIBCPP___TYPE_TRAITS_IS_REPLACEABLE_H
lib/libcxx/include/__type_traits/is_trivially_relocatable.h+4
...@@ -34,10 +34,14 @@ template <class _Tp, class = void>...@@ -34,10 +34,14 @@ template <class _Tp, class = void>
34struct __libcpp_is_trivially_relocatable : is_trivially_copyable<_Tp> {};34struct __libcpp_is_trivially_relocatable : is_trivially_copyable<_Tp> {};
35#endif35#endif
3636
37// __trivially_relocatable on libc++'s builtin types does not currently return the right answer with PFP
38// in tagged mode, in which the address of the pointer is used as part of the pointer encoding.
39#if !defined(__POINTER_FIELD_PROTECTION_TAGGED__)
37template <class _Tp>40template <class _Tp>
38struct __libcpp_is_trivially_relocatable<_Tp,41struct __libcpp_is_trivially_relocatable<_Tp,
39 __enable_if_t<is_same<_Tp, typename _Tp::__trivially_relocatable>::value> >42 __enable_if_t<is_same<_Tp, typename _Tp::__trivially_relocatable>::value> >
40 : true_type {};43 : true_type {};
44#endif
4145
42_LIBCPP_END_NAMESPACE_STD46_LIBCPP_END_NAMESPACE_STD
4347
lib/libcxx/include/__type_traits/is_unbounded_array.h deleted-38
...@@ -1,38 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
10#define _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
11
12#include <__config>
13#include <__type_traits/integral_constant.h>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21template <class>
22inline const bool __is_unbounded_array_v = false;
23template <class _Tp>
24inline const bool __is_unbounded_array_v<_Tp[]> = true;
25
26#if _LIBCPP_STD_VER >= 20
27
28template <class _Tp>
29struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : bool_constant<__is_unbounded_array_v<_Tp>> {};
30
31template <class _Tp>
32_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = __is_unbounded_array_v<_Tp>;
33
34#endif
35
36_LIBCPP_END_NAMESPACE_STD
37
38#endif // _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
lib/libcxx/include/__type_traits/is_valid_expansion.h deleted-31
...@@ -1,31 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H
10#define _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H
11
12#include <__config>
13#include <__type_traits/integral_constant.h>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21template <template <class...> class _Templ, class... _Args, class = _Templ<_Args...> >
22true_type __sfinae_test_impl(int);
23template <template <class...> class, class...>
24false_type __sfinae_test_impl(...);
25
26template <template <class...> class _Templ, class... _Args>
27using _IsValidExpansion _LIBCPP_NODEBUG = decltype(std::__sfinae_test_impl<_Templ, _Args...>(0));
28
29_LIBCPP_END_NAMESPACE_STD
30
31#endif // _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H
lib/libcxx/include/__type_traits/is_within_lifetime.h+1-1
...@@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
1919
20#if _LIBCPP_STD_VER >= 26 && __has_builtin(__builtin_is_within_lifetime)20#if _LIBCPP_STD_VER >= 26 && __has_builtin(__builtin_is_within_lifetime)
21template <class _Tp>21template <class _Tp>
22_LIBCPP_HIDE_FROM_ABI consteval bool is_within_lifetime(const _Tp* __p) noexcept {22[[nodiscard]] _LIBCPP_HIDE_FROM_ABI consteval bool is_within_lifetime(const _Tp* __p) noexcept {
23 return __builtin_is_within_lifetime(__p);23 return __builtin_is_within_lifetime(__p);
24}24}
25#endif25#endif
lib/libcxx/include/__type_traits/lazy.h deleted-25
...@@ -1,25 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___TYPE_TRAITS_LAZY_H
10#define _LIBCPP___TYPE_TRAITS_LAZY_H
11
12#include <__config>
13
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header
16#endif
17
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20template <template <class...> class _Func, class... _Args>
21struct _Lazy : _Func<_Args...> {};
22
23_LIBCPP_END_NAMESPACE_STD
24
25#endif // _LIBCPP___TYPE_TRAITS_LAZY_H
lib/libcxx/include/__type_traits/make_transparent.h+13-11
...@@ -22,29 +22,31 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -22,29 +22,31 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222
23// __make_transparent tries to create a transparent comparator from its non-transparent counterpart, e.g. obtain23// __make_transparent tries to create a transparent comparator from its non-transparent counterpart, e.g. obtain
24// `less<>` from `less<T>`. This is useful in cases where conversions can be avoided (e.g. a string literal to a24// `less<>` from `less<T>`. This is useful in cases where conversions can be avoided (e.g. a string literal to a
25// std::string).25// std::string). This depends on the argument type provided to the comparator, because a comparator might be
26// transparent for some argument types but not for others.
2627
27template <class _Tp, class _Comparator>28template <class _ArgumentType, class _Comparator>
28struct __make_transparent {29struct __make_transparent {
29 using type _LIBCPP_NODEBUG = _Comparator;30 using type _LIBCPP_NODEBUG = _Comparator;
30};31};
3132
32template <class _Tp, class _Comparator>33template <class _ArgumentType, class _Comparator>
33using __make_transparent_t _LIBCPP_NODEBUG = typename __make_transparent<_Tp, _Comparator>::type;34using __make_transparent_t _LIBCPP_NODEBUG = typename __make_transparent<_ArgumentType, _Comparator>::type;
3435
35template <class _Tp,36template <class _ArgumentType,
36 class _Comparator,37 class _Comparator,
37 __enable_if_t<is_same<_Comparator, __make_transparent_t<_Tp, _Comparator> >::value, int> = 0>38 __enable_if_t<is_same<_Comparator, __make_transparent_t<_ArgumentType, _Comparator> >::value, int> = 0>
38_LIBCPP_HIDE_FROM_ABI _Comparator& __as_transparent(_Comparator& __comp) {39_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Comparator& __as_transparent(_Comparator& __comp) {
39 return __comp;40 return __comp;
40}41}
4142
42template <class _Tp,43template <class _ArgumentType,
43 class _Comparator,44 class _Comparator,
44 __enable_if_t<!is_same<_Comparator, __make_transparent_t<_Tp, _Comparator> >::value, int> = 0>45 __enable_if_t<!is_same<_Comparator, __make_transparent_t<_ArgumentType, _Comparator> >::value, int> = 0>
45_LIBCPP_HIDE_FROM_ABI __make_transparent_t<_Tp, _Comparator> __as_transparent(_Comparator&) {46_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __make_transparent_t<_ArgumentType, _Comparator>
47__as_transparent(_Comparator&) {
46 static_assert(is_empty<_Comparator>::value);48 static_assert(is_empty<_Comparator>::value);
47 return __make_transparent_t<_Tp, _Comparator>();49 return __make_transparent_t<_ArgumentType, _Comparator>();
48}50}
4951
50_LIBCPP_END_NAMESPACE_STD52_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__type_traits/rank.h+1-21
...@@ -19,32 +19,12 @@...@@ -19,32 +19,12 @@
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
2121
22#if __has_builtin(__array_rank) && !defined(_LIBCPP_COMPILER_CLANG_BASED) || \
23 (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 2001)
24
25template <class _Tp>22template <class _Tp>
26struct _LIBCPP_NO_SPECIALIZATIONS rank : integral_constant<size_t, __array_rank(_Tp)> {};23struct _LIBCPP_NO_SPECIALIZATIONS rank : integral_constant<size_t, __array_rank(_Tp)> {};
2724
28#else
29
30template <class _Tp>
31struct _LIBCPP_NO_SPECIALIZATIONS rank : public integral_constant<size_t, 0> {};
32
33_LIBCPP_DIAGNOSTIC_PUSH
34# if __has_warning("-Winvalid-specialization")
35_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
36# endif
37template <class _Tp>
38struct rank<_Tp[]> : public integral_constant<size_t, rank<_Tp>::value + 1> {};
39template <class _Tp, size_t _Np>
40struct rank<_Tp[_Np]> : public integral_constant<size_t, rank<_Tp>::value + 1> {};
41_LIBCPP_DIAGNOSTIC_POP
42
43#endif // __has_builtin(__array_rank)
44
45#if _LIBCPP_STD_VER >= 1725#if _LIBCPP_STD_VER >= 17
46template <class _Tp>26template <class _Tp>
47_LIBCPP_NO_SPECIALIZATIONS inline constexpr size_t rank_v = rank<_Tp>::value;27_LIBCPP_NO_SPECIALIZATIONS inline constexpr size_t rank_v = __array_rank(_Tp);
48#endif28#endif
4929
50_LIBCPP_END_NAMESPACE_STD30_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__type_traits/reference_converts_from_temporary.h+4-4
...@@ -16,10 +16,10 @@...@@ -16,10 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if _LIBCPP_STD_VER >= 2319#if _LIBCPP_STD_VER >= 23
2220
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23template <class _Tp, class _Up>23template <class _Tp, class _Up>
24struct _LIBCPP_NO_SPECIALIZATIONS reference_converts_from_temporary24struct _LIBCPP_NO_SPECIALIZATIONS reference_converts_from_temporary
25 : public bool_constant<__reference_converts_from_temporary(_Tp, _Up)> {};25 : public bool_constant<__reference_converts_from_temporary(_Tp, _Up)> {};
...@@ -28,8 +28,8 @@ template <class _Tp, class _Up>...@@ -28,8 +28,8 @@ template <class _Tp, class _Up>
28_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool reference_converts_from_temporary_v =28_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool reference_converts_from_temporary_v =
29 __reference_converts_from_temporary(_Tp, _Up);29 __reference_converts_from_temporary(_Tp, _Up);
3030
31#endif
32
33_LIBCPP_END_NAMESPACE_STD31_LIBCPP_END_NAMESPACE_STD
3432
33#endif // _LIBCPP_STD_VER >= 23
34
35#endif // _LIBCPP___TYPE_TRAITS_REFERENCE_CONVERTS_FROM_TEMPORARY_H35#endif // _LIBCPP___TYPE_TRAITS_REFERENCE_CONVERTS_FROM_TEMPORARY_H
lib/libcxx/include/__type_traits/remove_pointer.h+3-16
...@@ -17,31 +17,18 @@...@@ -17,31 +17,18 @@
1717
18_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
1919
20#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
21template <class _Tp>20template <class _Tp>
22struct _LIBCPP_NO_SPECIALIZATIONS remove_pointer {21struct _LIBCPP_NO_SPECIALIZATIONS remove_pointer {
23 using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);22 using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
24};23};
2524
26# ifdef _LIBCPP_COMPILER_GCC25#ifdef _LIBCPP_COMPILER_GCC
27template <class _Tp>26template <class _Tp>
28using __remove_pointer_t _LIBCPP_NODEBUG = typename remove_pointer<_Tp>::type;27using __remove_pointer_t _LIBCPP_NODEBUG = typename remove_pointer<_Tp>::type;
29# else
30template <class _Tp>
31using __remove_pointer_t _LIBCPP_NODEBUG = __remove_pointer(_Tp);
32# endif
33#else28#else
34// clang-format off
35template <class _Tp> struct remove_pointer {using type _LIBCPP_NODEBUG = _Tp;};
36template <class _Tp> struct remove_pointer<_Tp*> {using type _LIBCPP_NODEBUG = _Tp;};
37template <class _Tp> struct remove_pointer<_Tp* const> {using type _LIBCPP_NODEBUG = _Tp;};
38template <class _Tp> struct remove_pointer<_Tp* volatile> {using type _LIBCPP_NODEBUG = _Tp;};
39template <class _Tp> struct remove_pointer<_Tp* const volatile> {using type _LIBCPP_NODEBUG = _Tp;};
40// clang-format on
41
42template <class _Tp>29template <class _Tp>
43using __remove_pointer_t = typename remove_pointer<_Tp>::type;30using __remove_pointer_t _LIBCPP_NODEBUG = __remove_pointer(_Tp);
44#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)31#endif
4532
46#if _LIBCPP_STD_VER >= 1433#if _LIBCPP_STD_VER >= 14
47template <class _Tp>34template <class _Tp>
lib/libcxx/include/__type_traits/result_of.h+6-4
...@@ -16,18 +16,19 @@...@@ -16,18 +16,19 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
20
19_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
2022
21// result_of23// result_of
2224
23#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
24template <class _Callable>25template <class _Callable>
25struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS result_of;26struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS result_of;
2627
27_LIBCPP_DIAGNOSTIC_PUSH28_LIBCPP_DIAGNOSTIC_PUSH
28#if __has_warning("-Winvalid-specialization")29# if __has_warning("-Winvalid-specialization")
29_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")30_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
30#endif31# endif
31template <class _Fp, class... _Args>32template <class _Fp, class... _Args>
32struct result_of<_Fp(_Args...)> : __invoke_result<_Fp, _Args...> {};33struct result_of<_Fp(_Args...)> : __invoke_result<_Fp, _Args...> {};
33_LIBCPP_DIAGNOSTIC_POP34_LIBCPP_DIAGNOSTIC_POP
...@@ -36,8 +37,9 @@ _LIBCPP_DIAGNOSTIC_POP...@@ -36,8 +37,9 @@ _LIBCPP_DIAGNOSTIC_POP
36template <class _Tp>37template <class _Tp>
37using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;38using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
38# endif // _LIBCPP_STD_VER >= 1439# endif // _LIBCPP_STD_VER >= 14
39#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
4040
41_LIBCPP_END_NAMESPACE_STD41_LIBCPP_END_NAMESPACE_STD
4242
43#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
44
43#endif // _LIBCPP___TYPE_TRAITS_RESULT_OF_H45#endif // _LIBCPP___TYPE_TRAITS_RESULT_OF_H
lib/libcxx/include/__type_traits/strip_signature.h+3
...@@ -74,6 +74,9 @@ template<class _Rp, class _Gp, class ..._Ap>...@@ -74,6 +74,9 @@ template<class _Rp, class _Gp, class ..._Ap>
74struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type _LIBCPP_NODEBUG = _Rp(_Ap...); };74struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type _LIBCPP_NODEBUG = _Rp(_Ap...); };
75// clang-format on75// clang-format on
7676
77template <class _Fp>
78using __strip_signature_t _LIBCPP_NODEBUG = typename __strip_signature<_Fp>::type;
79
77_LIBCPP_END_NAMESPACE_STD80_LIBCPP_END_NAMESPACE_STD
7881
79#endif // _LIBCPP_STD_VER >= 1782#endif // _LIBCPP_STD_VER >= 17
lib/libcxx/include/__utility/as_const.h+4-2
...@@ -15,9 +15,10 @@...@@ -15,9 +15,10 @@
15# pragma GCC system_header15# pragma GCC system_header
16#endif16#endif
1717
18#if _LIBCPP_STD_VER >= 17
19
18_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
1921
20#if _LIBCPP_STD_VER >= 17
21template <class _Tp>22template <class _Tp>
22[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& as_const(_Tp& __t) noexcept {23[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& as_const(_Tp& __t) noexcept {
23 return __t;24 return __t;
...@@ -25,8 +26,9 @@ template <class _Tp>...@@ -25,8 +26,9 @@ template <class _Tp>
2526
26template <class _Tp>27template <class _Tp>
27void as_const(const _Tp&&) = delete;28void as_const(const _Tp&&) = delete;
28#endif
2929
30_LIBCPP_END_NAMESPACE_STD30_LIBCPP_END_NAMESPACE_STD
3131
32#endif // _LIBCPP_STD_VER >= 17
33
32#endif // _LIBCPP___UTILITY_AS_CONST_H34#endif // _LIBCPP___UTILITY_AS_CONST_H
lib/libcxx/include/__utility/constant_wrapper.h created+326
...@@ -0,0 +1,326 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___UTILITY_CONSTANT_WRAPPER_H
10#define _LIBCPP___UTILITY_CONSTANT_WRAPPER_H
11
12#include <__config>
13#include <__cstddef/size_t.h>
14#include <__functional/invoke.h>
15#include <__type_traits/invoke.h>
16#include <__type_traits/is_constructible.h>
17#include <__type_traits/is_same.h>
18#include <__type_traits/remove_cvref.h>
19#include <__utility/declval.h>
20#include <__utility/forward.h>
21#include <__utility/integer_sequence.h>
22
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24# pragma GCC system_header
25#endif
26
27_LIBCPP_BEGIN_NAMESPACE_STD
28
29#if _LIBCPP_STD_VER >= 26
30
31template <auto _Xp, class = remove_cvref_t<decltype(_Xp)>>
32struct constant_wrapper;
33
34template <class _Tp>
35concept __constexpr_param = requires { typename constant_wrapper<_Tp::value>; };
36
37template <auto _Xp>
38constexpr auto cw = constant_wrapper<_Xp>{};
39
40struct __cw_operators {
41 // unary operators
42 template <__constexpr_param _Tp>
43 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator+(_Tp) noexcept -> constant_wrapper<(+_Tp::value)> {
44 return {};
45 }
46 template <__constexpr_param _Tp>
47 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator-(_Tp) noexcept -> constant_wrapper<(-_Tp::value)> {
48 return {};
49 }
50 template <__constexpr_param _Tp>
51 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator~(_Tp) noexcept -> constant_wrapper<(~_Tp::value)> {
52 return {};
53 }
54 template <__constexpr_param _Tp>
55 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator!(_Tp) noexcept -> constant_wrapper<(!_Tp::value)> {
56 return {};
57 }
58 template <__constexpr_param _Tp>
59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator&(_Tp) noexcept -> constant_wrapper<(&_Tp::value)> {
60 return {};
61 }
62 template <__constexpr_param _Tp>
63 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator*(_Tp) noexcept -> constant_wrapper<(*_Tp::value)> {
64 return {};
65 }
66
67 // binary operators
68 template <__constexpr_param _Lp, __constexpr_param _Rp>
69 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator+(_Lp, _Rp) noexcept
70 -> constant_wrapper<(_Lp::value + _Rp::value)> {
71 return {};
72 }
73 template <__constexpr_param _Lp, __constexpr_param _Rp>
74 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator-(_Lp, _Rp) noexcept
75 -> constant_wrapper<(_Lp::value - _Rp::value)> {
76 return {};
77 }
78 template <__constexpr_param _Lp, __constexpr_param _Rp>
79 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator*(_Lp, _Rp) noexcept
80 -> constant_wrapper<(_Lp::value * _Rp::value)> {
81 return {};
82 }
83 template <__constexpr_param _Lp, __constexpr_param _Rp>
84 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator/(_Lp, _Rp) noexcept
85 -> constant_wrapper<(_Lp::value / _Rp::value)> {
86 return {};
87 }
88 template <__constexpr_param _Lp, __constexpr_param _Rp>
89 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator%(_Lp, _Rp) noexcept
90 -> constant_wrapper<(_Lp::value % _Rp::value)> {
91 return {};
92 }
93
94 template <__constexpr_param _Lp, __constexpr_param _Rp>
95 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<<(_Lp, _Rp) noexcept
96 -> constant_wrapper<(_Lp::value << _Rp::value)> {
97 return {};
98 }
99 template <__constexpr_param _Lp, __constexpr_param _Rp>
100 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator>>(_Lp, _Rp) noexcept
101 -> constant_wrapper<(_Lp::value >> _Rp::value)> {
102 return {};
103 }
104 template <__constexpr_param _Lp, __constexpr_param _Rp>
105 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator&(_Lp, _Rp) noexcept
106 -> constant_wrapper<(_Lp::value & _Rp::value)> {
107 return {};
108 }
109 template <__constexpr_param _Lp, __constexpr_param _Rp>
110 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator|(_Lp, _Rp) noexcept
111 -> constant_wrapper<(_Lp::value | _Rp::value)> {
112 return {};
113 }
114 template <__constexpr_param _Lp, __constexpr_param _Rp>
115 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator^(_Lp, _Rp) noexcept
116 -> constant_wrapper<(_Lp::value ^ _Rp::value)> {
117 return {};
118 }
119
120 template <__constexpr_param _Lp, __constexpr_param _Rp>
121 requires(!is_constructible_v<bool, decltype(_Lp::value)> || !is_constructible_v<bool, decltype(_Rp::value)>)
122 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator&&(_Lp, _Rp) noexcept
123 -> constant_wrapper<(_Lp::value && _Rp::value)> {
124 return {};
125 }
126 template <__constexpr_param _Lp, __constexpr_param _Rp>
127 requires(!is_constructible_v<bool, decltype(_Lp::value)> || !is_constructible_v<bool, decltype(_Rp::value)>)
128 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator||(_Lp, _Rp) noexcept
129 -> constant_wrapper<(_Lp::value || _Rp::value)> {
130 return {};
131 }
132
133 // comparisons
134 template <__constexpr_param _Lp, __constexpr_param _Rp>
135 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(_Lp, _Rp) noexcept
136 -> constant_wrapper<(_Lp::value <=> _Rp::value)> {
137 return {};
138 }
139 template <__constexpr_param _Lp, __constexpr_param _Rp>
140 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<(_Lp, _Rp) noexcept
141 -> constant_wrapper<(_Lp::value < _Rp::value)> {
142 return {};
143 }
144 template <__constexpr_param _Lp, __constexpr_param _Rp>
145 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=(_Lp, _Rp) noexcept
146 -> constant_wrapper<(_Lp::value <= _Rp::value)> {
147 return {};
148 }
149 template <__constexpr_param _Lp, __constexpr_param _Rp>
150 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator==(_Lp, _Rp) noexcept
151 -> constant_wrapper<(_Lp::value == _Rp::value)> {
152 return {};
153 }
154 template <__constexpr_param _Lp, __constexpr_param _Rp>
155 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator!=(_Lp, _Rp) noexcept
156 -> constant_wrapper<(_Lp::value != _Rp::value)> {
157 return {};
158 }
159 template <__constexpr_param _Lp, __constexpr_param _Rp>
160 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator>(_Lp, _Rp) noexcept
161 -> constant_wrapper<(_Lp::value > _Rp::value)> {
162 return {};
163 }
164 template <__constexpr_param _Lp, __constexpr_param _Rp>
165 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator>=(_Lp, _Rp) noexcept
166 -> constant_wrapper<(_Lp::value >= _Rp::value)> {
167 return {};
168 }
169
170 template <__constexpr_param _Lp, __constexpr_param _Rp>
171 friend auto operator,(_Lp, _Rp) = delete;
172
173 template <__constexpr_param _Lp, __constexpr_param _Rp>
174 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator->*(_Lp, _Rp) noexcept
175 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
176 -> constant_wrapper<auto(_Lp::value->*_Rp::value)> {
177 return {};
178 }
179
180 // pseudo-mutators
181 template <__constexpr_param _Tp>
182 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator++(this _Tp) noexcept -> constant_wrapper<(++_Tp::value)> {
183 return {};
184 }
185 template <__constexpr_param _Tp>
186 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator++(this _Tp, int) noexcept
187 -> constant_wrapper<(_Tp::value++)> {
188 return {};
189 }
190 template <__constexpr_param _Tp>
191 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator--(this _Tp) noexcept -> constant_wrapper<(--_Tp::value)> {
192 return {};
193 }
194 template <__constexpr_param _Tp>
195 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator--(this _Tp, int) noexcept
196 -> constant_wrapper<(_Tp::value--)> {
197 return {};
198 }
199
200 template <__constexpr_param _Tp, __constexpr_param _Rp>
201 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator+=(this _Tp, _Rp) noexcept
202 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
203 -> constant_wrapper<auto(_Tp::value += _Rp::value)> {
204 return {};
205 }
206 template <__constexpr_param _Tp, __constexpr_param _Rp>
207 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator-=(this _Tp, _Rp) noexcept
208 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
209 -> constant_wrapper<auto(_Tp::value -= _Rp::value)> {
210 return {};
211 }
212 template <__constexpr_param _Tp, __constexpr_param _Rp>
213 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator*=(this _Tp, _Rp) noexcept
214 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
215 -> constant_wrapper<auto(_Tp::value *= _Rp::value)> {
216 return {};
217 }
218 template <__constexpr_param _Tp, __constexpr_param _Rp>
219 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator/=(this _Tp, _Rp) noexcept
220 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
221 -> constant_wrapper<auto(_Tp::value /= _Rp::value)> {
222 return {};
223 }
224 template <__constexpr_param _Tp, __constexpr_param _Rp>
225 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator%=(this _Tp, _Rp) noexcept
226 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
227 -> constant_wrapper<auto(_Tp::value %= _Rp::value)> {
228 return {};
229 }
230 template <__constexpr_param _Tp, __constexpr_param _Rp>
231 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator&=(this _Tp, _Rp) noexcept
232 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
233 -> constant_wrapper<auto(_Tp::value &= _Rp::value)> {
234 return {};
235 }
236 template <__constexpr_param _Tp, __constexpr_param _Rp>
237 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator|=(this _Tp, _Rp) noexcept
238 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
239 -> constant_wrapper<auto(_Tp::value |= _Rp::value)> {
240 return {};
241 }
242 template <__constexpr_param _Tp, __constexpr_param _Rp>
243 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator^=(this _Tp, _Rp) noexcept
244 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
245 -> constant_wrapper<auto(_Tp::value ^= _Rp::value)> {
246 return {};
247 }
248 template <__constexpr_param _Tp, __constexpr_param _Rp>
249 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator<<=(this _Tp, _Rp) noexcept
250 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
251 -> constant_wrapper<auto(_Tp::value <<= _Rp::value)> {
252 return {};
253 }
254 template <__constexpr_param _Tp, __constexpr_param _Rp>
255 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator>>=(this _Tp, _Rp) noexcept
256 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
257 -> constant_wrapper<auto(_Tp::value >>= _Rp::value)> {
258 return {};
259 }
260};
261
262template <const auto& _Callable, class... _Args>
263concept __constexpr_callable = (__constexpr_param<remove_cvref_t<_Args>> && ...) && requires {
264 typename constant_wrapper<std::invoke(_Callable, remove_cvref_t<_Args>::value...)>;
265};
266
267template <const auto& _Obj, class... _Args>
268concept __constexpr_indexable = (__constexpr_param<remove_cvref_t<_Args>> && ...) && requires {
269 typename constant_wrapper<auto(_Obj[remove_cvref_t<_Args>::value...])>;
270};
271
272template <auto _Xp, class _Tp>
273struct constant_wrapper : __cw_operators {
274 static constexpr decltype((_Xp)) value = (_Xp);
275
276 using type = constant_wrapper;
277 using value_type = decltype(_Xp);
278
279 static_assert(is_same_v<_Tp, value_type>,
280 "the second template parameter of std::constant_wrapper must be its value_type");
281
282 template <__constexpr_param _Rp>
283 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator=(_Rp) const noexcept
284 // TODO: Remove `auto` when all support versions of Clang have https://llvm.org/PR202693 fixed.
285 -> constant_wrapper<auto(value = _Rp::value)> {
286 return {};
287 }
288
289 _LIBCPP_HIDE_FROM_ABI constexpr operator decltype(value)() const noexcept { return value; }
290
291 template <class... _Args>
292 requires __constexpr_callable<value, _Args...>
293 [[nodiscard]]
294 _LIBCPP_HIDE_FROM_ABI static constexpr constant_wrapper<std::invoke(value, remove_cvref_t<_Args>::value...)>
295 operator()(_Args&&...) noexcept {
296 return {};
297 }
298
299 template <class... _Args>
300 requires(!__constexpr_callable<value, _Args...> && is_invocable_v<const value_type&, _Args && ...>)
301 _LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto)
302 operator()(_Args&&... __args) noexcept(noexcept(std::invoke(value, std::forward<_Args>(__args)...))) {
303 return std::invoke(value, std::forward<_Args>(__args)...);
304 }
305
306 template <class... _Args>
307 requires __constexpr_indexable<value, _Args...>
308 [[nodiscard]]
309 _LIBCPP_HIDE_FROM_ABI static constexpr constant_wrapper<auto(value[remove_cvref_t<_Args>::value...])>
310 operator[](_Args&&...) noexcept {
311 return {};
312 }
313
314 template <class... _Args>
315 requires(!__constexpr_indexable<value, _Args...> && requires { value[std::declval<_Args>()...]; })
316 _LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto)
317 operator[](_Args&&... __args) noexcept(noexcept(value[std::forward<_Args>(__args)...])) {
318 return value[std::forward<_Args>(__args)...];
319 }
320};
321
322#endif // _LIBCPP_STD_VER >= 26
323
324_LIBCPP_END_NAMESPACE_STD
325
326#endif // _LIBCPP___UTILITY_CONSTANT_WRAPPER_H
lib/libcxx/include/__utility/default_three_way_comparator.h+2-2
...@@ -31,7 +31,7 @@ template <class _LHS, class _RHS>...@@ -31,7 +31,7 @@ template <class _LHS, class _RHS>
31struct __default_three_way_comparator<_LHS,31struct __default_three_way_comparator<_LHS,
32 _RHS,32 _RHS,
33 __enable_if_t<is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value> > {33 __enable_if_t<is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value> > {
34 _LIBCPP_HIDE_FROM_ABI static int operator()(_LHS __lhs, _RHS __rhs) {34 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static int operator()(_LHS __lhs, _RHS __rhs) {
35 if (__lhs < __rhs)35 if (__lhs < __rhs)
36 return -1;36 return -1;
37 if (__lhs > __rhs)37 if (__lhs > __rhs)
...@@ -47,7 +47,7 @@ struct __default_three_way_comparator<...@@ -47,7 +47,7 @@ struct __default_three_way_comparator<
47 _RHS,47 _RHS,
48 __enable_if_t<!(is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value) &&48 __enable_if_t<!(is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value) &&
49 __builtin_lt_synthesizes_from_spaceship(const _LHS&, const _RHS&)>> {49 __builtin_lt_synthesizes_from_spaceship(const _LHS&, const _RHS&)>> {
50 _LIBCPP_HIDE_FROM_ABI static int operator()(const _LHS& __lhs, const _RHS& __rhs) {50 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static int operator()(const _LHS& __lhs, const _RHS& __rhs) {
51 auto __res = __lhs <=> __rhs;51 auto __res = __lhs <=> __rhs;
52 if (__res < 0)52 if (__res < 0)
53 return -1;53 return -1;
lib/libcxx/include/__utility/exchange.h+14-3
...@@ -10,6 +10,9 @@...@@ -10,6 +10,9 @@
10#define _LIBCPP___UTILITY_EXCHANGE_H10#define _LIBCPP___UTILITY_EXCHANGE_H
1111
12#include <__config>12#include <__config>
13#include <__type_traits/enable_if.h>
14#include <__type_traits/is_assignable.h>
15#include <__type_traits/is_constructible.h>
13#include <__type_traits/is_nothrow_assignable.h>16#include <__type_traits/is_nothrow_assignable.h>
14#include <__type_traits/is_nothrow_constructible.h>17#include <__type_traits/is_nothrow_constructible.h>
15#include <__utility/forward.h>18#include <__utility/forward.h>
...@@ -24,14 +27,22 @@ _LIBCPP_PUSH_MACROS...@@ -24,14 +27,22 @@ _LIBCPP_PUSH_MACROS
2427
25_LIBCPP_BEGIN_NAMESPACE_STD28_LIBCPP_BEGIN_NAMESPACE_STD
2629
27#if _LIBCPP_STD_VER >= 14
28template <class _T1, class _T2 = _T1>30template <class _T1, class _T2 = _T1>
29inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _T1 exchange(_T1& __obj, _T2&& __new_value) noexcept(31[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _T1
30 is_nothrow_move_constructible<_T1>::value && is_nothrow_assignable<_T1&, _T2>::value) {32__exchange(_T1& __obj, _T2&& __new_value)
33 _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value&& is_nothrow_assignable<_T1&, _T2>::value) {
31 _T1 __old_value = std::move(__obj);34 _T1 __old_value = std::move(__obj);
32 __obj = std::forward<_T2>(__new_value);35 __obj = std::forward<_T2>(__new_value);
33 return __old_value;36 return __old_value;
34}37}
38
39#if _LIBCPP_STD_VER >= 14
40template <class _T1, class _T2 = _T1>
41[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
42_LIBCPP_CONSTEXPR_SINCE_CXX20 _T1 exchange(_T1& __obj, _T2&& __new_value) noexcept(
43 is_nothrow_move_constructible<_T1>::value && is_nothrow_assignable<_T1&, _T2>::value) {
44 return std::__exchange(__obj, std::forward<_T2>(__new_value));
45}
35#endif // _LIBCPP_STD_VER >= 1446#endif // _LIBCPP_STD_VER >= 14
3647
37_LIBCPP_END_NAMESPACE_STD48_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/__utility/forward_like.h+4-4
...@@ -21,10 +21,10 @@...@@ -21,10 +21,10 @@
21# pragma GCC system_header21# pragma GCC system_header
22#endif22#endif
2323
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26#if _LIBCPP_STD_VER >= 2324#if _LIBCPP_STD_VER >= 23
2725
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28template <class _Ap, class _Bp>28template <class _Ap, class _Bp>
29using _CopyConst _LIBCPP_NODEBUG = _If<is_const_v<_Ap>, const _Bp, _Bp>;29using _CopyConst _LIBCPP_NODEBUG = _If<is_const_v<_Ap>, const _Bp, _Bp>;
3030
...@@ -56,8 +56,8 @@ __forward_as(_LIBCPP_LIFETIMEBOUND _Up&& __val) noexcept {...@@ -56,8 +56,8 @@ __forward_as(_LIBCPP_LIFETIMEBOUND _Up&& __val) noexcept {
56 return static_cast<_ForwardLike<_Tp, _As>>(__val);56 return static_cast<_ForwardLike<_Tp, _As>>(__val);
57}57}
5858
59#endif // _LIBCPP_STD_VER >= 23
60
61_LIBCPP_END_NAMESPACE_STD59_LIBCPP_END_NAMESPACE_STD
6260
61#endif // _LIBCPP_STD_VER >= 23
62
63#endif // _LIBCPP___UTILITY_FORWARD_LIKE_H63#endif // _LIBCPP___UTILITY_FORWARD_LIKE_H
lib/libcxx/include/__utility/in_place.h+4-4
...@@ -18,10 +18,10 @@...@@ -18,10 +18,10 @@
18# pragma GCC system_header18# pragma GCC system_header
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER >= 1721#if _LIBCPP_STD_VER >= 17
2422
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25struct in_place_t {25struct in_place_t {
26 explicit in_place_t() = default;26 explicit in_place_t() = default;
27};27};
...@@ -57,8 +57,8 @@ struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};...@@ -57,8 +57,8 @@ struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
57template <class _Tp>57template <class _Tp>
58using __is_inplace_index _LIBCPP_NODEBUG = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;58using __is_inplace_index _LIBCPP_NODEBUG = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
5959
60#endif // _LIBCPP_STD_VER >= 17
61
62_LIBCPP_END_NAMESPACE_STD60_LIBCPP_END_NAMESPACE_STD
6361
62#endif // _LIBCPP_STD_VER >= 17
63
64#endif // _LIBCPP___UTILITY_IN_PLACE_H64#endif // _LIBCPP___UTILITY_IN_PLACE_H
lib/libcxx/include/__utility/is_pointer_in_range.h+6-6
...@@ -12,12 +12,12 @@...@@ -12,12 +12,12 @@
12#include <__algorithm/comp.h>12#include <__algorithm/comp.h>
13#include <__assert>13#include <__assert>
14#include <__config>14#include <__config>
15#include <__memory/valid_range.h>
15#include <__type_traits/enable_if.h>16#include <__type_traits/enable_if.h>
16#include <__type_traits/integral_constant.h>17#include <__type_traits/integral_constant.h>
17#include <__type_traits/is_constant_evaluated.h>18#include <__type_traits/is_constant_evaluated.h>
18#include <__type_traits/void_t.h>19#include <__type_traits/void_t.h>
19#include <__utility/declval.h>20#include <__utility/declval.h>
20#include <__utility/is_valid_range.h>
2121
22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
23# pragma GCC system_header23# pragma GCC system_header
...@@ -26,13 +26,13 @@...@@ -26,13 +26,13 @@
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
2727
28template <class _Tp, class _Up, class = void>28template <class _Tp, class _Up, class = void>
29struct __is_less_than_comparable : false_type {};29inline const bool __is_less_than_comparable_v = false;
3030
31template <class _Tp, class _Up>31template <class _Tp, class _Up>
32struct __is_less_than_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() < std::declval<_Up>())> > : true_type {32inline const bool
33};33 __is_less_than_comparable_v<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() < std::declval<_Up>())> > = true;
3434
35template <class _Tp, class _Up, __enable_if_t<__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0>35template <class _Tp, class _Up, __enable_if_t<__is_less_than_comparable_v<const _Tp*, const _Up*>, int> = 0>
36_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool36_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool
37__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {37__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
38 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__begin, __end), "[__begin, __end) is not a valid range");38 _LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__begin, __end), "[__begin, __end) is not a valid range");
...@@ -47,7 +47,7 @@ __is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {...@@ -47,7 +47,7 @@ __is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
47 return !__less<>()(__ptr, __begin) && __less<>()(__ptr, __end);47 return !__less<>()(__ptr, __begin) && __less<>()(__ptr, __end);
48}48}
4949
50template <class _Tp, class _Up, __enable_if_t<!__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0>50template <class _Tp, class _Up, __enable_if_t<!__is_less_than_comparable_v<const _Tp*, const _Up*>, int> = 0>
51_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool51_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool
52__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {52__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
53 if (__libcpp_is_constant_evaluated())53 if (__libcpp_is_constant_evaluated())
lib/libcxx/include/__utility/is_valid_range.h deleted-37
...@@ -1,37 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___UTILITY_IS_VALID_RANGE_H
10#define _LIBCPP___UTILITY_IS_VALID_RANGE_H
11
12#include <__algorithm/comp.h>
13#include <__config>
14#include <__type_traits/is_constant_evaluated.h>
15
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header
18#endif
19
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22template <class _Tp>
23_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool
24__is_valid_range(const _Tp* __first, const _Tp* __last) {
25 if (__libcpp_is_constant_evaluated()) {
26 // If this is not a constant during constant evaluation, that is because __first and __last are not
27 // part of the same allocation. If they are part of the same allocation, we must still make sure they
28 // are ordered properly.
29 return __builtin_constant_p(__first <= __last) && __first <= __last;
30 }
31
32 return !__less<>()(__last, __first);
33}
34
35_LIBCPP_END_NAMESPACE_STD
36
37#endif // _LIBCPP___UTILITY_IS_VALID_RANGE_H
lib/libcxx/include/__utility/lazy_synth_three_way_comparator.h+18-15
...@@ -35,20 +35,20 @@ struct __lazy_compare_result {...@@ -35,20 +35,20 @@ struct __lazy_compare_result {
35 const _LHS& __lhs_;35 const _LHS& __lhs_;
36 const _RHS& __rhs_;36 const _RHS& __rhs_;
3737
38 _LIBCPP_HIDE_FROM_ABI38 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __lazy_compare_result(
39 __lazy_compare_result(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator& __comp,39 _LIBCPP_CTOR_LIFETIMEBOUND const _Comparator& __comp,
40 _LIBCPP_CTOR_LIFETIMEBOUND const _LHS& __lhs,40 _LIBCPP_CTOR_LIFETIMEBOUND const _LHS& __lhs,
41 _LIBCPP_CTOR_LIFETIMEBOUND const _RHS& __rhs)41 _LIBCPP_CTOR_LIFETIMEBOUND const _RHS& __rhs)
42 : __comp_(__comp), __lhs_(__lhs), __rhs_(__rhs) {}42 : __comp_(__comp), __lhs_(__lhs), __rhs_(__rhs) {}
4343
44 _LIBCPP_HIDE_FROM_ABI bool __less() const {44 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __less() const {
45 bool __result = __comp_(__lhs_, __rhs_);45 bool __result = __comp_(__lhs_, __rhs_);
46 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__result ? !static_cast<bool>(__comp_(__rhs_, __lhs_)) : true,46 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__result ? !static_cast<bool>(__comp_(__rhs_, __lhs_)) : true,
47 "Comparator does not induce a strict weak ordering");47 "Comparator does not induce a strict weak ordering");
48 return __result;48 return __result;
49 }49 }
5050
51 _LIBCPP_HIDE_FROM_ABI bool __greater() const {51 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __greater() const {
52 bool __result = __comp_(__rhs_, __lhs_);52 bool __result = __comp_(__rhs_, __lhs_);
53 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__result ? !static_cast<bool>(__comp_(__lhs_, __rhs_)) : true,53 _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(__result ? !static_cast<bool>(__comp_(__lhs_, __rhs_)) : true,
54 "Comparator does not induce a strict weak ordering");54 "Comparator does not induce a strict weak ordering");
...@@ -63,10 +63,11 @@ template <class _Comparator, class _LHS, class _RHS, class = void>...@@ -63,10 +63,11 @@ template <class _Comparator, class _LHS, class _RHS, class = void>
63struct __lazy_synth_three_way_comparator {63struct __lazy_synth_three_way_comparator {
64 const _Comparator& __comp_;64 const _Comparator& __comp_;
6565
66 _LIBCPP_HIDE_FROM_ABI __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator& __comp)66 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
67 __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator& __comp)
67 : __comp_(__comp) {}68 : __comp_(__comp) {}
6869
69 _LIBCPP_HIDE_FROM_ABI __lazy_compare_result<_Comparator, _LHS, _RHS>70 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __lazy_compare_result<_Comparator, _LHS, _RHS>
70 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) const {71 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) const {
71 return __lazy_compare_result<_Comparator, _LHS, _RHS>(__comp_, __lhs, __rhs);72 return __lazy_compare_result<_Comparator, _LHS, _RHS>(__comp_, __lhs, __rhs);
72 }73 }
...@@ -75,10 +76,10 @@ struct __lazy_synth_three_way_comparator {...@@ -75,10 +76,10 @@ struct __lazy_synth_three_way_comparator {
75struct __eager_compare_result {76struct __eager_compare_result {
76 int __res_;77 int __res_;
7778
78 _LIBCPP_HIDE_FROM_ABI explicit __eager_compare_result(int __res) : __res_(__res) {}79 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __eager_compare_result(int __res) : __res_(__res) {}
7980
80 _LIBCPP_HIDE_FROM_ABI bool __less() const { return __res_ < 0; }81 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __less() const { return __res_ < 0; }
81 _LIBCPP_HIDE_FROM_ABI bool __greater() const { return __res_ > 0; }82 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __greater() const { return __res_ > 0; }
82};83};
8384
84template <class _Comparator, class _LHS, class _RHS>85template <class _Comparator, class _LHS, class _RHS>
...@@ -89,10 +90,11 @@ struct __lazy_synth_three_way_comparator<_Comparator,...@@ -89,10 +90,11 @@ struct __lazy_synth_three_way_comparator<_Comparator,
89 __has_default_three_way_comparator<_LHS, _RHS> >::value> > {90 __has_default_three_way_comparator<_LHS, _RHS> >::value> > {
90 // This lifetimebound annotation is technically incorrect, but other specializations actually capture the lifetime of91 // This lifetimebound annotation is technically incorrect, but other specializations actually capture the lifetime of
91 // the comparator.92 // the comparator.
92 _LIBCPP_HIDE_FROM_ABI __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator&) {}93 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
94 __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator&) {}
9395
94 // Same comment as above.96 // Same comment as above.
95 _LIBCPP_HIDE_FROM_ABI static __eager_compare_result97 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static __eager_compare_result
96 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) {98 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) {
97 return __eager_compare_result(__default_three_way_comparator<_LHS, _RHS>()(__lhs, __rhs));99 return __eager_compare_result(__default_three_way_comparator<_LHS, _RHS>()(__lhs, __rhs));
98 }100 }
...@@ -106,10 +108,11 @@ struct __lazy_synth_three_way_comparator<_Comparator,...@@ -106,10 +108,11 @@ struct __lazy_synth_three_way_comparator<_Comparator,
106 __has_default_three_way_comparator<_LHS, _RHS> >::value> > {108 __has_default_three_way_comparator<_LHS, _RHS> >::value> > {
107 // This lifetimebound annotation is technically incorrect, but other specializations actually capture the lifetime of109 // This lifetimebound annotation is technically incorrect, but other specializations actually capture the lifetime of
108 // the comparator.110 // the comparator.
109 _LIBCPP_HIDE_FROM_ABI __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator&) {}111 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
112 __lazy_synth_three_way_comparator(_LIBCPP_CTOR_LIFETIMEBOUND const _Comparator&) {}
110113
111 // Same comment as above.114 // Same comment as above.
112 _LIBCPP_HIDE_FROM_ABI static __eager_compare_result115 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static __eager_compare_result
113 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) {116 operator()(_LIBCPP_LIFETIMEBOUND const _LHS& __lhs, _LIBCPP_LIFETIMEBOUND const _RHS& __rhs) {
114 return __eager_compare_result(-__default_three_way_comparator<_LHS, _RHS>()(__lhs, __rhs));117 return __eager_compare_result(-__default_three_way_comparator<_LHS, _RHS>()(__lhs, __rhs));
115 }118 }
lib/libcxx/include/__utility/pair.h+77-97
...@@ -55,22 +55,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -55,22 +55,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
55template <class _T1, class _T2>55template <class _T1, class _T2>
56struct __check_pair_construction {56struct __check_pair_construction {
57 template <int&...>57 template <int&...>
58 static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() {58 static constexpr bool __enable_implicit_default() {
59 return __is_implicitly_default_constructible<_T1>::value && __is_implicitly_default_constructible<_T2>::value;59 return __is_implicitly_default_constructible<_T1>::value && __is_implicitly_default_constructible<_T2>::value;
60 }60 }
6161
62 template <int&...>62 template <int&...>
63 static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_default() {63 static constexpr bool __enable_default() {
64 return is_default_constructible<_T1>::value && is_default_constructible<_T2>::value;64 return is_default_constructible<_T1>::value && is_default_constructible<_T2>::value;
65 }65 }
6666
67 template <class _U1, class _U2>67 template <class _U1, class _U2>
68 static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_pair_constructible() {68 static constexpr bool __is_pair_constructible() {
69 return is_constructible<_T1, _U1>::value && is_constructible<_T2, _U2>::value;69 return is_constructible<_T1, _U1>::value && is_constructible<_T2, _U2>::value;
70 }70 }
7171
72 template <class _U1, class _U2>72 template <class _U1, class _U2>
73 static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_implicit() {73 static constexpr bool __is_implicit() {
74 return is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value;74 return is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value;
75 }75 }
76};76};
...@@ -79,9 +79,8 @@ struct __check_pair_construction {...@@ -79,9 +79,8 @@ struct __check_pair_construction {
7979
80template <class, class>80template <class, class>
81struct __non_trivially_copyable_base {81struct __non_trivially_copyable_base {
82 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __non_trivially_copyable_base() _NOEXCEPT {}82 _LIBCPP_CONSTEXPR __non_trivially_copyable_base() _NOEXCEPT {}
83 _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI83 _LIBCPP_CONSTEXPR_SINCE_CXX14 __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
84 __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
85};84};
8685
87template <class _T1, class _T2>86template <class _T1, class _T2>
...@@ -101,18 +100,18 @@ struct pair...@@ -101,18 +100,18 @@ struct pair
101 pair,100 pair,
102 void>;101 void>;
103102
104 _LIBCPP_HIDE_FROM_ABI pair(pair const&) = default;103 pair(pair const&) = default;
105 _LIBCPP_HIDE_FROM_ABI pair(pair&&) = default;104 pair(pair&&) = default;
106105
107#ifdef _LIBCPP_CXX03_LANG106#ifdef _LIBCPP_CXX03_LANG
108 _LIBCPP_HIDE_FROM_ABI pair() : first(), second() {}107 pair() : first(), second() {}
109108
110 _LIBCPP_HIDE_FROM_ABI pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}109 pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
111110
112 template <class _U1, class _U2>111 template <class _U1, class _U2>
113 _LIBCPP_HIDE_FROM_ABI pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}112 pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
114113
115 _LIBCPP_HIDE_FROM_ABI pair& operator=(pair const& __p) {114 pair& operator=(pair const& __p) {
116 first = __p.first;115 first = __p.first;
117 second = __p.second;116 second = __p.second;
118 return *this;117 return *this;
...@@ -126,7 +125,7 @@ struct pair...@@ -126,7 +125,7 @@ struct pair
126 class _U2,125 class _U2,
127 __enable_if_t<is_assignable<first_type&, _U1 const&>::value && is_assignable<second_type&, _U2 const&>::value,126 __enable_if_t<is_assignable<first_type&, _U1 const&>::value && is_assignable<second_type&, _U2 const&>::value,
128 int> = 0>127 int> = 0>
129 _LIBCPP_HIDE_FROM_ABI pair& operator=(pair<_U1, _U2> const& __p) {128 pair& operator=(pair<_U1, _U2> const& __p) {
130 first = __p.first;129 first = __p.first;
131 second = __p.second;130 second = __p.second;
132 return *this;131 return *this;
...@@ -134,13 +133,12 @@ struct pair...@@ -134,13 +133,12 @@ struct pair
134#else133#else
135 template <class _CheckArgsDep = __check_pair_construction<_T1, _T2>,134 template <class _CheckArgsDep = __check_pair_construction<_T1, _T2>,
136 __enable_if_t<_CheckArgsDep::__enable_default(), int> = 0>135 __enable_if_t<_CheckArgsDep::__enable_default(), int> = 0>
137 explicit(!_CheckArgsDep::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI constexpr pair() noexcept(136 explicit(!_CheckArgsDep::__enable_implicit_default()) constexpr pair() noexcept(
138 is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value)137 is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value)
139 : first(), second() {}138 : first(), second() {}
140139
141 template <class _CheckArgsDep = __check_pair_construction<_T1, _T2>,140 template <class _CheckArgsDep = __check_pair_construction<_T1, _T2>,
142 __enable_if_t<_CheckArgsDep::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0>141 __enable_if_t<_CheckArgsDep::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0>
143 _LIBCPP_HIDE_FROM_ABI
144 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgsDep::template __is_implicit<_T1 const&, _T2 const&>())142 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgsDep::template __is_implicit<_T1 const&, _T2 const&>())
145 pair(_T1 const& __t1, _T2 const& __t2) noexcept(is_nothrow_copy_constructible<first_type>::value &&143 pair(_T1 const& __t1, _T2 const& __t2) noexcept(is_nothrow_copy_constructible<first_type>::value &&
146 is_nothrow_copy_constructible<second_type>::value)144 is_nothrow_copy_constructible<second_type>::value)
...@@ -155,7 +153,6 @@ struct pair...@@ -155,7 +153,6 @@ struct pair
155 class _U2,153 class _U2,
156# endif154# endif
157 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1, _U2>(), int> = 0 >155 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1, _U2>(), int> = 0 >
158 _LIBCPP_HIDE_FROM_ABI
159 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<_U1, _U2>())156 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<_U1, _U2>())
160 pair(_U1&& __u1, _U2&& __u2) noexcept(is_nothrow_constructible<first_type, _U1>::value &&157 pair(_U1&& __u1, _U2&& __u2) noexcept(is_nothrow_constructible<first_type, _U1>::value &&
161 is_nothrow_constructible<second_type, _U2>::value)158 is_nothrow_constructible<second_type, _U2>::value)
...@@ -166,7 +163,7 @@ struct pair...@@ -166,7 +163,7 @@ struct pair
166 template <class _U1,163 template <class _U1,
167 class _U2,164 class _U2,
168 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1&, _U2&>(), int> = 0>165 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1&, _U2&>(), int> = 0>
169 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<_U1&, _U2&>())166 constexpr explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<_U1&, _U2&>())
170 pair(pair<_U1, _U2>& __p) noexcept((is_nothrow_constructible<first_type, _U1&>::value &&167 pair(pair<_U1, _U2>& __p) noexcept((is_nothrow_constructible<first_type, _U1&>::value &&
171 is_nothrow_constructible<second_type, _U2&>::value))168 is_nothrow_constructible<second_type, _U2&>::value))
172 : first(__p.first), second(__p.second) {}169 : first(__p.first), second(__p.second) {}
...@@ -177,7 +174,7 @@ struct pair...@@ -177,7 +174,7 @@ struct pair
177 class _U2,174 class _U2,
178 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1 const&, _U2 const&>(),175 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1 const&, _U2 const&>(),
179 int> = 0>176 int> = 0>
180 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(177 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(
181 !__check_pair_construction<_T1, _T2>::template __is_implicit<_U1 const&, _U2 const&>())178 !__check_pair_construction<_T1, _T2>::template __is_implicit<_U1 const&, _U2 const&>())
182 pair(pair<_U1, _U2> const& __p) noexcept(is_nothrow_constructible<first_type, _U1 const&>::value &&179 pair(pair<_U1, _U2> const& __p) noexcept(is_nothrow_constructible<first_type, _U1 const&>::value &&
183 is_nothrow_constructible<second_type, _U2 const&>::value)180 is_nothrow_constructible<second_type, _U2 const&>::value)
...@@ -186,7 +183,6 @@ struct pair...@@ -186,7 +183,6 @@ struct pair
186 template <class _U1,183 template <class _U1,
187 class _U2,184 class _U2,
188 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1, _U2>(), int> = 0>185 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<_U1, _U2>(), int> = 0>
189 _LIBCPP_HIDE_FROM_ABI
190 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<_U1, _U2>())186 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<_U1, _U2>())
191 pair(pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, _U1&&>::value &&187 pair(pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, _U1&&>::value &&
192 is_nothrow_constructible<second_type, _U2&&>::value)188 is_nothrow_constructible<second_type, _U2&&>::value)
...@@ -198,8 +194,7 @@ struct pair...@@ -198,8 +194,7 @@ struct pair
198 class _U2,194 class _U2,
199 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<const _U1&&, const _U2&&>(),195 __enable_if_t<__check_pair_construction<_T1, _T2>::template __is_pair_constructible<const _U1&&, const _U2&&>(),
200 int> = 0>196 int> = 0>
201 _LIBCPP_HIDE_FROM_ABI constexpr explicit(197 constexpr explicit(!__check_pair_construction<_T1, _T2>::template __is_implicit<const _U1&&, const _U2&&>())
202 !__check_pair_construction<_T1, _T2>::template __is_implicit<const _U1&&, const _U2&&>())
203 pair(const pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, const _U1&&>::value &&198 pair(const pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, const _U1&&>::value &&
204 is_nothrow_constructible<second_type, const _U2&&>::value)199 is_nothrow_constructible<second_type, const _U2&&>::value)
205 : first(std::move(__p.first)), second(std::move(__p.second)) {}200 : first(std::move(__p.first)), second(std::move(__p.second)) {}
...@@ -209,19 +204,19 @@ struct pair...@@ -209,19 +204,19 @@ struct pair
209 template <__pair_like_no_subrange _PairLike>204 template <__pair_like_no_subrange _PairLike>
210 requires(is_constructible_v<first_type, decltype(std::get<0>(std::declval<_PairLike &&>()))> &&205 requires(is_constructible_v<first_type, decltype(std::get<0>(std::declval<_PairLike &&>()))> &&
211 is_constructible_v<second_type, decltype(std::get<1>(std::declval<_PairLike &&>()))>)206 is_constructible_v<second_type, decltype(std::get<1>(std::declval<_PairLike &&>()))>)
212 _LIBCPP_HIDE_FROM_ABI constexpr explicit(207 constexpr explicit(!is_convertible_v<decltype(std::get<0>(std::declval<_PairLike&&>())), first_type> ||
213 !is_convertible_v<decltype(std::get<0>(std::declval<_PairLike&&>())), first_type> ||208 !is_convertible_v<decltype(std::get<1>(std::declval<_PairLike&&>())), second_type>)
214 !is_convertible_v<decltype(std::get<1>(std::declval<_PairLike&&>())), second_type>) pair(_PairLike&& __p)209 pair(_PairLike&& __p)
215 : first(std::get<0>(std::forward<_PairLike>(__p))), second(std::get<1>(std::forward<_PairLike>(__p))) {}210 : first(std::get<0>(std::forward<_PairLike>(__p))), second(std::get<1>(std::forward<_PairLike>(__p))) {}
216# endif211# endif
217212
218 template <class... _Args1, class... _Args2>213 template <class... _Args1, class... _Args2>
219 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20214 _LIBCPP_CONSTEXPR_SINCE_CXX20
220 pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept(215 pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept(
221 is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)216 is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)
222 : pair(__pc, __first_args, __second_args, __index_sequence_for<_Args1...>(), __index_sequence_for<_Args2...>()) {}217 : pair(__pc, __first_args, __second_args, __index_sequence_for<_Args1...>(), __index_sequence_for<_Args2...>()) {}
223218
224 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&219 _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&
225 operator=(__conditional_t<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value,220 operator=(__conditional_t<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value,
226 pair,221 pair,
227 __nat> const& __p) noexcept(is_nothrow_copy_assignable<first_type>::value &&222 __nat> const& __p) noexcept(is_nothrow_copy_assignable<first_type>::value &&
...@@ -231,7 +226,7 @@ struct pair...@@ -231,7 +226,7 @@ struct pair
231 return *this;226 return *this;
232 }227 }
233228
234 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(229 _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(
235 __conditional_t<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair, __nat>&&230 __conditional_t<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair, __nat>&&
236 __p) noexcept(is_nothrow_move_assignable<first_type>::value &&231 __p) noexcept(is_nothrow_move_assignable<first_type>::value &&
237 is_nothrow_move_assignable<second_type>::value) {232 is_nothrow_move_assignable<second_type>::value) {
...@@ -245,7 +240,7 @@ struct pair...@@ -245,7 +240,7 @@ struct pair
245 class _U2,240 class _U2,
246 __enable_if_t<is_assignable<first_type&, _U1 const&>::value && is_assignable<second_type&, _U2 const&>::value,241 __enable_if_t<is_assignable<first_type&, _U1 const&>::value && is_assignable<second_type&, _U2 const&>::value,
247 int> = 0>242 int> = 0>
248 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(pair<_U1, _U2> const& __p) {243 _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(pair<_U1, _U2> const& __p) {
249 first = __p.first;244 first = __p.first;
250 second = __p.second;245 second = __p.second;
251 return *this;246 return *this;
...@@ -254,7 +249,7 @@ struct pair...@@ -254,7 +249,7 @@ struct pair
254 template <class _U1,249 template <class _U1,
255 class _U2,250 class _U2,
256 __enable_if_t<is_assignable<first_type&, _U1>::value && is_assignable<second_type&, _U2>::value, int> = 0>251 __enable_if_t<is_assignable<first_type&, _U1>::value && is_assignable<second_type&, _U2>::value, int> = 0>
257 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(pair<_U1, _U2>&& __p) {252 _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(pair<_U1, _U2>&& __p) {
258 first = std::forward<_U1>(__p.first);253 first = std::forward<_U1>(__p.first);
259 second = std::forward<_U2>(__p.second);254 second = std::forward<_U2>(__p.second);
260 return *this;255 return *this;
...@@ -262,7 +257,7 @@ struct pair...@@ -262,7 +257,7 @@ struct pair
262257
263# if _LIBCPP_STD_VER >= 23258# if _LIBCPP_STD_VER >= 23
264 template <class = void>259 template <class = void>
265 _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair const& __p) const260 constexpr const pair& operator=(pair const& __p) const
266 noexcept(is_nothrow_copy_assignable_v<const first_type> && is_nothrow_copy_assignable_v<const second_type>)261 noexcept(is_nothrow_copy_assignable_v<const first_type> && is_nothrow_copy_assignable_v<const second_type>)
267 requires(is_copy_assignable_v<const first_type> && is_copy_assignable_v<const second_type>)262 requires(is_copy_assignable_v<const first_type> && is_copy_assignable_v<const second_type>)
268 {263 {
...@@ -272,7 +267,7 @@ struct pair...@@ -272,7 +267,7 @@ struct pair
272 }267 }
273268
274 template <class = void>269 template <class = void>
275 _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair&& __p) const270 constexpr const pair& operator=(pair&& __p) const
276 noexcept(is_nothrow_assignable_v<const first_type&, first_type> &&271 noexcept(is_nothrow_assignable_v<const first_type&, first_type> &&
277 is_nothrow_assignable_v<const second_type&, second_type>)272 is_nothrow_assignable_v<const second_type&, second_type>)
278 requires(is_assignable_v<const first_type&, first_type> && is_assignable_v<const second_type&, second_type>)273 requires(is_assignable_v<const first_type&, first_type> && is_assignable_v<const second_type&, second_type>)
...@@ -283,7 +278,7 @@ struct pair...@@ -283,7 +278,7 @@ struct pair
283 }278 }
284279
285 template <class _U1, class _U2>280 template <class _U1, class _U2>
286 _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(const pair<_U1, _U2>& __p) const281 constexpr const pair& operator=(const pair<_U1, _U2>& __p) const
287 requires(is_assignable_v<const first_type&, const _U1&> && is_assignable_v<const second_type&, const _U2&>)282 requires(is_assignable_v<const first_type&, const _U1&> && is_assignable_v<const second_type&, const _U2&>)
288 {283 {
289 first = __p.first;284 first = __p.first;
...@@ -292,7 +287,7 @@ struct pair...@@ -292,7 +287,7 @@ struct pair
292 }287 }
293288
294 template <class _U1, class _U2>289 template <class _U1, class _U2>
295 _LIBCPP_HIDE_FROM_ABI constexpr const pair& operator=(pair<_U1, _U2>&& __p) const290 constexpr const pair& operator=(pair<_U1, _U2>&& __p) const
296 requires(is_assignable_v<const first_type&, _U1> && is_assignable_v<const second_type&, _U2>)291 requires(is_assignable_v<const first_type&, _U1> && is_assignable_v<const second_type&, _U2>)
297 {292 {
298 first = std::forward<_U1>(__p.first);293 first = std::forward<_U1>(__p.first);
...@@ -304,7 +299,7 @@ struct pair...@@ -304,7 +299,7 @@ struct pair
304 requires(__different_from<_PairLike, pair> &&299 requires(__different_from<_PairLike, pair> &&
305 is_assignable_v<first_type&, decltype(std::get<0>(std::declval<_PairLike>()))> &&300 is_assignable_v<first_type&, decltype(std::get<0>(std::declval<_PairLike>()))> &&
306 is_assignable_v<second_type&, decltype(std::get<1>(std::declval<_PairLike>()))>)301 is_assignable_v<second_type&, decltype(std::get<1>(std::declval<_PairLike>()))>)
307 _LIBCPP_HIDE_FROM_ABI constexpr pair& operator=(_PairLike&& __p) {302 constexpr pair& operator=(_PairLike&& __p) {
308 first = std::get<0>(std::forward<_PairLike>(__p));303 first = std::get<0>(std::forward<_PairLike>(__p));
309 second = std::get<1>(std::forward<_PairLike>(__p));304 second = std::get<1>(std::forward<_PairLike>(__p));
310 return *this;305 return *this;
...@@ -314,7 +309,7 @@ struct pair...@@ -314,7 +309,7 @@ struct pair
314 requires(__different_from<_PairLike, pair> &&309 requires(__different_from<_PairLike, pair> &&
315 is_assignable_v<first_type const&, decltype(std::get<0>(std::declval<_PairLike>()))> &&310 is_assignable_v<first_type const&, decltype(std::get<0>(std::declval<_PairLike>()))> &&
316 is_assignable_v<second_type const&, decltype(std::get<1>(std::declval<_PairLike>()))>)311 is_assignable_v<second_type const&, decltype(std::get<1>(std::declval<_PairLike>()))>)
317 _LIBCPP_HIDE_FROM_ABI constexpr pair const& operator=(_PairLike&& __p) const {312 constexpr pair const& operator=(_PairLike&& __p) const {
318 first = std::get<0>(std::forward<_PairLike>(__p));313 first = std::get<0>(std::forward<_PairLike>(__p));
319 second = std::get<1>(std::forward<_PairLike>(__p));314 second = std::get<1>(std::forward<_PairLike>(__p));
320 return *this;315 return *this;
...@@ -328,34 +323,33 @@ struct pair...@@ -328,34 +323,33 @@ struct pair
328 template <class _U1,323 template <class _U1,
329 class _U2,324 class _U2,
330 __enable_if_t<is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value, int> = 0>325 __enable_if_t<is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value, int> = 0>
331 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2> const& __p)326 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2> const& __p) : first(std::get<0>(__p)), second(std::get<1>(__p)) {}
332 : first(std::get<0>(__p)), second(std::get<1>(__p)) {}
333327
334 template < class _U1,328 template < class _U1,
335 class _U2,329 class _U2,
336 __enable_if_t<is_constructible<_T1, _U1 const&>::value && is_constructible<_T2, _U2 const&>::value &&330 __enable_if_t<is_constructible<_T1, _U1 const&>::value && is_constructible<_T2, _U2 const&>::value &&
337 !(is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value),331 !(is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value),
338 int> = 0>332 int> = 0>
339 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(tuple<_U1, _U2> const& __p)333 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(tuple<_U1, _U2> const& __p)
340 : first(std::get<0>(__p)), second(std::get<1>(__p)) {}334 : first(std::get<0>(__p)), second(std::get<1>(__p)) {}
341335
342 template <class _U1,336 template <class _U1,
343 class _U2,337 class _U2,
344 __enable_if_t<is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value, int> = 0>338 __enable_if_t<is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value, int> = 0>
345 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2>&& __p)339 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2>&& __p)
346 : first(std::get<0>(std::move(__p))), second(std::get<1>(std::move(__p))) {}340 : first(std::get<0>(std::move(__p))), second(std::get<1>(std::move(__p))) {}
347341
348 template <class _U1,342 template <class _U1,
349 class _U2,343 class _U2,
350 __enable_if_t<is_constructible<_T1, _U1>::value && is_constructible<_T2, _U2>::value &&344 __enable_if_t<is_constructible<_T1, _U1>::value && is_constructible<_T2, _U2>::value &&
351 !(is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value) > = 0>345 !(is_convertible<_U1, _T1>::value && is_convertible<_U2, _T2>::value) > = 0>
352 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(tuple<_U1, _U2>&& __p)346 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(tuple<_U1, _U2>&& __p)
353 : first(std::get<0>(std::move(__p))), second(std::get<1>(std::move(__p))) {}347 : first(std::get<0>(std::move(__p))), second(std::get<1>(std::move(__p))) {}
354348
355 template <class _U1,349 template <class _U1,
356 class _U2,350 class _U2,
357 __enable_if_t<is_assignable<_T1&, _U1 const&>::value && is_assignable<_T2&, _U2 const&>::value, int> = 0>351 __enable_if_t<is_assignable<_T1&, _U1 const&>::value && is_assignable<_T2&, _U2 const&>::value, int> = 0>
358 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(tuple<_U1, _U2> const& __p) {352 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(tuple<_U1, _U2> const& __p) {
359 first = std::get<0>(__p);353 first = std::get<0>(__p);
360 second = std::get<1>(__p);354 second = std::get<1>(__p);
361 return *this;355 return *this;
...@@ -364,7 +358,7 @@ struct pair...@@ -364,7 +358,7 @@ struct pair
364 template <class _U1,358 template <class _U1,
365 class _U2,359 class _U2,
366 __enable_if_t<is_assignable<_T1&, _U1&&>::value && is_assignable<_T2&, _U2&&>::value, int> = 0>360 __enable_if_t<is_assignable<_T1&, _U1&&>::value && is_assignable<_T2&, _U2&&>::value, int> = 0>
367 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(tuple<_U1, _U2>&& __p) {361 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(tuple<_U1, _U2>&& __p) {
368 first = std::get<0>(std::move(__p));362 first = std::get<0>(std::move(__p));
369 second = std::get<1>(std::move(__p));363 second = std::get<1>(std::move(__p));
370 return *this;364 return *this;
...@@ -373,36 +367,34 @@ struct pair...@@ -373,36 +367,34 @@ struct pair
373 // from std::array367 // from std::array
374 template <class _Up,368 template <class _Up,
375 __enable_if_t<is_convertible<_Up const&, _T1>::value && is_convertible<_Up const&, _T2>::value, int> = 0>369 __enable_if_t<is_convertible<_Up const&, _T1>::value && is_convertible<_Up const&, _T2>::value, int> = 0>
376 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(array<_Up, 2> const& __p) : first(__p[0]), second(__p[1]) {}370 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(array<_Up, 2> const& __p) : first(__p[0]), second(__p[1]) {}
377371
378 template <class _Up,372 template <class _Up,
379 __enable_if_t<is_constructible<_T1, _Up const&>::value && is_constructible<_T2, _Up const&>::value &&373 __enable_if_t<is_constructible<_T1, _Up const&>::value && is_constructible<_T2, _Up const&>::value &&
380 !(is_convertible<_Up const&, _T1>::value && is_convertible<_Up const&, _T2>::value),374 !(is_convertible<_Up const&, _T1>::value && is_convertible<_Up const&, _T2>::value),
381 int> = 0>375 int> = 0>
382 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(array<_Up, 2> const& __p)376 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(array<_Up, 2> const& __p) : first(__p[0]), second(__p[1]) {}
383 : first(__p[0]), second(__p[1]) {}
384377
385 template <class _Up, __enable_if_t< is_convertible<_Up, _T1>::value && is_convertible<_Up, _T2>::value, int> = 0>378 template <class _Up, __enable_if_t< is_convertible<_Up, _T1>::value && is_convertible<_Up, _T2>::value, int> = 0>
386 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(array<_Up, 2>&& __p)379 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(array<_Up, 2>&& __p) : first(std::move(__p)[0]), second(std::move(__p)[1]) {}
387 : first(std::move(__p)[0]), second(std::move(__p)[1]) {}
388380
389 template <class _Up,381 template <class _Up,
390 __enable_if_t<is_constructible<_T1, _Up>::value && is_constructible<_T2, _Up>::value &&382 __enable_if_t<is_constructible<_T1, _Up>::value && is_constructible<_T2, _Up>::value &&
391 !(is_convertible<_Up, _T1>::value && is_convertible<_Up, _T2>::value),383 !(is_convertible<_Up, _T1>::value && is_convertible<_Up, _T2>::value),
392 int> = 0>384 int> = 0>
393 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(array<_Up, 2>&& __p)385 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(array<_Up, 2>&& __p)
394 : first(std::move(__p)[0]), second(std::move(__p)[1]) {}386 : first(std::move(__p)[0]), second(std::move(__p)[1]) {}
395387
396 template <class _Up,388 template <class _Up,
397 __enable_if_t<is_assignable<_T1&, _Up const&>::value && is_assignable<_T2&, _Up const&>::value, int> = 0>389 __enable_if_t<is_assignable<_T1&, _Up const&>::value && is_assignable<_T2&, _Up const&>::value, int> = 0>
398 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(array<_Up, 2> const& __p) {390 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(array<_Up, 2> const& __p) {
399 first = std::get<0>(__p);391 first = std::get<0>(__p);
400 second = std::get<1>(__p);392 second = std::get<1>(__p);
401 return *this;393 return *this;
402 }394 }
403395
404 template <class _Up, __enable_if_t<is_assignable<_T1&, _Up>::value && is_assignable<_T2&, _Up>::value, int> = 0>396 template <class _Up, __enable_if_t<is_assignable<_T1&, _Up>::value && is_assignable<_T2&, _Up>::value, int> = 0>
405 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(array<_Up, 2>&& __p) {397 _LIBCPP_CONSTEXPR_SINCE_CXX14 pair& operator=(array<_Up, 2>&& __p) {
406 first = std::get<0>(std::move(__p));398 first = std::get<0>(std::move(__p));
407 second = std::get<1>(std::move(__p));399 second = std::get<1>(std::move(__p));
408 return *this;400 return *this;
...@@ -410,7 +402,7 @@ struct pair...@@ -410,7 +402,7 @@ struct pair
410# endif // _LIBCPP_STD_VER < 23402# endif // _LIBCPP_STD_VER < 23
411#endif // _LIBCPP_CXX03_LANG403#endif // _LIBCPP_CXX03_LANG
412404
413 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair& __p)405 _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair& __p)
414 _NOEXCEPT_(__is_nothrow_swappable_v<first_type>&& __is_nothrow_swappable_v<second_type>) {406 _NOEXCEPT_(__is_nothrow_swappable_v<first_type>&& __is_nothrow_swappable_v<second_type>) {
415 using std::swap;407 using std::swap;
416 swap(first, __p.first);408 swap(first, __p.first);
...@@ -418,7 +410,7 @@ struct pair...@@ -418,7 +410,7 @@ struct pair
418 }410 }
419411
420#if _LIBCPP_STD_VER >= 23412#if _LIBCPP_STD_VER >= 23
421 _LIBCPP_HIDE_FROM_ABI constexpr void swap(const pair& __p) const413 constexpr void swap(const pair& __p) const
422 noexcept(__is_nothrow_swappable_v<const first_type> && __is_nothrow_swappable_v<const second_type>) {414 noexcept(__is_nothrow_swappable_v<const first_type> && __is_nothrow_swappable_v<const second_type>) {
423 using std::swap;415 using std::swap;
424 swap(first, __p.first);416 swap(first, __p.first);
...@@ -429,7 +421,7 @@ struct pair...@@ -429,7 +421,7 @@ struct pair
429private:421private:
430#ifndef _LIBCPP_CXX03_LANG422#ifndef _LIBCPP_CXX03_LANG
431 template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>423 template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
432 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20424 _LIBCPP_CONSTEXPR_SINCE_CXX20
433 pair(piecewise_construct_t,425 pair(piecewise_construct_t,
434 tuple<_Args1...>& __first_args,426 tuple<_Args1...>& __first_args,
435 tuple<_Args2...>& __second_args,427 tuple<_Args2...>& __second_args,
...@@ -448,8 +440,7 @@ pair(_T1, _T2) -> pair<_T1, _T2>;...@@ -448,8 +440,7 @@ pair(_T1, _T2) -> pair<_T1, _T2>;
448// [pairs.spec], specialized algorithms440// [pairs.spec], specialized algorithms
449441
450template <class _T1, class _T2, class _U1, class _U2>442template <class _T1, class _T2, class _U1, class _U2>
451inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool443inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y)
452operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y)
453#if _LIBCPP_STD_VER >= 26444#if _LIBCPP_STD_VER >= 26
454 requires requires {445 requires requires {
455 { __x.first == __y.first } -> __boolean_testable;446 { __x.first == __y.first } -> __boolean_testable;
...@@ -463,8 +454,7 @@ operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y)...@@ -463,8 +454,7 @@ operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y)
463#if _LIBCPP_STD_VER >= 20454#if _LIBCPP_STD_VER >= 20
464455
465template <class _T1, class _T2, class _U1, class _U2>456template <class _T1, class _T2, class _U1, class _U2>
466_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t< __synth_three_way_result<_T1, _U1>,457constexpr common_comparison_category_t< __synth_three_way_result<_T1, _U1>, __synth_three_way_result<_T2, _U2> >
467 __synth_three_way_result<_T2, _U2> >
468operator<=>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {458operator<=>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
469 if (auto __c = std::__synth_three_way(__x.first, __y.first); __c != 0) {459 if (auto __c = std::__synth_three_way(__x.first, __y.first); __c != 0) {
470 return __c;460 return __c;
...@@ -475,32 +465,27 @@ operator<=>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {...@@ -475,32 +465,27 @@ operator<=>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
475#else // _LIBCPP_STD_VER >= 20465#else // _LIBCPP_STD_VER >= 20
476466
477template <class _T1, class _T2, class _U1, class _U2>467template <class _T1, class _T2, class _U1, class _U2>
478inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool468inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator!=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
479operator!=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
480 return !(__x == __y);469 return !(__x == __y);
481}470}
482471
483template <class _T1, class _T2, class _U1, class _U2>472template <class _T1, class _T2, class _U1, class _U2>
484inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool473inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator<(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
485operator<(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
486 return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second);474 return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second);
487}475}
488476
489template <class _T1, class _T2, class _U1, class _U2>477template <class _T1, class _T2, class _U1, class _U2>
490inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool478inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
491operator>(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
492 return __y < __x;479 return __y < __x;
493}480}
494481
495template <class _T1, class _T2, class _U1, class _U2>482template <class _T1, class _T2, class _U1, class _U2>
496inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool483inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator>=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
497operator>=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
498 return !(__x < __y);484 return !(__x < __y);
499}485}
500486
501template <class _T1, class _T2, class _U1, class _U2>487template <class _T1, class _T2, class _U1, class _U2>
502inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool488inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator<=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
503operator<=(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) {
504 return !(__y < __x);489 return !(__y < __x);
505}490}
506491
...@@ -524,7 +509,7 @@ struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {...@@ -524,7 +509,7 @@ struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
524#endif // _LIBCPP_STD_VER >= 23509#endif // _LIBCPP_STD_VER >= 23
525510
526template <class _T1, class _T2, __enable_if_t<__is_swappable_v<_T1> && __is_swappable_v<_T2>, int> = 0>511template <class _T1, class _T2, __enable_if_t<__is_swappable_v<_T1> && __is_swappable_v<_T2>, int> = 0>
527inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)512inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
528 _NOEXCEPT_(__is_nothrow_swappable_v<_T1>&& __is_nothrow_swappable_v<_T2>) {513 _NOEXCEPT_(__is_nothrow_swappable_v<_T1>&& __is_nothrow_swappable_v<_T2>) {
529 __x.swap(__y);514 __x.swap(__y);
530}515}
...@@ -532,15 +517,14 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _...@@ -532,15 +517,14 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _
532#if _LIBCPP_STD_VER >= 23517#if _LIBCPP_STD_VER >= 23
533template <class _T1, class _T2>518template <class _T1, class _T2>
534 requires(__is_swappable_v<const _T1> && __is_swappable_v<const _T2>)519 requires(__is_swappable_v<const _T1> && __is_swappable_v<const _T2>)
535_LIBCPP_HIDE_FROM_ABI constexpr void520constexpr void swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) {
536swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) {
537 __x.swap(__y);521 __x.swap(__y);
538}522}
539#endif523#endif
540524
541template <class _T1, class _T2>525template <class _T1, class _T2>
542[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14526[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> >
543pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> > make_pair(_T1&& __t1, _T2&& __t2) {527make_pair(_T1&& __t1, _T2&& __t2) {
544 return pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> >(std::forward<_T1>(__t1), std::forward<_T2>(__t2));528 return pair<__unwrap_ref_decay_t<_T1>, __unwrap_ref_decay_t<_T2> >(std::forward<_T1>(__t1), std::forward<_T2>(__t2));
545}529}
546530
...@@ -568,22 +552,22 @@ struct __get_pair;...@@ -568,22 +552,22 @@ struct __get_pair;
568template <>552template <>
569struct __get_pair<0> {553struct __get_pair<0> {
570 template <class _T1, class _T2>554 template <class _T1, class _T2>
571 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {555 static _LIBCPP_CONSTEXPR_SINCE_CXX14 _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {
572 return __p.first;556 return __p.first;
573 }557 }
574558
575 template <class _T1, class _T2>559 template <class _T1, class _T2>
576 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T1& get(const pair<_T1, _T2>& __p) _NOEXCEPT {560 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T1& get(const pair<_T1, _T2>& __p) _NOEXCEPT {
577 return __p.first;561 return __p.first;
578 }562 }
579563
580 template <class _T1, class _T2>564 template <class _T1, class _T2>
581 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {565 static _LIBCPP_CONSTEXPR_SINCE_CXX14 _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
582 return std::forward<_T1>(__p.first);566 return std::forward<_T1>(__p.first);
583 }567 }
584568
585 template <class _T1, class _T2>569 template <class _T1, class _T2>
586 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T1&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {570 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T1&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {
587 return std::forward<const _T1>(__p.first);571 return std::forward<const _T1>(__p.first);
588 }572 }
589};573};
...@@ -591,92 +575,88 @@ struct __get_pair<0> {...@@ -591,92 +575,88 @@ struct __get_pair<0> {
591template <>575template <>
592struct __get_pair<1> {576struct __get_pair<1> {
593 template <class _T1, class _T2>577 template <class _T1, class _T2>
594 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _T2& get(pair<_T1, _T2>& __p) _NOEXCEPT {578 static _LIBCPP_CONSTEXPR_SINCE_CXX14 _T2& get(pair<_T1, _T2>& __p) _NOEXCEPT {
595 return __p.second;579 return __p.second;
596 }580 }
597581
598 template <class _T1, class _T2>582 template <class _T1, class _T2>
599 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T2& get(const pair<_T1, _T2>& __p) _NOEXCEPT {583 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T2& get(const pair<_T1, _T2>& __p) _NOEXCEPT {
600 return __p.second;584 return __p.second;
601 }585 }
602586
603 template <class _T1, class _T2>587 template <class _T1, class _T2>
604 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _T2&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {588 static _LIBCPP_CONSTEXPR_SINCE_CXX14 _T2&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
605 return std::forward<_T2>(__p.second);589 return std::forward<_T2>(__p.second);
606 }590 }
607591
608 template <class _T1, class _T2>592 template <class _T1, class _T2>
609 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T2&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {593 static _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T2&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {
610 return std::forward<const _T2>(__p.second);594 return std::forward<const _T2>(__p.second);
611 }595 }
612};596};
613597
614template <size_t _Ip, class _T1, class _T2>598template <size_t _Ip, class _T1, class _T2>
615[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14599[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&
616typename tuple_element<_Ip, pair<_T1, _T2> >::type&
617get(pair<_T1, _T2>& __p) _NOEXCEPT {600get(pair<_T1, _T2>& __p) _NOEXCEPT {
618 return __get_pair<_Ip>::get(__p);601 return __get_pair<_Ip>::get(__p);
619}602}
620603
621template <size_t _Ip, class _T1, class _T2>604template <size_t _Ip, class _T1, class _T2>
622[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI605[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
623_LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
624get(const pair<_T1, _T2>& __p) _NOEXCEPT {606get(const pair<_T1, _T2>& __p) _NOEXCEPT {
625 return __get_pair<_Ip>::get(__p);607 return __get_pair<_Ip>::get(__p);
626}608}
627609
628template <size_t _Ip, class _T1, class _T2>610template <size_t _Ip, class _T1, class _T2>
629[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14611[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
630typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
631get(pair<_T1, _T2>&& __p) _NOEXCEPT {612get(pair<_T1, _T2>&& __p) _NOEXCEPT {
632 return __get_pair<_Ip>::get(std::move(__p));613 return __get_pair<_Ip>::get(std::move(__p));
633}614}
634615
635template <size_t _Ip, class _T1, class _T2>616template <size_t _Ip, class _T1, class _T2>
636[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI617[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
637_LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
638get(const pair<_T1, _T2>&& __p) _NOEXCEPT {618get(const pair<_T1, _T2>&& __p) _NOEXCEPT {
639 return __get_pair<_Ip>::get(std::move(__p));619 return __get_pair<_Ip>::get(std::move(__p));
640}620}
641621
642#if _LIBCPP_STD_VER >= 14622#if _LIBCPP_STD_VER >= 14
643template <class _T1, class _T2>623template <class _T1, class _T2>
644[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {624[[__nodiscard__]] inline constexpr _T1& get(pair<_T1, _T2>& __p) _NOEXCEPT {
645 return __p.first;625 return __p.first;
646}626}
647627
648template <class _T1, class _T2>628template <class _T1, class _T2>
649[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {629[[__nodiscard__]] inline constexpr _T1 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {
650 return __p.first;630 return __p.first;
651}631}
652632
653template <class _T1, class _T2>633template <class _T1, class _T2>
654[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {634[[__nodiscard__]] inline constexpr _T1&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
655 return std::forward<_T1&&>(__p.first);635 return std::forward<_T1&&>(__p.first);
656}636}
657637
658template <class _T1, class _T2>638template <class _T1, class _T2>
659[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T1 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {639[[__nodiscard__]] inline constexpr _T1 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {
660 return std::forward<_T1 const&&>(__p.first);640 return std::forward<_T1 const&&>(__p.first);
661}641}
662642
663template <class _T2, class _T1>643template <class _T2, class _T1>
664[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2& get(pair<_T1, _T2>& __p) _NOEXCEPT {644[[__nodiscard__]] inline constexpr _T2& get(pair<_T1, _T2>& __p) _NOEXCEPT {
665 return __p.second;645 return __p.second;
666}646}
667647
668template <class _T2, class _T1>648template <class _T2, class _T1>
669[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {649[[__nodiscard__]] inline constexpr _T2 const& get(pair<_T1, _T2> const& __p) _NOEXCEPT {
670 return __p.second;650 return __p.second;
671}651}
672652
673template <class _T2, class _T1>653template <class _T2, class _T1>
674[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {654[[__nodiscard__]] inline constexpr _T2&& get(pair<_T1, _T2>&& __p) _NOEXCEPT {
675 return std::forward<_T2&&>(__p.second);655 return std::forward<_T2&&>(__p.second);
676}656}
677657
678template <class _T2, class _T1>658template <class _T2, class _T1>
679[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI constexpr _T2 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {659[[__nodiscard__]] inline constexpr _T2 const&& get(pair<_T1, _T2> const&& __p) _NOEXCEPT {
680 return std::forward<_T2 const&&>(__p.second);660 return std::forward<_T2 const&&>(__p.second);
681}661}
682662
lib/libcxx/include/__utility/try_key_extraction.h+16-12
...@@ -27,61 +27,65 @@...@@ -27,61 +27,65 @@
2727
28_LIBCPP_BEGIN_NAMESPACE_STD28_LIBCPP_BEGIN_NAMESPACE_STD
2929
30template <class _KeyT, class _Ret, class _WithKey, class _WithoutKey, class... _Args>30template <class _KeyT, bool, class _Ret, class _WithKey, class _WithoutKey, class... _Args>
31_LIBCPP_HIDE_FROM_ABI _Ret31_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Ret
32__try_key_extraction_impl(__priority_tag<0>, _WithKey, _WithoutKey __without_key, _Args&&... __args) {32__try_key_extraction_impl(__priority_tag<0>, _WithKey, _WithoutKey __without_key, _Args&&... __args) {
33 return __without_key(std::forward<_Args>(__args)...);33 return __without_key(std::forward<_Args>(__args)...);
34}34}
3535
36template <class _KeyT,36template <class _KeyT,
37 bool,
37 class _Ret,38 class _Ret,
38 class _WithKey,39 class _WithKey,
39 class _WithoutKey,40 class _WithoutKey,
40 class _Arg,41 class _Arg,
41 __enable_if_t<is_same<_KeyT, __remove_const_ref_t<_Arg> >::value, int> = 0>42 __enable_if_t<is_same<_KeyT, __remove_const_ref_t<_Arg> >::value, int> = 0>
42_LIBCPP_HIDE_FROM_ABI _Ret43_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Ret
43__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg&& __arg) {44__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg&& __arg) {
44 return __with_key(__arg, std::forward<_Arg>(__arg));45 return __with_key(__arg, std::forward<_Arg>(__arg));
45}46}
4647
47template <class _KeyT,48template <class _KeyT,
49 bool __is_map,
48 class _Ret,50 class _Ret,
49 class _WithKey,51 class _WithKey,
50 class _WithoutKey,52 class _WithoutKey,
51 class _Arg,53 class _Arg,
52 __enable_if_t<__is_pair_v<__remove_const_ref_t<_Arg> > &&54 __enable_if_t<__is_map && __is_pair_v<__remove_const_ref_t<_Arg> > &&
53 is_same<__remove_const_t<typename __remove_const_ref_t<_Arg>::first_type>, _KeyT>::value,55 is_same<__remove_const_t<typename __remove_const_ref_t<_Arg>::first_type>, _KeyT>::value,
54 int> = 0>56 int> = 0>
55_LIBCPP_HIDE_FROM_ABI _Ret57_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Ret
56__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg&& __arg) {58__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg&& __arg) {
57 return __with_key(__arg.first, std::forward<_Arg>(__arg));59 return __with_key(__arg.first, std::forward<_Arg>(__arg));
58}60}
5961
60template <class _KeyT,62template <class _KeyT,
63 bool __is_map,
61 class _Ret,64 class _Ret,
62 class _WithKey,65 class _WithKey,
63 class _WithoutKey,66 class _WithoutKey,
64 class _Arg1,67 class _Arg1,
65 class _Arg2,68 class _Arg2,
66 __enable_if_t<is_same<_KeyT, __remove_const_ref_t<_Arg1> >::value, int> = 0>69 __enable_if_t<__is_map && is_same<_KeyT, __remove_const_ref_t<_Arg1> >::value, int> = 0>
67_LIBCPP_HIDE_FROM_ABI _Ret70_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Ret
68__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg1&& __arg1, _Arg2&& __arg2) {71__try_key_extraction_impl(__priority_tag<1>, _WithKey __with_key, _WithoutKey, _Arg1&& __arg1, _Arg2&& __arg2) {
69 return __with_key(__arg1, std::forward<_Arg1>(__arg1), std::forward<_Arg2>(__arg2));72 return __with_key(__arg1, std::forward<_Arg1>(__arg1), std::forward<_Arg2>(__arg2));
70}73}
7174
72#ifndef _LIBCPP_CXX03_LANG75#ifndef _LIBCPP_CXX03_LANG
73template <class _KeyT,76template <class _KeyT,
77 bool __is_map,
74 class _Ret,78 class _Ret,
75 class _WithKey,79 class _WithKey,
76 class _WithoutKey,80 class _WithoutKey,
77 class _PiecewiseConstruct,81 class _PiecewiseConstruct,
78 class _Tuple1,82 class _Tuple1,
79 class _Tuple2,83 class _Tuple2,
80 __enable_if_t<is_same<__remove_const_ref_t<_PiecewiseConstruct>, piecewise_construct_t>::value &&84 __enable_if_t<__is_map && is_same<__remove_const_ref_t<_PiecewiseConstruct>, piecewise_construct_t>::value &&
81 __is_tuple_v<_Tuple1> && tuple_size<_Tuple1>::value == 1 &&85 __is_tuple_v<_Tuple1> && tuple_size<_Tuple1>::value == 1 &&
82 is_same<__remove_const_ref_t<typename tuple_element<0, _Tuple1>::type>, _KeyT>::value,86 is_same<__remove_const_ref_t<typename tuple_element<0, _Tuple1>::type>, _KeyT>::value,
83 int> = 0>87 int> = 0>
84_LIBCPP_HIDE_FROM_ABI _Ret __try_key_extraction_impl(88_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Ret __try_key_extraction_impl(
85 __priority_tag<1>,89 __priority_tag<1>,
86 _WithKey __with_key,90 _WithKey __with_key,
87 _WithoutKey,91 _WithoutKey,
...@@ -101,11 +105,11 @@ _LIBCPP_HIDE_FROM_ABI _Ret __try_key_extraction_impl(...@@ -101,11 +105,11 @@ _LIBCPP_HIDE_FROM_ABI _Ret __try_key_extraction_impl(
101// arguments. Otherwise it calls the `__without_key` function with all of the arguments.105// arguments. Otherwise it calls the `__without_key` function with all of the arguments.
102//106//
103// Both `__with_key` and `__without_key` must take all arguments by reference.107// Both `__with_key` and `__without_key` must take all arguments by reference.
104template <class _KeyT, class _WithKey, class _WithoutKey, class... _Args>108template <class _KeyT, class _ValT, class _WithKey, class _WithoutKey, class... _Args>
105_LIBCPP_HIDE_FROM_ABI decltype(std::declval<_WithoutKey>()(std::declval<_Args>()...))109_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 decltype(std::declval<_WithoutKey>()(std::declval<_Args>()...))
106__try_key_extraction(_WithKey __with_key, _WithoutKey __without_key, _Args&&... __args) {110__try_key_extraction(_WithKey __with_key, _WithoutKey __without_key, _Args&&... __args) {
107 using _Ret = decltype(__without_key(std::forward<_Args>(__args)...));111 using _Ret = decltype(__without_key(std::forward<_Args>(__args)...));
108 return std::__try_key_extraction_impl<_KeyT, _Ret>(112 return std::__try_key_extraction_impl<_KeyT, !is_same<_KeyT, _ValT>::value, _Ret>(
109 __priority_tag<1>(), __with_key, __without_key, std::forward<_Args>(__args)...);113 __priority_tag<1>(), __with_key, __without_key, std::forward<_Args>(__args)...);
110}114}
111115
lib/libcxx/include/__variant/monostate.h+4-4
...@@ -19,10 +19,10 @@...@@ -19,10 +19,10 @@
19# pragma GCC system_header19# pragma GCC system_header
20#endif20#endif
2121
22_LIBCPP_BEGIN_NAMESPACE_STD
23
24#if _LIBCPP_STD_VER >= 1722#if _LIBCPP_STD_VER >= 17
2523
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26struct monostate {};26struct monostate {};
2727
28_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }28_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }
...@@ -59,8 +59,8 @@ struct hash<monostate> {...@@ -59,8 +59,8 @@ struct hash<monostate> {
59 }59 }
60};60};
6161
62#endif // _LIBCPP_STD_VER >= 17
63
64_LIBCPP_END_NAMESPACE_STD62_LIBCPP_END_NAMESPACE_STD
6563
64#endif // _LIBCPP_STD_VER >= 17
65
66#endif // _LIBCPP___VARIANT_MONOSTATE_H66#endif // _LIBCPP___VARIANT_MONOSTATE_H
lib/libcxx/include/__vector/layout.h created+479
...@@ -0,0 +1,479 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP___VECTOR_LAYOUT_H
10#define _LIBCPP___VECTOR_LAYOUT_H
11
12#include <__assert>
13#include <__config>
14#include <__debug_utils/sanitizers.h>
15#include <__memory/allocator_traits.h>
16#include <__memory/compressed_pair.h>
17#include <__memory/pointer_traits.h>
18#include <__memory/swap_allocator.h>
19#include <__memory/uninitialized_algorithms.h>
20#include <__split_buffer>
21#include <__type_traits/is_nothrow_constructible.h>
22#include <__utility/exchange.h>
23#include <__utility/move.h>
24#include <__utility/swap.h>
25
26#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
27# pragma GCC system_header
28#endif
29
30_LIBCPP_PUSH_MACROS
31#include <__undef_macros>
32
33_LIBCPP_BEGIN_NAMESPACE_STD
34
35/// Defines `std::vector`'s storage layout and any operations that are affected by a change in the
36/// layout.
37///
38/// `std::vector` can be represented in a variety of ways. Each representation strongly influences
39/// the codegen when calling vector operations, which can significantly impact runtime performance
40/// and memory utilisation. libc++ provides two alternative layouts for `std::vector`, although only
41/// one can be active for an entire binary:
42///
43/// * pointer-based layout (stable ABI default)
44/// * size-based layout (unstable ABI alternative)
45//
46/// We describe these layouts below. All vector representations have a pointer that points to where
47/// the memory is allocated (called `__begin_`).
48///
49/// **Pointer-based layout**
50///
51/// The pointer-based layout uses two more pointers in addition to `__begin_`. The second pointer
52/// (called `__end_`) points past the end of the part of the buffer that holds valid elements.
53/// Another pointer (called `__capacity_`) points past the end of the allocated buffer. The original
54/// libc++ `std::vector` implementation only provided the pointer-based layout. libc++ continues to
55/// use the pointer-based layout, by default, in order to maintain binary compatibility with
56/// existing software.
57///
58/// The `__end_` pointer has three primary use-cases:
59/// * to compute the size of the vector; and
60/// * to construct the past-the-end iterator; and
61/// * to indicate where the next element should be appended.
62///
63/// The `__capacity_` is used to compute the capacity of the vector, which lets the vector know how
64/// many elements can be added to the vector before a reallocation is necessary.
65///
66/// __begin_ = 0xE4FD0, __end_ = 0xE4FF0, __capacity_ = 0xE5000
67/// 0xE4FD0 0xE4FF0 0xE5000
68/// v v v
69/// +---------------+--------+--------+--------+--------+--------+--------+---------------------+
70/// | ????????????? | 3174 | 5656 | 648 | 489 | ------ | ------ | ??????????????????? |
71/// +---------------+--------+--------+--------+--------+--------+--------+---------------------+
72/// ^ ^ ^
73/// __begin_ __end_ __capacity_
74///
75/// Figure 1: A visual representation of a pointer-based `std::vector<short>`. This vector has
76/// four elements, with the capacity to store six. Boxes with numbers are valid elements within
77/// the vector, and boxes with `xx` have been allocated, but aren't being used as elements right
78/// now.
79///
80/// This is the default layout for libc++.
81///
82/// **Size-based layout**
83///
84/// The size-based layout uses integers to track its size and capacity, and computes pointers to
85/// past-the-end of the valid range and the whole buffer only when it's necessary. Programs using
86/// the size-based layout have been measured to yield improved compute and memory performance over
87/// the pointer-based layout. Despite these promising measurements, the size-based layout is opt-in,
88/// to preserve ABI compatibility with prebuilt binaries. Given the improved performance, we
89/// recommend preferring the size-based layout in the absence of such ABI constraints.
90///
91/// __begin_ = 0xE4FD0, __size_ = 4, __capacity_ = 6
92/// 0xE4FD0
93/// v
94/// +---------------+--------+--------+--------+--------+--------+--------+---------------------+
95/// | ????????????? | 3174 | 5656 | 648 | 489 | ------ | ------ | ??????????????????? |
96/// +---------------+--------+--------+--------+--------+--------+--------+---------------------+
97/// ^
98/// __begin_
99///
100/// Figure 2: A visual representation of this a size-based layout. Blank boxes are not a part
101/// of the vector's allocated buffer.
102///
103/// **Class design**
104///
105/// __vector_layout was designed with the following goals:
106/// 1. to abstractly represent the buffer's boundaries; and
107/// 2. to limit the number of `#ifdef` blocks that a reader needs to pass through; and
108/// 3. given (1) and (2), to have no logically identical components in multiple `#ifdef` clauses.
109///
110/// To facilitate these goals, there is a single `__vector_layout` definition. Users must choose
111/// their vector's layout when libc++ is being configured, so there is no need to manage multiple
112/// vector layout types (e.g. `__vector_size_layout`, `__vector_pointer_layout`, etc.). In doing so,
113/// we reduce a significant portion of duplicate code.
114template <class _Tp, class _Allocator>
115class __vector_layout {
116public:
117 using value_type _LIBCPP_NODEBUG = _Tp;
118 using allocator_type _LIBCPP_NODEBUG = _Allocator;
119 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
120 using size_type _LIBCPP_NODEBUG = typename __alloc_traits::size_type;
121 using pointer _LIBCPP_NODEBUG = typename __alloc_traits::pointer;
122 using const_pointer _LIBCPP_NODEBUG = typename __alloc_traits::const_pointer;
123#ifdef _LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED
124 using _SplitBuffer _LIBCPP_NODEBUG = __split_buffer<_Tp, _Allocator, __split_buffer_size_layout>;
125 using __bound_type _LIBCPP_NODEBUG = size_type;
126#else
127 using _SplitBuffer _LIBCPP_NODEBUG = __split_buffer<_Tp, _Allocator, __split_buffer_pointer_layout>;
128 using __bound_type _LIBCPP_NODEBUG = pointer;
129#endif
130
131 // Cannot be defaulted, since `_LIBCPP_COMPRESSED_PAIR` isn't an aggregate before C++14.
132 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __vector_layout()
133 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
134 : __capacity_() {}
135
136 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __vector_layout(allocator_type const& __a)
137 _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
138 : __capacity_(), __alloc_(__a) {}
139
140 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __vector_layout(allocator_type&& __a)
141 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
142 : __capacity_(), __alloc_(std::move(__a)) {}
143
144 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __vector_layout(__vector_layout&& __other)
145 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
146
147 /// Returns a reference to the stored allocator.
148 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type& __alloc() _NOEXCEPT {
149 return __alloc_;
150 }
151
152 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type const&
153 __alloc() const _NOEXCEPT {
154 return __alloc_;
155 }
156
157 /// Returns a pointer to the beginning of the buffer.
158 ///
159 /// `__begin_ptr()` is not called `data()` because `vector::data()` returns `T*`, but `__begin_`
160 /// is allowed to be a fancy pointer.
161 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __begin_ptr() _NOEXCEPT {
162 return __begin_;
163 }
164
165 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __begin_ptr() const _NOEXCEPT {
166 return __begin_;
167 }
168
169 /// Returns a built-in pointer to the beginning of the buffer.
170 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _Tp* __data() _NOEXCEPT {
171 return std::__to_address(__begin_);
172 }
173
174 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _Tp const* __data() const _NOEXCEPT {
175 return std::__to_address(__begin_);
176 }
177
178 /// Returns how many elements can be added before a reallocation occurs.
179 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type
180 __remaining_capacity() const _NOEXCEPT;
181
182 /// Sets the member pointing to the first element in the vector to `__new_begin`, the member used
183 /// to obtain the vector's bound to the equivalent of `__new_size`, and the member that represents
184 /// the vector's capacity to the equivalent to `__new_capacity`.
185 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
186 __set_layout(pointer __new_begin, size_type __new_size, size_type __new_capacity) _NOEXCEPT;
187
188 /// Sets the member used to obtain the vector's bound to the equivalent of `__ptr`.
189 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __set_bound_using_pointer(pointer __ptr) _NOEXCEPT;
190
191 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __reset_without_allocator() _NOEXCEPT;
192 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap(__vector_layout& __other) _NOEXCEPT;
193 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
194 __move_assign_without_allocator(__vector_layout& __other) _NOEXCEPT;
195
196 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __relocate(_SplitBuffer& __buffer);
197 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer
198 __relocate_with_pivot(_SplitBuffer& __buffer, pointer __pivot);
199
200 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __size() const _NOEXCEPT;
201 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __capacity() const _NOEXCEPT;
202 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __empty() const _NOEXCEPT;
203 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __end_ptr() _NOEXCEPT;
204 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __end_ptr() const _NOEXCEPT;
205 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __capacity_ptr() _NOEXCEPT;
206 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __capacity_ptr() const _NOEXCEPT;
207 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const _NOEXCEPT;
208
209private:
210 pointer __begin_ = nullptr;
211
212#ifdef _LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED
213 size_type __size_ = 0;
214 size_type __capacity_ = 0;
215 _LIBCPP_NO_UNIQUE_ADDRESS allocator_type __alloc_;
216#else
217 pointer __end_ = nullptr;
218 _LIBCPP_COMPRESSED_PAIR(pointer, __capacity_ = nullptr, allocator_type, __alloc_);
219#endif
220
221 _LIBCPP_CONSTEXPR_SINCE_CXX20
222 _LIBCPP_HIDE_FROM_ABI void __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {
223 std::__annotate_contiguous_container<_Allocator>(__data(), __data() + __capacity(), __old_mid, __new_mid);
224 }
225
226 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_new(size_type __current_size) const _NOEXCEPT {
227 __annotate_contiguous_container(__data() + __capacity(), __data() + __current_size);
228 }
229
230 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_delete() const _NOEXCEPT {
231 __annotate_contiguous_container(__data() + __size(), __data() + __capacity());
232 }
233};
234
235#ifdef _LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED
236template <class _Tp, class _Alloc>
237_LIBCPP_CONSTEXPR_SINCE_CXX20 __vector_layout<_Tp, _Alloc>::__vector_layout(__vector_layout&& __other)
238 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
239 : __begin_(std::__exchange(__other.__begin_, nullptr)),
240 __size_(std::__exchange(__other.__size_, 0)),
241 __capacity_(std::__exchange(__other.__capacity_, 0)),
242 __alloc_(std::move(__other.__alloc_)) {}
243
244template <class _Tp, class _Alloc>
245_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::size_type
246__vector_layout<_Tp, _Alloc>::__remaining_capacity() const _NOEXCEPT {
247 return __capacity_ - __size_;
248}
249
250template <class _Tp, class _Alloc>
251_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__set_layout(
252 pointer __new_begin, size_type __new_size, size_type __new_capacity) _NOEXCEPT {
253 __begin_ = __new_begin;
254 __size_ = __new_size;
255 __capacity_ = __new_capacity;
256}
257
258template <class _Tp, class _Alloc>
259_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__set_bound_using_pointer(pointer __ptr) _NOEXCEPT {
260 __size_ = static_cast<size_type>(__ptr - __begin_);
261}
262
263template <class _Tp, class _Alloc>
264_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__reset_without_allocator() _NOEXCEPT {
265 __begin_ = nullptr;
266 __size_ = 0;
267 __capacity_ = 0;
268}
269
270template <class _Tp, class _Alloc>
271_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__swap(__vector_layout& __other) _NOEXCEPT {
272 using std::swap;
273 swap(__begin_, __other.__begin_);
274 swap(__size_, __other.__size_);
275 swap(__capacity_, __other.__capacity_);
276 std::__swap_allocator(__alloc_, __other.__alloc_);
277}
278
279template <class _Tp, class _Alloc>
280_LIBCPP_CONSTEXPR_SINCE_CXX20 void
281__vector_layout<_Tp, _Alloc>::__move_assign_without_allocator(__vector_layout& __other) _NOEXCEPT {
282 __begin_ = __other.__begin_;
283 __size_ = __other.__size_;
284 __capacity_ = __other.__capacity_;
285
286 __other.__reset_without_allocator();
287}
288
289template <class _Tp, class _Alloc>
290_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__relocate(_SplitBuffer& __buffer) {
291 __annotate_delete();
292 __buffer.__relocate(__begin_, __size_, __capacity_);
293 __annotate_new(__size_);
294}
295
296template <class _Tp, class _Alloc>
297_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::pointer
298__vector_layout<_Tp, _Alloc>::__relocate_with_pivot(_SplitBuffer& __buffer, pointer __pivot) {
299 __annotate_delete();
300 auto __result = __buffer.__relocate_with_pivot(__pivot, __begin_, __size_, __capacity_);
301 __annotate_new(__size_);
302 return __result;
303}
304
305template <class _Tp, class _Alloc>
306_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::size_type
307__vector_layout<_Tp, _Alloc>::__size() const _NOEXCEPT {
308 return __size_;
309}
310
311template <class _Tp, class _Alloc>
312_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::size_type
313__vector_layout<_Tp, _Alloc>::__capacity() const _NOEXCEPT {
314 return __capacity_;
315}
316
317template <class _Tp, class _Alloc>
318_LIBCPP_CONSTEXPR_SINCE_CXX20 bool __vector_layout<_Tp, _Alloc>::__empty() const _NOEXCEPT {
319 return __size_ == 0;
320}
321
322template <class _Tp, class _Alloc>
323_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::pointer
324__vector_layout<_Tp, _Alloc>::__end_ptr() _NOEXCEPT {
325 return __begin_ + __size_;
326}
327
328template <class _Tp, class _Alloc>
329_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::const_pointer
330__vector_layout<_Tp, _Alloc>::__end_ptr() const _NOEXCEPT {
331 return __begin_ + __size_;
332}
333
334template <class _Tp, class _Alloc>
335_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::pointer
336__vector_layout<_Tp, _Alloc>::__capacity_ptr() _NOEXCEPT {
337 return __begin_ + __capacity_;
338}
339
340template <class _Tp, class _Alloc>
341_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::const_pointer
342__vector_layout<_Tp, _Alloc>::__capacity_ptr() const _NOEXCEPT {
343 return __begin_ + __capacity_;
344}
345
346template <class _Tp, class _Alloc>
347_LIBCPP_CONSTEXPR_SINCE_CXX20 bool __vector_layout<_Tp, _Alloc>::__invariants() const _NOEXCEPT {
348 if (__begin_ == nullptr)
349 return __size_ == 0 && __capacity_ == 0;
350 return __size_ <= __capacity_;
351}
352#else // !defined(_LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED)
353template <class _Tp, class _Alloc>
354_LIBCPP_CONSTEXPR_SINCE_CXX20 __vector_layout<_Tp, _Alloc>::__vector_layout(__vector_layout&& __other)
355 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
356 : __begin_(std::__exchange(__other.__begin_, nullptr)),
357 __end_(std::__exchange(__other.__end_, nullptr)),
358 __capacity_(std::__exchange(__other.__capacity_, nullptr)),
359 __alloc_(std::move(__other.__alloc_)) {}
360
361template <class _Tp, class _Alloc>
362_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::size_type
363__vector_layout<_Tp, _Alloc>::__remaining_capacity() const _NOEXCEPT {
364 return __capacity_ - __end_;
365}
366
367template <class _Tp, class _Alloc>
368_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__set_layout(
369 pointer __new_begin, size_type __new_size, size_type __new_capacity) _NOEXCEPT {
370 __begin_ = __new_begin;
371 __end_ = __new_begin + __new_size;
372 __capacity_ = __new_begin + __new_capacity;
373}
374
375template <class _Tp, class _Alloc>
376_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__set_bound_using_pointer(pointer __ptr) _NOEXCEPT {
377 __end_ = __ptr;
378}
379
380template <class _Tp, class _Alloc>
381_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__reset_without_allocator() _NOEXCEPT {
382 __begin_ = nullptr;
383 __end_ = nullptr;
384 __capacity_ = nullptr;
385}
386
387template <class _Tp, class _Alloc>
388_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__swap(__vector_layout& __other) _NOEXCEPT {
389 using std::swap;
390 swap(__begin_, __other.__begin_);
391 swap(__end_, __other.__end_);
392 swap(__capacity_, __other.__capacity_);
393 std::__swap_allocator(__alloc_, __other.__alloc_);
394}
395
396template <class _Tp, class _Alloc>
397_LIBCPP_CONSTEXPR_SINCE_CXX20 void
398__vector_layout<_Tp, _Alloc>::__move_assign_without_allocator(__vector_layout& __other) _NOEXCEPT {
399 __begin_ = __other.__begin_;
400 __end_ = __other.__end_;
401 __capacity_ = __other.__capacity_;
402
403 __other.__reset_without_allocator();
404}
405
406template <class _Tp, class _Alloc>
407_LIBCPP_CONSTEXPR_SINCE_CXX20 void __vector_layout<_Tp, _Alloc>::__relocate(_SplitBuffer& __buffer) {
408 __annotate_delete();
409 __buffer.__relocate(__begin_, __end_, __capacity_);
410 __annotate_new(__size());
411}
412
413template <class _Tp, class _Alloc>
414_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::pointer
415__vector_layout<_Tp, _Alloc>::__relocate_with_pivot(_SplitBuffer& __buffer, pointer __pivot) {
416 __annotate_delete();
417 auto __result = __buffer.__relocate_with_pivot(__pivot, __begin_, __end_, __capacity_);
418 __annotate_new(__size());
419 return __result;
420}
421
422template <class _Tp, class _Alloc>
423_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::size_type
424__vector_layout<_Tp, _Alloc>::__size() const _NOEXCEPT {
425 return static_cast<size_type>(__end_ - __begin_);
426}
427
428template <class _Tp, class _Alloc>
429_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::size_type
430__vector_layout<_Tp, _Alloc>::__capacity() const _NOEXCEPT {
431 return static_cast<size_type>(__capacity_ - __begin_);
432}
433
434template <class _Tp, class _Alloc>
435_LIBCPP_CONSTEXPR_SINCE_CXX20 bool __vector_layout<_Tp, _Alloc>::__empty() const _NOEXCEPT {
436 return __begin_ == __end_;
437}
438
439template <class _Tp, class _Alloc>
440_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::pointer
441__vector_layout<_Tp, _Alloc>::__end_ptr() _NOEXCEPT {
442 return __end_;
443}
444
445template <class _Tp, class _Alloc>
446_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::const_pointer
447__vector_layout<_Tp, _Alloc>::__end_ptr() const _NOEXCEPT {
448 return __end_;
449}
450
451template <class _Tp, class _Alloc>
452_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::pointer
453__vector_layout<_Tp, _Alloc>::__capacity_ptr() _NOEXCEPT {
454 return __capacity_;
455}
456
457template <class _Tp, class _Alloc>
458_LIBCPP_CONSTEXPR_SINCE_CXX20 typename __vector_layout<_Tp, _Alloc>::const_pointer
459__vector_layout<_Tp, _Alloc>::__capacity_ptr() const _NOEXCEPT {
460 return __capacity_;
461}
462
463template <class _Tp, class _Alloc>
464_LIBCPP_CONSTEXPR_SINCE_CXX20 bool __vector_layout<_Tp, _Alloc>::__invariants() const _NOEXCEPT {
465 if (__begin_ == nullptr)
466 return __end_ == nullptr && __capacity_ == nullptr;
467 if (__begin_ > __end_)
468 return false;
469 if (__begin_ == __capacity_)
470 return false;
471 return __end_ <= __capacity_;
472}
473#endif // _LIBCPP_ABI_VECTOR_LAYOUT_SIZE_BASED
474
475_LIBCPP_END_NAMESPACE_STD
476
477_LIBCPP_POP_MACROS
478
479#endif // _LIBCPP___VECTOR_LAYOUT_H
lib/libcxx/include/__vector/vector.h+218-301
...@@ -56,6 +56,7 @@...@@ -56,6 +56,7 @@
56#include <__type_traits/is_nothrow_constructible.h>56#include <__type_traits/is_nothrow_constructible.h>
57#include <__type_traits/is_pointer.h>57#include <__type_traits/is_pointer.h>
58#include <__type_traits/is_same.h>58#include <__type_traits/is_same.h>
59#include <__type_traits/is_swappable.h>
59#include <__type_traits/is_trivially_relocatable.h>60#include <__type_traits/is_trivially_relocatable.h>
60#include <__type_traits/type_identity.h>61#include <__type_traits/type_identity.h>
61#include <__utility/declval.h>62#include <__utility/declval.h>
...@@ -72,6 +73,7 @@...@@ -72,6 +73,7 @@
72// These headers define parts of vectors definition, since they define ADL functions or class specializations.73// These headers define parts of vectors definition, since they define ADL functions or class specializations.
73#include <__vector/comparison.h>74#include <__vector/comparison.h>
74#include <__vector/container_traits.h>75#include <__vector/container_traits.h>
76#include <__vector/layout.h>
75#include <__vector/swap.h>77#include <__vector/swap.h>
7678
77#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)79#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -85,19 +87,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -85,19 +87,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD
8587
86template <class _Tp, class _Allocator /* = allocator<_Tp> */>88template <class _Tp, class _Allocator /* = allocator<_Tp> */>
87class vector {89class vector {
88 template <class _Up, class _Alloc>90 using __base_type _LIBCPP_NODEBUG = __vector_layout<_Tp, _Allocator>;
89 using __split_buffer _LIBCPP_NODEBUG = std::__split_buffer<_Up, _Alloc, __split_buffer_pointer_layout>;91 using __bound_type _LIBCPP_NODEBUG = typename __base_type::__bound_type;
92 using _SplitBuffer _LIBCPP_NODEBUG = typename __base_type::_SplitBuffer;
9093
91public:94public:
92 //95 //
93 // Types96 // Types
94 //97 //
95 using __self _LIBCPP_NODEBUG = vector;
96 using value_type = _Tp;98 using value_type = _Tp;
97 using allocator_type = _Allocator;99 using allocator_type = _Allocator;
98 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;100 using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<_Allocator>;
99 using reference = value_type&;101 using reference = _Tp&;
100 using const_reference = const value_type&;102 using const_reference = const _Tp&;
101 using size_type = typename __alloc_traits::size_type;103 using size_type = typename __alloc_traits::size_type;
102 using difference_type = typename __alloc_traits::difference_type;104 using difference_type = typename __alloc_traits::difference_type;
103 using pointer = typename __alloc_traits::pointer;105 using pointer = typename __alloc_traits::pointer;
...@@ -106,8 +108,8 @@ public:...@@ -106,8 +108,8 @@ public:
106 // Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's108 // Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's
107 // pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is109 // pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is
108 // considered contiguous.110 // considered contiguous.
109 using iterator = __bounded_iter<__wrap_iter<pointer> >;111 using iterator = __bounded_iter<pointer>;
110 using const_iterator = __bounded_iter<__wrap_iter<const_pointer> >;112 using const_iterator = __bounded_iter<const_pointer>;
111#else113#else
112 using iterator = __wrap_iter<pointer>;114 using iterator = __wrap_iter<pointer>;
113 using const_iterator = __wrap_iter<const_pointer>;115 using const_iterator = __wrap_iter<const_pointer>;
...@@ -139,7 +141,7 @@ public:...@@ -139,7 +141,7 @@ public:
139#else141#else
140 noexcept142 noexcept
141#endif143#endif
142 : __alloc_(__a) {144 : __layout_(__a) {
143 }145 }
144146
145 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n) {147 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n) {
...@@ -151,9 +153,8 @@ public:...@@ -151,9 +153,8 @@ public:
151 __guard.__complete();153 __guard.__complete();
152 }154 }
153155
154#if _LIBCPP_STD_VER >= 14
155 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a)156 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a)
156 : __alloc_(__a) {157 : __layout_(__a) {
157 auto __guard = std::__make_exception_guard(__destroy_vector(*this));158 auto __guard = std::__make_exception_guard(__destroy_vector(*this));
158 if (__n > 0) {159 if (__n > 0) {
159 __vallocate(__n);160 __vallocate(__n);
...@@ -161,7 +162,6 @@ public:...@@ -161,7 +162,6 @@ public:
161 }162 }
162 __guard.__complete();163 __guard.__complete();
163 }164 }
164#endif
165165
166 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x) {166 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x) {
167 auto __guard = std::__make_exception_guard(__destroy_vector(*this));167 auto __guard = std::__make_exception_guard(__destroy_vector(*this));
...@@ -175,7 +175,7 @@ public:...@@ -175,7 +175,7 @@ public:
175 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>175 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
176 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI176 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
177 vector(size_type __n, const value_type& __x, const allocator_type& __a)177 vector(size_type __n, const value_type& __x, const allocator_type& __a)
178 : __alloc_(__a) {178 : __layout_(__a) {
179 auto __guard = std::__make_exception_guard(__destroy_vector(*this));179 auto __guard = std::__make_exception_guard(__destroy_vector(*this));
180 if (__n > 0) {180 if (__n > 0) {
181 __vallocate(__n);181 __vallocate(__n);
...@@ -198,7 +198,7 @@ public:...@@ -198,7 +198,7 @@ public:
198 int> = 0>198 int> = 0>
199 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI199 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
200 vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a)200 vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
201 : __alloc_(__a) {201 : __layout_(__a) {
202 __init_with_sentinel(__first, __last);202 __init_with_sentinel(__first, __last);
203 }203 }
204204
...@@ -219,16 +219,15 @@ public:...@@ -219,16 +219,15 @@ public:
219 int> = 0>219 int> = 0>
220 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI220 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
221 vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a)221 vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a)
222 : __alloc_(__a) {222 : __layout_(__a) {
223 size_type __n = static_cast<size_type>(std::distance(__first, __last));223 size_type __n = static_cast<size_type>(std::distance(__first, __last));
224 __init_with_size(__first, __last, __n);224 __init_with_size(__first, __last, __n);
225 }225 }
226226
227#if _LIBCPP_STD_VER >= 23227#if _LIBCPP_STD_VER >= 23
228 template <_ContainerCompatibleRange<_Tp> _Range>228 template <_ContainerCompatibleRange<_Tp> _Range>
229 _LIBCPP_HIDE_FROM_ABI constexpr vector(229 _LIBCPP_HIDE_FROM_ABI constexpr vector(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
230 from_range_t, _Range&& __range, const allocator_type& __alloc = allocator_type())230 : __layout_(__a) {
231 : __alloc_(__alloc) {
232 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {231 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
233 auto __n = static_cast<size_type>(ranges::distance(__range));232 auto __n = static_cast<size_type>(ranges::distance(__range));
234 __init_with_size(ranges::begin(__range), ranges::end(__range), __n);233 __init_with_size(ranges::begin(__range), ranges::end(__range), __n);
...@@ -245,10 +244,10 @@ private:...@@ -245,10 +244,10 @@ private:
245 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __destroy_vector(vector& __vec) : __vec_(__vec) {}244 _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __destroy_vector(vector& __vec) : __vec_(__vec) {}
246245
247 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() {246 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() {
248 if (__vec_.__begin_ != nullptr) {247 if (__vec_.__layout_.__begin_ptr() != nullptr) {
249 __vec_.clear();248 __vec_.clear();
250 __vec_.__annotate_delete();249 __vec_.__annotate_delete();
251 __alloc_traits::deallocate(__vec_.__alloc_, __vec_.__begin_, __vec_.capacity());250 __alloc_traits::deallocate(__vec_.__layout_.__alloc(), __vec_.__layout_.__begin_ptr(), __vec_.capacity());
252 }251 }
253 }252 }
254253
...@@ -256,17 +255,19 @@ private:...@@ -256,17 +255,19 @@ private:
256 vector& __vec_;255 vector& __vec_;
257 };256 };
258257
258 using __emplace_back_result_t _LIBCPP_NODEBUG = _If<(_LIBCPP_STD_VER < 17), void, reference>;
259
259public:260public:
260 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~vector() { __destroy_vector (*this)(); }261 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~vector() { __destroy_vector (*this)(); }
261262
262 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(const vector& __x)263 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(const vector& __x)
263 : __alloc_(__alloc_traits::select_on_container_copy_construction(__x.__alloc_)) {264 : __layout_(__alloc_traits::select_on_container_copy_construction(__x.__layout_.__alloc())) {
264 __init_with_size(__x.__begin_, __x.__end_, __x.size());265 __init_with_size(__x.__layout_.__begin_ptr(), __x.__layout_.__end_ptr(), __x.size());
265 }266 }
266 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI267 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
267 vector(const vector& __x, const __type_identity_t<allocator_type>& __a)268 vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
268 : __alloc_(__a) {269 : __layout_(__a) {
269 __init_with_size(__x.__begin_, __x.__end_, __x.size());270 __init_with_size(__x.__layout_.__begin_ptr(), __x.__layout_.__end_ptr(), __x.size());
270 }271 }
271 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(const vector& __x);272 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(const vector& __x);
272273
...@@ -277,7 +278,7 @@ public:...@@ -277,7 +278,7 @@ public:
277278
278 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI279 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
279 vector(initializer_list<value_type> __il, const allocator_type& __a)280 vector(initializer_list<value_type> __il, const allocator_type& __a)
280 : __alloc_(__a) {281 : __layout_(__a) {
281 __init_with_size(__il.begin(), __il.end(), __il.size());282 __init_with_size(__il.begin(), __il.end(), __il.size());
282 }283 }
283284
...@@ -294,8 +295,8 @@ public:...@@ -294,8 +295,8 @@ public:
294 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);295 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
295#endif296#endif
296297
297 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI298 _LIBCPP_CONSTEXPR_SINCE_CXX20
298 vector(vector&& __x, const __type_identity_t<allocator_type>& __a);299 _LIBCPP_HIDE_FROM_ABI vector(vector&& __x, const __type_identity_t<allocator_type>& __a);
299 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(vector&& __x)300 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(vector&& __x)
300 _NOEXCEPT_(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) {301 _NOEXCEPT_(__noexcept_move_assign_container<_Allocator, __alloc_traits>::value) {
301 __move_assign(__x, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());302 __move_assign(__x, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
...@@ -340,23 +341,23 @@ public:...@@ -340,23 +341,23 @@ public:
340#endif341#endif
341342
342 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {343 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
343 return this->__alloc_;344 return this->__layout_.__alloc();
344 }345 }
345346
346 //347 //
347 // Iterators348 // Iterators
348 //349 //
349 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {350 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
350 return __make_iter(__add_alignment_assumption(this->__begin_));351 return __make_iter(__add_alignment_assumption(this->__layout_.__begin_ptr()));
351 }352 }
352 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {353 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
353 return __make_iter(__add_alignment_assumption(this->__begin_));354 return __make_iter(__add_alignment_assumption(this->__layout_.__begin_ptr()));
354 }355 }
355 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {356 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
356 return __make_iter(__add_alignment_assumption(this->__end_));357 return __make_iter(__add_alignment_assumption(__layout_.__end_ptr()));
357 }358 }
358 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {359 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
359 return __make_iter(__add_alignment_assumption(this->__end_));360 return __make_iter(__add_alignment_assumption(__layout_.__end_ptr()));
360 }361 }
361362
362 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {363 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {
...@@ -391,16 +392,17 @@ public:...@@ -391,16 +392,17 @@ public:
391 // [vector.capacity], capacity392 // [vector.capacity], capacity
392 //393 //
393 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {394 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
394 return static_cast<size_type>(this->__end_ - this->__begin_);395 return __layout_.__size();
395 }396 }
396 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {397 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
397 return static_cast<size_type>(this->__cap_ - this->__begin_);398 return __layout_.__capacity();
398 }399 }
399 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {400 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
400 return this->__begin_ == this->__end_;401 return __layout_.__empty();
401 }402 }
403
402 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {404 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
403 return std::min<size_type>(__alloc_traits::max_size(this->__alloc_), numeric_limits<difference_type>::max());405 return std::min<size_type>(__alloc_traits::max_size(__layout_.__alloc()), numeric_limits<difference_type>::max());
404 }406 }
405 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);407 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
406 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;408 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
...@@ -410,50 +412,50 @@ public:...@@ -410,50 +412,50 @@ public:
410 //412 //
411 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT {413 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT {
412 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");414 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
413 return this->__begin_[__n];415 return this->__layout_.__begin_ptr()[__n];
414 }416 }
415 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference417 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference
416 operator[](size_type __n) const _NOEXCEPT {418 operator[](size_type __n) const _NOEXCEPT {
417 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");419 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
418 return this->__begin_[__n];420 return this->__layout_.__begin_ptr()[__n];
419 }421 }
420 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) {422 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) {
421 if (__n >= size())423 if (__n >= size())
422 this->__throw_out_of_range();424 this->__throw_out_of_range();
423 return this->__begin_[__n];425 return this->__layout_.__begin_ptr()[__n];
424 }426 }
425 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const {427 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const {
426 if (__n >= size())428 if (__n >= size())
427 this->__throw_out_of_range();429 this->__throw_out_of_range();
428 return this->__begin_[__n];430 return this->__layout_.__begin_ptr()[__n];
429 }431 }
430432
431 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {433 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {
432 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");434 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
433 return *this->__begin_;435 return *this->__layout_.__begin_ptr();
434 }436 }
435 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {437 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
436 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");438 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
437 return *this->__begin_;439 return *this->__layout_.__begin_ptr();
438 }440 }
439 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {441 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
440 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");442 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
441 return *(this->__end_ - 1);443 return end()[-1];
442 }444 }
443 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {445 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
444 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");446 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
445 return *(this->__end_ - 1);447 return end()[-1];
446 }448 }
447449
448 //450 //
449 // [vector.data], data access451 // [vector.data], data access
450 //452 //
451 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI value_type* data() _NOEXCEPT {453 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI value_type* data() _NOEXCEPT {
452 return std::__to_address(this->__begin_);454 return __layout_.__data();
453 }455 }
454456
455 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const value_type* data() const _NOEXCEPT {457 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const value_type* data() const _NOEXCEPT {
456 return std::__to_address(this->__begin_);458 return __layout_.__data();
457 }459 }
458460
459 //461 //
...@@ -464,21 +466,15 @@ public:...@@ -464,21 +466,15 @@ public:
464 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x) { emplace_back(std::move(__x)); }466 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x) { emplace_back(std::move(__x)); }
465467
466 template <class... _Args>468 template <class... _Args>
467 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI469 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __emplace_back_result_t emplace_back(_Args&&... __args);
468#if _LIBCPP_STD_VER >= 17
469 reference
470 emplace_back(_Args&&... __args);
471#else
472 void
473 emplace_back(_Args&&... __args);
474#endif
475470
476 template <class... _Args>471 template <class... _Args>
477 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __emplace_back_assume_capacity(_Args&&... __args) {472 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __emplace_back_assume_capacity(_Args&&... __args) {
478 _LIBCPP_ASSERT_INTERNAL(473 _LIBCPP_ASSERT_INTERNAL(
479 size() < capacity(), "We assume that we have enough space to insert an element at the end of the vector");474 size() < capacity(), "We assume that we have enough space to insert an element at the end of the vector");
480 _ConstructTransaction __tx(*this, 1);475 _ConstructTransaction __tx(*this, 1);
481 __alloc_traits::construct(this->__alloc_, std::__to_address(__tx.__pos_), std::forward<_Args>(__args)...);476 __alloc_traits::construct(
477 this->__layout_.__alloc(), std::__to_address(__tx.__pos_), std::forward<_Args>(__args)...);
482 ++__tx.__pos_;478 ++__tx.__pos_;
483 }479 }
484480
...@@ -487,15 +483,15 @@ public:...@@ -487,15 +483,15 @@ public:
487 _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {483 _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {
488 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {484 if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
489 auto __len = ranges::distance(__range);485 auto __len = ranges::distance(__range);
490 if (__len <= __cap_ - __end_) {486 if (__len <= static_cast<difference_type>(__layout_.__remaining_capacity())) {
491 __construct_at_end(ranges::begin(__range), ranges::end(__range), __len);487 __construct_at_end(ranges::begin(__range), ranges::end(__range), __len);
492 } else {488 } else {
493 __split_buffer<value_type, allocator_type> __buffer(__recommend(size() + __len), size(), __alloc_);489 _SplitBuffer __buffer(__recommend(size() + __len), size(), __layout_.__alloc());
494 __buffer.__construct_at_end_with_size(ranges::begin(__range), __len);490 __buffer.__construct_at_end_with_size(ranges::begin(__range), __len);
495 __swap_out_circular_buffer(__buffer);491 __layout_.__relocate(__buffer);
496 }492 }
497 } else {493 } else {
498 vector __buffer(__alloc_);494 vector __buffer(__layout_.__alloc());
499 for (auto&& __val : __range)495 for (auto&& __val : __range)
500 __buffer.emplace_back(std::forward<decltype(__val)>(__val));496 __buffer.emplace_back(std::forward<decltype(__val)>(__val));
501 append_range(ranges::as_rvalue_view(__buffer));497 append_range(ranges::as_rvalue_view(__buffer));
...@@ -505,7 +501,7 @@ public:...@@ -505,7 +501,7 @@ public:
505501
506 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() {502 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() {
507 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector::pop_back called on an empty vector");503 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "vector::pop_back called on an empty vector");
508 this->__destruct_at_end(this->__end_ - 1);504 this->__destruct_at_end(__layout_.__end_ptr() - 1);
509 }505 }
510506
511 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, const_reference __x);507 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, const_reference __x);
...@@ -550,8 +546,8 @@ public:...@@ -550,8 +546,8 @@ public:
550#endif546#endif
551547
552#ifndef _LIBCPP_CXX03_LANG548#ifndef _LIBCPP_CXX03_LANG
553 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator549 _LIBCPP_CONSTEXPR_SINCE_CXX20
554 insert(const_iterator __position, initializer_list<value_type> __il) {550 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, initializer_list<value_type> __il) {
555 return insert(__position, __il.begin(), __il.end());551 return insert(__position, __il.begin(), __il.end());
556 }552 }
557#endif553#endif
...@@ -561,7 +557,7 @@ public:...@@ -561,7 +557,7 @@ public:
561557
562 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {558 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
563 size_type __old_size = size();559 size_type __old_size = size();
564 __base_destruct_at_end(this->__begin_);560 __base_destruct_at_end(this->__layout_.__begin_ptr());
565 __annotate_shrink(__old_size);561 __annotate_shrink(__old_size);
566 }562 }
567563
...@@ -575,27 +571,41 @@ public:...@@ -575,27 +571,41 @@ public:
575 _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);571 _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
576#endif572#endif
577573
578 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;574 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const _NOEXCEPT {
575 return __layout_.__invariants();
576 }
579577
580private:578private:
581 pointer __begin_ = nullptr;579 __base_type __layout_;
582 pointer __end_ = nullptr;
583 _LIBCPP_COMPRESSED_PAIR(pointer, __cap_ = nullptr, allocator_type, __alloc_);
584580
585 // Allocate space for __n objects581 // Allocate space for __n objects
586 // throws length_error if __n > max_size()582 // throws length_error if __n > max_size()
587 // throws (probably bad_alloc) if memory run out583 // throws (probably bad_alloc) if memory run out
588 // Precondition: __begin_ == __end_ == __cap_ == nullptr584 // Precondition: begin() == nullptr
585 // Precondition: size() == 0
586 // Precondition: capacity() == 0
589 // Precondition: __n > 0587 // Precondition: __n > 0
590 // Postcondition: capacity() >= __n588 // Postcondition: capacity() >= __n
591 // Postcondition: size() == 0589 // Postcondition: size() == 0
592 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __vallocate(size_type __n) {590 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __vallocate(size_type __n) {
591 _LIBCPP_ASSERT_INTERNAL(
592 __layout_.__begin_ptr() == nullptr,
593 "vector::__vallocate can only be called on a vector that hasn't allocated memory. This vector either already "
594 "owns a buffer, or a deallocation function didn't reset the layout's begin pointer.");
595 _LIBCPP_ASSERT_INTERNAL(
596 size() == 0,
597 "vector::__vallocate can only be called on a vector that hasn't allocated memory. This vector either already "
598 "owns a buffer, or a deallocation function didn't reset the layout's size.");
599 _LIBCPP_ASSERT_INTERNAL(
600 __layout_.__capacity() == 0,
601 "vector::__vallocate can only be called on a vector that hasn't allocated memory. This vector either already "
602 "owns a buffer, or a deallocation function didn't reset the layout's capacity.");
603 _LIBCPP_ASSERT_INTERNAL(__n > 0, "vector::__vallocate cannot allocate 0 bytes");
604
593 if (__n > max_size())605 if (__n > max_size())
594 this->__throw_length_error();606 this->__throw_length_error();
595 auto __allocation = std::__allocate_at_least(this->__alloc_, __n);607 auto __allocation = std::__allocate_at_least(this->__layout_.__alloc(), __n);
596 __begin_ = __allocation.ptr;608 __layout_.__set_layout(__allocation.ptr, 0, __allocation.count);
597 __end_ = __allocation.ptr;
598 __cap_ = __begin_ + __allocation.count;
599 __annotate_new(0);609 __annotate_new(0);
600 }610 }
601611
...@@ -644,7 +654,7 @@ private:...@@ -644,7 +654,7 @@ private:
644 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void654 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
645 __insert_assign_n_unchecked(_Iterator __first, difference_type __n, pointer __position) {655 __insert_assign_n_unchecked(_Iterator __first, difference_type __n, pointer __position) {
646 for (pointer __end_position = __position + __n; __position != __end_position; ++__position, (void)++__first) {656 for (pointer __end_position = __position + __n; __position != __end_position; ++__position, (void)++__first) {
647 __temp_value<value_type, _Allocator> __tmp(this->__alloc_, *__first);657 __temp_value<value_type, _Allocator> __tmp(this->__layout_.__alloc(), *__first);
648 *__position = std::move(__tmp.get());658 *__position = std::move(__tmp.get());
649 }659 }
650 }660 }
...@@ -680,10 +690,7 @@ private:...@@ -680,10 +690,7 @@ private:
680 // current implementation, there is no connection between a bounded iterator and its associated container, so we690 // current implementation, there is no connection between a bounded iterator and its associated container, so we
681 // don't have a way to update existing valid iterators when the container is resized and thus have to go with691 // don't have a way to update existing valid iterators when the container is resized and thus have to go with
682 // a laxer approach.692 // a laxer approach.
683 return std::__make_bounded_iter(693 return std::__make_bounded_iter(__p, __layout_.__begin_ptr(), __layout_.__capacity_ptr());
684 std::__wrap_iter<pointer>(__p),
685 std::__wrap_iter<pointer>(this->__begin_),
686 std::__wrap_iter<pointer>(this->__cap_));
687#else694#else
688 return iterator(__p);695 return iterator(__p);
689#endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR696#endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR
...@@ -692,19 +699,12 @@ private:...@@ -692,19 +699,12 @@ private:
692 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator __make_iter(const_pointer __p) const _NOEXCEPT {699 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator __make_iter(const_pointer __p) const _NOEXCEPT {
693#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR700#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR
694 // Bound the iterator according to the capacity, rather than the size.701 // Bound the iterator according to the capacity, rather than the size.
695 return std::__make_bounded_iter(702 return std::__make_bounded_iter(__p, __layout_.__begin_ptr(), __layout_.__capacity_ptr());
696 std::__wrap_iter<const_pointer>(__p),
697 std::__wrap_iter<const_pointer>(this->__begin_),
698 std::__wrap_iter<const_pointer>(this->__cap_));
699#else703#else
700 return const_iterator(__p);704 return const_iterator(__p);
701#endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR705#endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR
702 }706 }
703707
704 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
705 __swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v);
706 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer
707 __swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v, pointer __p);
708 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void708 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
709 __move_range(pointer __from_s, pointer __from_e, pointer __to);709 __move_range(pointer __from_s, pointer __from_e, pointer __to);
710 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign(vector& __c, true_type)710 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign(vector& __c, true_type)
...@@ -751,14 +751,14 @@ private:...@@ -751,14 +751,14 @@ private:
751751
752 struct _ConstructTransaction {752 struct _ConstructTransaction {
753 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(vector& __v, size_type __n)753 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(vector& __v, size_type __n)
754 : __v_(__v), __pos_(__v.__end_), __new_end_(__v.__end_ + __n) {754 : __v_(__v), __pos_(__v.__layout_.__end_ptr()), __new_end_(__pos_ + __n) {
755 __v_.__annotate_increase(__n);755 __v_.__annotate_increase(__n);
756 }756 }
757757
758 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() {758 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() {
759 __v_.__end_ = __pos_;759 __v_.__layout_.__set_bound_using_pointer(__pos_);
760 if (__pos_ != __new_end_) {760 if (__pos_ != __new_end_) {
761 __v_.__annotate_shrink(__new_end_ - __v_.__begin_);761 __v_.__annotate_shrink(__new_end_ - __v_.__layout_.__begin_ptr());
762 }762 }
763 }763 }
764764
...@@ -771,10 +771,10 @@ private:...@@ -771,10 +771,10 @@ private:
771 };771 };
772772
773 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __base_destruct_at_end(pointer __new_last) _NOEXCEPT {773 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __base_destruct_at_end(pointer __new_last) _NOEXCEPT {
774 pointer __soon_to_be_end = this->__end_;774 pointer __soon_to_be_end = __layout_.__end_ptr();
775 while (__new_last != __soon_to_be_end)775 while (__new_last != __soon_to_be_end)
776 __alloc_traits::destroy(this->__alloc_, std::__to_address(--__soon_to_be_end));776 __alloc_traits::destroy(this->__layout_.__alloc(), std::__to_address(--__soon_to_be_end));
777 this->__end_ = __new_last;777 __layout_.__set_bound_using_pointer(__new_last);
778 }778 }
779779
780 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector& __c) {780 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector& __c) {
...@@ -792,56 +792,38 @@ private:...@@ -792,56 +792,38 @@ private:
792 [[__noreturn__]] _LIBCPP_HIDE_FROM_ABI static void __throw_out_of_range() { std::__throw_out_of_range("vector"); }792 [[__noreturn__]] _LIBCPP_HIDE_FROM_ABI static void __throw_out_of_range() { std::__throw_out_of_range("vector"); }
793793
794 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector& __c, true_type) {794 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector& __c, true_type) {
795 if (this->__alloc_ != __c.__alloc_) {795 if (this->__layout_.__alloc() != __c.__layout_.__alloc()) {
796 clear();796 clear();
797 __annotate_delete();797 __annotate_delete();
798 __alloc_traits::deallocate(this->__alloc_, this->__begin_, capacity());798 __alloc_traits::deallocate(this->__layout_.__alloc(), this->__layout_.__begin_ptr(), capacity());
799 this->__begin_ = this->__end_ = this->__cap_ = nullptr;799 __layout_.__reset_without_allocator();
800 }800 }
801 this->__alloc_ = __c.__alloc_;801 this->__layout_.__alloc() = __c.__layout_.__alloc();
802 }802 }
803803
804 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector&, false_type) {}804 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector&, false_type) {}
805805
806 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(vector& __c, true_type)806 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(vector& __c, true_type)
807 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {807 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
808 this->__alloc_ = std::move(__c.__alloc_);808 this->__layout_.__alloc() = std::move(__c.__layout_.__alloc());
809 }809 }
810810
811 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(vector&, false_type) _NOEXCEPT {}811 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(vector&, false_type) _NOEXCEPT {}
812812
813 template <class _Ptr = pointer, __enable_if_t<is_pointer<_Ptr>::value, int> = 0>813 template <class _Ptr = pointer, __enable_if_t<is_pointer<_Ptr>::value, int> = 0>
814 static _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI pointer814 static _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _Ptr
815 __add_alignment_assumption(_Ptr __p) _NOEXCEPT {815 __add_alignment_assumption(_Ptr __p) _NOEXCEPT {
816 if (!__libcpp_is_constant_evaluated()) {816 if (!__libcpp_is_constant_evaluated()) {
817 return static_cast<pointer>(__builtin_assume_aligned(__p, _LIBCPP_ALIGNOF(decltype(*__p))));817 return static_cast<_Ptr>(__builtin_assume_aligned(__p, _LIBCPP_ALIGNOF(decltype(*__p))));
818 }818 }
819 return __p;819 return __p;
820 }820 }
821821
822 template <class _Ptr = pointer, __enable_if_t<!is_pointer<_Ptr>::value, int> = 0>822 template <class _Ptr = pointer, __enable_if_t<!is_pointer<_Ptr>::value, int> = 0>
823 static _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI pointer823 static _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _Ptr
824 __add_alignment_assumption(_Ptr __p) _NOEXCEPT {824 __add_alignment_assumption(_Ptr __p) _NOEXCEPT {
825 return __p;825 return __p;
826 }826 }
827
828 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_layouts(__split_buffer<_Tp, allocator_type>& __sb) {
829 auto __vector_begin = __begin_;
830 auto __vector_sentinel = __end_;
831 auto __vector_cap = __cap_;
832
833 auto __sb_begin = __sb.begin();
834 auto __sb_sentinel = __sb.__raw_sentinel();
835 auto __sb_cap = __sb.__raw_capacity();
836
837 // TODO: replace with __set_valid_range and __set_capacity when vector supports it.
838 __begin_ = __sb_begin;
839 __end_ = __sb_sentinel;
840 __cap_ = __sb_cap;
841
842 __sb.__set_valid_range(__vector_begin, __vector_sentinel);
843 __sb.__set_capacity(__vector_cap);
844 }
845};827};
846828
847#if _LIBCPP_STD_VER >= 17829#if _LIBCPP_STD_VER >= 17
...@@ -865,60 +847,13 @@ template <ranges::input_range _Range,...@@ -865,60 +847,13 @@ template <ranges::input_range _Range,
865vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;847vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;
866#endif848#endif
867849
868// __swap_out_circular_buffer relocates the objects in [__begin_, __end_) into the front of __v and swaps the buffers of
869// *this and __v. It is assumed that __v provides space for exactly (__end_ - __begin_) objects in the front. This
870// function has a strong exception guarantee.
871template <class _Tp, class _Allocator>
872_LIBCPP_CONSTEXPR_SINCE_CXX20 void
873vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v) {
874 __annotate_delete();
875 auto __new_begin = __v.begin() - size();
876 std::__uninitialized_allocator_relocate(
877 this->__alloc_, std::__to_address(__begin_), std::__to_address(__end_), std::__to_address(__new_begin));
878 __v.__set_valid_range(__new_begin, __v.end());
879 __end_ = __begin_; // All the objects have been destroyed by relocating them.
880
881 __swap_layouts(__v);
882 __v.__set_data(__v.begin());
883 __annotate_new(size());
884}
885
886// __swap_out_circular_buffer relocates the objects in [__begin_, __p) into the front of __v, the objects in
887// [__p, __end_) into the back of __v and swaps the buffers of *this and __v. It is assumed that __v provides space for
888// exactly (__p - __begin_) objects in the front and space for at least (__end_ - __p) objects in the back. This
889// function has a strong exception guarantee if __begin_ == __p || __end_ == __p.
890template <class _Tp, class _Allocator>
891_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer
892vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type>& __v, pointer __p) {
893 __annotate_delete();
894 pointer __ret = __v.begin();
895
896 // Relocate [__p, __end_) first to avoid having a hole in [__begin_, __end_)
897 // in case something in [__begin_, __p) throws.
898 std::__uninitialized_allocator_relocate(
899 this->__alloc_, std::__to_address(__p), std::__to_address(__end_), std::__to_address(__v.end()));
900 auto __relocated_so_far = __end_ - __p;
901 __v.__set_sentinel(__v.end() + __relocated_so_far);
902 __end_ = __p; // The objects in [__p, __end_) have been destroyed by relocating them.
903 auto __new_begin = __v.begin() - (__p - __begin_);
904
905 std::__uninitialized_allocator_relocate(
906 this->__alloc_, std::__to_address(__begin_), std::__to_address(__p), std::__to_address(__new_begin));
907 __v.__set_valid_range(__new_begin, __v.end());
908 __end_ = __begin_; // All the objects have been destroyed by relocating them.
909 __swap_layouts(__v);
910 __v.__set_data(__v.begin());
911 __annotate_new(size());
912 return __ret;
913}
914
915template <class _Tp, class _Allocator>850template <class _Tp, class _Allocator>
916_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT {851_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT {
917 if (this->__begin_ != nullptr) {852 if (this->__layout_.__begin_ptr() != nullptr) {
918 clear();853 clear();
919 __annotate_delete();854 __annotate_delete();
920 __alloc_traits::deallocate(this->__alloc_, this->__begin_, capacity());855 __alloc_traits::deallocate(this->__layout_.__alloc(), this->__layout_.__begin_ptr(), capacity());
921 this->__begin_ = this->__end_ = this->__cap_ = nullptr;856 __layout_.__reset_without_allocator();
922 }857 }
923}858}
924859
...@@ -935,7 +870,7 @@ vector<_Tp, _Allocator>::__recommend(size_type __new_size) const {...@@ -935,7 +870,7 @@ vector<_Tp, _Allocator>::__recommend(size_type __new_size) const {
935 return std::max<size_type>(2 * __cap, __new_size);870 return std::max<size_type>(2 * __cap, __new_size);
936}871}
937872
938// Default constructs __n objects starting at __end_873// Default constructs __n objects starting at __layout_.__end_ptr()
939// throws if construction throws874// throws if construction throws
940// Precondition: __n > 0875// Precondition: __n > 0
941// Precondition: size() + __n <= capacity()876// Precondition: size() + __n <= capacity()
...@@ -945,11 +880,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__construct_at_end(s...@@ -945,11 +880,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__construct_at_end(s
945 _ConstructTransaction __tx(*this, __n);880 _ConstructTransaction __tx(*this, __n);
946 const_pointer __new_end = __tx.__new_end_;881 const_pointer __new_end = __tx.__new_end_;
947 for (pointer __pos = __tx.__pos_; __pos != __new_end; __tx.__pos_ = ++__pos) {882 for (pointer __pos = __tx.__pos_; __pos != __new_end; __tx.__pos_ = ++__pos) {
948 __alloc_traits::construct(this->__alloc_, std::__to_address(__pos));883 __alloc_traits::construct(this->__layout_.__alloc(), std::__to_address(__pos));
949 }884 }
950}885}
951886
952// Copy constructs __n objects starting at __end_ from __x887// Copy constructs __n objects starting at __layout_.__end_ptr() from __x
953// throws if construction throws888// throws if construction throws
954// Precondition: __n > 0889// Precondition: __n > 0
955// Precondition: size() + __n <= capacity()890// Precondition: size() + __n <= capacity()
...@@ -961,7 +896,7 @@ vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)...@@ -961,7 +896,7 @@ vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
961 _ConstructTransaction __tx(*this, __n);896 _ConstructTransaction __tx(*this, __n);
962 const_pointer __new_end = __tx.__new_end_;897 const_pointer __new_end = __tx.__new_end_;
963 for (pointer __pos = __tx.__pos_; __pos != __new_end; __tx.__pos_ = ++__pos) {898 for (pointer __pos = __tx.__pos_; __pos != __new_end; __tx.__pos_ = ++__pos) {
964 __alloc_traits::construct(this->__alloc_, std::__to_address(__pos), __x);899 __alloc_traits::construct(this->__layout_.__alloc(), std::__to_address(__pos), __x);
965 }900 }
966}901}
967902
...@@ -970,7 +905,8 @@ template <class _InputIterator, class _Sentinel>...@@ -970,7 +905,8 @@ template <class _InputIterator, class _Sentinel>
970_LIBCPP_CONSTEXPR_SINCE_CXX20 void905_LIBCPP_CONSTEXPR_SINCE_CXX20 void
971vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n) {906vector<_Tp, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n) {
972 _ConstructTransaction __tx(*this, __n);907 _ConstructTransaction __tx(*this, __n);
973 __tx.__pos_ = std::__uninitialized_allocator_copy(this->__alloc_, std::move(__first), std::move(__last), __tx.__pos_);908 __tx.__pos_ = std::__uninitialized_allocator_copy(
909 this->__layout_.__alloc(), std::move(__first), std::move(__last), __tx.__pos_);
974}910}
975911
976template <class _Tp, class _Allocator>912template <class _Tp, class _Allocator>
...@@ -980,22 +916,15 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocato...@@ -980,22 +916,15 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocato
980#else916#else
981 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)917 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
982#endif918#endif
983 : __alloc_(std::move(__x.__alloc_)) {919 : __layout_(std::move(__x.__layout_)) {
984 this->__begin_ = __x.__begin_;
985 this->__end_ = __x.__end_;
986 this->__cap_ = __x.__cap_;
987 __x.__begin_ = __x.__end_ = __x.__cap_ = nullptr;
988}920}
989921
990template <class _Tp, class _Allocator>922template <class _Tp, class _Allocator>
991_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI923_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI
992vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_type>& __a)924vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
993 : __alloc_(__a) {925 : __layout_(__a) {
994 if (__a == __x.__alloc_) {926 if (__a == __x.__layout_.__alloc()) {
995 this->__begin_ = __x.__begin_;927 __layout_.__move_assign_without_allocator(__x.__layout_);
996 this->__end_ = __x.__end_;
997 this->__cap_ = __x.__cap_;
998 __x.__begin_ = __x.__end_ = __x.__cap_ = nullptr;
999 } else {928 } else {
1000 typedef move_iterator<iterator> _Ip;929 typedef move_iterator<iterator> _Ip;
1001 __init_with_size(_Ip(__x.begin()), _Ip(__x.end()), __x.size());930 __init_with_size(_Ip(__x.begin()), _Ip(__x.end()), __x.size());
...@@ -1005,7 +934,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_...@@ -1005,7 +934,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_
1005template <class _Tp, class _Allocator>934template <class _Tp, class _Allocator>
1006_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type)935_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type)
1007 _NOEXCEPT_(__alloc_traits::is_always_equal::value) {936 _NOEXCEPT_(__alloc_traits::is_always_equal::value) {
1008 if (this->__alloc_ != __c.__alloc_) {937 if (this->__layout_.__alloc() != __c.__layout_.__alloc()) {
1009 typedef move_iterator<iterator> _Ip;938 typedef move_iterator<iterator> _Ip;
1010 assign(_Ip(__c.begin()), _Ip(__c.end()));939 assign(_Ip(__c.begin()), _Ip(__c.end()));
1011 } else940 } else
...@@ -1017,10 +946,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__move_assign(vector...@@ -1017,10 +946,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__move_assign(vector
1017 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {946 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
1018 __vdeallocate();947 __vdeallocate();
1019 __move_assign_alloc(__c); // this can throw948 __move_assign_alloc(__c); // this can throw
1020 this->__begin_ = __c.__begin_;949 __layout_.__move_assign_without_allocator(__c.__layout_);
1021 this->__end_ = __c.__end_;
1022 this->__cap_ = __c.__cap_;
1023 __c.__begin_ = __c.__end_ = __c.__cap_ = nullptr;
1024}950}
1025951
1026template <class _Tp, class _Allocator>952template <class _Tp, class _Allocator>
...@@ -1028,7 +954,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocato...@@ -1028,7 +954,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocato
1028vector<_Tp, _Allocator>::operator=(const vector& __x) {954vector<_Tp, _Allocator>::operator=(const vector& __x) {
1029 if (this != std::addressof(__x)) {955 if (this != std::addressof(__x)) {
1030 __copy_assign_alloc(__x);956 __copy_assign_alloc(__x);
1031 assign(__x.__begin_, __x.__end_);957 assign(__x.__layout_.__begin_ptr(), __x.__layout_.__end_ptr());
1032 }958 }
1033 return *this;959 return *this;
1034}960}
...@@ -1037,10 +963,11 @@ template <class _Tp, class _Allocator>...@@ -1037,10 +963,11 @@ template <class _Tp, class _Allocator>
1037template <class _Iterator, class _Sentinel>963template <class _Iterator, class _Sentinel>
1038_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void964_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
1039vector<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentinel __last) {965vector<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentinel __last) {
1040 pointer __cur = __begin_;966 pointer __cur = __layout_.__begin_ptr();
1041 for (; __first != __last && __cur != __end_; ++__first, (void)++__cur)967 pointer __end = __layout_.__end_ptr();
968 for (; __first != __last && __cur != __end; ++__first, (void)++__cur)
1042 *__cur = *__first;969 *__cur = *__first;
1043 if (__cur != __end_) {970 if (__cur != __end) {
1044 __destruct_at_end(__cur);971 __destruct_at_end(__cur);
1045 } else {972 } else {
1046 for (; __first != __last; ++__first)973 for (; __first != __last; ++__first)
...@@ -1054,11 +981,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void...@@ -1054,11 +981,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
1054vector<_Tp, _Allocator>::__assign_with_size(_Iterator __first, _Sentinel __last, difference_type __n) {981vector<_Tp, _Allocator>::__assign_with_size(_Iterator __first, _Sentinel __last, difference_type __n) {
1055 size_type __new_size = static_cast<size_type>(__n);982 size_type __new_size = static_cast<size_type>(__n);
1056 if (__new_size <= capacity()) {983 if (__new_size <= capacity()) {
1057 if (__new_size > size()) {984 auto const __size = size();
1058 auto __mid = std::__copy_n<_AlgPolicy>(std::move(__first), size(), this->__begin_).first;985 if (__new_size > __size) {
1059 __construct_at_end(std::move(__mid), std::move(__last), __new_size - size());986 auto __mid = std::__copy_n<_AlgPolicy>(std::move(__first), __size, this->__layout_.__begin_ptr()).__in_;
987 __construct_at_end(std::move(__mid), std::move(__last), __new_size - __size);
1060 } else {988 } else {
1061 pointer __m = std::__copy(std::move(__first), __last, this->__begin_).second;989 pointer __m = std::__copy(std::move(__first), __last, this->__layout_.__begin_ptr()).__out_;
1062 this->__destruct_at_end(__m);990 this->__destruct_at_end(__m);
1063 }991 }
1064 } else {992 } else {
...@@ -1072,11 +1000,11 @@ template <class _Tp, class _Allocator>...@@ -1072,11 +1000,11 @@ template <class _Tp, class _Allocator>
1072_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u) {1000_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u) {
1073 if (__n <= capacity()) {1001 if (__n <= capacity()) {
1074 size_type __s = size();1002 size_type __s = size();
1075 std::fill_n(this->__begin_, std::min(__n, __s), __u);1003 std::fill_n(this->__layout_.__begin_ptr(), std::min(__n, __s), __u);
1076 if (__n > __s)1004 if (__n > __s)
1077 __construct_at_end(__n - __s, __u);1005 __construct_at_end(__n - __s, __u);
1078 else1006 else
1079 this->__destruct_at_end(this->__begin_ + __n);1007 this->__destruct_at_end(this->__layout_.__begin_ptr() + __n);
1080 } else {1008 } else {
1081 __vdeallocate();1009 __vdeallocate();
1082 __vallocate(__recommend(static_cast<size_type>(__n)));1010 __vallocate(__recommend(static_cast<size_type>(__n)));
...@@ -1089,8 +1017,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::reserve(size_type __...@@ -1089,8 +1017,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::reserve(size_type __
1089 if (__n > capacity()) {1017 if (__n > capacity()) {
1090 if (__n > max_size())1018 if (__n > max_size())
1091 this->__throw_length_error();1019 this->__throw_length_error();
1092 __split_buffer<value_type, allocator_type> __v(__n, size(), this->__alloc_);1020 _SplitBuffer __v(__n, size(), this->__layout_.__alloc());
1093 __swap_out_circular_buffer(__v);1021 __layout_.__relocate(__v);
1094 }1022 }
1095}1023}
10961024
...@@ -1100,12 +1028,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::shrink_to_fit() _NOE...@@ -1100,12 +1028,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::shrink_to_fit() _NOE
1100#if _LIBCPP_HAS_EXCEPTIONS1028#if _LIBCPP_HAS_EXCEPTIONS
1101 try {1029 try {
1102#endif // _LIBCPP_HAS_EXCEPTIONS1030#endif // _LIBCPP_HAS_EXCEPTIONS
1103 __split_buffer<value_type, allocator_type> __v(size(), size(), this->__alloc_);1031 _SplitBuffer __v(size(), size(), this->__layout_.__alloc());
1104 // The Standard mandates shrink_to_fit() does not increase the capacity.1032 // The Standard mandates shrink_to_fit() does not increase the capacity.
1105 // With equal capacity keep the existing buffer. This avoids extra work1033 // With equal capacity keep the existing buffer. This avoids extra work
1106 // due to swapping the elements.1034 // due to swapping the elements.
1107 if (__v.capacity() < capacity())1035 if (__v.capacity() < capacity())
1108 __swap_out_circular_buffer(__v);1036 __layout_.__relocate(__v);
1109#if _LIBCPP_HAS_EXCEPTIONS1037#if _LIBCPP_HAS_EXCEPTIONS
1110 } catch (...) {1038 } catch (...) {
1111 }1039 }
...@@ -1117,13 +1045,13 @@ template <class _Tp, class _Allocator>...@@ -1117,13 +1045,13 @@ template <class _Tp, class _Allocator>
1117template <class... _Args>1045template <class... _Args>
1118_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer1046_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::pointer
1119vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) {1047vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) {
1120 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), size(), this->__alloc_);1048 _SplitBuffer __v(__recommend(size() + 1), size(), this->__layout_.__alloc());
1121 // __v.emplace_back(std::forward<_Args>(__args)...);1049 // __v.emplace_back(std::forward<_Args>(__args)...);
1122 pointer __end = __v.end();1050 pointer __end = __v.end();
1123 __alloc_traits::construct(this->__alloc_, std::__to_address(__end), std::forward<_Args>(__args)...);1051 __alloc_traits::construct(this->__layout_.__alloc(), std::__to_address(__end), std::forward<_Args>(__args)...);
1124 __v.__set_sentinel(++__end);1052 __v.__set_sentinel(++__end);
1125 __swap_out_circular_buffer(__v);1053 __layout_.__relocate(__v);
1126 return this->__end_;1054 return __end;
1127}1055}
11281056
1129// This makes the compiler inline `__else()` if `__cond` is known to be false. Currently LLVM doesn't do that without1057// This makes the compiler inline `__else()` if `__cond` is known to be false. Currently LLVM doesn't do that without
...@@ -1144,27 +1072,22 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __if_likely_else(bool _...@@ -1144,27 +1072,22 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __if_likely_else(bool _
1144 }1072 }
1145}1073}
11461074
1147template <class _Tp, class _Allocator>1075template <class _Tp, class _Alloc>
1148template <class... _Args>1076template <class... _Args>
1149_LIBCPP_CONSTEXPR_SINCE_CXX20 inline1077_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Alloc>::__emplace_back_result_t
1150#if _LIBCPP_STD_VER >= 171078vector<_Tp, _Alloc>::emplace_back(_Args&&... __args) {
1151 typename vector<_Tp, _Allocator>::reference1079 pointer __end = __layout_.__end_ptr();
1152#else
1153 void
1154#endif
1155 vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
1156 pointer __end = this->__end_;
1157 std::__if_likely_else(1080 std::__if_likely_else(
1158 __end < this->__cap_,1081 size() != capacity(),
1159 [&] {1082 [&] {
1160 __emplace_back_assume_capacity(std::forward<_Args>(__args)...);1083 __emplace_back_assume_capacity(std::forward<_Args>(__args)...);
1161 ++__end;1084 ++__end;
1162 },1085 },
1163 [&] { __end = __emplace_back_slow_path(std::forward<_Args>(__args)...); });1086 [&] { __end = __emplace_back_slow_path(std::forward<_Args>(__args)...); });
11641087
1165 this->__end_ = __end;1088 __layout_.__set_bound_using_pointer(__end);
1166#if _LIBCPP_STD_VER >= 171089#if _LIBCPP_STD_VER >= 17
1167 return *(__end - 1);1090 return back();
1168#endif1091#endif
1169}1092}
11701093
...@@ -1174,8 +1097,8 @@ vector<_Tp, _Allocator>::erase(const_iterator __position) {...@@ -1174,8 +1097,8 @@ vector<_Tp, _Allocator>::erase(const_iterator __position) {
1174 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(1097 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
1175 __position != end(), "vector::erase(iterator) called with a non-dereferenceable iterator");1098 __position != end(), "vector::erase(iterator) called with a non-dereferenceable iterator");
1176 difference_type __ps = __position - cbegin();1099 difference_type __ps = __position - cbegin();
1177 pointer __p = this->__begin_ + __ps;1100 pointer __p = this->__layout_.__begin_ptr() + __ps;
1178 this->__destruct_at_end(std::move(__p + 1, this->__end_, __p));1101 this->__destruct_at_end(std::move(__p + 1, __layout_.__end_ptr(), __p));
1179 return __make_iter(__p);1102 return __make_iter(__p);
1180}1103}
11811104
...@@ -1183,9 +1106,9 @@ template <class _Tp, class _Allocator>...@@ -1183,9 +1106,9 @@ template <class _Tp, class _Allocator>
1183_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator1106_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
1184vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) {1107vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) {
1185 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__first <= __last, "vector::erase(first, last) called with invalid range");1108 _LIBCPP_ASSERT_VALID_INPUT_RANGE(__first <= __last, "vector::erase(first, last) called with invalid range");
1186 pointer __p = this->__begin_ + (__first - begin());1109 pointer __p = this->__layout_.__begin_ptr() + (__first - begin());
1187 if (__first != __last) {1110 if (__first != __last) {
1188 this->__destruct_at_end(std::move(__p + (__last - __first), this->__end_, __p));1111 this->__destruct_at_end(std::move(__p + (__last - __first), __layout_.__end_ptr(), __p));
1189 }1112 }
1190 return __make_iter(__p);1113 return __make_iter(__p);
1191}1114}
...@@ -1193,13 +1116,13 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) {...@@ -1193,13 +1116,13 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) {
1193template <class _Tp, class _Allocator>1116template <class _Tp, class _Allocator>
1194_LIBCPP_CONSTEXPR_SINCE_CXX20 void1117_LIBCPP_CONSTEXPR_SINCE_CXX20 void
1195vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointer __to) {1118vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointer __to) {
1196 pointer __old_last = this->__end_;1119 pointer __old_last = __layout_.__end_ptr();
1197 difference_type __n = __old_last - __to;1120 difference_type __n = __old_last - __to;
1198 {1121 {
1199 pointer __i = __from_s + __n;1122 pointer __i = __from_s + __n;
1200 _ConstructTransaction __tx(*this, __from_e - __i);1123 _ConstructTransaction __tx(*this, __from_e - __i);
1201 for (pointer __pos = __tx.__pos_; __i < __from_e; ++__i, (void)++__pos, __tx.__pos_ = __pos) {1124 for (pointer __pos = __tx.__pos_; __i < __from_e; ++__i, (void)++__pos, __tx.__pos_ = __pos) {
1202 __alloc_traits::construct(this->__alloc_, std::__to_address(__pos), std::move(*__i));1125 __alloc_traits::construct(this->__layout_.__alloc(), std::__to_address(__pos), std::move(*__i));
1203 }1126 }
1204 }1127 }
1205 std::move_backward(__from_s, __from_s + __n, __old_last);1128 std::move_backward(__from_s, __from_s + __n, __old_last);
...@@ -1208,21 +1131,22 @@ vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointe...@@ -1208,21 +1131,22 @@ vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointe
1208template <class _Tp, class _Allocator>1131template <class _Tp, class _Allocator>
1209_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator1132_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
1210vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x) {1133vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x) {
1211 pointer __p = this->__begin_ + (__position - begin());1134 pointer __p = this->__layout_.__begin_ptr() + (__position - begin());
1212 if (this->__end_ < this->__cap_) {1135 if (size() != capacity()) {
1213 if (__p == this->__end_) {1136 pointer __end = __layout_.__end_ptr();
1137 if (__p == __end) {
1214 __emplace_back_assume_capacity(__x);1138 __emplace_back_assume_capacity(__x);
1215 } else {1139 } else {
1216 __move_range(__p, this->__end_, __p + 1);1140 __move_range(__p, __end, __p + 1);
1217 const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);1141 const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
1218 if (std::__is_pointer_in_range(std::__to_address(__p), std::__to_address(__end_), std::addressof(__x)))1142 if (std::__is_pointer_in_range(std::__to_address(__p), std::__to_address(__end), std::addressof(__x)))
1219 ++__xr;1143 ++__xr;
1220 *__p = *__xr;1144 *__p = *__xr;
1221 }1145 }
1222 } else {1146 } else {
1223 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);1147 _SplitBuffer __v(__recommend(size() + 1), __p - this->__layout_.__begin_ptr(), this->__layout_.__alloc());
1224 __v.emplace_back(__x);1148 __v.emplace_back(__x);
1225 __p = __swap_out_circular_buffer(__v, __p);1149 __p = __layout_.__relocate_with_pivot(__v, __p);
1226 }1150 }
1227 return __make_iter(__p);1151 return __make_iter(__p);
1228}1152}
...@@ -1230,18 +1154,19 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)...@@ -1230,18 +1154,19 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
1230template <class _Tp, class _Allocator>1154template <class _Tp, class _Allocator>
1231_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator1155_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
1232vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {1156vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {
1233 pointer __p = this->__begin_ + (__position - begin());1157 pointer __p = this->__layout_.__begin_ptr() + (__position - begin());
1234 if (this->__end_ < this->__cap_) {1158 if (size() != capacity()) {
1235 if (__p == this->__end_) {1159 pointer __end = __layout_.__end_ptr();
1160 if (__p == __end) {
1236 __emplace_back_assume_capacity(std::move(__x));1161 __emplace_back_assume_capacity(std::move(__x));
1237 } else {1162 } else {
1238 __move_range(__p, this->__end_, __p + 1);1163 __move_range(__p, __end, __p + 1);
1239 *__p = std::move(__x);1164 *__p = std::move(__x);
1240 }1165 }
1241 } else {1166 } else {
1242 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);1167 _SplitBuffer __v(__recommend(size() + 1), __p - this->__layout_.__begin_ptr(), this->__layout_.__alloc());
1243 __v.emplace_back(std::move(__x));1168 __v.emplace_back(std::move(__x));
1244 __p = __swap_out_circular_buffer(__v, __p);1169 __p = __layout_.__relocate_with_pivot(__v, __p);
1245 }1170 }
1246 return __make_iter(__p);1171 return __make_iter(__p);
1247}1172}
...@@ -1250,19 +1175,20 @@ template <class _Tp, class _Allocator>...@@ -1250,19 +1175,20 @@ template <class _Tp, class _Allocator>
1250template <class... _Args>1175template <class... _Args>
1251_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator1176_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
1252vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {1177vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {
1253 pointer __p = this->__begin_ + (__position - begin());1178 pointer __p = this->__layout_.__begin_ptr() + (__position - begin());
1254 if (this->__end_ < this->__cap_) {1179 if (size() != capacity()) {
1255 if (__p == this->__end_) {1180 pointer __end = __layout_.__end_ptr();
1181 if (__p == __end) {
1256 __emplace_back_assume_capacity(std::forward<_Args>(__args)...);1182 __emplace_back_assume_capacity(std::forward<_Args>(__args)...);
1257 } else {1183 } else {
1258 __temp_value<value_type, _Allocator> __tmp(this->__alloc_, std::forward<_Args>(__args)...);1184 __temp_value<value_type, _Allocator> __tmp(this->__layout_.__alloc(), std::forward<_Args>(__args)...);
1259 __move_range(__p, this->__end_, __p + 1);1185 __move_range(__p, __end, __p + 1);
1260 *__p = std::move(__tmp.get());1186 *__p = std::move(__tmp.get());
1261 }1187 }
1262 } else {1188 } else {
1263 __split_buffer<value_type, allocator_type> __v(__recommend(size() + 1), __p - this->__begin_, this->__alloc_);1189 _SplitBuffer __v(__recommend(size() + 1), __p - this->__layout_.__begin_ptr(), this->__layout_.__alloc());
1264 __v.emplace_back(std::forward<_Args>(__args)...);1190 __v.emplace_back(std::forward<_Args>(__args)...);
1265 __p = __swap_out_circular_buffer(__v, __p);1191 __p = __layout_.__relocate_with_pivot(__v, __p);
1266 }1192 }
1267 return __make_iter(__p);1193 return __make_iter(__p);
1268}1194}
...@@ -1270,27 +1196,28 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {...@@ -1270,27 +1196,28 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {
1270template <class _Tp, class _Allocator>1196template <class _Tp, class _Allocator>
1271_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator1197_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<_Tp, _Allocator>::iterator
1272vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x) {1198vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x) {
1273 pointer __p = this->__begin_ + (__position - begin());1199 pointer __p = this->__layout_.__begin_ptr() + (__position - begin());
1274 if (__n > 0) {1200 if (__n > 0) {
1275 if (__n <= static_cast<size_type>(this->__cap_ - this->__end_)) {1201 if (__n <= __layout_.__remaining_capacity()) {
1276 size_type __old_n = __n;1202 size_type __old_n = __n;
1277 pointer __old_last = this->__end_;1203 pointer __end = __layout_.__end_ptr();
1278 if (__n > static_cast<size_type>(this->__end_ - __p)) {1204 pointer __old_last = __end;
1279 size_type __cx = __n - (this->__end_ - __p);1205 if (__n > static_cast<size_type>(__end - __p)) {
1206 size_type __cx = __n - (__end - __p);
1280 __construct_at_end(__cx, __x);1207 __construct_at_end(__cx, __x);
1281 __n -= __cx;1208 __n -= __cx;
1282 }1209 }
1283 if (__n > 0) {1210 if (__n > 0) {
1284 __move_range(__p, __old_last, __p + __old_n);1211 __move_range(__p, __old_last, __p + __old_n);
1285 const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);1212 const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
1286 if (std::__is_pointer_in_range(std::__to_address(__p), std::__to_address(__end_), std::addressof(__x)))1213 if (std::__is_pointer_in_range(std::__to_address(__p), std::__to_address(__end), std::addressof(__x)))
1287 __xr += __old_n;1214 __xr += __old_n;
1288 std::fill_n(__p, __n, *__xr);1215 std::fill_n(__p, __n, *__xr);
1289 }1216 }
1290 } else {1217 } else {
1291 __split_buffer<value_type, allocator_type> __v(__recommend(size() + __n), __p - this->__begin_, this->__alloc_);1218 _SplitBuffer __v(__recommend(size() + __n), __p - this->__layout_.__begin_ptr(), this->__layout_.__alloc());
1292 __v.__construct_at_end(__n, __x);1219 __v.__construct_at_end(__n, __x);
1293 __p = __swap_out_circular_buffer(__v, __p);1220 __p = __layout_.__relocate_with_pivot(__v, __p);
1294 }1221 }
1295 }1222 }
1296 return __make_iter(__p);1223 return __make_iter(__p);
...@@ -1301,30 +1228,38 @@ template <class _InputIterator, class _Sentinel>...@@ -1301,30 +1228,38 @@ template <class _InputIterator, class _Sentinel>
1301_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::iterator1228_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::iterator
1302vector<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last) {1229vector<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __position, _InputIterator __first, _Sentinel __last) {
1303 difference_type __off = __position - begin();1230 difference_type __off = __position - begin();
1304 pointer __p = this->__begin_ + __off;1231 pointer __p = this->__layout_.__begin_ptr() + __off;
1305 pointer __old_last = this->__end_;1232 pointer __old_last = __layout_.__end_ptr();
1306 for (; this->__end_ != this->__cap_ && __first != __last; ++__first)1233 for (; size() != capacity() && __first != __last; ++__first)
1307 __emplace_back_assume_capacity(*__first);1234 __emplace_back_assume_capacity(*__first);
13081235
1309 if (__first == __last)1236 if (__first == __last)
1310 (void)std::rotate(__p, __old_last, this->__end_);1237 (void)std::rotate(__p, __old_last, __layout_.__end_ptr());
1311 else {1238 else {
1312 __split_buffer<value_type, allocator_type> __v(__alloc_);1239 _SplitBuffer __v(__layout_.__alloc());
1313 auto __guard = std::__make_exception_guard(1240 pointer __end = __layout_.__end_ptr();
1314 _AllocatorDestroyRangeReverse<allocator_type, pointer>(__alloc_, __old_last, this->__end_));1241 auto __guard = std::__make_exception_guard(
1242 _AllocatorDestroyRangeReverse<allocator_type, pointer>(__layout_.__alloc(), __old_last, __end));
1315 __v.__construct_at_end_with_sentinel(std::move(__first), std::move(__last));1243 __v.__construct_at_end_with_sentinel(std::move(__first), std::move(__last));
1316 __split_buffer<value_type, allocator_type> __merged(1244 _SplitBuffer __merged(
1317 __recommend(size() + __v.size()), __off, __alloc_); // has `__off` positions available at the front1245 __recommend(size() + __v.size()), __off, __layout_.__alloc()); // has `__off` positions available at the front
1318 std::__uninitialized_allocator_relocate(1246 std::__uninitialized_allocator_relocate(
1319 __alloc_, std::__to_address(__old_last), std::__to_address(this->__end_), std::__to_address(__merged.end()));1247 __layout_.__alloc(),
1320 __guard.__complete(); // Release the guard once objects in [__old_last_, __end_) have been successfully relocated.1248 std::__to_address(__old_last),
1321 __merged.__set_sentinel(__merged.end() + (this->__end_ - __old_last));1249 std::__to_address(__layout_.__end_ptr()),
1322 this->__end_ = __old_last;1250 std::__to_address(__merged.end()));
1251 __guard.__complete(); // Release the guard once objects in [__old_last_, __layout_.__end_ptr()) have been
1252 // successfully relocated.
1253 __merged.__set_sentinel(__merged.end() + (__layout_.__end_ptr() - __old_last));
1254 __layout_.__set_bound_using_pointer(__old_last);
1323 std::__uninitialized_allocator_relocate(1255 std::__uninitialized_allocator_relocate(
1324 __alloc_, std::__to_address(__v.begin()), std::__to_address(__v.end()), std::__to_address(__merged.end()));1256 __layout_.__alloc(),
1257 std::__to_address(__v.begin()),
1258 std::__to_address(__v.end()),
1259 std::__to_address(__merged.end()));
1325 __merged.__set_sentinel(__merged.size() + __v.size());1260 __merged.__set_sentinel(__merged.size() + __v.size());
1326 __v.__set_sentinel(__v.begin());1261 __v.__set_sentinel(__v.begin());
1327 __p = __swap_out_circular_buffer(__merged, __p);1262 __p = __layout_.__relocate_with_pivot(__merged, __p);
1328 }1263 }
1329 return __make_iter(__p);1264 return __make_iter(__p);
1330}1265}
...@@ -1334,16 +1269,17 @@ template <class _AlgPolicy, class _Iterator, class _Sentinel>...@@ -1334,16 +1269,17 @@ template <class _AlgPolicy, class _Iterator, class _Sentinel>
1334_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::iterator1269_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::iterator
1335vector<_Tp, _Allocator>::__insert_with_size(1270vector<_Tp, _Allocator>::__insert_with_size(
1336 const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n) {1271 const_iterator __position, _Iterator __first, _Sentinel __last, difference_type __n) {
1337 pointer __p = this->__begin_ + (__position - begin());1272 pointer __p = this->__layout_.__begin_ptr() + (__position - begin());
1338 if (__n > 0) {1273 if (__n > 0) {
1339 if (__n <= this->__cap_ - this->__end_) {1274 if (__n <= static_cast<difference_type>(__layout_.__remaining_capacity())) {
1340 pointer __old_last = this->__end_;1275 pointer __end = __layout_.__end_ptr();
1341 difference_type __dx = this->__end_ - __p;1276 pointer __old_last = __end;
1277 difference_type __dx = __end - __p;
1342 if (__n > __dx) {1278 if (__n > __dx) {
1343#if _LIBCPP_STD_VER >= 231279#if _LIBCPP_STD_VER >= 23
1344 if constexpr (!forward_iterator<_Iterator>) {1280 if constexpr (!forward_iterator<_Iterator>) {
1345 __construct_at_end(std::move(__first), std::move(__last), __n);1281 __construct_at_end(std::move(__first), std::move(__last), __n);
1346 std::rotate(__p, __old_last, this->__end_);1282 std::rotate(__p, __old_last, __end);
1347 } else1283 } else
1348#endif1284#endif
1349 {1285 {
...@@ -1359,9 +1295,9 @@ vector<_Tp, _Allocator>::__insert_with_size(...@@ -1359,9 +1295,9 @@ vector<_Tp, _Allocator>::__insert_with_size(
1359 __insert_assign_n_unchecked<_AlgPolicy>(std::move(__first), __n, __p);1295 __insert_assign_n_unchecked<_AlgPolicy>(std::move(__first), __n, __p);
1360 }1296 }
1361 } else {1297 } else {
1362 __split_buffer<value_type, allocator_type> __v(__recommend(size() + __n), __p - this->__begin_, this->__alloc_);1298 _SplitBuffer __v(__recommend(size() + __n), __p - this->__layout_.__begin_ptr(), this->__layout_.__alloc());
1363 __v.__construct_at_end_with_size(std::move(__first), __n);1299 __v.__construct_at_end_with_size(std::move(__first), __n);
1364 __p = __swap_out_circular_buffer(__v, __p);1300 __p = __layout_.__relocate_with_pivot(__v, __p);
1365 }1301 }
1366 }1302 }
1367 return __make_iter(__p);1303 return __make_iter(__p);
...@@ -1374,12 +1310,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __n...@@ -1374,12 +1310,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __n
1374 if (__new_size <= capacity()) {1310 if (__new_size <= capacity()) {
1375 __construct_at_end(__new_size - __current_size);1311 __construct_at_end(__new_size - __current_size);
1376 } else {1312 } else {
1377 __split_buffer<value_type, allocator_type> __v(__recommend(__new_size), __current_size, __alloc_);1313 _SplitBuffer __v(__recommend(__new_size), __current_size, __layout_.__alloc());
1378 __v.__construct_at_end(__new_size - __current_size);1314 __v.__construct_at_end(__new_size - __current_size);
1379 __swap_out_circular_buffer(__v);1315 __layout_.__relocate(__v);
1380 }1316 }
1381 } else if (__current_size > __new_size) {1317 } else if (__current_size > __new_size) {
1382 this->__destruct_at_end(this->__begin_ + __new_size);1318 this->__destruct_at_end(this->__layout_.__begin_ptr() + __new_size);
1383 }1319 }
1384}1320}
13851321
...@@ -1390,12 +1326,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __n...@@ -1390,12 +1326,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __n
1390 if (__new_size <= capacity())1326 if (__new_size <= capacity())
1391 __construct_at_end(__new_size - __current_size, __x);1327 __construct_at_end(__new_size - __current_size, __x);
1392 else {1328 else {
1393 __split_buffer<value_type, allocator_type> __v(__recommend(__new_size), __current_size, __alloc_);1329 _SplitBuffer __v(__recommend(__new_size), __current_size, __layout_.__alloc());
1394 __v.__construct_at_end(__new_size - __current_size, __x);1330 __v.__construct_at_end(__new_size - __current_size, __x);
1395 __swap_out_circular_buffer(__v);1331 __layout_.__relocate(__v);
1396 }1332 }
1397 } else if (__current_size > __new_size) {1333 } else if (__current_size > __new_size) {
1398 this->__destruct_at_end(this->__begin_ + __new_size);1334 this->__destruct_at_end(this->__layout_.__begin_ptr() + __new_size);
1399 }1335 }
1400}1336}
14011337
...@@ -1408,29 +1344,10 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::swap(vector& __x)...@@ -1408,29 +1344,10 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::swap(vector& __x)
1408#endif1344#endif
1409{1345{
1410 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1346 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1411 __alloc_traits::propagate_on_container_swap::value || this->__alloc_ == __x.__alloc_,1347 __alloc_traits::propagate_on_container_swap::value || __layout_.__alloc() == __x.__layout_.__alloc(),
1412 "vector::swap: Either propagate_on_container_swap must be true"1348 "vector::swap: Either propagate_on_container_swap must be true"
1413 " or the allocators must compare equal");1349 " or the allocators must compare equal");
1414 std::swap(this->__begin_, __x.__begin_);1350 __layout_.__swap(__x.__layout_);
1415 std::swap(this->__end_, __x.__end_);
1416 std::swap(this->__cap_, __x.__cap_);
1417 std::__swap_allocator(this->__alloc_, __x.__alloc_);
1418}
1419
1420template <class _Tp, class _Allocator>
1421_LIBCPP_CONSTEXPR_SINCE_CXX20 bool vector<_Tp, _Allocator>::__invariants() const {
1422 if (this->__begin_ == nullptr) {
1423 if (this->__end_ != nullptr || this->__cap_ != nullptr)
1424 return false;
1425 } else {
1426 if (this->__begin_ > this->__end_)
1427 return false;
1428 if (this->__begin_ == this->__cap_)
1429 return false;
1430 if (this->__end_ > this->__cap_)
1431 return false;
1432 }
1433 return true;
1434}1351}
14351352
1436#if _LIBCPP_STD_VER >= 201353#if _LIBCPP_STD_VER >= 20
lib/libcxx/include/__vector/vector_bool.h+10-20
...@@ -45,6 +45,7 @@...@@ -45,6 +45,7 @@
45#include <__type_traits/is_nothrow_constructible.h>45#include <__type_traits/is_nothrow_constructible.h>
46#include <__type_traits/type_identity.h>46#include <__type_traits/type_identity.h>
47#include <__utility/exception_guard.h>47#include <__utility/exception_guard.h>
48#include <__utility/exchange.h>
48#include <__utility/forward.h>49#include <__utility/forward.h>
49#include <__utility/move.h>50#include <__utility/move.h>
50#include <__utility/swap.h>51#include <__utility/swap.h>
...@@ -151,9 +152,7 @@ public:...@@ -151,9 +152,7 @@ public:
151 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~vector() { __destroy_vector (*this)(); }152 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~vector() { __destroy_vector (*this)(); }
152153
153 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n);154 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n);
154#if _LIBCPP_STD_VER >= 14
155 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n, const allocator_type& __a);155 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n, const allocator_type& __a);
156#endif
157 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v);156 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v);
158 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20157 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
159 vector(size_type __n, const value_type& __v, const allocator_type& __a);158 vector(size_type __n, const value_type& __v, const allocator_type& __a);
...@@ -604,7 +603,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n)...@@ -604,7 +603,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n)
604 }603 }
605}604}
606605
607#if _LIBCPP_STD_VER >= 14
608template <class _Allocator>606template <class _Allocator>
609_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)607_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)
610 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(static_cast<__storage_allocator>(__a)) {608 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(static_cast<__storage_allocator>(__a)) {
...@@ -614,7 +612,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, co...@@ -614,7 +612,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, co
614 __size_ = __n;612 __size_ = __n;
615 }613 }
616}614}
617#endif
618615
619template <class _Allocator>616template <class _Allocator>
620_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x)617_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(size_type __n, const value_type& __x)
...@@ -740,13 +737,10 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocat...@@ -740,13 +737,10 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocat
740#else737#else
741 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)738 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
742#endif739#endif
743 : __begin_(__v.__begin_),740 : __begin_(std::__exchange(__v.__begin_, nullptr)),
744 __size_(__v.__size_),741 __size_(std::__exchange(__v.__size_, 0)),
745 __cap_(__v.__cap_),742 __cap_(std::__exchange(__v.__cap_, 0)),
746 __alloc_(std::move(__v.__alloc_)) {743 __alloc_(std::move(__v.__alloc_)) {
747 __v.__begin_ = nullptr;
748 __v.__size_ = 0;
749 __v.__cap_ = 0;
750}744}
751745
752template <class _Allocator>746template <class _Allocator>
...@@ -754,11 +748,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20...@@ -754,11 +748,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
754vector<bool, _Allocator>::vector(vector&& __v, const __type_identity_t<allocator_type>& __a)748vector<bool, _Allocator>::vector(vector&& __v, const __type_identity_t<allocator_type>& __a)
755 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(__a) {749 : __begin_(nullptr), __size_(0), __cap_(0), __alloc_(__a) {
756 if (__a == allocator_type(__v.__alloc_)) {750 if (__a == allocator_type(__v.__alloc_)) {
757 this->__begin_ = __v.__begin_;751 __begin_ = std::__exchange(__v.__begin_, nullptr);
758 this->__size_ = __v.__size_;752 __size_ = std::__exchange(__v.__size_, 0);
759 this->__cap_ = __v.__cap_;753 __cap_ = std::__exchange(__v.__cap_, 0);
760 __v.__begin_ = nullptr;
761 __v.__cap_ = __v.__size_ = 0;
762 } else if (__v.size() > 0) {754 } else if (__v.size() > 0) {
763 __vallocate(__v.size());755 __vallocate(__v.size());
764 __size_ = __v.__size_;756 __size_ = __v.__size_;
...@@ -787,11 +779,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::__move_assign(vecto...@@ -787,11 +779,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::__move_assign(vecto
787 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {779 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
788 __vdeallocate();780 __vdeallocate();
789 __move_assign_alloc(__c);781 __move_assign_alloc(__c);
790 this->__begin_ = __c.__begin_;782 __begin_ = std::__exchange(__c.__begin_, nullptr);
791 this->__size_ = __c.__size_;783 __size_ = std::__exchange(__c.__size_, 0);
792 this->__cap_ = __c.__cap_;784 __cap_ = std::__exchange(__c.__cap_, 0);
793 __c.__begin_ = nullptr;
794 __c.__cap_ = __c.__size_ = 0;
795}785}
796786
797template <class _Allocator>787template <class _Allocator>
lib/libcxx/include/__verbose_abort+2
...@@ -20,8 +20,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -20,8 +20,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2020
21// This function should never be called directly from the code -- it should only be called through21// This function should never be called directly from the code -- it should only be called through
22// the _LIBCPP_VERBOSE_ABORT macro.22// the _LIBCPP_VERBOSE_ABORT macro.
23_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
23[[__noreturn__]] _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(24[[__noreturn__]] _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(
24 __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _NOEXCEPT;25 __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _NOEXCEPT;
26_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
2527
26// _LIBCPP_VERBOSE_ABORT(format, args...)28// _LIBCPP_VERBOSE_ABORT(format, args...)
27//29//
lib/libcxx/include/__verbose_trap+1-12
...@@ -16,21 +16,10 @@...@@ -16,21 +16,10 @@
16# pragma GCC system_header16# pragma GCC system_header
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD
20
21#if __has_builtin(__builtin_verbose_trap)19#if __has_builtin(__builtin_verbose_trap)
22// AppleClang shipped a slightly different version of __builtin_verbose_trap from the upstream20# define _LIBCPP_VERBOSE_TRAP(message) __builtin_verbose_trap("libc++", message)
23// version before upstream Clang actually got the builtin.
24// TODO: Remove once AppleClang supports the two-arguments version of the builtin.
25# if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1700
26# define _LIBCPP_VERBOSE_TRAP(message) __builtin_verbose_trap(message)
27# else
28# define _LIBCPP_VERBOSE_TRAP(message) __builtin_verbose_trap("libc++", message)
29# endif
30#else21#else
31# define _LIBCPP_VERBOSE_TRAP(message) ((void)message, __builtin_trap())22# define _LIBCPP_VERBOSE_TRAP(message) ((void)message, __builtin_trap())
32#endif23#endif
3324
34_LIBCPP_END_NAMESPACE_STD
35
36#endif // _LIBCPP___VERBOSE_TRAP25#endif // _LIBCPP___VERBOSE_TRAP
lib/libcxx/include/algorithm+57-2
...@@ -883,6 +883,13 @@ namespace ranges {...@@ -883,6 +883,13 @@ namespace ranges {
883 uniform_random_bit_generator<remove_reference_t<Gen>>883 uniform_random_bit_generator<remove_reference_t<Gen>>
884 O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // since C++20884 O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // since C++20
885885
886 template<permutable I, sentinel_for<I> S>
887 constexpr subrange<I> ranges::shift_left(I first, S last, iter_difference_t<I> n); // since C++23
888
889 template<forward_range R>
890 requires permutable<iterator_t<R>>
891 constexpr borrowed_subrange_t<R> ranges::shift_left(R&& r, range_difference_t<R> n) // since C++23
892
886 template<random_access_iterator I, sentinel_for<I> S, class Gen>893 template<random_access_iterator I, sentinel_for<I> S, class Gen>
887 requires permutable<I> &&894 requires permutable<I> &&
888 uniform_random_bit_generator<remove_reference_t<Gen>>895 uniform_random_bit_generator<remove_reference_t<Gen>>
...@@ -944,6 +951,33 @@ namespace ranges {...@@ -944,6 +951,33 @@ namespace ranges {
944 template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>951 template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
945 constexpr auto fold_left(R&& r, T init, F f); // since C++23952 constexpr auto fold_left(R&& r, T init, F f); // since C++23
946953
954 template<input_iterator I, sentinel_for<I> S,
955 indirectly-binary-left-foldable<iter_value_t<I>, I> F>
956 requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
957 constexpr auto ranges::fold_left_first(I first, S last, F f); // since C++23
958
959 template<input_range R, indirectly-binary-left-foldable<range_value_t<R>, iterator_t<R>> F>
960 requires constructible_from<range_value_t<R>, range_reference_t<R>>
961 constexpr auto ranges::fold_left_first(R&& r, F f); // since C++23
962
963 template<bidirectional_iterator I, sentinel_for<I> S, class T = iter_value_t<I>,
964 indirectly-binary-right-foldable<T, I> F>
965 constexpr auto ranges::fold_right(I first, S last, T init, F f); // since C++23
966
967 template<bidirectional_range R, class T = range_value_t<R>,
968 indirectly-binary-right-foldable<T, iterator_t<R>> F>
969 constexpr auto ranges::fold_right(R&& r, T init, F f); // since C++23
970
971 template<bidirectional_iterator I, sentinel_for<I> S,
972 indirectly-binary-right-foldable<iter_value_t<I>, I> F>
973 requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
974 constexpr auto ranges::fold_right_last(I first, S last, F f); // since C++23
975
976 template<bidirectional_range R,
977 indirectly-binary-right-foldable<range_value_t<R>, iterator_t<R>> F>
978 requires constructible_from<range_value_t<R>, range_reference_t<R>>
979 constexpr auto ranges::fold_right_last(R&& r, F f); // since C++23
980
947 template<class I, class T>981 template<class I, class T>
948 using fold_left_with_iter_result = in_value_result<I, T>; // since C++23982 using fold_left_with_iter_result = in_value_result<I, T>; // since C++23
949983
...@@ -954,6 +988,18 @@ namespace ranges {...@@ -954,6 +988,18 @@ namespace ranges {
954 template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>988 template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
955 constexpr see below fold_left_with_iter(R&& r, T init, F f); // since C++23989 constexpr see below fold_left_with_iter(R&& r, T init, F f); // since C++23
956990
991 template<class I, class T>
992 using fold_left_first_with_iter_result = in_value_result<I, T>; // since C++23
993
994 template<input_iterator I, sentinel_for<I> S,
995 indirectly-binary-left-foldable<iter_value_t<I>, I> F>
996 requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
997 constexpr see below ranges::fold_left_first_with_iter(I first, S last, F f); // since C++23
998
999 template<input_range R, indirectly-binary-left-foldable<range_value_t<R>, iterator_t<R>> F>
1000 requires constructible_from<range_value_t<R>, range_reference_t<R>>
1001 constexpr see below ranges::fold_left_first_with_iter(R&& r, F f); // since C++23
1002
957 template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,1003 template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
958 class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>1004 class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
959 requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>1005 requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
...@@ -1489,6 +1535,13 @@ template<class ForwardIterator>...@@ -1489,6 +1535,13 @@ template<class ForwardIterator>
1489 shift_right(ForwardIterator first, ForwardIterator last,1535 shift_right(ForwardIterator first, ForwardIterator last,
1490 typename iterator_traits<ForwardIterator>::difference_type n); // C++201536 typename iterator_traits<ForwardIterator>::difference_type n); // C++20
14911537
1538 template<permutable I, sentinel_for<I> S>
1539 constexpr subrange<I> ranges::shift_right(I first, S last, iter_difference_t<I> n); // since C++23
1540
1541 template<forward_range R>
1542 requires permutable<iterator_t<R>>
1543 constexpr borrowed_subrange_t<R> ranges::shift_right(R&& r, range_difference_t<R> n) // since C++23
1544
1492template <class InputIterator, class Predicate>1545template <class InputIterator, class Predicate>
1493 constexpr bool // constexpr since C++201546 constexpr bool // constexpr since C++20
1494 is_partitioned(InputIterator first, InputIterator last, Predicate pred);1547 is_partitioned(InputIterator first, InputIterator last, Predicate pred);
...@@ -2035,6 +2088,8 @@ template <class BidirectionalIterator, class Compare>...@@ -2035,6 +2088,8 @@ template <class BidirectionalIterator, class Compare>
2035# include <__algorithm/ranges_ends_with.h>2088# include <__algorithm/ranges_ends_with.h>
2036# include <__algorithm/ranges_find_last.h>2089# include <__algorithm/ranges_find_last.h>
2037# include <__algorithm/ranges_fold.h>2090# include <__algorithm/ranges_fold.h>
2091# include <__algorithm/ranges_shift_left.h>
2092# include <__algorithm/ranges_shift_right.h>
2038# include <__algorithm/ranges_starts_with.h>2093# include <__algorithm/ranges_starts_with.h>
2039# endif // _LIBCPP_STD_VER >= 232094# endif // _LIBCPP_STD_VER >= 23
20402095
...@@ -2049,11 +2104,11 @@ template <class BidirectionalIterator, class Compare>...@@ -2049,11 +2104,11 @@ template <class BidirectionalIterator, class Compare>
2049# pragma GCC system_header2104# pragma GCC system_header
2050# endif2105# endif
20512106
2052# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 142107# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER == 14
2053# include <execution>2108# include <execution>
2054# endif2109# endif
20552110
2056# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 202111# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
2057# include <atomic>2112# include <atomic>
2058# include <bit>2113# include <bit>
2059# include <concepts>2114# include <concepts>
lib/libcxx/include/any+11-9
...@@ -120,16 +120,20 @@ _LIBCPP_PUSH_MACROS...@@ -120,16 +120,20 @@ _LIBCPP_PUSH_MACROS
120# include <__undef_macros>120# include <__undef_macros>
121121
122_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD122_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
123_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
124
123class _LIBCPP_EXPORTED_FROM_ABI bad_any_cast : public bad_cast {125class _LIBCPP_EXPORTED_FROM_ABI bad_any_cast : public bad_cast {
124public:126public:
125 const char* what() const _NOEXCEPT override;127 const char* what() const _NOEXCEPT override;
126};128};
127_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
128129
129_LIBCPP_BEGIN_NAMESPACE_STD130_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
131_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
130132
131# if _LIBCPP_STD_VER >= 17133# if _LIBCPP_STD_VER >= 17
132134
135_LIBCPP_BEGIN_NAMESPACE_STD
136
133[[noreturn]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_any_cast() {137[[noreturn]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_any_cast() {
134# if _LIBCPP_HAS_EXCEPTIONS138# if _LIBCPP_HAS_EXCEPTIONS
135 throw bad_any_cast();139 throw bad_any_cast();
...@@ -522,8 +526,6 @@ template <class _ValueType>...@@ -522,8 +526,6 @@ template <class _ValueType>
522526
523template <class _ValueType>527template <class _ValueType>
524[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const* __any) noexcept {528[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const* __any) noexcept {
525 static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
526 static_assert(!is_reference_v<_ValueType>, "_ValueType may not be a reference.");
527 return std::any_cast<_ValueType>(const_cast<any*>(__any));529 return std::any_cast<_ValueType>(const_cast<any*>(__any));
528}530}
529531
...@@ -550,17 +552,17 @@ template <class _ValueType>...@@ -550,17 +552,17 @@ template <class _ValueType>
550 return nullptr;552 return nullptr;
551}553}
552554
553# endif // _LIBCPP_STD_VER >= 17
554
555_LIBCPP_END_NAMESPACE_STD555_LIBCPP_END_NAMESPACE_STD
556556
557# endif // _LIBCPP_STD_VER >= 17
558
557_LIBCPP_POP_MACROS559_LIBCPP_POP_MACROS
558560
559# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17561# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
560# include <chrono>562# include <chrono>
561# endif563# endif
562564
563# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20565# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
564# include <atomic>566# include <atomic>
565# include <concepts>567# include <concepts>
566# include <cstdlib>568# include <cstdlib>
...@@ -572,7 +574,7 @@ _LIBCPP_POP_MACROS...@@ -572,7 +574,7 @@ _LIBCPP_POP_MACROS
572# include <variant>574# include <variant>
573# endif575# endif
574576
575# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23577# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
576# include <cstring>578# include <cstring>
577# include <limits>579# include <limits>
578# endif580# endif
lib/libcxx/include/array+1-1
...@@ -594,7 +594,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -594,7 +594,7 @@ _LIBCPP_END_NAMESPACE_STD
594594
595_LIBCPP_POP_MACROS595_LIBCPP_POP_MACROS
596596
597# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20597# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
598# include <algorithm>598# include <algorithm>
599# include <concepts>599# include <concepts>
600# include <cstdlib>600# include <cstdlib>
lib/libcxx/include/atomic+1-5
...@@ -626,11 +626,7 @@ template <class T>...@@ -626,11 +626,7 @@ template <class T>
626# pragma GCC system_header626# pragma GCC system_header
627# endif627# endif
628628
629# if !_LIBCPP_HAS_ATOMIC_HEADER629# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
630# error <atomic> is not implemented
631# endif
632
633# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
634# include <cmath>630# include <cmath>
635# include <compare>631# include <compare>
636# include <cstddef>632# include <cstddef>
lib/libcxx/include/barrier+3-1
...@@ -95,6 +95,7 @@ using __barrier_phase_t _LIBCPP_NODEBUG = uint8_t;...@@ -95,6 +95,7 @@ using __barrier_phase_t _LIBCPP_NODEBUG = uint8_t;
9595
96class __barrier_algorithm_base;96class __barrier_algorithm_base;
9797
98_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
98[[__gnu__::__returns_nonnull__, __gnu__::__malloc__]]99[[__gnu__::__returns_nonnull__, __gnu__::__malloc__]]
99_LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorithm_base(ptrdiff_t& __expected);100_LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base* __construct_barrier_algorithm_base(ptrdiff_t& __expected);
100101
...@@ -104,6 +105,7 @@ __arrive_barrier_algorithm_base([[__gnu__::__nonnull__]] _LIBCPP_NOESCAPE __barr...@@ -104,6 +105,7 @@ __arrive_barrier_algorithm_base([[__gnu__::__nonnull__]] _LIBCPP_NOESCAPE __barr
104105
105_LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(106_LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(
106 [[__gnu__::__nonnull__]] _LIBCPP_NOESCAPE __barrier_algorithm_base* __barrier) noexcept;107 [[__gnu__::__nonnull__]] _LIBCPP_NOESCAPE __barrier_algorithm_base* __barrier) noexcept;
108_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
107109
108template <class _CompletionF>110template <class _CompletionF>
109class __barrier_base {111class __barrier_base {
...@@ -190,7 +192,7 @@ _LIBCPP_POP_MACROS...@@ -190,7 +192,7 @@ _LIBCPP_POP_MACROS
190192
191# endif // _LIBCPP_HAS_THREADS193# endif // _LIBCPP_HAS_THREADS
192194
193# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20195# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
194# include <atomic>196# include <atomic>
195# include <concepts>197# include <concepts>
196# include <iterator>198# include <iterator>
lib/libcxx/include/bit+1-1
...@@ -90,7 +90,7 @@ namespace std {...@@ -90,7 +90,7 @@ namespace std {
90# pragma GCC system_header90# pragma GCC system_header
91# endif91# endif
9292
93# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2093# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
94# include <cstdlib>94# include <cstdlib>
95# include <iosfwd>95# include <iosfwd>
96# include <limits>96# include <limits>
lib/libcxx/include/bitset+1-1
...@@ -971,7 +971,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -971,7 +971,7 @@ _LIBCPP_END_NAMESPACE_STD
971971
972_LIBCPP_POP_MACROS972_LIBCPP_POP_MACROS
973973
974# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20974# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
975# include <concepts>975# include <concepts>
976# include <cstdlib>976# include <cstdlib>
977# include <optional>977# include <optional>
lib/libcxx/include/cctype+5-63
...@@ -39,13 +39,11 @@ int toupper(int c);...@@ -39,13 +39,11 @@ int toupper(int c);
39#else39#else
40# include <__config>40# include <__config>
4141
42# include <ctype.h>42# if __has_include(<ctype.h>)
4343# include <ctype.h>
44# ifndef _LIBCPP_CTYPE_H44# ifdef _LIBCPP_CTYPE_H
45# error <cctype> tried including <ctype.h> but didn't find libc++'s <ctype.h> header. \45# error "If libc++ starts defining <ctype.h>, the __has_include check should move to libc++'s <ctype.h>"
46 This usually means that your header search paths are not configured properly. \46# endif
47 The header search paths should contain the C++ Standard Library headers before \
48 any C Standard Library.
49# endif47# endif
5048
51# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)49# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -54,62 +52,6 @@ int toupper(int c);...@@ -54,62 +52,6 @@ int toupper(int c);
5452
55_LIBCPP_BEGIN_NAMESPACE_STD53_LIBCPP_BEGIN_NAMESPACE_STD
5654
57# ifdef isalnum
58# undef isalnum
59# endif
60
61# ifdef isalpha
62# undef isalpha
63# endif
64
65# ifdef isblank
66# undef isblank
67# endif
68
69# ifdef iscntrl
70# undef iscntrl
71# endif
72
73# ifdef isdigit
74# undef isdigit
75# endif
76
77# ifdef isgraph
78# undef isgraph
79# endif
80
81# ifdef islower
82# undef islower
83# endif
84
85# ifdef isprint
86# undef isprint
87# endif
88
89# ifdef ispunct
90# undef ispunct
91# endif
92
93# ifdef isspace
94# undef isspace
95# endif
96
97# ifdef isupper
98# undef isupper
99# endif
100
101# ifdef isxdigit
102# undef isxdigit
103# endif
104
105# ifdef tolower
106# undef tolower
107# endif
108
109# ifdef toupper
110# undef toupper
111# endif
112
113using ::isalnum _LIBCPP_USING_IF_EXISTS;55using ::isalnum _LIBCPP_USING_IF_EXISTS;
114using ::isalpha _LIBCPP_USING_IF_EXISTS;56using ::isalpha _LIBCPP_USING_IF_EXISTS;
115using ::isblank _LIBCPP_USING_IF_EXISTS;57using ::isblank _LIBCPP_USING_IF_EXISTS;
lib/libcxx/include/cfenv+5-8
...@@ -57,14 +57,11 @@ int feupdateenv(const fenv_t* envp);...@@ -57,14 +57,11 @@ int feupdateenv(const fenv_t* envp);
57#else57#else
58# include <__config>58# include <__config>
5959
60# include <fenv.h>60# if __has_include(<fenv.h>)
6161# include <fenv.h>
62# ifndef _LIBCPP_FENV_H62# ifdef _LIBCPP_FENV_H
63# error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \63# error "If libc++ starts defining <fenv.h>, the __has_include check should move to libc++'s <fenv.h>"
64 This usually means that your header search paths are not configured properly. \64# endif
65 The header search paths should contain the C++ Standard Library headers before \
66 any C Standard Library, and you are probably using compiler flags that make that \
67 not be the case.
68# endif65# endif
6966
70# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)67# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/cfloat+6-8
...@@ -74,14 +74,12 @@ Macros:...@@ -74,14 +74,12 @@ Macros:
74#else74#else
75# include <__config>75# include <__config>
7676
77# include <float.h>77// <float.h> is not provided by libc++
7878# if __has_include(<float.h>)
79# ifndef _LIBCPP_FLOAT_H79# include <float.h>
80# error <cfloat> tried including <float.h> but didn't find libc++'s <float.h> header. \80# ifdef _LIBCPP_FLOAT_H
81 This usually means that your header search paths are not configured properly. \81# error "If libc++ starts defining <float.h>, the __has_include check should move to libc++'s <float.h>"
82 The header search paths should contain the C++ Standard Library headers before \82# endif
83 any C Standard Library, and you are probably using compiler flags that make that \
84 not be the case.
85# endif83# endif
8684
87# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)85# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/charconv+1-5
...@@ -100,11 +100,7 @@ namespace std {...@@ -100,11 +100,7 @@ namespace std {
100# pragma GCC system_header100# pragma GCC system_header
101# endif101# endif
102102
103_LIBCPP_BEGIN_NAMESPACE_STD103# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
104
105_LIBCPP_END_NAMESPACE_STD
106
107# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
108# include <cmath>104# include <cmath>
109# include <concepts>105# include <concepts>
110# include <cstddef>106# include <cstddef>
lib/libcxx/include/chrono+4-3
...@@ -46,6 +46,7 @@ public:...@@ -46,6 +46,7 @@ public:
46template <class Rep, class Period = ratio<1>>46template <class Rep, class Period = ratio<1>>
47class duration47class duration
48{48{
49 static_assert(__is_unqualified_v<Rep>, "A duration representation cannot be qualified");
49 static_assert(!__is_duration<Rep>::value, "A duration representation can not be a duration");50 static_assert(!__is_duration<Rep>::value, "A duration representation can not be a duration");
50 static_assert(__is_ratio<Period>::value, "Second template parameter of duration must be a std::ratio");51 static_assert(__is_ratio<Period>::value, "Second template parameter of duration must be a std::ratio");
51 static_assert(Period::num > 0, "duration period must be positive");52 static_assert(Period::num > 0, "duration period must be positive");
...@@ -1148,13 +1149,13 @@ namespace std {...@@ -1148,13 +1149,13 @@ namespace std {
1148# pragma GCC system_header1149# pragma GCC system_header
1149# endif1150# endif
11501151
1151# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 171152# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
1152# include <cstdint>1153# include <cstdint>
1153# include <stdexcept>1154# include <stdexcept>
1154# include <string_view>1155# include <string_view>
1155# endif1156# endif
11561157
1157# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201158# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1158# include <bit>1159# include <bit>
1159# include <concepts>1160# include <concepts>
1160# include <cstring>1161# include <cstring>
...@@ -1164,7 +1165,7 @@ namespace std {...@@ -1164,7 +1165,7 @@ namespace std {
1164# include <vector>1165# include <vector>
1165# endif1166# endif
11661167
1167# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 201168# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER == 20
1168# include <charconv>1169# include <charconv>
1169# if _LIBCPP_HAS_LOCALIZATION1170# if _LIBCPP_HAS_LOCALIZATION
1170# include <locale>1171# include <locale>
lib/libcxx/include/cinttypes+5-8
...@@ -244,14 +244,11 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int...@@ -244,14 +244,11 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
244// [cinttypes.syn]244// [cinttypes.syn]
245# include <cstdint>245# include <cstdint>
246246
247# include <inttypes.h>247# if __has_include(<inttypes.h>)
248248# include <inttypes.h>
249# ifndef _LIBCPP_INTTYPES_H249# ifdef _LIBCPP_INTTYPES_H
250# error <cinttypes> tried including <inttypes.h> but didn't find libc++'s <inttypes.h> header. \250# error "If libc++ starts defining <inttypes.h>, the __has_include check should move to libc++'s <float.h>"
251 This usually means that your header search paths are not configured properly. \251# endif
252 The header search paths should contain the C++ Standard Library headers before \
253 any C Standard Library, and you are probably using compiler flags that make that \
254 not be the case.
255# endif252# endif
256253
257# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)254# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/cmath+1-1
...@@ -612,7 +612,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -612,7 +612,7 @@ _LIBCPP_END_NAMESPACE_STD
612612
613_LIBCPP_POP_MACROS613_LIBCPP_POP_MACROS
614614
615# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20615# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
616# include <type_traits>616# include <type_traits>
617# endif617# endif
618#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)618#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/codecvt+3-1
...@@ -71,6 +71,7 @@ class codecvt_utf8_utf16...@@ -71,6 +71,7 @@ class codecvt_utf8_utf16
71# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)71# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
7272
73_LIBCPP_BEGIN_NAMESPACE_STD73_LIBCPP_BEGIN_NAMESPACE_STD
74_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
7475
75enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };76enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
7677
...@@ -579,13 +580,14 @@ public:...@@ -579,13 +580,14 @@ public:
579};580};
580_LIBCPP_SUPPRESS_DEPRECATED_POP581_LIBCPP_SUPPRESS_DEPRECATED_POP
581582
583_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
582_LIBCPP_END_NAMESPACE_STD584_LIBCPP_END_NAMESPACE_STD
583585
584# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)586# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
585587
586# endif // _LIBCPP_HAS_LOCALIZATION588# endif // _LIBCPP_HAS_LOCALIZATION
587589
588# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20590# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
589# include <atomic>591# include <atomic>
590# include <concepts>592# include <concepts>
591# include <cstddef>593# include <cstddef>
lib/libcxx/include/compare+1-1
...@@ -167,7 +167,7 @@ namespace std {...@@ -167,7 +167,7 @@ namespace std {
167# pragma GCC system_header167# pragma GCC system_header
168# endif168# endif
169169
170# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20170# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
171# include <cmath>171# include <cmath>
172# include <cstddef>172# include <cstddef>
173# include <type_traits>173# include <type_traits>
lib/libcxx/include/complex+1-1
...@@ -1484,7 +1484,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -1484,7 +1484,7 @@ _LIBCPP_END_NAMESPACE_STD
14841484
1485_LIBCPP_POP_MACROS1485_LIBCPP_POP_MACROS
14861486
1487# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201487# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1488# include <iosfwd>1488# include <iosfwd>
1489# include <stdexcept>1489# include <stdexcept>
1490# include <type_traits>1490# include <type_traits>
lib/libcxx/include/concepts+1-1
...@@ -161,7 +161,7 @@ namespace std {...@@ -161,7 +161,7 @@ namespace std {
161161
162# include <version>162# include <version>
163163
164# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20164# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
165# include <cstddef>165# include <cstddef>
166# include <type_traits>166# include <type_traits>
167# endif167# endif
lib/libcxx/include/condition_variable+6-1
...@@ -146,6 +146,7 @@ _LIBCPP_PUSH_MACROS...@@ -146,6 +146,7 @@ _LIBCPP_PUSH_MACROS
146# if _LIBCPP_HAS_THREADS146# if _LIBCPP_HAS_THREADS
147147
148_LIBCPP_BEGIN_NAMESPACE_STD148_LIBCPP_BEGIN_NAMESPACE_STD
149_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
149150
150template <class _Lock>151template <class _Lock>
151struct __unlock_guard {152struct __unlock_guard {
...@@ -342,14 +343,18 @@ bool condition_variable_any::wait_for(...@@ -342,14 +343,18 @@ bool condition_variable_any::wait_for(
342343
343_LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);344_LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
344345
346_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
345_LIBCPP_END_NAMESPACE_STD347_LIBCPP_END_NAMESPACE_STD
346348
347# endif // _LIBCPP_HAS_THREADS349# endif // _LIBCPP_HAS_THREADS
348350
349_LIBCPP_POP_MACROS351_LIBCPP_POP_MACROS
350352
351# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20353# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
352# include <atomic>354# include <atomic>
355# endif
356
357# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
353# include <concepts>358# include <concepts>
354# include <cstdint>359# include <cstdint>
355# include <cstdlib>360# include <cstdlib>
lib/libcxx/include/coroutine+1-1
...@@ -61,7 +61,7 @@ struct suspend_always;...@@ -61,7 +61,7 @@ struct suspend_always;
61# pragma GCC system_header61# pragma GCC system_header
62# endif62# endif
6363
64# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2064# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
65# include <cstddef>65# include <cstddef>
66# include <iosfwd>66# include <iosfwd>
67# include <limits>67# include <limits>
lib/libcxx/include/ctype.h deleted-65
...@@ -1,65 +0,0 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_CTYPE_H
11#define _LIBCPP_CTYPE_H
12
13/*
14 ctype.h synopsis
15
16int isalnum(int c);
17int isalpha(int c);
18int isblank(int c); // C99
19int iscntrl(int c);
20int isdigit(int c);
21int isgraph(int c);
22int islower(int c);
23int isprint(int c);
24int ispunct(int c);
25int isspace(int c);
26int isupper(int c);
27int isxdigit(int c);
28int tolower(int c);
29int toupper(int c);
30*/
31
32#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
33# include <__cxx03/__config>
34#else
35# include <__config>
36#endif
37
38#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
39# pragma GCC system_header
40#endif
41
42#if __has_include_next(<ctype.h>)
43# include_next <ctype.h>
44#endif
45
46#ifdef __cplusplus
47
48# undef isalnum
49# undef isalpha
50# undef isblank
51# undef iscntrl
52# undef isdigit
53# undef isgraph
54# undef islower
55# undef isprint
56# undef ispunct
57# undef isspace
58# undef isupper
59# undef isxdigit
60# undef tolower
61# undef toupper
62
63#endif
64
65#endif // _LIBCPP_CTYPE_H
lib/libcxx/include/cuchar+4-4
...@@ -56,10 +56,10 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);...@@ -56,10 +56,10 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
56# pragma GCC system_header56# pragma GCC system_header
57# endif57# endif
5858
59_LIBCPP_BEGIN_NAMESPACE_STD
60
61# if !defined(_LIBCPP_CXX03_LANG)59# if !defined(_LIBCPP_CXX03_LANG)
6260
61_LIBCPP_BEGIN_NAMESPACE_STD
62
63using ::mbstate_t _LIBCPP_USING_IF_EXISTS;63using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
6464
65# if _LIBCPP_HAS_C8RTOMB_MBRTOC865# if _LIBCPP_HAS_C8RTOMB_MBRTOC8
...@@ -71,10 +71,10 @@ using ::c16rtomb _LIBCPP_USING_IF_EXISTS;...@@ -71,10 +71,10 @@ using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
71using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;71using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
72using ::c32rtomb _LIBCPP_USING_IF_EXISTS;72using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
7373
74# endif // _LIBCPP_CXX03_LANG
75
76_LIBCPP_END_NAMESPACE_STD74_LIBCPP_END_NAMESPACE_STD
7775
76# endif // _LIBCPP_CXX03_LANG
77
78#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)78#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
7979
80#endif // _LIBCPP_CUCHAR80#endif // _LIBCPP_CUCHAR
lib/libcxx/include/cwchar+1-1
...@@ -258,7 +258,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp...@@ -258,7 +258,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp
258258
259_LIBCPP_END_NAMESPACE_STD259_LIBCPP_END_NAMESPACE_STD
260260
261# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20261# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
262# include <cstddef>262# include <cstddef>
263# endif263# endif
264#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)264#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/deque+45-31
...@@ -40,7 +40,7 @@ public:...@@ -40,7 +40,7 @@ public:
40 deque() noexcept(is_nothrow_default_constructible<allocator_type>::value);40 deque() noexcept(is_nothrow_default_constructible<allocator_type>::value);
41 explicit deque(const allocator_type& a);41 explicit deque(const allocator_type& a);
42 explicit deque(size_type n);42 explicit deque(size_type n);
43 explicit deque(size_type n, const allocator_type& a); // C++1443 explicit deque(size_type n, const allocator_type& a);
44 deque(size_type n, const value_type& v);44 deque(size_type n, const value_type& v);
45 deque(size_type n, const value_type& v, const allocator_type& a);45 deque(size_type n, const value_type& v, const allocator_type& a);
46 template <class InputIterator>46 template <class InputIterator>
...@@ -263,10 +263,17 @@ _LIBCPP_PUSH_MACROS...@@ -263,10 +263,17 @@ _LIBCPP_PUSH_MACROS
263263
264_LIBCPP_BEGIN_NAMESPACE_STD264_LIBCPP_BEGIN_NAMESPACE_STD
265265
266# ifndef _LIBCPP_ABI_USE_SMALL_DEQUE_BLOCK_SIZE
266template <class _ValueType, class _DiffType>267template <class _ValueType, class _DiffType>
267struct __deque_block_size {268struct __deque_block_size {
268 static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;269 static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
269};270};
271# else
272template <class _ValueType, class _DiffType>
273struct __deque_block_size {
274 static const _DiffType value = sizeof(_ValueType) < 128 ? 512 / sizeof(_ValueType) : 4;
275};
276# endif
270277
271template <class _ValueType,278template <class _ValueType,
272 class _Pointer,279 class _Pointer,
...@@ -283,7 +290,18 @@ template <class _ValueType,...@@ -283,7 +290,18 @@ template <class _ValueType,
283# endif290# endif
284 >291 >
285class __deque_iterator {292class __deque_iterator {
286 typedef _MapPointer __map_iterator;293 using __map_iterator _LIBCPP_NODEBUG = __rebind_pointer_t<_Pointer, const __rebind_pointer_t<_Pointer, _ValueType> >;
294
295// TODO(LLVM 25): Remove this check
296# ifndef _LIBCPP_ABI_DEQUE_ITERATORS
297 static_assert(
298 sizeof(__map_iterator) == sizeof(_MapPointer) && _LIBCPP_ALIGNOF(__map_iterator) == _LIBCPP_ALIGNOF(_MapPointer),
299 "It looks like you are using fancy pointers such that FancyPtr<const FancyPtr<const value_type>> is not "
300 "layout-compatible with FancyPtr<FancyPtr<value_type>> or FancyPtr<const FancyPtr<value_type>>. "
301 "This means that your ABI is being broken between LLVM 22 and LLVM 23 if deque::iterator or "
302 "deque::const_iterator is used. If you don't care about your ABI being broken, define the "
303 "_LIBCPP_ABI_DEQUE_ITERATORS macro to silence this diagnostic.");
304# endif
287305
288public:306public:
289 typedef _Pointer pointer;307 typedef _Pointer pointer;
...@@ -459,7 +477,7 @@ private:...@@ -459,7 +477,7 @@ private:
459 __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer, _DiffType, _BlockSize>;477 __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer, _DiffType, _BlockSize>;
460478
461public:479public:
462 using __segment_iterator _LIBCPP_NODEBUG = _MapPointer;480 using __segment_iterator _LIBCPP_NODEBUG = typename _Iterator::__map_iterator;
463 using __local_iterator _LIBCPP_NODEBUG = _Pointer;481 using __local_iterator _LIBCPP_NODEBUG = _Pointer;
464482
465 static _LIBCPP_HIDE_FROM_ABI __segment_iterator __segment(_Iterator __iter) { return __iter.__m_iter_; }483 static _LIBCPP_HIDE_FROM_ABI __segment_iterator __segment(_Iterator __iter) { return __iter.__m_iter_; }
...@@ -626,9 +644,7 @@ public:...@@ -626,9 +644,7 @@ public:
626 }644 }
627645
628 explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);646 explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);
629# if _LIBCPP_STD_VER >= 14
630 explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a);647 explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a);
631# endif
632 _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);648 _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
633649
634 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>650 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
...@@ -725,24 +741,24 @@ public:...@@ -725,24 +741,24 @@ public:
725 // iterators:741 // iterators:
726742
727 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {743 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
728 __map_pointer __mp = __map_.begin() + __start_ / __block_size;744 auto __mp = __map_.begin() + __start_ / __block_size;
729 return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);745 return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
730 }746 }
731747
732 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {748 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
733 __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size);749 auto __mp = __map_.begin() + __start_ / __block_size;
734 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);750 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
735 }751 }
736752
737 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {753 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
738 size_type __p = size() + __start_;754 size_type __p = size() + __start_;
739 __map_pointer __mp = __map_.begin() + __p / __block_size;755 auto __mp = __map_.begin() + __p / __block_size;
740 return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);756 return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
741 }757 }
742758
743 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {759 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
744 size_type __p = size() + __start_;760 size_type __p = size() + __start_;
745 __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);761 auto __mp = __map_.begin() + __p / __block_size;
746 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);762 return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
747 }763 }
748764
...@@ -953,7 +969,7 @@ private:...@@ -953,7 +969,7 @@ private:
953 (void)__end;969 (void)__end;
954 (void)__annotation_type;970 (void)__annotation_type;
955 (void)__place;971 (void)__place;
956# if __has_feature(address_sanitizer)972# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
957 // __beg - index of the first item to annotate973 // __beg - index of the first item to annotate
958 // __end - index behind the last item to annotate (so last item + 1)974 // __end - index behind the last item to annotate (so last item + 1)
959 // __annotation_type - __asan_unposion or __asan_poison975 // __annotation_type - __asan_unposion or __asan_poison
...@@ -1046,23 +1062,23 @@ private:...@@ -1046,23 +1062,23 @@ private:
1046 std::__annotate_double_ended_contiguous_container<_Allocator>(1062 std::__annotate_double_ended_contiguous_container<_Allocator>(
1047 __mem_beg, __mem_end, __old_beg, __old_end, __new_beg, __new_end);1063 __mem_beg, __mem_end, __old_beg, __old_end, __new_beg, __new_end);
1048 }1064 }
1049# endif // __has_feature(address_sanitizer)1065# endif // _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1050 }1066 }
10511067
1052 _LIBCPP_HIDE_FROM_ABI void __annotate_new(size_type __current_size) const _NOEXCEPT {1068 _LIBCPP_HIDE_FROM_ABI void __annotate_new(size_type __current_size) const _NOEXCEPT {
1053 (void)__current_size;1069 (void)__current_size;
1054# if __has_feature(address_sanitizer)1070# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1055 if (__current_size == 0)1071 if (__current_size == 0)
1056 __annotate_from_to(0, __map_.size() * __block_size, __asan_poison, __asan_back_moved);1072 __annotate_from_to(0, __map_.size() * __block_size, __asan_poison, __asan_back_moved);
1057 else {1073 else {
1058 __annotate_from_to(0, __start_, __asan_poison, __asan_front_moved);1074 __annotate_from_to(0, __start_, __asan_poison, __asan_front_moved);
1059 __annotate_from_to(__start_ + __current_size, __map_.size() * __block_size, __asan_poison, __asan_back_moved);1075 __annotate_from_to(__start_ + __current_size, __map_.size() * __block_size, __asan_poison, __asan_back_moved);
1060 }1076 }
1061# endif // __has_feature(address_sanitizer)1077# endif // _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1062 }1078 }
10631079
1064 _LIBCPP_HIDE_FROM_ABI void __annotate_delete() const _NOEXCEPT {1080 _LIBCPP_HIDE_FROM_ABI void __annotate_delete() const _NOEXCEPT {
1065# if __has_feature(address_sanitizer)1081# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1066 if (empty()) {1082 if (empty()) {
1067 for (size_t __i = 0; __i < __map_.size(); ++__i) {1083 for (size_t __i = 0; __i < __map_.size(); ++__i) {
1068 __annotate_whole_block(__i, __asan_unposion);1084 __annotate_whole_block(__i, __asan_unposion);
...@@ -1071,19 +1087,19 @@ private:...@@ -1071,19 +1087,19 @@ private:
1071 __annotate_from_to(0, __start_, __asan_unposion, __asan_front_moved);1087 __annotate_from_to(0, __start_, __asan_unposion, __asan_front_moved);
1072 __annotate_from_to(__start_ + size(), __map_.size() * __block_size, __asan_unposion, __asan_back_moved);1088 __annotate_from_to(__start_ + size(), __map_.size() * __block_size, __asan_unposion, __asan_back_moved);
1073 }1089 }
1074# endif // __has_feature(address_sanitizer)1090# endif // _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1075 }1091 }
10761092
1077 _LIBCPP_HIDE_FROM_ABI void __annotate_increase_front(size_type __n) const _NOEXCEPT {1093 _LIBCPP_HIDE_FROM_ABI void __annotate_increase_front(size_type __n) const _NOEXCEPT {
1078 (void)__n;1094 (void)__n;
1079# if __has_feature(address_sanitizer)1095# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1080 __annotate_from_to(__start_ - __n, __start_, __asan_unposion, __asan_front_moved);1096 __annotate_from_to(__start_ - __n, __start_, __asan_unposion, __asan_front_moved);
1081# endif1097# endif
1082 }1098 }
10831099
1084 _LIBCPP_HIDE_FROM_ABI void __annotate_increase_back(size_type __n) const _NOEXCEPT {1100 _LIBCPP_HIDE_FROM_ABI void __annotate_increase_back(size_type __n) const _NOEXCEPT {
1085 (void)__n;1101 (void)__n;
1086# if __has_feature(address_sanitizer)1102# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1087 __annotate_from_to(__start_ + size(), __start_ + size() + __n, __asan_unposion, __asan_back_moved);1103 __annotate_from_to(__start_ + size(), __start_ + size() + __n, __asan_unposion, __asan_back_moved);
1088# endif1104# endif
1089 }1105 }
...@@ -1091,7 +1107,7 @@ private:...@@ -1091,7 +1107,7 @@ private:
1091 _LIBCPP_HIDE_FROM_ABI void __annotate_shrink_front(size_type __old_size, size_type __old_start) const _NOEXCEPT {1107 _LIBCPP_HIDE_FROM_ABI void __annotate_shrink_front(size_type __old_size, size_type __old_start) const _NOEXCEPT {
1092 (void)__old_size;1108 (void)__old_size;
1093 (void)__old_start;1109 (void)__old_start;
1094# if __has_feature(address_sanitizer)1110# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1095 __annotate_from_to(__old_start, __old_start + (__old_size - size()), __asan_poison, __asan_front_moved);1111 __annotate_from_to(__old_start, __old_start + (__old_size - size()), __asan_poison, __asan_front_moved);
1096# endif1112# endif
1097 }1113 }
...@@ -1099,7 +1115,7 @@ private:...@@ -1099,7 +1115,7 @@ private:
1099 _LIBCPP_HIDE_FROM_ABI void __annotate_shrink_back(size_type __old_size, size_type __old_start) const _NOEXCEPT {1115 _LIBCPP_HIDE_FROM_ABI void __annotate_shrink_back(size_type __old_size, size_type __old_start) const _NOEXCEPT {
1100 (void)__old_size;1116 (void)__old_size;
1101 (void)__old_start;1117 (void)__old_start;
1102# if __has_feature(address_sanitizer)1118# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1103 __annotate_from_to(__old_start + size(), __old_start + __old_size, __asan_poison, __asan_back_moved);1119 __annotate_from_to(__old_start + size(), __old_start + __old_size, __asan_poison, __asan_back_moved);
1104# endif1120# endif
1105 }1121 }
...@@ -1112,7 +1128,7 @@ private:...@@ -1112,7 +1128,7 @@ private:
1112 __annotate_whole_block(size_t __block_index, __asan_annotation_type __annotation_type) const _NOEXCEPT {1128 __annotate_whole_block(size_t __block_index, __asan_annotation_type __annotation_type) const _NOEXCEPT {
1113 (void)__block_index;1129 (void)__block_index;
1114 (void)__annotation_type;1130 (void)__annotation_type;
1115# if __has_feature(address_sanitizer)1131# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1116 __map_const_iterator __block_it = __map_.begin() + __block_index;1132 __map_const_iterator __block_it = __map_.begin() + __block_index;
1117 const void* __block_start = std::__to_address(*__block_it);1133 const void* __block_start = std::__to_address(*__block_it);
1118 const void* __block_end = std::__to_address(*__block_it + __block_size);1134 const void* __block_end = std::__to_address(*__block_it + __block_size);
...@@ -1125,7 +1141,7 @@ private:...@@ -1125,7 +1141,7 @@ private:
1125 }1141 }
1126# endif1142# endif
1127 }1143 }
1128# if __has_feature(address_sanitizer)1144# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
11291145
1130public:1146public:
1131 _LIBCPP_HIDE_FROM_ABI bool __verify_asan_annotations() const _NOEXCEPT {1147 _LIBCPP_HIDE_FROM_ABI bool __verify_asan_annotations() const _NOEXCEPT {
...@@ -1187,7 +1203,7 @@ public:...@@ -1187,7 +1203,7 @@ public:
1187 }1203 }
11881204
1189private:1205private:
1190# endif // __has_feature(address_sanitizer)1206# endif // _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS
1191 _LIBCPP_HIDE_FROM_ABI bool __maybe_remove_front_spare(bool __keep_one = true) {1207 _LIBCPP_HIDE_FROM_ABI bool __maybe_remove_front_spare(bool __keep_one = true) {
1192 if (__front_spare_blocks() >= 2 || (!__keep_one && __front_spare_blocks())) {1208 if (__front_spare_blocks() >= 2 || (!__keep_one && __front_spare_blocks())) {
1193 __annotate_whole_block(0, __asan_unposion);1209 __annotate_whole_block(0, __asan_unposion);
...@@ -1305,7 +1321,6 @@ deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0) {...@@ -1305,7 +1321,6 @@ deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0) {
1305 __append(__n);1321 __append(__n);
1306}1322}
13071323
1308# if _LIBCPP_STD_VER >= 14
1309template <class _Tp, class _Allocator>1324template <class _Tp, class _Allocator>
1310deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)1325deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
1311 : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {1326 : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
...@@ -1313,7 +1328,6 @@ deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)...@@ -1313,7 +1328,6 @@ deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
1313 if (__n > 0)1328 if (__n > 0)
1314 __append(__n);1329 __append(__n);
1315}1330}
1316# endif
13171331
1318template <class _Tp, class _Allocator>1332template <class _Tp, class _Allocator>
1319deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v) : __start_(0), __size_(0) {1333deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v) : __start_(0), __size_(0) {
...@@ -2220,7 +2234,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __...@@ -2220,7 +2234,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
2220 __fe = __fb + __bs;2234 __fe = __fb + __bs;
2221 }2235 }
2222 if (__fb <= __vt && __vt < __fe)2236 if (__fb <= __vt && __vt < __fe)
2223 __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) -= __f - __r).__ptr_;2237 __vt = (const_iterator(__f.__m_iter_, __vt) -= __f - __r).__ptr_;
2224 __r = std::move(__fb, __fe, __r);2238 __r = std::move(__fb, __fe, __r);
2225 __n -= __bs;2239 __n -= __bs;
2226 __f += __bs;2240 __f += __bs;
...@@ -2247,7 +2261,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it...@@ -2247,7 +2261,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
2247 __lb = __le - __bs;2261 __lb = __le - __bs;
2248 }2262 }
2249 if (__lb <= __vt && __vt < __le)2263 if (__lb <= __vt && __vt < __le)
2250 __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) += __r - __l - 1).__ptr_;2264 __vt = (const_iterator(__l.__m_iter_, __vt) += __r - __l - 1).__ptr_;
2251 __r = std::move_backward(__lb, __le, __r);2265 __r = std::move_backward(__lb, __le, __r);
2252 __n -= __bs;2266 __n -= __bs;
2253 __l -= __bs - 1;2267 __l -= __bs - 1;
...@@ -2273,7 +2287,7 @@ void deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator _...@@ -2273,7 +2287,7 @@ void deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator _
2273 __fe = __fb + __bs;2287 __fe = __fb + __bs;
2274 }2288 }
2275 if (__fb <= __vt && __vt < __fe)2289 if (__fb <= __vt && __vt < __fe)
2276 __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) += __r - __f).__ptr_;2290 __vt = (const_iterator(__f.__m_iter_, __vt) += __r - __f).__ptr_;
2277 for (; __fb != __fe; ++__fb, ++__r, ++__size())2291 for (; __fb != __fe; ++__fb, ++__r, ++__size())
2278 __alloc_traits::construct(__a, std::addressof(*__r), std::move(*__fb));2292 __alloc_traits::construct(__a, std::addressof(*__r), std::move(*__fb));
2279 __n -= __bs;2293 __n -= __bs;
...@@ -2305,7 +2319,7 @@ void deque<_Tp, _Allocator>::__move_construct_backward_and_check(...@@ -2305,7 +2319,7 @@ void deque<_Tp, _Allocator>::__move_construct_backward_and_check(
2305 __lb = __le - __bs;2319 __lb = __le - __bs;
2306 }2320 }
2307 if (__lb <= __vt && __vt < __le)2321 if (__lb <= __vt && __vt < __le)
2308 __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) -= __l - __r + 1).__ptr_;2322 __vt = (const_iterator(__l.__m_iter_, __vt) -= __l - __r + 1).__ptr_;
2309 while (__le != __lb) {2323 while (__le != __lb) {
2310 __alloc_traits::construct(__a, std::addressof(*--__r), std::move(*--__le));2324 __alloc_traits::construct(__a, std::addressof(*--__r), std::move(*--__le));
2311 --__start_;2325 --__start_;
...@@ -2532,7 +2546,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -2532,7 +2546,7 @@ _LIBCPP_END_NAMESPACE_STD
25322546
2533_LIBCPP_POP_MACROS2547_LIBCPP_POP_MACROS
25342548
2535# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 202549# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
2536# include <algorithm>2550# include <algorithm>
2537# include <atomic>2551# include <atomic>
2538# include <concepts>2552# include <concepts>
lib/libcxx/include/exception+2-2
...@@ -91,13 +91,13 @@ template <class E> void rethrow_if_nested(const E& e);...@@ -91,13 +91,13 @@ template <class E> void rethrow_if_nested(const E& e);
91# pragma GCC system_header91# pragma GCC system_header
92# endif92# endif
9393
94# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2094# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
95# include <cstddef>95# include <cstddef>
96# include <new>96# include <new>
97# include <type_traits>97# include <type_traits>
98# endif98# endif
9999
100# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23100# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
101# include <cstdlib>101# include <cstdlib>
102# endif102# endif
103#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)103#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/execution+1-1
...@@ -155,7 +155,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -155,7 +155,7 @@ _LIBCPP_END_NAMESPACE_STD
155155
156# endif // _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17156# endif // _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17
157157
158# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20158# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
159# include <cstddef>159# include <cstddef>
160# endif160# endif
161#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)161#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/experimental/iterator+2-2
...@@ -124,14 +124,14 @@ _LIBCPP_END_NAMESPACE_LFTS...@@ -124,14 +124,14 @@ _LIBCPP_END_NAMESPACE_LFTS
124124
125_LIBCPP_POP_MACROS125_LIBCPP_POP_MACROS
126126
127# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20127# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
128# include <cstddef>128# include <cstddef>
129# include <iosfwd>129# include <iosfwd>
130# include <optional>130# include <optional>
131# include <type_traits>131# include <type_traits>
132# endif132# endif
133133
134# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23134# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
135# include <locale>135# include <locale>
136# endif136# endif
137137
lib/libcxx/include/experimental/memory+5-7
...@@ -70,10 +70,10 @@ public:...@@ -70,10 +70,10 @@ public:
7070
71# ifdef _LIBCPP_ENABLE_EXPERIMENTAL71# ifdef _LIBCPP_ENABLE_EXPERIMENTAL
7272
73_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
74
75# if _LIBCPP_STD_VER >= 1773# if _LIBCPP_STD_VER >= 17
7674
75_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
76
77template <class _Wp>77template <class _Wp>
78class observer_ptr {78class observer_ptr {
79public:79public:
...@@ -175,28 +175,26 @@ _LIBCPP_HIDE_FROM_ABI bool operator>=(observer_ptr<_W1> __a, observer_ptr<_W2> _...@@ -175,28 +175,26 @@ _LIBCPP_HIDE_FROM_ABI bool operator>=(observer_ptr<_W1> __a, observer_ptr<_W2> _
175 return !(__a < __b);175 return !(__a < __b);
176}176}
177177
178# endif // _LIBCPP_STD_VER >= 17
179
180_LIBCPP_END_NAMESPACE_LFTS_V2178_LIBCPP_END_NAMESPACE_LFTS_V2
181179
182_LIBCPP_BEGIN_NAMESPACE_STD180_LIBCPP_BEGIN_NAMESPACE_STD
183181
184// hash182// hash
185183
186# if _LIBCPP_STD_VER >= 17
187template <class _Tp>184template <class _Tp>
188struct hash<experimental::observer_ptr<_Tp>> {185struct hash<experimental::observer_ptr<_Tp>> {
189 _LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::observer_ptr<_Tp>& __ptr) const noexcept {186 _LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::observer_ptr<_Tp>& __ptr) const noexcept {
190 return hash<_Tp*>()(__ptr.get());187 return hash<_Tp*>()(__ptr.get());
191 }188 }
192};189};
193# endif // _LIBCPP_STD_VER >= 17
194190
195_LIBCPP_END_NAMESPACE_STD191_LIBCPP_END_NAMESPACE_STD
196192
193# endif // _LIBCPP_STD_VER >= 17
194
197# endif // _LIBCPP_ENABLE_EXPERIMENTAL195# endif // _LIBCPP_ENABLE_EXPERIMENTAL
198196
199# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20197# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
200# include <cstddef>198# include <cstddef>
201# include <limits>199# include <limits>
202# endif200# endif
lib/libcxx/include/experimental/propagate_const+1-1
...@@ -488,7 +488,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -488,7 +488,7 @@ _LIBCPP_END_NAMESPACE_STD
488488
489_LIBCPP_POP_MACROS489_LIBCPP_POP_MACROS
490490
491# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20491# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
492# include <cstddef>492# include <cstddef>
493# include <type_traits>493# include <type_traits>
494# endif494# endif
lib/libcxx/include/experimental/simd+1-1
...@@ -88,7 +88,7 @@ inline namespace parallelism_v2 {...@@ -88,7 +88,7 @@ inline namespace parallelism_v2 {
88# include <experimental/__simd/traits.h>88# include <experimental/__simd/traits.h>
89# include <experimental/__simd/vec_ext.h>89# include <experimental/__simd/vec_ext.h>
9090
91# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2091# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
92# include <cstddef>92# include <cstddef>
93# endif93# endif
94#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)94#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/experimental/type_traits+1-1
...@@ -151,7 +151,7 @@ constexpr bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Ar...@@ -151,7 +151,7 @@ constexpr bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Ar
151151
152_LIBCPP_END_NAMESPACE_LFTS152_LIBCPP_END_NAMESPACE_LFTS
153153
154# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20154# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
155# include <cstddef>155# include <cstddef>
156# endif156# endif
157157
lib/libcxx/include/experimental/utility+1-1
...@@ -46,7 +46,7 @@ struct erased_type {};...@@ -46,7 +46,7 @@ struct erased_type {};
4646
47_LIBCPP_END_NAMESPACE_LFTS47_LIBCPP_END_NAMESPACE_LFTS
4848
49# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2049# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
50# include <cstddef>50# include <cstddef>
51# endif51# endif
52#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)52#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/ext/hash_map+1-1
...@@ -825,7 +825,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multimap<_Key, _Tp, _Has...@@ -825,7 +825,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multimap<_Key, _Tp, _Has
825825
826} // namespace __gnu_cxx826} // namespace __gnu_cxx
827827
828# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20828# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
829# include <concepts>829# include <concepts>
830# include <iterator>830# include <iterator>
831# include <type_traits>831# include <type_traits>
lib/libcxx/include/ext/hash_set+1-1
...@@ -572,7 +572,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multiset<_Value, _Hash,...@@ -572,7 +572,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multiset<_Value, _Hash,
572572
573} // namespace __gnu_cxx573} // namespace __gnu_cxx
574574
575# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20575# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
576# include <concepts>576# include <concepts>
577# include <iterator>577# include <iterator>
578# include <type_traits>578# include <type_traits>
lib/libcxx/include/fenv.h deleted-118
...@@ -1,118 +0,0 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_FENV_H
11#define _LIBCPP_FENV_H
12
13/*
14 fenv.h synopsis
15
16This entire header is C99 / C++0X
17
18Macros:
19
20 FE_DIVBYZERO
21 FE_INEXACT
22 FE_INVALID
23 FE_OVERFLOW
24 FE_UNDERFLOW
25 FE_ALL_EXCEPT
26 FE_DOWNWARD
27 FE_TONEAREST
28 FE_TOWARDZERO
29 FE_UPWARD
30 FE_DFL_ENV
31
32Types:
33
34 fenv_t
35 fexcept_t
36
37int feclearexcept(int excepts);
38int fegetexceptflag(fexcept_t* flagp, int excepts);
39int feraiseexcept(int excepts);
40int fesetexceptflag(const fexcept_t* flagp, int excepts);
41int fetestexcept(int excepts);
42int fegetround();
43int fesetround(int round);
44int fegetenv(fenv_t* envp);
45int feholdexcept(fenv_t* envp);
46int fesetenv(const fenv_t* envp);
47int feupdateenv(const fenv_t* envp);
48
49
50*/
51
52#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
53# include <__cxx03/__config>
54#else
55# include <__config>
56#endif
57
58#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
59# pragma GCC system_header
60#endif
61
62#if __has_include_next(<fenv.h>)
63# include_next <fenv.h>
64#endif
65
66#ifdef __cplusplus
67
68extern "C++" {
69
70# ifdef feclearexcept
71# undef feclearexcept
72# endif
73
74# ifdef fegetexceptflag
75# undef fegetexceptflag
76# endif
77
78# ifdef feraiseexcept
79# undef feraiseexcept
80# endif
81
82# ifdef fesetexceptflag
83# undef fesetexceptflag
84# endif
85
86# ifdef fetestexcept
87# undef fetestexcept
88# endif
89
90# ifdef fegetround
91# undef fegetround
92# endif
93
94# ifdef fesetround
95# undef fesetround
96# endif
97
98# ifdef fegetenv
99# undef fegetenv
100# endif
101
102# ifdef feholdexcept
103# undef feholdexcept
104# endif
105
106# ifdef fesetenv
107# undef fesetenv
108# endif
109
110# ifdef feupdateenv
111# undef feupdateenv
112# endif
113
114} // extern "C++"
115
116#endif // defined(__cplusplus)
117
118#endif // _LIBCPP_FENV_H
lib/libcxx/include/filesystem+1-1
...@@ -568,7 +568,7 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct...@@ -568,7 +568,7 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
568# pragma GCC system_header568# pragma GCC system_header
569# endif569# endif
570570
571# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20571# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
572# include <concepts>572# include <concepts>
573# include <cstdlib>573# include <cstdlib>
574# include <cstring>574# include <cstring>
lib/libcxx/include/float.h deleted-99
...@@ -1,99 +0,0 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_FLOAT_H
11#define _LIBCPP_FLOAT_H
12
13/*
14 float.h synopsis
15
16Macros:
17
18 FLT_ROUNDS
19 FLT_EVAL_METHOD // C99
20 FLT_RADIX
21
22 FLT_MANT_DIG
23 DBL_MANT_DIG
24 LDBL_MANT_DIG
25
26 FLT_HAS_SUBNORM // C11
27 DBL_HAS_SUBNORM // C11
28 LDBL_HAS_SUBNORM // C11
29
30 DECIMAL_DIG // C99
31 FLT_DECIMAL_DIG // C11
32 DBL_DECIMAL_DIG // C11
33 LDBL_DECIMAL_DIG // C11
34
35 FLT_DIG
36 DBL_DIG
37 LDBL_DIG
38
39 FLT_MIN_EXP
40 DBL_MIN_EXP
41 LDBL_MIN_EXP
42
43 FLT_MIN_10_EXP
44 DBL_MIN_10_EXP
45 LDBL_MIN_10_EXP
46
47 FLT_MAX_EXP
48 DBL_MAX_EXP
49 LDBL_MAX_EXP
50
51 FLT_MAX_10_EXP
52 DBL_MAX_10_EXP
53 LDBL_MAX_10_EXP
54
55 FLT_MAX
56 DBL_MAX
57 LDBL_MAX
58
59 FLT_EPSILON
60 DBL_EPSILON
61 LDBL_EPSILON
62
63 FLT_MIN
64 DBL_MIN
65 LDBL_MIN
66
67 FLT_TRUE_MIN // C11
68 DBL_TRUE_MIN // C11
69 LDBL_TRUE_MIN // C11
70
71*/
72
73#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
74# include <__cxx03/__config>
75#else
76# include <__config>
77#endif
78
79#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
80# pragma GCC system_header
81#endif
82
83#if __has_include_next(<float.h>)
84# include_next <float.h>
85#endif
86
87#ifdef __cplusplus
88
89# ifndef FLT_EVAL_METHOD
90# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
91# endif
92
93# ifndef DECIMAL_DIG
94# define DECIMAL_DIG __DECIMAL_DIG__
95# endif
96
97#endif // __cplusplus
98
99#endif // _LIBCPP_FLOAT_H
lib/libcxx/include/format+13-10
...@@ -31,7 +31,7 @@ namespace std {...@@ -31,7 +31,7 @@ namespace std {
3131
32 public:32 public:
33 template<class T> consteval basic_format_string(const T& s);33 template<class T> consteval basic_format_string(const T& s);
34 basic_format_string(runtime-format-string<charT> s) noexcept : str(s.str) {} // since C++2634 basic_format_string(dynamic-format-string<charT> s) noexcept : str(s.str) {} // since C++26
3535
36 constexpr basic_string_view<charT> get() const noexcept { return str; }36 constexpr basic_string_view<charT> get() const noexcept { return str; }
37 };37 };
...@@ -42,21 +42,21 @@ namespace std {...@@ -42,21 +42,21 @@ namespace std {
42 using wformat_string = // since C++23, exposition only before C++2342 using wformat_string = // since C++23, exposition only before C++23
43 basic_format_string<wchar_t, type_identity_t<Args>...>;43 basic_format_string<wchar_t, type_identity_t<Args>...>;
4444
45 template<class charT> struct runtime-format-string { // since C++26, exposition-only45 template<class charT> struct dynamic-format-string { // since C++26, exposition-only
46 private:46 private:
47 basic_string_view<charT> str; // exposition-only47 basic_string_view<charT> str; // exposition-only
4848
49 public:49 public:
50 runtime-format-string(basic_string_view<charT> s) noexcept : str(s) {}50 dynamic-format-string(basic_string_view<charT> s) noexcept : str(s) {}
5151
52 runtime-format-string(const runtime-format-string&) = delete;52 dynamic-format-string(const dynamic-format-string&) = delete;
53 runtime-format-string& operator=(const runtime-format-string&) = delete;53 dynamic-format-string& operator=(const dynamic-format-string&) = delete;
54 };54 };
5555
56 runtime-format-string<char> runtime_format(string_view fmt) noexcept {56 dynamic-format-string<char> dynamic_format(string_view fmt) noexcept {
57 return fmt;57 return fmt;
58 }58 }
59 runtime-format-string<wchar_t> runtime_format(wstring_view fmt) noexcept {59 dynamic-format-string<wchar_t> dynamic_format(wstring_view fmt) noexcept {
60 return fmt;60 return fmt;
61 }61 }
6262
...@@ -213,7 +213,7 @@ namespace std {...@@ -213,7 +213,7 @@ namespace std {
213# include <__format/format_string.h>213# include <__format/format_string.h>
214# include <__format/format_to_n_result.h>214# include <__format/format_to_n_result.h>
215# include <__format/formatter.h>215# include <__format/formatter.h>
216# include <__format/formatter_bool.h>216# include <__format/formatter_bool_impl.h>
217# include <__format/formatter_char.h>217# include <__format/formatter_char.h>
218# include <__format/formatter_floating_point.h>218# include <__format/formatter_floating_point.h>
219# include <__format/formatter_integer.h>219# include <__format/formatter_integer.h>
...@@ -233,12 +233,15 @@ namespace std {...@@ -233,12 +233,15 @@ namespace std {
233# pragma GCC system_header233# pragma GCC system_header
234# endif234# endif
235235
236# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20236# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
237# include <cmath>
238# endif
239
240# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
237# include <array>241# include <array>
238# include <cctype>242# include <cctype>
239# include <cerrno>243# include <cerrno>
240# include <clocale>244# include <clocale>
241# include <cmath>
242# include <cstddef>245# include <cstddef>
243# include <cstdint>246# include <cstdint>
244# include <cstdlib>247# include <cstdlib>
lib/libcxx/include/forward_list+4-8
...@@ -37,7 +37,7 @@ public:...@@ -37,7 +37,7 @@ public:
37 noexcept(is_nothrow_default_constructible<allocator_type>::value);37 noexcept(is_nothrow_default_constructible<allocator_type>::value);
38 explicit forward_list(const allocator_type& a);38 explicit forward_list(const allocator_type& a);
39 explicit forward_list(size_type n);39 explicit forward_list(size_type n);
40 explicit forward_list(size_type n, const allocator_type& a); // C++1440 explicit forward_list(size_type n, const allocator_type& a);
41 forward_list(size_type n, const value_type& v);41 forward_list(size_type n, const value_type& v);
42 forward_list(size_type n, const value_type& v, const allocator_type& a);42 forward_list(size_type n, const value_type& v, const allocator_type& a);
43 template <class InputIterator>43 template <class InputIterator>
...@@ -234,6 +234,7 @@ template <class T, class Allocator, class Predicate>...@@ -234,6 +234,7 @@ template <class T, class Allocator, class Predicate>
234# include <__type_traits/remove_cv.h>234# include <__type_traits/remove_cv.h>
235# include <__type_traits/type_identity.h>235# include <__type_traits/type_identity.h>
236# include <__utility/exception_guard.h>236# include <__utility/exception_guard.h>
237# include <__utility/exchange.h>
237# include <__utility/forward.h>238# include <__utility/forward.h>
238# include <__utility/move.h>239# include <__utility/move.h>
239# include <__utility/swap.h>240# include <__utility/swap.h>
...@@ -663,9 +664,7 @@ public:...@@ -663,9 +664,7 @@ public:
663 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {} // = default;664 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {} // = default;
664 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit forward_list(const allocator_type& __a);665 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit forward_list(const allocator_type& __a);
665 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n);666 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n);
666# if _LIBCPP_STD_VER >= 14
667 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n, const allocator_type& __a);667 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n, const allocator_type& __a);
668# endif
669 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);668 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);
670669
671 template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>670 template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
...@@ -940,7 +939,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type...@@ -940,7 +939,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type
940 }939 }
941}940}
942941
943# if _LIBCPP_STD_VER >= 14
944template <class _Tp, class _Alloc>942template <class _Tp, class _Alloc>
945_LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __base_alloc)943_LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __base_alloc)
946 : __base(__base_alloc) {944 : __base(__base_alloc) {
...@@ -951,7 +949,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type...@@ -951,7 +949,6 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type
951 }949 }
952 }950 }
953}951}
954# endif
955952
956template <class _Tp, class _Alloc>953template <class _Tp, class _Alloc>
957_LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type __n, const value_type& __v) {954_LIBCPP_CONSTEXPR_SINCE_CXX26 forward_list<_Tp, _Alloc>::forward_list(size_type __n, const value_type& __v) {
...@@ -1022,8 +1019,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void forward_list<_Tp, _Alloc>::__move_assign(forw...@@ -1022,8 +1019,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void forward_list<_Tp, _Alloc>::__move_assign(forw
1022 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {1019 _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
1023 clear();1020 clear();
1024 __base::__move_assign_alloc(__x);1021 __base::__move_assign_alloc(__x);
1025 __base::__before_begin()->__next_ = __x.__before_begin()->__next_;1022 __base::__before_begin()->__next_ = std::__exchange(__x.__before_begin()->__next_, nullptr);
1026 __x.__before_begin()->__next_ = nullptr;
1027}1023}
10281024
1029template <class _Tp, class _Alloc>1025template <class _Tp, class _Alloc>
...@@ -1603,7 +1599,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -1603,7 +1599,7 @@ _LIBCPP_END_NAMESPACE_STD
16031599
1604_LIBCPP_POP_MACROS1600_LIBCPP_POP_MACROS
16051601
1606# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201602# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1607# include <algorithm>1603# include <algorithm>
1608# include <atomic>1604# include <atomic>
1609# include <concepts>1605# include <concepts>
lib/libcxx/include/fstream+90-31
...@@ -220,6 +220,7 @@ _LIBCPP_PUSH_MACROS...@@ -220,6 +220,7 @@ _LIBCPP_PUSH_MACROS
220# include <__undef_macros>220# include <__undef_macros>
221221
222_LIBCPP_BEGIN_NAMESPACE_STD222_LIBCPP_BEGIN_NAMESPACE_STD
223_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
223224
224# if _LIBCPP_STD_VER >= 23 && defined(_LIBCPP_WIN32API)225# if _LIBCPP_STD_VER >= 23 && defined(_LIBCPP_WIN32API)
225_LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) noexcept;226_LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) noexcept;
...@@ -308,6 +309,34 @@ protected:...@@ -308,6 +309,34 @@ protected:
308 return basic_streambuf<_CharT, _Traits>::xsputn(__str, __len);309 return basic_streambuf<_CharT, _Traits>::xsputn(__str, __len);
309 }310 }
310311
312 _LIBCPP_HIDE_FROM_ABI_VIRTUAL streamsize xsgetn(char_type* __str, streamsize __len) override {
313 if (__file_ && __always_noconv_) {
314 char_type __1buf;
315 __read_guard __guard(__1buf, *this);
316 const streamsize __n = std::min(this->egptr() - this->gptr(), __len);
317 if (__n != 0) {
318 traits_type::copy(__str, this->gptr(), __n);
319 this->__gbump_ptrdiff(__n);
320 }
321 const streamsize __remainder = __len - __n;
322 const streamsize __buffer_space = this->egptr() - this->eback();
323
324 if (__remainder >= __buffer_space) {
325 auto __res = std::fread(__str + __n, sizeof(char_type), __remainder, __file_) + __n;
326
327 // Copy the buffer-sized tail into the buffer so that `unget`ting works correctly
328 auto __buf_size = std::min<size_t>(__res, this->egptr() - this->eback());
329 traits_type::copy(this->eback(), __str + __res - __buf_size, __buf_size);
330 this->setg(this->eback(), this->eback() + __buf_size, this->eback() + __buf_size);
331
332 return __res;
333 } else if (__remainder > 0)
334 return basic_streambuf<_CharT, _Traits>::xsgetn(__str + __n, __remainder) + __n;
335 return __n;
336 }
337 return basic_streambuf<_CharT, _Traits>::xsgetn(__str, __len);
338 }
339
311private:340private:
312 char* __extbuf_;341 char* __extbuf_;
313 const char* __extbufnext_;342 const char* __extbufnext_;
...@@ -364,6 +393,40 @@ private:...@@ -364,6 +393,40 @@ private:
364 bool __always_noconv_;393 bool __always_noconv_;
365394
366 bool __read_mode();395 bool __read_mode();
396
397 struct [[__nodiscard__]] __read_guard {
398 basic_filebuf& __self_;
399 size_t __unget_size_;
400 char_type& __1buf_;
401
402 _LIBCPP_HIDE_FROM_ABI __read_guard(char_type& __1buf, basic_filebuf& __self) : __self_(__self), __1buf_(__1buf) {
403 if (__self.__cm_ & ios_base::in) {
404 __unget_size_ = std::min<size_t>((__self.egptr() - __self.eback()) / 2, 4);
405 } else {
406 __self.setp(nullptr, nullptr);
407 if (__self.__always_noconv_) {
408 __self.setg(reinterpret_cast<char_type*>(__self.__extbuf_),
409 reinterpret_cast<char_type*>(__self.__extbuf_) + __self.__ebs_,
410 reinterpret_cast<char_type*>(__self.__extbuf_) + __self.__ebs_);
411 } else {
412 __self.setg(__self.__intbuf_, __self.__intbuf_ + __self.__ibs_, __self.__intbuf_ + __self.__ibs_);
413 }
414 __self.__cm_ = ios_base::in;
415 __unget_size_ = 0;
416 }
417
418 if (__self.gptr() == nullptr)
419 __self.setg(std::addressof(__1buf_), std::addressof(__1buf_) + 1, std::addressof(__1buf_) + 1);
420 }
421
422 _LIBCPP_HIDE_FROM_ABI size_t __unget_size() { return __unget_size_; }
423
424 _LIBCPP_HIDE_FROM_ABI ~__read_guard() {
425 if (__self_.eback() == std::addressof(__1buf_))
426 __self_.setg(nullptr, nullptr, nullptr);
427 }
428 };
429
367 void __write_mode();430 void __write_mode();
368431
369 _LIBCPP_HIDE_FROM_ABI static int __fseek(FILE* __file, pos_type __offset, int __whence);432 _LIBCPP_HIDE_FROM_ABI static int __fseek(FILE* __file, pos_type __offset, int __whence);
...@@ -400,14 +463,12 @@ private:...@@ -400,14 +463,12 @@ private:
400 // If the file is already open, switch to unbuffered mode. Otherwise, record463 // If the file is already open, switch to unbuffered mode. Otherwise, record
401 // the request to use unbuffered mode so that we use that mode when we464 // the request to use unbuffered mode so that we use that mode when we
402 // eventually open the file.465 // eventually open the file.
403 _LIBCPP_HIDE_FROM_ABI void __request_unbuffered_mode(char_type* __s, streamsize __n) {466 _LIBCPP_HIDE_FROM_ABI void __request_unbuffered_mode() {
404 if (__cm_ == __no_io_operations && __s == nullptr && __n == 0) {467 if (__file_) {
405 if (__file_) {468 std::setbuf(__file_, nullptr);
406 std::setbuf(__file_, nullptr);469 __cm_ = 0;
407 __cm_ = 0;470 } else {
408 } else {471 __cm_ = __no_io_operations | __use_unbuffered_io;
409 __cm_ = __no_io_operations | __use_unbuffered_io;
410 }
411 }472 }
412 }473 }
413474
...@@ -601,6 +662,17 @@ inline bool basic_filebuf<_CharT, _Traits>::is_open() const {...@@ -601,6 +662,17 @@ inline bool basic_filebuf<_CharT, _Traits>::is_open() const {
601 return __file_ != nullptr;662 return __file_ != nullptr;
602}663}
603664
665// Configures the fopen close-on-exec mode character, if any. This string will
666// be appended to any mode string used by fstream for fopen/fdopen.
667//
668// Not all platforms support this, but it helps avoid fd-leaks on platforms that
669// do.
670# if defined(__BIONIC__)
671# define _LIBCPP_FOPEN_CLOEXEC_MODE "e"
672# else
673# define _LIBCPP_FOPEN_CLOEXEC_MODE
674# endif
675
604template <class _CharT, class _Traits>676template <class _CharT, class _Traits>
605const char* basic_filebuf<_CharT, _Traits>::__make_mdstring(ios_base::openmode __mode) _NOEXCEPT {677const char* basic_filebuf<_CharT, _Traits>::__make_mdstring(ios_base::openmode __mode) _NOEXCEPT {
606 switch (__mode & ~ios_base::ate) {678 switch (__mode & ~ios_base::ate) {
...@@ -773,11 +845,11 @@ template <class _CharT, class _Traits>...@@ -773,11 +845,11 @@ template <class _CharT, class _Traits>
773typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::underflow() {845typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::underflow() {
774 if (__file_ == nullptr)846 if (__file_ == nullptr)
775 return traits_type::eof();847 return traits_type::eof();
776 bool __initial = __read_mode();848
777 char_type __1buf;849 char_type __1buf;
778 if (this->gptr() == nullptr)850 __read_guard __guard(__1buf, *this);
779 this->setg(std::addressof(__1buf), std::addressof(__1buf) + 1, std::addressof(__1buf) + 1);851
780 const size_t __unget_sz = __initial ? 0 : std::min<size_t>((this->egptr() - this->eback()) / 2, 4);852 const size_t __unget_sz = __guard.__unget_size();
781 int_type __c = traits_type::eof();853 int_type __c = traits_type::eof();
782 if (this->gptr() == this->egptr()) {854 if (this->gptr() == this->egptr()) {
783 std::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));855 std::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
...@@ -820,8 +892,6 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>...@@ -820,8 +892,6 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
820 }892 }
821 } else893 } else
822 __c = traits_type::to_int_type(*this->gptr());894 __c = traits_type::to_int_type(*this->gptr());
823 if (this->eback() == std::addressof(__1buf))
824 this->setg(nullptr, nullptr, nullptr);
825 return __c;895 return __c;
826}896}
827897
...@@ -920,7 +990,9 @@ template <class _CharT, class _Traits>...@@ -920,7 +990,9 @@ template <class _CharT, class _Traits>
920basic_streambuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n) {990basic_streambuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n) {
921 this->setg(nullptr, nullptr, nullptr);991 this->setg(nullptr, nullptr, nullptr);
922 this->setp(nullptr, nullptr);992 this->setp(nullptr, nullptr);
923 __request_unbuffered_mode(__s, __n);993 // Calling setbuf(nullptr, 0) before any i/o operation switches the stream to unbuffered mode
994 if (__cm_ == __no_io_operations && __s == nullptr && __n == 0)
995 __request_unbuffered_mode();
924 if (__owns_eb_)996 if (__owns_eb_)
925 delete[] __extbuf_;997 delete[] __extbuf_;
926 if (__owns_ib_)998 if (__owns_ib_)
...@@ -1110,20 +1182,6 @@ void basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc) {...@@ -1110,20 +1182,6 @@ void basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc) {
1110 }1182 }
1111}1183}
11121184
1113template <class _CharT, class _Traits>
1114bool basic_filebuf<_CharT, _Traits>::__read_mode() {
1115 if (!(__cm_ & ios_base::in)) {
1116 this->setp(nullptr, nullptr);
1117 if (__always_noconv_)
1118 this->setg((char_type*)__extbuf_, (char_type*)__extbuf_ + __ebs_, (char_type*)__extbuf_ + __ebs_);
1119 else
1120 this->setg(__intbuf_, __intbuf_ + __ibs_, __intbuf_ + __ibs_);
1121 __cm_ = ios_base::in;
1122 return true;
1123 }
1124 return false;
1125}
1126
1127template <class _CharT, class _Traits>1185template <class _CharT, class _Traits>
1128void basic_filebuf<_CharT, _Traits>::__write_mode() {1186void basic_filebuf<_CharT, _Traits>::__write_mode() {
1129 if (!(__cm_ & ios_base::out)) {1187 if (!(__cm_ & ios_base::out)) {
...@@ -1616,13 +1674,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>;...@@ -1616,13 +1674,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>;
1616extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;1674extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
1617# endif1675# endif
16181676
1677_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1619_LIBCPP_END_NAMESPACE_STD1678_LIBCPP_END_NAMESPACE_STD
16201679
1621_LIBCPP_POP_MACROS1680_LIBCPP_POP_MACROS
16221681
1623# endif // _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION1682# endif // _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
16241683
1625# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201684# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1626# include <atomic>1685# include <atomic>
1627# include <concepts>1686# include <concepts>
1628# include <cstdlib>1687# include <cstdlib>
...@@ -1634,7 +1693,7 @@ _LIBCPP_POP_MACROS...@@ -1634,7 +1693,7 @@ _LIBCPP_POP_MACROS
1634# include <type_traits>1693# include <type_traits>
1635# endif1694# endif
16361695
1637# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 231696# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
1638# include <filesystem>1697# include <filesystem>
1639# endif1698# endif
1640#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)1699#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/functional+7-5
...@@ -221,6 +221,8 @@ template <auto f>...@@ -221,6 +221,8 @@ template <auto f>
221// [func.bind.partial], function templates bind_front and bind_back221// [func.bind.partial], function templates bind_front and bind_back
222template<class F, class... Args>222template<class F, class... Args>
223 constexpr unspecified bind_front(F&&, Args&&...); // C++20223 constexpr unspecified bind_front(F&&, Args&&...); // C++20
224template<auto f, class... Args>
225 constexpr unspecified bind_front(Args&&...); // C++26
224template<class F, class... Args>226template<class F, class... Args>
225 constexpr unspecified bind_back(F&&, Args&&...); // C++23227 constexpr unspecified bind_back(F&&, Args&&...); // C++23
226228
...@@ -540,7 +542,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited...@@ -540,7 +542,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited
540# include <__functional/binder1st.h>542# include <__functional/binder1st.h>
541# include <__functional/binder2nd.h>543# include <__functional/binder2nd.h>
542# include <__functional/hash.h>544# include <__functional/hash.h>
543# include <__functional/mem_fn.h> // TODO: deprecate545# include <__functional/mem_fn.h>
544# include <__functional/mem_fun_ref.h>546# include <__functional/mem_fun_ref.h>
545# include <__functional/operations.h>547# include <__functional/operations.h>
546# include <__functional/pointer_to_binary_function.h>548# include <__functional/pointer_to_binary_function.h>
...@@ -575,18 +577,18 @@ POLICY: For non-variadic implementations, the number of arguments is limited...@@ -575,18 +577,18 @@ POLICY: For non-variadic implementations, the number of arguments is limited
575# pragma GCC system_header577# pragma GCC system_header
576# endif578# endif
577579
578# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && defined(_LIBCPP_CXX03_LANG)580# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && defined(_LIBCPP_CXX03_LANG)
579# include <limits>581# include <limits>
580# include <new>582# include <new>
581# endif583# endif
582584
583# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14585# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 14
584# include <array>586# include <array>
585# include <initializer_list>587# include <initializer_list>
586# include <unordered_map>588# include <unordered_map>
587# endif589# endif
588590
589# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20591# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
590# include <atomic>592# include <atomic>
591# include <concepts>593# include <concepts>
592# include <cstdlib>594# include <cstdlib>
...@@ -601,7 +603,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited...@@ -601,7 +603,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited
601# include <vector>603# include <vector>
602# endif604# endif
603605
604# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 23606# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER == 23
605# include <__vector/vector.h>607# include <__vector/vector.h>
606# endif608# endif
607#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)609#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/future+23-10
...@@ -379,7 +379,6 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;...@@ -379,7 +379,6 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
379# include <__memory/allocator_arg_t.h>379# include <__memory/allocator_arg_t.h>
380# include <__memory/allocator_destructor.h>380# include <__memory/allocator_destructor.h>
381# include <__memory/allocator_traits.h>381# include <__memory/allocator_traits.h>
382# include <__memory/compressed_pair.h>
383# include <__memory/pointer_traits.h>382# include <__memory/pointer_traits.h>
384# include <__memory/shared_count.h>383# include <__memory/shared_count.h>
385# include <__memory/unique_ptr.h>384# include <__memory/unique_ptr.h>
...@@ -420,6 +419,7 @@ _LIBCPP_PUSH_MACROS...@@ -420,6 +419,7 @@ _LIBCPP_PUSH_MACROS
420# include <__undef_macros>419# include <__undef_macros>
421420
422_LIBCPP_BEGIN_NAMESPACE_STD421_LIBCPP_BEGIN_NAMESPACE_STD
422_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
423423
424// enum class future_errc424// enum class future_errc
425_LIBCPP_DECLARE_STRONG_ENUM(future_errc){425_LIBCPP_DECLARE_STRONG_ENUM(future_errc){
...@@ -435,7 +435,12 @@ struct is_error_code_enum<future_errc::__lx> : public true_type {};...@@ -435,7 +435,12 @@ struct is_error_code_enum<future_errc::__lx> : public true_type {};
435# endif435# endif
436436
437// enum class launch437// enum class launch
438_LIBCPP_DECLARE_STRONG_ENUM(launch){async = 1, deferred = 2, any = async | deferred};438_LIBCPP_DECLARE_STRONG_ENUM(launch){
439 async = 1,
440 deferred = 2,
441 any _LIBCPP_DEPRECATED_("std::launch::any is a deprecated extension. "
442 "Use std::launch::async | std::launch::deferred instead. "
443 "It will be removed in LLVM 25.") = async | deferred};
439_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch)444_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch)
440445
441# ifndef _LIBCPP_CXX03_LANG446# ifndef _LIBCPP_CXX03_LANG
...@@ -1407,8 +1412,10 @@ template <class _FD, class _Alloc, class _FB>...@@ -1407,8 +1412,10 @@ template <class _FD, class _Alloc, class _FB>
1407class __packaged_task_func;1412class __packaged_task_func;
14081413
1409template <class _Fp, class _Alloc, class _Rp, class... _ArgTypes>1414template <class _Fp, class _Alloc, class _Rp, class... _ArgTypes>
1410class __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)> : public __packaged_task_base<_Rp(_ArgTypes...)> {1415class _LIBCPP_HIDE_STRUCT_FROM_ABI
1411 _LIBCPP_COMPRESSED_PAIR(_Fp, __func_, _Alloc, __alloc_);1416 __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)> : public __packaged_task_base<_Rp(_ArgTypes...)> {
1417 _LIBCPP_NO_UNIQUE_ADDRESS _Fp __func_;
1418 _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
14121419
1413public:1420public:
1414 _LIBCPP_HIDE_FROM_ABI explicit __packaged_task_func(const _Fp& __f) : __func_(__f) {}1421 _LIBCPP_HIDE_FROM_ABI explicit __packaged_task_func(const _Fp& __f) : __func_(__f) {}
...@@ -1429,8 +1436,8 @@ void __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(...@@ -1429,8 +1436,8 @@ void __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
14291436
1430template <class _Fp, class _Alloc, class _Rp, class... _ArgTypes>1437template <class _Fp, class _Alloc, class _Rp, class... _ArgTypes>
1431void __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() {1438void __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() {
1432 __func_.~_Fp();
1433 __alloc_.~_Alloc();1439 __alloc_.~_Alloc();
1440 __func_.~_Fp();
1434}1441}
14351442
1436template <class _Fp, class _Alloc, class _Rp, class... _ArgTypes>1443template <class _Fp, class _Alloc, class _Rp, class... _ArgTypes>
...@@ -1439,8 +1446,8 @@ void __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate()...@@ -1439,8 +1446,8 @@ void __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate()
1439 typedef allocator_traits<_Ap> _ATraits;1446 typedef allocator_traits<_Ap> _ATraits;
1440 typedef pointer_traits<typename _ATraits::pointer> _PTraits;1447 typedef pointer_traits<typename _ATraits::pointer> _PTraits;
1441 _Ap __a(__alloc_);1448 _Ap __a(__alloc_);
1442 __func_.~_Fp();
1443 __alloc_.~_Alloc();1449 __alloc_.~_Alloc();
1450 __func_.~_Fp();
1444 __a.deallocate(_PTraits::pointer_to(*this), 1);1451 __a.deallocate(_PTraits::pointer_to(*this), 1);
1445}1452}
14461453
...@@ -1744,7 +1751,7 @@ public:...@@ -1744,7 +1751,7 @@ public:
1744template <class _Rp, class... _Args>1751template <class _Rp, class... _Args>
1745packaged_task(_Rp (*)(_Args...)) -> packaged_task<_Rp(_Args...)>;1752packaged_task(_Rp (*)(_Args...)) -> packaged_task<_Rp(_Args...)>;
17461753
1747template <class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>1754template <class _Fp, class _Stripped = __strip_signature_t<decltype(&_Fp::operator())>>
1748packaged_task(_Fp) -> packaged_task<_Stripped>;1755packaged_task(_Fp) -> packaged_task<_Stripped>;
17491756
1750# endif1757# endif
...@@ -1876,7 +1883,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args) {...@@ -1876,7 +1883,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args) {
1876template <class _Fp, class... _Args>1883template <class _Fp, class... _Args>
1877[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI future<__invoke_result_t<__decay_t<_Fp>, __decay_t<_Args>...> >1884[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI future<__invoke_result_t<__decay_t<_Fp>, __decay_t<_Args>...> >
1878async(_Fp&& __f, _Args&&... __args) {1885async(_Fp&& __f, _Args&&... __args) {
1879 return std::async(launch::any, std::forward<_Fp>(__f), std::forward<_Args>(__args)...);1886 return std::async(launch::async | launch::deferred, std::forward<_Fp>(__f), std::forward<_Args>(__args)...);
1880}1887}
18811888
1882# endif // C++031889# endif // C++03
...@@ -2052,17 +2059,18 @@ inline shared_future<_Rp&> future<_Rp&>::share() _NOEXCEPT {...@@ -2052,17 +2059,18 @@ inline shared_future<_Rp&> future<_Rp&>::share() _NOEXCEPT {
20522059
2053inline shared_future<void> future<void>::share() _NOEXCEPT { return shared_future<void>(std::move(*this)); }2060inline shared_future<void> future<void>::share() _NOEXCEPT { return shared_future<void>(std::move(*this)); }
20542061
2062_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
2055_LIBCPP_END_NAMESPACE_STD2063_LIBCPP_END_NAMESPACE_STD
20562064
2057_LIBCPP_POP_MACROS2065_LIBCPP_POP_MACROS
20582066
2059# endif // _LIBCPP_HAS_THREADS2067# endif // _LIBCPP_HAS_THREADS
20602068
2061# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 172069# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
2062# include <chrono>2070# include <chrono>
2063# endif2071# endif
20642072
2065# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 202073# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
2066# include <atomic>2074# include <atomic>
2067# include <cstdlib>2075# include <cstdlib>
2068# include <exception>2076# include <exception>
...@@ -2070,6 +2078,11 @@ _LIBCPP_POP_MACROS...@@ -2070,6 +2078,11 @@ _LIBCPP_POP_MACROS
2070# include <system_error>2078# include <system_error>
2071# include <thread>2079# include <thread>
2072# endif2080# endif
2081
2082# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
2083# include <sstream>
2084# endif
2085
2073#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)2086#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
20742087
2075#endif // _LIBCPP_FUTURE2088#endif // _LIBCPP_FUTURE
lib/libcxx/include/initializer_list+5-5
...@@ -53,11 +53,11 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in...@@ -53,11 +53,11 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
53# pragma GCC system_header53# pragma GCC system_header
54# endif54# endif
5555
56# ifndef _LIBCPP_CXX03_LANG
57
56namespace std // purposefully not versioned58namespace std // purposefully not versioned
57{59{
5860
59# ifndef _LIBCPP_CXX03_LANG
60
61template <class _Ep>61template <class _Ep>
62class _LIBCPP_NO_SPECIALIZATIONS initializer_list {62class _LIBCPP_NO_SPECIALIZATIONS initializer_list {
63 const _Ep* __begin_;63 const _Ep* __begin_;
...@@ -101,11 +101,11 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia...@@ -101,11 +101,11 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia
101 return __il.end();101 return __il.end();
102}102}
103103
104# endif // !defined(_LIBCPP_CXX03_LANG)
105
106} // namespace std104} // namespace std
107105
108# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20106# endif // _LIBCPP_CXX03_LANG
107
108# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
109# include <cstddef>109# include <cstddef>
110# endif110# endif
111#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)111#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/inttypes.h deleted-268
...@@ -1,268 +0,0 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_INTTYPES_H
11// AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T
12// is defined until an inclusion of it without _STD_TYPES_T occurs, in which
13// case the header guard macro is defined.
14#if !defined(_AIX) || !defined(_STD_TYPES_T)
15# define _LIBCPP_INTTYPES_H
16#endif // _STD_TYPES_T
17
18/*
19 inttypes.h synopsis
20
21This entire header is C99 / C++0X
22
23#include <stdint.h> // <cinttypes> includes <cstdint>
24
25Macros:
26
27 PRId8
28 PRId16
29 PRId32
30 PRId64
31
32 PRIdLEAST8
33 PRIdLEAST16
34 PRIdLEAST32
35 PRIdLEAST64
36
37 PRIdFAST8
38 PRIdFAST16
39 PRIdFAST32
40 PRIdFAST64
41
42 PRIdMAX
43 PRIdPTR
44
45 PRIi8
46 PRIi16
47 PRIi32
48 PRIi64
49
50 PRIiLEAST8
51 PRIiLEAST16
52 PRIiLEAST32
53 PRIiLEAST64
54
55 PRIiFAST8
56 PRIiFAST16
57 PRIiFAST32
58 PRIiFAST64
59
60 PRIiMAX
61 PRIiPTR
62
63 PRIo8
64 PRIo16
65 PRIo32
66 PRIo64
67
68 PRIoLEAST8
69 PRIoLEAST16
70 PRIoLEAST32
71 PRIoLEAST64
72
73 PRIoFAST8
74 PRIoFAST16
75 PRIoFAST32
76 PRIoFAST64
77
78 PRIoMAX
79 PRIoPTR
80
81 PRIu8
82 PRIu16
83 PRIu32
84 PRIu64
85
86 PRIuLEAST8
87 PRIuLEAST16
88 PRIuLEAST32
89 PRIuLEAST64
90
91 PRIuFAST8
92 PRIuFAST16
93 PRIuFAST32
94 PRIuFAST64
95
96 PRIuMAX
97 PRIuPTR
98
99 PRIx8
100 PRIx16
101 PRIx32
102 PRIx64
103
104 PRIxLEAST8
105 PRIxLEAST16
106 PRIxLEAST32
107 PRIxLEAST64
108
109 PRIxFAST8
110 PRIxFAST16
111 PRIxFAST32
112 PRIxFAST64
113
114 PRIxMAX
115 PRIxPTR
116
117 PRIX8
118 PRIX16
119 PRIX32
120 PRIX64
121
122 PRIXLEAST8
123 PRIXLEAST16
124 PRIXLEAST32
125 PRIXLEAST64
126
127 PRIXFAST8
128 PRIXFAST16
129 PRIXFAST32
130 PRIXFAST64
131
132 PRIXMAX
133 PRIXPTR
134
135 SCNd8
136 SCNd16
137 SCNd32
138 SCNd64
139
140 SCNdLEAST8
141 SCNdLEAST16
142 SCNdLEAST32
143 SCNdLEAST64
144
145 SCNdFAST8
146 SCNdFAST16
147 SCNdFAST32
148 SCNdFAST64
149
150 SCNdMAX
151 SCNdPTR
152
153 SCNi8
154 SCNi16
155 SCNi32
156 SCNi64
157
158 SCNiLEAST8
159 SCNiLEAST16
160 SCNiLEAST32
161 SCNiLEAST64
162
163 SCNiFAST8
164 SCNiFAST16
165 SCNiFAST32
166 SCNiFAST64
167
168 SCNiMAX
169 SCNiPTR
170
171 SCNo8
172 SCNo16
173 SCNo32
174 SCNo64
175
176 SCNoLEAST8
177 SCNoLEAST16
178 SCNoLEAST32
179 SCNoLEAST64
180
181 SCNoFAST8
182 SCNoFAST16
183 SCNoFAST32
184 SCNoFAST64
185
186 SCNoMAX
187 SCNoPTR
188
189 SCNu8
190 SCNu16
191 SCNu32
192 SCNu64
193
194 SCNuLEAST8
195 SCNuLEAST16
196 SCNuLEAST32
197 SCNuLEAST64
198
199 SCNuFAST8
200 SCNuFAST16
201 SCNuFAST32
202 SCNuFAST64
203
204 SCNuMAX
205 SCNuPTR
206
207 SCNx8
208 SCNx16
209 SCNx32
210 SCNx64
211
212 SCNxLEAST8
213 SCNxLEAST16
214 SCNxLEAST32
215 SCNxLEAST64
216
217 SCNxFAST8
218 SCNxFAST16
219 SCNxFAST32
220 SCNxFAST64
221
222 SCNxMAX
223 SCNxPTR
224
225Types:
226
227 imaxdiv_t
228
229intmax_t imaxabs(intmax_t j);
230imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
231intmax_t strtoimax(const char* restrict nptr, char** restrict endptr, int base);
232uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base);
233intmax_t wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
234uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
235
236*/
237
238#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
239# include <__cxx03/__config>
240#else
241# include <__config>
242#endif
243
244#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
245# pragma GCC system_header
246#endif
247
248/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
249 for C++11 unless __STDC_FORMAT_MACROS is defined
250*/
251#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
252# define __STDC_FORMAT_MACROS
253#endif
254
255#if __has_include_next(<inttypes.h>)
256# include_next <inttypes.h>
257#endif
258
259#ifdef __cplusplus
260
261# include <stdint.h>
262
263# undef imaxabs
264# undef imaxdiv
265
266#endif // __cplusplus
267
268#endif // _LIBCPP_INTTYPES_H
lib/libcxx/include/iomanip+4-18
...@@ -413,6 +413,8 @@ inline _LIBCPP_HIDE_FROM_ABI __iom_t10<_CharT> put_time(const tm* __tm, const _C...@@ -413,6 +413,8 @@ inline _LIBCPP_HIDE_FROM_ABI __iom_t10<_CharT> put_time(const tm* __tm, const _C
413 return __iom_t10<_CharT>(__tm, __fmt);413 return __iom_t10<_CharT>(__tm, __fmt);
414}414}
415415
416# if _LIBCPP_STD_VER >= 14
417
416template <class _CharT, class _Traits>418template <class _CharT, class _Traits>
417_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& __quoted_output(419_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& __quoted_output(
418 basic_ostream<_CharT, _Traits>& __os,420 basic_ostream<_CharT, _Traits>& __os,
...@@ -502,22 +504,6 @@ struct _LIBCPP_HIDDEN __quoted_proxy {...@@ -502,22 +504,6 @@ struct _LIBCPP_HIDDEN __quoted_proxy {
502 }504 }
503};505};
504506
505template <class _CharT, class _Traits, class _Allocator>
506_LIBCPP_HIDE_FROM_ABI __quoted_output_proxy<_CharT, _Traits>
507__quoted(const basic_string<_CharT, _Traits, _Allocator>& __s,
508 _CharT __delim = _CharT('"'),
509 _CharT __escape = _CharT('\\')) {
510 return __quoted_output_proxy<_CharT, _Traits>(__s.data(), __s.data() + __s.size(), __delim, __escape);
511}
512
513template <class _CharT, class _Traits, class _Allocator>
514_LIBCPP_HIDE_FROM_ABI __quoted_proxy<_CharT, _Traits, _Allocator>
515__quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
516 return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
517}
518
519# if _LIBCPP_STD_VER >= 14
520
521template <class _CharT>507template <class _CharT>
522_LIBCPP_HIDE_FROM_ABI auto quoted(const _CharT* __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {508_LIBCPP_HIDE_FROM_ABI auto quoted(const _CharT* __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
523 const _CharT* __end = __s;509 const _CharT* __end = __s;
...@@ -552,7 +538,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -552,7 +538,7 @@ _LIBCPP_END_NAMESPACE_STD
552538
553# endif // _LIBCPP_HAS_LOCALIZATION539# endif // _LIBCPP_HAS_LOCALIZATION
554540
555# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20541# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
556# include <array>542# include <array>
557# include <bitset>543# include <bitset>
558# include <deque>544# include <deque>
...@@ -567,7 +553,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -567,7 +553,7 @@ _LIBCPP_END_NAMESPACE_STD
567# include <vector>553# include <vector>
568# endif554# endif
569555
570# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23556# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
571# include <locale>557# include <locale>
572# endif558# endif
573559
lib/libcxx/include/ios+18-15
...@@ -235,10 +235,6 @@ storage-class-specifier const error_category& iostream_category() noexcept;...@@ -235,10 +235,6 @@ storage-class-specifier const error_category& iostream_category() noexcept;
235# include <__verbose_abort>235# include <__verbose_abort>
236# include <version>236# include <version>
237237
238# if _LIBCPP_HAS_ATOMIC_HEADER
239# include <__atomic/atomic.h> // for __xindex_
240# endif
241
242# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)238# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
243# pragma GCC system_header239# pragma GCC system_header
244# endif240# endif
...@@ -247,6 +243,7 @@ _LIBCPP_PUSH_MACROS...@@ -247,6 +243,7 @@ _LIBCPP_PUSH_MACROS
247# include <__undef_macros>243# include <__undef_macros>
248244
249_LIBCPP_BEGIN_NAMESPACE_STD245_LIBCPP_BEGIN_NAMESPACE_STD
246_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
250247
251typedef ptrdiff_t streamsize;248typedef ptrdiff_t streamsize;
252249
...@@ -361,7 +358,7 @@ public:...@@ -361,7 +358,7 @@ public:
361 }358 }
362359
363protected:360protected:
364 _LIBCPP_HIDE_FROM_ABI ios_base() : __loc_(nullptr) {361 _LIBCPP_HIDE_FROM_ABI ios_base() : __loc_(__private_constructor_tag(), nullptr) {
365 // Purposefully does no initialization362 // Purposefully does no initialization
366 //363 //
367 // Except for the locale, this is a sentinel to avoid destroying364 // Except for the locale, this is a sentinel to avoid destroying
...@@ -386,25 +383,25 @@ protected:...@@ -386,25 +383,25 @@ protected:
386 _LIBCPP_HIDE_FROM_ABI void set_rdbuf(void* __sb) { __rdbuf_ = __sb; }383 _LIBCPP_HIDE_FROM_ABI void set_rdbuf(void* __sb) { __rdbuf_ = __sb; }
387384
388private:385private:
389 // All data members must be scalars
390 fmtflags __fmtflags_;386 fmtflags __fmtflags_;
391 streamsize __precision_;387 streamsize __precision_;
392 streamsize __width_;388 streamsize __width_;
393 iostate __rdstate_;389 iostate __rdstate_;
394 iostate __exceptions_;390 iostate __exceptions_;
395 void* __rdbuf_;391 void* __rdbuf_;
396 void* __loc_;392# ifndef _LIBCPP_CXX03_LANG
393 union {
394 locale __loc_;
395 };
396# else
397 // We only care about the union above to implement the destructor correctly, which we do in C++26 anyways. No need to
398 // handle C++03 shenanigans.
399 locale __loc_;
400# endif
397 event_callback* __fn_;401 event_callback* __fn_;
398 int* __index_;402 int* __index_;
399 size_t __event_size_;403 size_t __event_size_;
400 size_t __event_cap_;404 size_t __event_cap_;
401// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
402// enabled with clang.
403# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
404 static atomic<int> __xindex_;
405# else
406 static int __xindex_;
407# endif
408 long* __iarray_;405 long* __iarray_;
409 size_t __iarray_size_;406 size_t __iarray_size_;
410 size_t __iarray_cap_;407 size_t __iarray_cap_;
...@@ -871,13 +868,19 @@ _LIBCPP_HIDE_FROM_ABI inline ios_base& defaultfloat(ios_base& __str) {...@@ -871,13 +868,19 @@ _LIBCPP_HIDE_FROM_ABI inline ios_base& defaultfloat(ios_base& __str) {
871 return __str;868 return __str;
872}869}
873870
871_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
874_LIBCPP_END_NAMESPACE_STD872_LIBCPP_END_NAMESPACE_STD
875873
876_LIBCPP_POP_MACROS874_LIBCPP_POP_MACROS
877875
878# endif // _LIBCPP_HAS_LOCALIZATION876# endif // _LIBCPP_HAS_LOCALIZATION
879877
880# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20878# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
879# include <ctime>
880# include <ratio>
881# endif
882
883# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
881# include <atomic>884# include <atomic>
882# include <concepts>885# include <concepts>
883# include <cstddef>886# include <cstddef>
lib/libcxx/include/istream+4-2
...@@ -190,6 +190,7 @@ _LIBCPP_PUSH_MACROS...@@ -190,6 +190,7 @@ _LIBCPP_PUSH_MACROS
190# include <__undef_macros>190# include <__undef_macros>
191191
192_LIBCPP_BEGIN_NAMESPACE_STD192_LIBCPP_BEGIN_NAMESPACE_STD
193_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
193194
194template <class _CharT, class _Traits>195template <class _CharT, class _Traits>
195class basic_istream : virtual public basic_ios<_CharT, _Traits> {196class basic_istream : virtual public basic_ios<_CharT, _Traits> {
...@@ -1405,20 +1406,21 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;...@@ -1405,20 +1406,21 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;
1405# endif1406# endif
1406extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;1407extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
14071408
1409_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1408_LIBCPP_END_NAMESPACE_STD1410_LIBCPP_END_NAMESPACE_STD
14091411
1410_LIBCPP_POP_MACROS1412_LIBCPP_POP_MACROS
14111413
1412# endif // _LIBCPP_HAS_LOCALIZATION1414# endif // _LIBCPP_HAS_LOCALIZATION
14131415
1414# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201416# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1415# include <concepts>1417# include <concepts>
1416# include <iosfwd>1418# include <iosfwd>
1417# include <ostream>1419# include <ostream>
1418# include <type_traits>1420# include <type_traits>
1419# endif1421# endif
14201422
1421# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 231423# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
1422# include <locale>1424# include <locale>
1423# endif1425# endif
14241426
lib/libcxx/include/iterator+2-2
...@@ -751,11 +751,11 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;...@@ -751,11 +751,11 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
751# pragma GCC system_header751# pragma GCC system_header
752# endif752# endif
753753
754# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17754# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
755# include <variant>755# include <variant>
756# endif756# endif
757757
758# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20758# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
759# include <cstddef>759# include <cstddef>
760# include <cstdlib>760# include <cstdlib>
761# include <exception>761# include <exception>
lib/libcxx/include/latch+1-1
...@@ -128,7 +128,7 @@ _LIBCPP_POP_MACROS...@@ -128,7 +128,7 @@ _LIBCPP_POP_MACROS
128128
129# endif // _LIBCPP_HAS_THREADS129# endif // _LIBCPP_HAS_THREADS
130130
131# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20131# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
132# include <atomic>132# include <atomic>
133# include <cstddef>133# include <cstddef>
134# endif134# endif
lib/libcxx/include/limits+12-4
...@@ -108,6 +108,7 @@ template<> class numeric_limits<cv long double>;...@@ -108,6 +108,7 @@ template<> class numeric_limits<cv long double>;
108# include <__config>108# include <__config>
109# include <__type_traits/is_arithmetic.h>109# include <__type_traits/is_arithmetic.h>
110# include <__type_traits/is_same.h>110# include <__type_traits/is_same.h>
111# include <__type_traits/make_unsigned.h>
111112
112# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)113# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
113# pragma GCC system_header114# pragma GCC system_header
...@@ -184,9 +185,16 @@ protected:...@@ -184,9 +185,16 @@ protected:
184185
185 static _LIBCPP_CONSTEXPR const bool is_specialized = true;186 static _LIBCPP_CONSTEXPR const bool is_specialized = true;
186187
187 static _LIBCPP_CONSTEXPR const bool is_signed = type(-1) < type(0);188 static _LIBCPP_CONSTEXPR const bool is_signed = type(-1) < type(0);
188 static _LIBCPP_CONSTEXPR const int digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed);189 // Number of value bits in type. Works for any integer type, including
189 static _LIBCPP_CONSTEXPR const int digits10 = digits * 3 / 10;190 // _BitInt(N), whose sizeof(type) * CHAR_BIT may include padding.
191 static _LIBCPP_CONSTEXPR const int digits =
192 __builtin_popcountg(static_cast<__make_unsigned_t<type> >(~__make_unsigned_t<type>(0))) - is_signed;
193 // digits10 = floor(digits * log10(2)). 1936274/6432163 is a continued-fraction
194 // convergent of log10(2) and matches floor(digits * log10(2)) exactly for every
195 // digits in [1, 8388608], i.e. up to __BITINT_MAXWIDTH__ on x86.
196 // TODO: switch to __builtin_log10 once it becomes constexpr.
197 static _LIBCPP_CONSTEXPR const int digits10 = static_cast<int>((digits * 1936274LL) / 6432163);
190 static _LIBCPP_CONSTEXPR const int max_digits10 = 0;198 static _LIBCPP_CONSTEXPR const int max_digits10 = 0;
191 static _LIBCPP_CONSTEXPR const type __min = is_signed ? _Tp(_Tp(1) << digits) : 0;199 static _LIBCPP_CONSTEXPR const type __min = is_signed ? _Tp(_Tp(1) << digits) : 0;
192 static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);200 static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
...@@ -520,7 +528,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -520,7 +528,7 @@ _LIBCPP_END_NAMESPACE_STD
520528
521_LIBCPP_POP_MACROS529_LIBCPP_POP_MACROS
522530
523# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20531# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
524# include <type_traits>532# include <type_traits>
525# endif533# endif
526#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)534#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/list+6-6
...@@ -39,7 +39,7 @@ public:...@@ -39,7 +39,7 @@ public:
39 noexcept(is_nothrow_default_constructible<allocator_type>::value);39 noexcept(is_nothrow_default_constructible<allocator_type>::value);
40 explicit list(const allocator_type& a);40 explicit list(const allocator_type& a);
41 explicit list(size_type n);41 explicit list(size_type n);
42 explicit list(size_type n, const allocator_type& a); // C++1442 explicit list(size_type n, const allocator_type& a);
43 list(size_type n, const value_type& value);43 list(size_type n, const value_type& value);
44 list(size_type n, const value_type& value, const allocator_type& a);44 list(size_type n, const value_type& value, const allocator_type& a);
45 template <class Iter>45 template <class Iter>
...@@ -708,9 +708,7 @@ public:...@@ -708,9 +708,7 @@ public:
708 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {}708 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) {}
709 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(const allocator_type& __a) : __base(__a) {}709 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(const allocator_type& __a) : __base(__a) {}
710 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n);710 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n);
711# if _LIBCPP_STD_VER >= 14
712 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);711 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);
713# endif
714 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);712 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);
715 template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>713 template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
716 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI714 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI
...@@ -1066,13 +1064,15 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 list<_Tp, _Alloc>::list(size_type __n) {...@@ -1066,13 +1064,15 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 list<_Tp, _Alloc>::list(size_type __n) {
1066# endif1064# endif
1067}1065}
10681066
1069# if _LIBCPP_STD_VER >= 14
1070template <class _Tp, class _Alloc>1067template <class _Tp, class _Alloc>
1071_LIBCPP_CONSTEXPR_SINCE_CXX26 list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : __base(__a) {1068_LIBCPP_CONSTEXPR_SINCE_CXX26 list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : __base(__a) {
1072 for (; __n > 0; --__n)1069 for (; __n > 0; --__n)
1070# ifndef _LIBCPP_CXX03_LANG
1073 emplace_back();1071 emplace_back();
1074}1072# else
1073 push_back(value_type());
1075# endif1074# endif
1075}
10761076
1077template <class _Tp, class _Alloc>1077template <class _Tp, class _Alloc>
1078_LIBCPP_CONSTEXPR_SINCE_CXX26 list<_Tp, _Alloc>::list(size_type __n, const value_type& __x) {1078_LIBCPP_CONSTEXPR_SINCE_CXX26 list<_Tp, _Alloc>::list(size_type __n, const value_type& __x) {
...@@ -1815,7 +1815,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -1815,7 +1815,7 @@ _LIBCPP_END_NAMESPACE_STD
18151815
1816_LIBCPP_POP_MACROS1816_LIBCPP_POP_MACROS
18171817
1818# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201818# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1819# include <algorithm>1819# include <algorithm>
1820# include <atomic>1820# include <atomic>
1821# include <concepts>1821# include <concepts>
lib/libcxx/include/locale+1-1
...@@ -210,7 +210,7 @@ template <class charT> class messages_byname;...@@ -210,7 +210,7 @@ template <class charT> class messages_byname;
210210
211# endif // _LIBCPP_HAS_LOCALIZATION211# endif // _LIBCPP_HAS_LOCALIZATION
212212
213# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20213# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
214# include <atomic>214# include <atomic>
215# include <concepts>215# include <concepts>
216# include <cstdarg>216# include <cstdarg>
lib/libcxx/include/map+565-397
...@@ -57,177 +57,175 @@ public:...@@ -57,177 +57,175 @@ public:
57 };57 };
5858
59 // construct/copy/destroy:59 // construct/copy/destroy:
60 map()60 constexpr map()
61 noexcept(61 noexcept(
62 is_nothrow_default_constructible<allocator_type>::value &&62 is_nothrow_default_constructible<allocator_type>::value &&
63 is_nothrow_default_constructible<key_compare>::value &&63 is_nothrow_default_constructible<key_compare>::value &&
64 is_nothrow_copy_constructible<key_compare>::value);64 is_nothrow_copy_constructible<key_compare>::value);
65 explicit map(const key_compare& comp);65 constexpr explicit map(const key_compare& comp);
66 map(const key_compare& comp, const allocator_type& a);66 constexpr map(const key_compare& comp, const allocator_type& a);
67 template <class InputIterator>67 template <class InputIterator>
68 map(InputIterator first, InputIterator last,68 constexpr map(InputIterator first, InputIterator last,
69 const key_compare& comp = key_compare());69 const key_compare& comp = key_compare());
70 template <class InputIterator>70 template <class InputIterator>
71 map(InputIterator first, InputIterator last,71 constexpr map(InputIterator first, InputIterator last,
72 const key_compare& comp, const allocator_type& a);72 const key_compare& comp, const allocator_type& a);
73 template<container-compatible-range<value_type> R>73 template<container-compatible-range<value_type> R>
74 map(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++2374 constexpr map(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23
75 map(const map& m);75 constexpr map(const map& m);
76 map(map&& m)76 constexpr map(map&& m)
77 noexcept(77 noexcept(
78 is_nothrow_move_constructible<allocator_type>::value &&78 is_nothrow_move_constructible<allocator_type>::value &&
79 is_nothrow_move_constructible<key_compare>::value);79 is_nothrow_move_constructible<key_compare>::value);
80 explicit map(const allocator_type& a);80 constexpr explicit map(const allocator_type& a);
81 map(const map& m, const allocator_type& a);81 constexpr map(const map& m, const allocator_type& a);
82 map(map&& m, const allocator_type& a);82 constexpr map(map&& m, const allocator_type& a);
83 map(initializer_list<value_type> il, const key_compare& comp = key_compare());83 constexpr map(initializer_list<value_type> il, const key_compare& comp = key_compare());
84 map(initializer_list<value_type> il, const key_compare& comp, const allocator_type& a);84 constexpr map(initializer_list<value_type> il, const key_compare& comp, const allocator_type& a);
85 template <class InputIterator>85 template <class InputIterator>
86 map(InputIterator first, InputIterator last, const allocator_type& a)86 constexpr map(InputIterator first, InputIterator last, const allocator_type& a)
87 : map(first, last, Compare(), a) {} // C++1487 : map(first, last, Compare(), a) {}
88 template<container-compatible-range<value_type> R>88 template<container-compatible-range<value_type> R>
89 map(from_range_t, R&& rg, const Allocator& a))89 constexpr map(from_range_t, R&& rg, const Allocator& a))
90 : map(from_range, std::forward<R>(rg), Compare(), a) { } // C++2390 : map(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
91 map(initializer_list<value_type> il, const allocator_type& a)91 constexpr map(initializer_list<value_type> il, const allocator_type& a)
92 : map(il, Compare(), a) {} // C++1492 : map(il, Compare(), a) {}
93 ~map();93 constexpr ~map();
9494
95 map& operator=(const map& m);95 constexpr map& operator=(const map& m);
96 map& operator=(map&& m)96 constexpr map& operator=(map&& m)
97 noexcept(97 noexcept(
98 allocator_type::propagate_on_container_move_assignment::value &&98 allocator_type::propagate_on_container_move_assignment::value &&
99 is_nothrow_move_assignable<allocator_type>::value &&99 is_nothrow_move_assignable<allocator_type>::value &&
100 is_nothrow_move_assignable<key_compare>::value);100 is_nothrow_move_assignable<key_compare>::value);
101 map& operator=(initializer_list<value_type> il);101 constexpr map& operator=(initializer_list<value_type> il);
102102
103 // iterators:103 // iterators:
104 iterator begin() noexcept;104 constexpr iterator begin() noexcept;
105 const_iterator begin() const noexcept;105 constexpr const_iterator begin() const noexcept;
106 iterator end() noexcept;106 constexpr iterator end() noexcept;
107 const_iterator end() const noexcept;107 constexpr const_iterator end() const noexcept;
108108
109 reverse_iterator rbegin() noexcept;109 constexpr reverse_iterator rbegin() noexcept;
110 const_reverse_iterator rbegin() const noexcept;110 constexpr const_reverse_iterator rbegin() const noexcept;
111 reverse_iterator rend() noexcept;111 constexpr reverse_iterator rend() noexcept;
112 const_reverse_iterator rend() const noexcept;112 constexpr const_reverse_iterator rend() const noexcept;
113113
114 const_iterator cbegin() const noexcept;114 constexpr const_iterator cbegin() const noexcept;
115 const_iterator cend() const noexcept;115 constexpr const_iterator cend() const noexcept;
116 const_reverse_iterator crbegin() const noexcept;116 constexpr const_reverse_iterator crbegin() const noexcept;
117 const_reverse_iterator crend() const noexcept;117 constexpr const_reverse_iterator crend() const noexcept;
118118
119 // capacity:119 // capacity:
120 bool empty() const noexcept;120 constexpr bool empty() const noexcept;
121 size_type size() const noexcept;121 constexpr size_type size() const noexcept;
122 size_type max_size() const noexcept;122 constexpr size_type max_size() const noexcept;
123123
124 // element access:124 // element access:
125 mapped_type& operator[](const key_type& k);125 constexpr mapped_type& operator[](const key_type& k);
126 mapped_type& operator[](key_type&& k);126 constexpr mapped_type& operator[](key_type&& k);
127127
128 mapped_type& at(const key_type& k);128 constexpr mapped_type& at(const key_type& k);
129 const mapped_type& at(const key_type& k) const;129 constexpr const mapped_type& at(const key_type& k) const;
130130
131 // modifiers:131 // modifiers:
132 template <class... Args>132 template <class... Args>
133 pair<iterator, bool> emplace(Args&&... args);133 constexpr pair<iterator, bool> emplace(Args&&... args);
134 template <class... Args>134 template <class... Args>
135 iterator emplace_hint(const_iterator position, Args&&... args);135 constexpr iterator emplace_hint(const_iterator position, Args&&... args);
136 pair<iterator, bool> insert(const value_type& v);136 constexpr pair<iterator, bool> insert(const value_type& v);
137 pair<iterator, bool> insert( value_type&& v); // C++17137 constexpr pair<iterator, bool> insert( value_type&& v); // C++17
138 template <class P>138 template <class P> constexpr pair<iterator, bool> insert(P&& p);
139 pair<iterator, bool> insert(P&& p);139 constexpr iterator insert(const_iterator position, const value_type& v);
140 iterator insert(const_iterator position, const value_type& v);140 constexpr iterator insert(const_iterator position, value_type&& v); // C++17
141 iterator insert(const_iterator position, value_type&& v); // C++17141 template <class P> constexpr iterator insert(const_iterator position, P&& p);
142 template <class P>142 template <class InputIterator> constexpr void insert(InputIterator first, InputIterator last);
143 iterator insert(const_iterator position, P&& p);143
144 template <class InputIterator>
145 void insert(InputIterator first, InputIterator last);
146 template<container-compatible-range<value_type> R>144 template<container-compatible-range<value_type> R>
147 void insert_range(R&& rg); // C++23145 constexpr void insert_range(R&& rg); // C++23
148 void insert(initializer_list<value_type> il);146 constexpr void insert(initializer_list<value_type> il);
149147
150 node_type extract(const_iterator position); // C++17148 constexpr node_type extract(const_iterator position); // C++17
151 node_type extract(const key_type& x); // C++17149 constexpr node_type extract(const key_type& x); // C++17
152 insert_return_type insert(node_type&& nh); // C++17150 constexpr insert_return_type insert(node_type&& nh); // C++17
153 iterator insert(const_iterator hint, node_type&& nh); // C++17151 constexpr iterator insert(const_iterator hint, node_type&& nh); // C++17
154152
155 template <class... Args>153 template <class... Args>
156 pair<iterator, bool> try_emplace(const key_type& k, Args&&... args); // C++17154 constexpr pair<iterator, bool> try_emplace(const key_type& k, Args&&... args); // C++17
157 template <class... Args>155 template <class... Args>
158 pair<iterator, bool> try_emplace(key_type&& k, Args&&... args); // C++17156 constexpr pair<iterator, bool> try_emplace(key_type&& k, Args&&... args); // C++17
159 template <class... Args>157 template <class... Args>
160 iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17158 constexpr iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17
161 template <class... Args>159 template <class... Args>
162 iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17160 constexpr iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17
163 template <class M>161 template <class M>
164 pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj); // C++17162 constexpr pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj); // C++17
165 template <class M>163 template <class M>
166 pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj); // C++17164 constexpr pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj); // C++17
167 template <class M>165 template <class M>
168 iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17166 constexpr iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17
169 template <class M>167 template <class M>
170 iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17168 constexpr iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17
171169
172 iterator erase(const_iterator position);170 constexpr iterator erase(const_iterator position);
173 iterator erase(iterator position); // C++14171 constexpr iterator erase(iterator position); // C++14
174 size_type erase(const key_type& k);172 constexpr size_type erase(const key_type& k);
175 iterator erase(const_iterator first, const_iterator last);173 constexpr iterator erase(const_iterator first, const_iterator last);
176 void clear() noexcept;174 constexpr void clear() noexcept;
177175
178 template<class C2>176 template<class C2>
179 void merge(map<Key, T, C2, Allocator>& source); // C++17177 constexpr void merge(map<Key, T, C2, Allocator>& source); // C++17
180 template<class C2>178 template<class C2>
181 void merge(map<Key, T, C2, Allocator>&& source); // C++17179 constexpr void merge(map<Key, T, C2, Allocator>&& source); // C++17
182 template<class C2>180 template<class C2>
183 void merge(multimap<Key, T, C2, Allocator>& source); // C++17181 constexpr void merge(multimap<Key, T, C2, Allocator>& source); // C++17
184 template<class C2>182 template<class C2>
185 void merge(multimap<Key, T, C2, Allocator>&& source); // C++17183 constexpr void merge(multimap<Key, T, C2, Allocator>&& source); // C++17
186184
187 void swap(map& m)185 constexpr void swap(map& m)
188 noexcept(allocator_traits<allocator_type>::is_always_equal::value &&186 noexcept(allocator_traits<allocator_type>::is_always_equal::value &&
189 is_nothrow_swappable<key_compare>::value); // C++17187 is_nothrow_swappable<key_compare>::value); // C++17
190188
191 // observers:189 // observers:
192 allocator_type get_allocator() const noexcept;190 constexpr allocator_type get_allocator() const noexcept;
193 key_compare key_comp() const;191 constexpr key_compare key_comp() const;
194 value_compare value_comp() const;192 constexpr value_compare value_comp() const;
195193
196 // map operations:194 // map operations:
197 iterator find(const key_type& k);195 constexpr iterator find(const key_type& k);
198 const_iterator find(const key_type& k) const;196 constexpr const_iterator find(const key_type& k) const;
199 template<typename K>197 template<typename K>
200 iterator find(const K& x); // C++14198 constexpr iterator find(const K& x); // C++14
201 template<typename K>199 template<typename K>
202 const_iterator find(const K& x) const; // C++14200 constexpr const_iterator find(const K& x) const; // C++14
203201
204 template<typename K>202 template<typename K>
205 size_type count(const K& x) const; // C++14203 constexpr size_type count(const K& x) const; // C++14
206 size_type count(const key_type& k) const;204 constexpr size_type count(const key_type& k) const;
207205
208 bool contains(const key_type& x) const; // C++20206 constexpr bool contains(const key_type& x) const; // C++20
209 template<class K> bool contains(const K& x) const; // C++20207 template<class K> constexpr bool contains(const K& x) const; // C++20
210208
211 iterator lower_bound(const key_type& k);209 constexpr iterator lower_bound(const key_type& k);
212 const_iterator lower_bound(const key_type& k) const;210 constexpr const_iterator lower_bound(const key_type& k) const;
213 template<typename K>211 template<typename K>
214 iterator lower_bound(const K& x); // C++14212 constexpr iterator lower_bound(const K& x); // C++14
215 template<typename K>213 template<typename K>
216 const_iterator lower_bound(const K& x) const; // C++14214 constexpr const_iterator lower_bound(const K& x) const; // C++14
217215
218 iterator upper_bound(const key_type& k);216 constexpr iterator upper_bound(const key_type& k);
219 const_iterator upper_bound(const key_type& k) const;217 constexpr const_iterator upper_bound(const key_type& k) const;
220 template<typename K>218 template<typename K>
221 iterator upper_bound(const K& x); // C++14219 constexpr iterator upper_bound(const K& x); // C++14
222 template<typename K>220 template<typename K>
223 const_iterator upper_bound(const K& x) const; // C++14221 constexpr const_iterator upper_bound(const K& x) const; // C++14
224222
225 pair<iterator,iterator> equal_range(const key_type& k);223 constexpr pair<iterator,iterator> equal_range(const key_type& k);
226 pair<const_iterator,const_iterator> equal_range(const key_type& k) const;224 constexpr pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
227 template<typename K>225 template<typename K>
228 pair<iterator,iterator> equal_range(const K& x); // C++14226 constexpr pair<iterator,iterator> equal_range(const K& x); // C++14
229 template<typename K>227 template<typename K>
230 pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14228 constexpr pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14
231};229};
232230
233template <class InputIterator,231template <class InputIterator,
...@@ -370,12 +368,12 @@ public:...@@ -370,12 +368,12 @@ public:
370 const allocator_type& a);368 const allocator_type& a);
371 template <class InputIterator>369 template <class InputIterator>
372 multimap(InputIterator first, InputIterator last, const allocator_type& a)370 multimap(InputIterator first, InputIterator last, const allocator_type& a)
373 : multimap(first, last, Compare(), a) {} // C++14371 : multimap(first, last, Compare(), a) {}
374 template<container-compatible-range<value_type> R>372 template<container-compatible-range<value_type> R>
375 multimap(from_range_t, R&& rg, const Allocator& a))373 multimap(from_range_t, R&& rg, const Allocator& a))
376 : multimap(from_range, std::forward<R>(rg), Compare(), a) { } // C++23374 : multimap(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
377 multimap(initializer_list<value_type> il, const allocator_type& a)375 multimap(initializer_list<value_type> il, const allocator_type& a)
378 : multimap(il, Compare(), a) {} // C++14376 : multimap(il, Compare(), a) {}
379 ~multimap();377 ~multimap();
380378
381 multimap& operator=(const multimap& m);379 multimap& operator=(const multimap& m);
...@@ -411,7 +409,7 @@ public:...@@ -411,7 +409,7 @@ public:
411 template <class... Args>409 template <class... Args>
412 iterator emplace(Args&&... args);410 iterator emplace(Args&&... args);
413 template <class... Args>411 template <class... Args>
414 iterator emplace_hint(const_iterator position, Args&&... args);412 iterator emplace_hint(const_iterator position, Args&&... args);
415 iterator insert(const value_type& v);413 iterator insert(const value_type& v);
416 iterator insert( value_type&& v); // C++17414 iterator insert( value_type&& v); // C++17
417 template <class P>415 template <class P>
...@@ -641,28 +639,37 @@ class __map_value_compare {...@@ -641,28 +639,37 @@ class __map_value_compare {
641 _LIBCPP_COMPRESSED_ELEMENT(_Compare, __comp_);639 _LIBCPP_COMPRESSED_ELEMENT(_Compare, __comp_);
642640
643public:641public:
644 _LIBCPP_HIDE_FROM_ABI __map_value_compare() _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)642 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_value_compare()
643 _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
645 : __comp_() {}644 : __comp_() {}
646 _LIBCPP_HIDE_FROM_ABI __map_value_compare(_Compare __c) _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)645 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_value_compare(_Compare __c)
646 _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
647 : __comp_(__c) {}647 : __comp_(__c) {}
648 _LIBCPP_HIDE_FROM_ABI const _Compare& key_comp() const _NOEXCEPT { return __comp_; }648 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const _Compare& key_comp() const _NOEXCEPT { return __comp_; }
649649
650 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _CP& __y) const { return __comp_(__x.first, __y.first); }650 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool operator()(const _CP& __x, const _CP& __y) const {
651 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _Key& __y) const { return __comp_(__x.first, __y); }651 return __comp_(__x.first, __y.first);
652 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Key& __x, const _CP& __y) const { return __comp_(__x, __y.first); }652 }
653 _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) {653 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool operator()(const _CP& __x, const _Key& __y) const {
654 return __comp_(__x.first, __y);
655 }
656 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool operator()(const _Key& __x, const _CP& __y) const {
657 return __comp_(__x, __y.first);
658 }
659 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(__map_value_compare& __y)
660 _NOEXCEPT_(__is_nothrow_swappable_v<_Compare>) {
654 using std::swap;661 using std::swap;
655 swap(__comp_, __y.__comp_);662 swap(__comp_, __y.__comp_);
656 }663 }
657664
658# if _LIBCPP_STD_VER >= 14665# if _LIBCPP_STD_VER >= 14
659 template <typename _K2>666 template <typename _K2>
660 _LIBCPP_HIDE_FROM_ABI bool operator()(const _K2& __x, const _CP& __y) const {667 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool operator()(const _K2& __x, const _CP& __y) const {
661 return __comp_(__x, __y.first);668 return __comp_(__x, __y.first);
662 }669 }
663670
664 template <typename _K2>671 template <typename _K2>
665 _LIBCPP_HIDE_FROM_ABI bool operator()(const _CP& __x, const _K2& __y) const {672 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool operator()(const _CP& __x, const _K2& __y) const {
666 return __comp_(__x.first, __y);673 return __comp_(__x.first, __y);
667 }674 }
668# endif675# endif
...@@ -678,11 +685,11 @@ template <class _MapValueT, class _Key, class _Compare>...@@ -678,11 +685,11 @@ template <class _MapValueT, class _Key, class _Compare>
678struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _MapValueT, _MapValueT> {685struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _MapValueT, _MapValueT> {
679 __lazy_synth_three_way_comparator<_Compare, _Key, _Key> __comp_;686 __lazy_synth_three_way_comparator<_Compare, _Key, _Key> __comp_;
680687
681 __lazy_synth_three_way_comparator(688 _LIBCPP_CONSTEXPR_SINCE_CXX26 __lazy_synth_three_way_comparator(
682 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)689 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)
683 : __comp_(__comp.key_comp()) {}690 : __comp_(__comp.key_comp()) {}
684691
685 _LIBCPP_HIDE_FROM_ABI auto692 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 auto
686 operator()(_LIBCPP_LIFETIMEBOUND const _MapValueT& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {693 operator()(_LIBCPP_LIFETIMEBOUND const _MapValueT& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {
687 return __comp_(__lhs.first, __rhs.first);694 return __comp_(__lhs.first, __rhs.first);
688 }695 }
...@@ -692,11 +699,11 @@ template <class _MapValueT, class _Key, class _TransparentKey, class _Compare>...@@ -692,11 +699,11 @@ template <class _MapValueT, class _Key, class _TransparentKey, class _Compare>
692struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _TransparentKey, _MapValueT> {699struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _Compare>, _TransparentKey, _MapValueT> {
693 __lazy_synth_three_way_comparator<_Compare, _TransparentKey, _Key> __comp_;700 __lazy_synth_three_way_comparator<_Compare, _TransparentKey, _Key> __comp_;
694701
695 __lazy_synth_three_way_comparator(702 _LIBCPP_CONSTEXPR_SINCE_CXX26 __lazy_synth_three_way_comparator(
696 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)703 _LIBCPP_CTOR_LIFETIMEBOUND const __map_value_compare<_Key, _MapValueT, _Compare>& __comp)
697 : __comp_(__comp.key_comp()) {}704 : __comp_(__comp.key_comp()) {}
698705
699 _LIBCPP_HIDE_FROM_ABI auto706 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 auto
700 operator()(_LIBCPP_LIFETIMEBOUND const _TransparentKey& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {707 operator()(_LIBCPP_LIFETIMEBOUND const _TransparentKey& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {
701 return __comp_(__lhs, __rhs.first);708 return __comp_(__lhs, __rhs.first);
702 }709 }
...@@ -718,7 +725,7 @@ struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _...@@ -718,7 +725,7 @@ struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _
718# endif // _LIBCPP_STD_VER >= 14725# endif // _LIBCPP_STD_VER >= 14
719726
720template <class _Key, class _CP, class _Compare>727template <class _Key, class _CP, class _Compare>
721inline _LIBCPP_HIDE_FROM_ABI void728inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
722swap(__map_value_compare<_Key, _CP, _Compare>& __x, __map_value_compare<_Key, _CP, _Compare>& __y)729swap(__map_value_compare<_Key, _CP, _Compare>& __x, __map_value_compare<_Key, _CP, _Compare>& __y)
723 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {730 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
724 __x.swap(__y);731 __x.swap(__y);
...@@ -779,37 +786,41 @@ public:...@@ -779,37 +786,41 @@ public:
779 using reference = value_type&;786 using reference = value_type&;
780 using pointer = typename _TreeIterator::pointer;787 using pointer = typename _TreeIterator::pointer;
781788
782 _LIBCPP_HIDE_FROM_ABI __map_iterator() _NOEXCEPT {}789 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_iterator() _NOEXCEPT {}
783790
784 _LIBCPP_HIDE_FROM_ABI __map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}791 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
785792
786 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return *__i_; }793 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator*() const { return *__i_; }
787 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return pointer_traits<pointer>::pointer_to(*__i_); }794 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pointer operator->() const {
795 return pointer_traits<pointer>::pointer_to(*__i_);
796 }
788797
789 _LIBCPP_HIDE_FROM_ABI __map_iterator& operator++() {798 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_iterator& operator++() {
790 ++__i_;799 ++__i_;
791 return *this;800 return *this;
792 }801 }
793 _LIBCPP_HIDE_FROM_ABI __map_iterator operator++(int) {802 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_iterator operator++(int) {
794 __map_iterator __t(*this);803 __map_iterator __t(*this);
795 ++(*this);804 ++(*this);
796 return __t;805 return __t;
797 }806 }
798807
799 _LIBCPP_HIDE_FROM_ABI __map_iterator& operator--() {808 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_iterator& operator--() {
800 --__i_;809 --__i_;
801 return *this;810 return *this;
802 }811 }
803 _LIBCPP_HIDE_FROM_ABI __map_iterator operator--(int) {812 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_iterator operator--(int) {
804 __map_iterator __t(*this);813 __map_iterator __t(*this);
805 --(*this);814 --(*this);
806 return __t;815 return __t;
807 }816 }
808817
809 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const __map_iterator& __x, const __map_iterator& __y) {818 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
819 operator==(const __map_iterator& __x, const __map_iterator& __y) {
810 return __x.__i_ == __y.__i_;820 return __x.__i_ == __y.__i_;
811 }821 }
812 friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const __map_iterator& __x, const __map_iterator& __y) {822 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
823 operator!=(const __map_iterator& __x, const __map_iterator& __y) {
813 return __x.__i_ != __y.__i_;824 return __x.__i_ != __y.__i_;
814 }825 }
815826
...@@ -834,7 +845,8 @@ struct __specialized_algorithm<_Alg, __iterator_pair<__map_iterator<_TreeIterato...@@ -834,7 +845,8 @@ struct __specialized_algorithm<_Alg, __iterator_pair<__map_iterator<_TreeIterato
834 using __iterator _LIBCPP_NODEBUG = __map_iterator<_TreeIterator>;845 using __iterator _LIBCPP_NODEBUG = __map_iterator<_TreeIterator>;
835846
836 template <class... _Args>847 template <class... _Args>
837 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Args&&... __args) {848 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
849 operator()(__iterator __first, __iterator __last, _Args&&... __args) {
838 __base()(__first.__i_, __last.__i_, std::forward<_Args>(__args)...);850 __base()(__first.__i_, __last.__i_, std::forward<_Args>(__args)...);
839 }851 }
840};852};
...@@ -851,39 +863,43 @@ public:...@@ -851,39 +863,43 @@ public:
851 using reference = const value_type&;863 using reference = const value_type&;
852 using pointer = typename _TreeIterator::pointer;864 using pointer = typename _TreeIterator::pointer;
853865
854 _LIBCPP_HIDE_FROM_ABI __map_const_iterator() _NOEXCEPT {}866 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_const_iterator() _NOEXCEPT {}
855867
856 _LIBCPP_HIDE_FROM_ABI __map_const_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}868 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_const_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
857 _LIBCPP_HIDE_FROM_ABI869 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
858 __map_const_iterator(__map_iterator< typename _TreeIterator::__non_const_iterator> __i) _NOEXCEPT : __i_(__i.__i_) {}870 __map_const_iterator(__map_iterator< typename _TreeIterator::__non_const_iterator> __i) _NOEXCEPT : __i_(__i.__i_) {}
859871
860 _LIBCPP_HIDE_FROM_ABI reference operator*() const { return *__i_; }872 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator*() const { return *__i_; }
861 _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return pointer_traits<pointer>::pointer_to(*__i_); }873 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pointer operator->() const {
874 return pointer_traits<pointer>::pointer_to(*__i_);
875 }
862876
863 _LIBCPP_HIDE_FROM_ABI __map_const_iterator& operator++() {877 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_const_iterator& operator++() {
864 ++__i_;878 ++__i_;
865 return *this;879 return *this;
866 }880 }
867 _LIBCPP_HIDE_FROM_ABI __map_const_iterator operator++(int) {881 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_const_iterator operator++(int) {
868 __map_const_iterator __t(*this);882 __map_const_iterator __t(*this);
869 ++(*this);883 ++(*this);
870 return __t;884 return __t;
871 }885 }
872886
873 _LIBCPP_HIDE_FROM_ABI __map_const_iterator& operator--() {887 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_const_iterator& operator--() {
874 --__i_;888 --__i_;
875 return *this;889 return *this;
876 }890 }
877 _LIBCPP_HIDE_FROM_ABI __map_const_iterator operator--(int) {891 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __map_const_iterator operator--(int) {
878 __map_const_iterator __t(*this);892 __map_const_iterator __t(*this);
879 --(*this);893 --(*this);
880 return __t;894 return __t;
881 }895 }
882896
883 friend _LIBCPP_HIDE_FROM_ABI bool operator==(const __map_const_iterator& __x, const __map_const_iterator& __y) {897 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
898 operator==(const __map_const_iterator& __x, const __map_const_iterator& __y) {
884 return __x.__i_ == __y.__i_;899 return __x.__i_ == __y.__i_;
885 }900 }
886 friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y) {901 friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
902 operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y) {
887 return __x.__i_ != __y.__i_;903 return __x.__i_ != __y.__i_;
888 }904 }
889905
...@@ -910,7 +926,8 @@ struct __specialized_algorithm<...@@ -910,7 +926,8 @@ struct __specialized_algorithm<
910 using __iterator _LIBCPP_NODEBUG = __map_const_iterator<_TreeIterator>;926 using __iterator _LIBCPP_NODEBUG = __map_const_iterator<_TreeIterator>;
911927
912 template <class... _Args>928 template <class... _Args>
913 _LIBCPP_HIDE_FROM_ABI static void operator()(__iterator __first, __iterator __last, _Args&&... __args) {929 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
930 operator()(__iterator __first, __iterator __last, _Args&&... __args) {
914 __base()(__first.__i_, __last.__i_, std::forward<_Args>(__args)...);931 __base()(__first.__i_, __last.__i_, std::forward<_Args>(__args)...);
915 }932 }
916};933};
...@@ -940,10 +957,11 @@ public:...@@ -940,10 +957,11 @@ public:
940 protected:957 protected:
941 key_compare comp;958 key_compare comp;
942959
943 _LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : comp(__c) {}960 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare(key_compare __c) : comp(__c) {}
944961
945 public:962 public:
946 _LIBCPP_HIDE_FROM_ABI bool operator()(const value_type& __x, const value_type& __y) const {963 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
964 operator()(const value_type& __x, const value_type& __y) const {
947 return comp(__x.first, __y.first);965 return comp(__x.first, __y.first);
948 }966 }
949 };967 };
...@@ -979,26 +997,27 @@ public:...@@ -979,26 +997,27 @@ public:
979 template <class _Key2, class _Value2, class _Comp2, class _Alloc2>997 template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
980 friend class multimap;998 friend class multimap;
981999
982 _LIBCPP_HIDE_FROM_ABI map() _NOEXCEPT_(1000 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map() _NOEXCEPT_(
983 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&1001 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&
984 is_nothrow_copy_constructible<key_compare>::value)1002 is_nothrow_copy_constructible<key_compare>::value)
985 : __tree_(__vc(key_compare())) {}1003 : __tree_(__vc(key_compare())) {}
9861004
987 _LIBCPP_HIDE_FROM_ABI explicit map(const key_compare& __comp) _NOEXCEPT_(1005 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit map(const key_compare& __comp) _NOEXCEPT_(
988 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)1006 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)
989 : __tree_(__vc(__comp)) {}1007 : __tree_(__vc(__comp)) {}
9901008
991 _LIBCPP_HIDE_FROM_ABI explicit map(const key_compare& __comp, const allocator_type& __a)1009 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit map(const key_compare& __comp, const allocator_type& __a)
992 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}1010 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}
9931011
994 template <class _InputIterator>1012 template <class _InputIterator>
995 _LIBCPP_HIDE_FROM_ABI map(_InputIterator __f, _InputIterator __l, const key_compare& __comp = key_compare())1013 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1014 map(_InputIterator __f, _InputIterator __l, const key_compare& __comp = key_compare())
996 : __tree_(__vc(__comp)) {1015 : __tree_(__vc(__comp)) {
997 insert(__f, __l);1016 insert(__f, __l);
998 }1017 }
9991018
1000 template <class _InputIterator>1019 template <class _InputIterator>
1001 _LIBCPP_HIDE_FROM_ABI1020 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1002 map(_InputIterator __f, _InputIterator __l, const key_compare& __comp, const allocator_type& __a)1021 map(_InputIterator __f, _InputIterator __l, const key_compare& __comp, const allocator_type& __a)
1003 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {1022 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
1004 insert(__f, __l);1023 insert(__f, __l);
...@@ -1006,7 +1025,7 @@ public:...@@ -1006,7 +1025,7 @@ public:
10061025
1007# if _LIBCPP_STD_VER >= 231026# if _LIBCPP_STD_VER >= 23
1008 template <_ContainerCompatibleRange<value_type> _Range>1027 template <_ContainerCompatibleRange<value_type> _Range>
1009 _LIBCPP_HIDE_FROM_ABI1028 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1010 map(from_range_t,1029 map(from_range_t,
1011 _Range&& __range,1030 _Range&& __range,
1012 const key_compare& __comp = key_compare(),1031 const key_compare& __comp = key_compare(),
...@@ -1016,46 +1035,46 @@ public:...@@ -1016,46 +1035,46 @@ public:
1016 }1035 }
1017# endif1036# endif
10181037
1019# if _LIBCPP_STD_VER >= 14
1020 template <class _InputIterator>1038 template <class _InputIterator>
1021 _LIBCPP_HIDE_FROM_ABI map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)1039 _LIBCPP_HIDE_FROM_ABI
1040 _LIBCPP_CONSTEXPR_SINCE_CXX26 map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
1022 : map(__f, __l, key_compare(), __a) {}1041 : map(__f, __l, key_compare(), __a) {}
1023# endif
10241042
1025# if _LIBCPP_STD_VER >= 231043# if _LIBCPP_STD_VER >= 23
1026 template <_ContainerCompatibleRange<value_type> _Range>1044 template <_ContainerCompatibleRange<value_type> _Range>
1027 _LIBCPP_HIDE_FROM_ABI map(from_range_t, _Range&& __range, const allocator_type& __a)1045 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map(from_range_t, _Range&& __range, const allocator_type& __a)
1028 : map(from_range, std::forward<_Range>(__range), key_compare(), __a) {}1046 : map(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
1029# endif1047# endif
10301048
1031 _LIBCPP_HIDE_FROM_ABI map(const map& __m) = default;1049 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map(const map& __m) = default;
10321050
1033 _LIBCPP_HIDE_FROM_ABI map& operator=(const map& __m) = default;1051 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map& operator=(const map& __m) = default;
10341052
1035# ifndef _LIBCPP_CXX03_LANG1053# ifndef _LIBCPP_CXX03_LANG
10361054
1037 _LIBCPP_HIDE_FROM_ABI map(map&& __m) = default;1055 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map(map&& __m) = default;
10381056
1039 _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a) : __tree_(std::move(__m.__tree_), __a) {}1057 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map(map&& __m, const allocator_type& __a)
1058 : __tree_(std::move(__m.__tree_), __a) {}
10401059
1041 _LIBCPP_HIDE_FROM_ABI map& operator=(map&& __m) = default;1060 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map& operator=(map&& __m) = default;
10421061
1043 _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())1062 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1063 map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
1044 : __tree_(__vc(__comp)) {1064 : __tree_(__vc(__comp)) {
1045 insert(__il.begin(), __il.end());1065 insert(__il.begin(), __il.end());
1046 }1066 }
10471067
1048 _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)1068 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1069 map(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
1049 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {1070 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
1050 insert(__il.begin(), __il.end());1071 insert(__il.begin(), __il.end());
1051 }1072 }
10521073
1053# if _LIBCPP_STD_VER >= 141074 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map(initializer_list<value_type> __il, const allocator_type& __a)
1054 _LIBCPP_HIDE_FROM_ABI map(initializer_list<value_type> __il, const allocator_type& __a)
1055 : map(__il, key_compare(), __a) {}1075 : map(__il, key_compare(), __a) {}
1056# endif
10571076
1058 _LIBCPP_HIDE_FROM_ABI map& operator=(initializer_list<value_type> __il) {1077 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map& operator=(initializer_list<value_type> __il) {
1059 clear();1078 clear();
1060 insert(__il.begin(), __il.end());1079 insert(__il.begin(), __il.end());
1061 return *this;1080 return *this;
...@@ -1063,118 +1082,157 @@ public:...@@ -1063,118 +1082,157 @@ public:
10631082
1064# endif // _LIBCPP_CXX03_LANG1083# endif // _LIBCPP_CXX03_LANG
10651084
1066 _LIBCPP_HIDE_FROM_ABI explicit map(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}1085 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit map(const allocator_type& __a)
1086 : __tree_(typename __base::allocator_type(__a)) {}
10671087
1068 _LIBCPP_HIDE_FROM_ABI map(const map& __m, const allocator_type& __alloc) : __tree_(__m.__tree_, __alloc) {}1088 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 map(const map& __m, const allocator_type& __alloc)
1089 : __tree_(__m.__tree_, __alloc) {}
10691090
1070 _LIBCPP_HIDE_FROM_ABI ~map() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); }1091 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~map() {
1092 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");
1093 }
10711094
1072 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }1095 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT {
1073 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }1096 return __tree_.begin();
1074 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }1097 }
1075 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }1098 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT {
1099 return __tree_.begin();
1100 }
1101 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT {
1102 return __tree_.end();
1103 }
1104 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT {
1105 return __tree_.end();
1106 }
10761107
1077 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }1108 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT {
1078 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {1109 return reverse_iterator(end());
1110 }
1111 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
1112 rbegin() const _NOEXCEPT {
1079 return const_reverse_iterator(end());1113 return const_reverse_iterator(end());
1080 }1114 }
1081 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }1115 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT {
1082 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {1116 return reverse_iterator(begin());
1117 }
1118 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const _NOEXCEPT {
1083 return const_reverse_iterator(begin());1119 return const_reverse_iterator(begin());
1084 }1120 }
10851121
1086 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }1122 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT {
1087 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }1123 return begin();
1088 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }1124 }
1089 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1125 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT {
1126 return end();
1127 }
1128 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
1129 crbegin() const _NOEXCEPT {
1130 return rbegin();
1131 }
1132 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT {
1133 return rend();
1134 }
10901135
1091 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }1136 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const _NOEXCEPT {
1092 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }1137 return __tree_.size() == 0;
1093 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }1138 }
1139 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT {
1140 return __tree_.size();
1141 }
1142 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
1143 return __tree_.max_size();
1144 }
10941145
1095 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);1146 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator[](const key_type& __k);
1096# ifndef _LIBCPP_CXX03_LANG1147# ifndef _LIBCPP_CXX03_LANG
1097 _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);1148 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator[](key_type&& __k);
1098# endif1149# endif
10991150
1100 template <class _Arg,1151 template <class _Arg,
1101 __enable_if_t<__is_transparently_comparable_v<_Compare, key_type, __remove_cvref_t<_Arg> >, int> = 0>1152 __enable_if_t<__is_transparently_comparable_v<_Compare, key_type, __remove_cvref_t<_Arg> >, int> = 0>
1102 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& at(_Arg&& __arg) {1153 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(_Arg&& __arg) {
1103 auto [_, __child] = __tree_.__find_equal(__arg);1154 auto [__dummy, __child] = __tree_.__find_equal(__arg);
1104 if (__child == nullptr)1155 if (__child == nullptr)
1105 std::__throw_out_of_range("map::at: key not found");1156 std::__throw_out_of_range("map::at: key not found");
1106 return static_cast<__node_pointer>(__child)->__get_value().second;1157 return std::__static_fancy_pointer_cast<__node_pointer>(__child)->__get_value().second;
1107 }1158 }
11081159
1109 template <class _Arg,1160 template <class _Arg,
1110 __enable_if_t<__is_transparently_comparable_v<_Compare, key_type, __remove_cvref_t<_Arg> >, int> = 0>1161 __enable_if_t<__is_transparently_comparable_v<_Compare, key_type, __remove_cvref_t<_Arg> >, int> = 0>
1111 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const mapped_type& at(_Arg&& __arg) const {1162 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(_Arg&& __arg) const {
1112 auto [_, __child] = __tree_.__find_equal(__arg);1163 auto [__dummy, __child] = __tree_.__find_equal(__arg);
1113 if (__child == nullptr)1164 if (__child == nullptr)
1114 std::__throw_out_of_range("map::at: key not found");1165 std::__throw_out_of_range("map::at: key not found");
1115 return static_cast<__node_pointer>(__child)->__get_value().second;1166 return std::__static_fancy_pointer_cast<__node_pointer>(__child)->__get_value().second;
1116 }1167 }
11171168
1118 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);1169 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const key_type& __k);
1119 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const;1170 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type&
1171 at(const key_type& __k) const;
11201172
1121 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {1173 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const _NOEXCEPT {
1122 return allocator_type(__tree_.__alloc());1174 return allocator_type(__tree_.__alloc());
1123 }1175 }
1124 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }1176 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const {
1125 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const {1177 return __tree_.value_comp().key_comp();
1178 }
1179 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
1126 return value_compare(__tree_.value_comp().key_comp());1180 return value_compare(__tree_.value_comp().key_comp());
1127 }1181 }
11281182
1129# ifndef _LIBCPP_CXX03_LANG1183# ifndef _LIBCPP_CXX03_LANG
1130 template <class... _Args>1184 template <class... _Args>
1131 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {1185 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> emplace(_Args&&... __args) {
1132 return __tree_.__emplace_unique(std::forward<_Args>(__args)...);1186 return __tree_.__emplace_unique(std::forward<_Args>(__args)...);
1133 }1187 }
11341188
1135 template <class... _Args>1189 template <class... _Args>
1136 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {1190 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __p, _Args&&... __args) {
1137 return __tree_.__emplace_hint_unique(__p.__i_, std::forward<_Args>(__args)...).first;1191 return __tree_.__emplace_hint_unique(__p.__i_, std::forward<_Args>(__args)...).first;
1138 }1192 }
11391193
1140 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>1194 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
1141 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __p) {1195 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(_Pp&& __p) {
1142 return __tree_.__emplace_unique(std::forward<_Pp>(__p));1196 return __tree_.__emplace_unique(std::forward<_Pp>(__p));
1143 }1197 }
11441198
1145 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>1199 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
1146 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {1200 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __pos, _Pp&& __p) {
1147 return __tree_.__emplace_hint_unique(__pos.__i_, std::forward<_Pp>(__p)).first;1201 return __tree_.__emplace_hint_unique(__pos.__i_, std::forward<_Pp>(__p)).first;
1148 }1202 }
11491203
1150# endif // _LIBCPP_CXX03_LANG1204# endif // _LIBCPP_CXX03_LANG
11511205
1152 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__emplace_unique(__v); }1206 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(const value_type& __v) {
1207 return __tree_.__emplace_unique(__v);
1208 }
11531209
1154 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {1210 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v) {
1155 return __tree_.__emplace_hint_unique(__p.__i_, __v).first;1211 return __tree_.__emplace_hint_unique(__p.__i_, __v).first;
1156 }1212 }
11571213
1158# ifndef _LIBCPP_CXX03_LANG1214# ifndef _LIBCPP_CXX03_LANG
1159 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) {1215 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(value_type&& __v) {
1160 return __tree_.__emplace_unique(std::move(__v));1216 return __tree_.__emplace_unique(std::move(__v));
1161 }1217 }
11621218
1163 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {1219 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v) {
1164 return __tree_.__emplace_hint_unique(__p.__i_, std::move(__v)).first;1220 return __tree_.__emplace_hint_unique(__p.__i_, std::move(__v)).first;
1165 }1221 }
11661222
1167 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }1223 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
1224 insert(__il.begin(), __il.end());
1225 }
1168# endif1226# endif
11691227
1170 template <class _InputIterator>1228 template <class _InputIterator>
1171 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {1229 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __first, _InputIterator __last) {
1172 __tree_.__insert_range_unique(__first, __last);1230 __tree_.__insert_range_unique(__first, __last);
1173 }1231 }
11741232
1175# if _LIBCPP_STD_VER >= 231233# if _LIBCPP_STD_VER >= 23
1176 template <_ContainerCompatibleRange<value_type> _Range>1234 template <_ContainerCompatibleRange<value_type> _Range>
1177 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {1235 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
1178 __tree_.__insert_range_unique(ranges::begin(__range), ranges::end(__range));1236 __tree_.__insert_range_unique(ranges::begin(__range), ranges::end(__range));
1179 }1237 }
1180# endif1238# endif
...@@ -1182,13 +1240,15 @@ public:...@@ -1182,13 +1240,15 @@ public:
1182# if _LIBCPP_STD_VER >= 171240# if _LIBCPP_STD_VER >= 17
11831241
1184 template <class... _Args>1242 template <class... _Args>
1185 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args) {1243 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
1244 try_emplace(const key_type& __k, _Args&&... __args) {
1186 return __tree_.__emplace_unique(1245 return __tree_.__emplace_unique(
1187 std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple(std::forward<_Args>(__args)...));1246 std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple(std::forward<_Args>(__args)...));
1188 }1247 }
11891248
1190 template <class... _Args>1249 template <class... _Args>
1191 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args) {1250 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
1251 try_emplace(key_type&& __k, _Args&&... __args) {
1192 return __tree_.__emplace_unique(1252 return __tree_.__emplace_unique(
1193 std::piecewise_construct,1253 std::piecewise_construct,
1194 std::forward_as_tuple(std::move(__k)),1254 std::forward_as_tuple(std::move(__k)),
...@@ -1196,7 +1256,8 @@ public:...@@ -1196,7 +1256,8 @@ public:
1196 }1256 }
11971257
1198 template <class... _Args>1258 template <class... _Args>
1199 _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) {1259 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1260 try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) {
1200 return __tree_1261 return __tree_
1201 .__emplace_hint_unique(1262 .__emplace_hint_unique(
1202 __h.__i_,1263 __h.__i_,
...@@ -1207,7 +1268,8 @@ public:...@@ -1207,7 +1268,8 @@ public:
1207 }1268 }
12081269
1209 template <class... _Args>1270 template <class... _Args>
1210 _LIBCPP_HIDE_FROM_ABI iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) {1271 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1272 try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) {
1211 return __tree_1273 return __tree_
1212 .__emplace_hint_unique(1274 .__emplace_hint_unique(
1213 __h.__i_,1275 __h.__i_,
...@@ -1218,7 +1280,8 @@ public:...@@ -1218,7 +1280,8 @@ public:
1218 }1280 }
12191281
1220 template <class _Vp>1282 template <class _Vp>
1221 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {1283 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
1284 insert_or_assign(const key_type& __k, _Vp&& __v) {
1222 auto __result = __tree_.__emplace_unique(__k, std::forward<_Vp>(__v));1285 auto __result = __tree_.__emplace_unique(__k, std::forward<_Vp>(__v));
1223 auto& [__iter, __inserted] = __result;1286 auto& [__iter, __inserted] = __result;
1224 if (!__inserted)1287 if (!__inserted)
...@@ -1227,7 +1290,7 @@ public:...@@ -1227,7 +1290,7 @@ public:
1227 }1290 }
12281291
1229 template <class _Vp>1292 template <class _Vp>
1230 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {1293 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
1231 auto __result = __tree_.__emplace_unique(std::move(__k), std::forward<_Vp>(__v));1294 auto __result = __tree_.__emplace_unique(std::move(__k), std::forward<_Vp>(__v));
1232 auto& [__iter, __inserted] = __result;1295 auto& [__iter, __inserted] = __result;
1233 if (!__inserted)1296 if (!__inserted)
...@@ -1236,7 +1299,8 @@ public:...@@ -1236,7 +1299,8 @@ public:
1236 }1299 }
12371300
1238 template <class _Vp>1301 template <class _Vp>
1239 _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) {1302 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1303 insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) {
1240 auto [__r, __inserted] = __tree_.__emplace_hint_unique(__h.__i_, __k, std::forward<_Vp>(__v));1304 auto [__r, __inserted] = __tree_.__emplace_hint_unique(__h.__i_, __k, std::forward<_Vp>(__v));
12411305
1242 if (!__inserted)1306 if (!__inserted)
...@@ -1246,7 +1310,8 @@ public:...@@ -1246,7 +1310,8 @@ public:
1246 }1310 }
12471311
1248 template <class _Vp>1312 template <class _Vp>
1249 _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) {1313 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
1314 insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) {
1250 auto [__r, __inserted] = __tree_.__emplace_hint_unique(__h.__i_, std::move(__k), std::forward<_Vp>(__v));1315 auto [__r, __inserted] = __tree_.__emplace_hint_unique(__h.__i_, std::move(__k), std::forward<_Vp>(__v));
12511316
1252 if (!__inserted)1317 if (!__inserted)
...@@ -1257,101 +1322,118 @@ public:...@@ -1257,101 +1322,118 @@ public:
12571322
1258# endif // _LIBCPP_STD_VER >= 171323# endif // _LIBCPP_STD_VER >= 17
12591324
1260 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p.__i_); }1325 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __p) {
1261 _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }1326 return __tree_.erase(__p.__i_);
1262 _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); }1327 }
1263 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) {1328 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }
1329 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __k) {
1330 return __tree_.__erase_unique(__k);
1331 }
1332 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __f, const_iterator __l) {
1264 return __tree_.erase(__f.__i_, __l.__i_);1333 return __tree_.erase(__f.__i_, __l.__i_);
1265 }1334 }
1266 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }1335 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() _NOEXCEPT { __tree_.clear(); }
12671336
1268# if _LIBCPP_STD_VER >= 171337# if _LIBCPP_STD_VER >= 17
1269 _LIBCPP_HIDE_FROM_ABI insert_return_type insert(node_type&& __nh) {1338 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 insert_return_type insert(node_type&& __nh) {
1270 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),1339 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
1271 "node_type with incompatible allocator passed to map::insert()");1340 "node_type with incompatible allocator passed to map::insert()");
1272 return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));1341 return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
1273 }1342 }
1274 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {1343 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, node_type&& __nh) {
1275 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),1344 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
1276 "node_type with incompatible allocator passed to map::insert()");1345 "node_type with incompatible allocator passed to map::insert()");
1277 return __tree_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));1346 return __tree_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
1278 }1347 }
1279 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1348 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(key_type const& __key) {
1280 return __tree_.template __node_handle_extract<node_type>(__key);1349 return __tree_.template __node_handle_extract<node_type>(__key);
1281 }1350 }
1282 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1351 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(const_iterator __it) {
1283 return __tree_.template __node_handle_extract<node_type>(__it.__i_);1352 return __tree_.template __node_handle_extract<node_type>(__it.__i_);
1284 }1353 }
1285 template <class _Compare2>1354 template <class _Compare2>
1286 _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source) {1355 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1356 merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source) {
1287 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1357 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1288 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1358 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1289 __tree_.__node_handle_merge_unique(__source.__tree_);1359 __tree_.__node_handle_merge_unique(__source.__tree_);
1290 }1360 }
1291 template <class _Compare2>1361 template <class _Compare2>
1292 _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source) {1362 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1363 merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
1293 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1364 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1294 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1365 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1295 __tree_.__node_handle_merge_unique(__source.__tree_);1366 __tree_.__node_handle_merge_unique(__source.__tree_);
1296 }1367 }
1297 template <class _Compare2>1368 template <class _Compare2>
1298 _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source) {1369 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1370 merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source) {
1299 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1371 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1300 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1372 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1301 __tree_.__node_handle_merge_unique(__source.__tree_);1373 __tree_.__node_handle_merge_unique(__source.__tree_);
1302 }1374 }
1303 template <class _Compare2>1375 template <class _Compare2>
1304 _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source) {1376 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1377 merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
1305 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1378 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1306 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1379 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1307 __tree_.__node_handle_merge_unique(__source.__tree_);1380 __tree_.__node_handle_merge_unique(__source.__tree_);
1308 }1381 }
1309# endif1382# endif
13101383
1311 _LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); }1384 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {
1385 __tree_.swap(__m.__tree_);
1386 }
13121387
1313 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }1388 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __k) {
1314 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }1389 return __tree_.find(__k);
1390 }
1391 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __k) const {
1392 return __tree_.find(__k);
1393 }
1315# if _LIBCPP_STD_VER >= 141394# if _LIBCPP_STD_VER >= 14
1316 template <typename _K2,1395 template <typename _K2,
1317 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1396 class _Comp = _Compare,
1318 int> = 0>1397 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1319 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1398 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _K2& __k) {
1320 return __tree_.find(__k);1399 return __tree_.find(__k);
1321 }1400 }
1322 template <typename _K2,1401 template <typename _K2,
1323 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1402 class _Comp = _Compare,
1324 int> = 0>1403 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1325 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1404 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _K2& __k) const {
1326 return __tree_.find(__k);1405 return __tree_.find(__k);
1327 }1406 }
1328# endif1407# endif
13291408
1330 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {1409 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __k) const {
1331 return __tree_.__count_unique(__k);1410 return __tree_.__count_unique(__k);
1332 }1411 }
1333# if _LIBCPP_STD_VER >= 141412# if _LIBCPP_STD_VER >= 14
1334 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1413 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1335 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1414 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _K2& __k) const {
1336 return __tree_.__count_multi(__k);1415 return __tree_.__count_multi(__k);
1337 }1416 }
1338# endif1417# endif
13391418
1340# if _LIBCPP_STD_VER >= 201419# if _LIBCPP_STD_VER >= 20
1341 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1420 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __k) const {
1421 return find(__k) != end();
1422 }
1342 template <typename _K2,1423 template <typename _K2,
1343 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1424 class _Comp = _Compare,
1344 int> = 0>1425 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1345 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1426 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _K2& __k) const {
1346 return find(__k) != end();1427 return find(__k) != end();
1347 }1428 }
1348# endif // _LIBCPP_STD_VER >= 201429# endif // _LIBCPP_STD_VER >= 20
13491430
1350 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {1431 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __k) {
1351 return __tree_.__lower_bound_unique(__k);1432 return __tree_.__lower_bound_unique(__k);
1352 }1433 }
13531434
1354 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {1435 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1436 lower_bound(const key_type& __k) const {
1355 return __tree_.__lower_bound_unique(__k);1437 return __tree_.__lower_bound_unique(__k);
1356 }1438 }
13571439
...@@ -1359,56 +1441,63 @@ public:...@@ -1359,56 +1441,63 @@ public:
1359 // match multiple elements.1441 // match multiple elements.
1360# if _LIBCPP_STD_VER >= 141442# if _LIBCPP_STD_VER >= 14
1361 template <typename _K2,1443 template <typename _K2,
1362 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1444 class _Comp = _Compare,
1363 int> = 0>1445 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1364 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {1446 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _K2& __k) {
1365 return __tree_.__lower_bound_multi(__k);1447 return __tree_.__lower_bound_multi(__k);
1366 }1448 }
13671449
1368 template <typename _K2,1450 template <typename _K2,
1369 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1451 class _Comp = _Compare,
1370 int> = 0>1452 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1371 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {1453 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1454 lower_bound(const _K2& __k) const {
1372 return __tree_.__lower_bound_multi(__k);1455 return __tree_.__lower_bound_multi(__k);
1373 }1456 }
1374# endif1457# endif
13751458
1376 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {1459 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __k) {
1377 return __tree_.__upper_bound_unique(__k);1460 return __tree_.__upper_bound_unique(__k);
1378 }1461 }
13791462
1380 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {1463 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1464 upper_bound(const key_type& __k) const {
1381 return __tree_.__upper_bound_unique(__k);1465 return __tree_.__upper_bound_unique(__k);
1382 }1466 }
13831467
1384# if _LIBCPP_STD_VER >= 141468# if _LIBCPP_STD_VER >= 14
1385 template <typename _K2,1469 template <typename _K2,
1386 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1470 class _Comp = _Compare,
1387 int> = 0>1471 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1388 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {1472 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _K2& __k) {
1389 return __tree_.__upper_bound_multi(__k);1473 return __tree_.__upper_bound_multi(__k);
1390 }1474 }
1391 template <typename _K2,1475 template <typename _K2,
1392 enable_if_t<__is_transparent_v<_Compare, _K2> || __is_transparently_comparable_v<_Compare, key_type, _K2>,1476 class _Comp = _Compare,
1393 int> = 0>1477 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1394 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {1478 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1479 upper_bound(const _K2& __k) const {
1395 return __tree_.__upper_bound_multi(__k);1480 return __tree_.__upper_bound_multi(__k);
1396 }1481 }
1397# endif1482# endif
13981483
1399 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1484 [[__nodiscard__]]
1485 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __k) {
1400 return __tree_.__equal_range_unique(__k);1486 return __tree_.__equal_range_unique(__k);
1401 }1487 }
1402 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1488 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
1489 equal_range(const key_type& __k) const {
1403 return __tree_.__equal_range_unique(__k);1490 return __tree_.__equal_range_unique(__k);
1404 }1491 }
1405# if _LIBCPP_STD_VER >= 141492# if _LIBCPP_STD_VER >= 14
1406 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1493 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1407 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1494 [[__nodiscard__]]
1495 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _K2& __k) {
1408 return __tree_.__equal_range_multi(__k);1496 return __tree_.__equal_range_multi(__k);
1409 }1497 }
1410 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1498 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1411 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1499 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
1500 equal_range(const _K2& __k) const {
1412 return __tree_.__equal_range_multi(__k);1501 return __tree_.__equal_range_multi(__k);
1413 }1502 }
1414# endif1503# endif
...@@ -1487,8 +1576,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<map<_Key,...@@ -1487,8 +1576,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<map<_Key,
1487 static const bool __has_algorithm = true;1576 static const bool __has_algorithm = true;
14881577
1489 template <class _Map, class _Func, class _Proj>1578 template <class _Map, class _Func, class _Proj>
1490 _LIBCPP_HIDE_FROM_ABI static auto operator()(_Map&& __map, _Func __func, _Proj __proj) {1579 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto operator()(_Map&& __map, _Func __func, _Proj __proj) {
1491 auto [_, __func2] = __specialized_algorithm<_Algorithm::__for_each, __single_range<typename __map::__base>>()(1580 auto [__dummy, __func2] = __specialized_algorithm<_Algorithm::__for_each, __single_range<typename __map::__base>>()(
1492 __map.__tree_, std::move(__func), std::move(__proj));1581 __map.__tree_, std::move(__func), std::move(__proj));
1493 return std::make_pair(__map.end(), std::move(__func2));1582 return std::make_pair(__map.end(), std::move(__func2));
1494 }1583 }
...@@ -1497,13 +1586,13 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<map<_Key,...@@ -1497,13 +1586,13 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<map<_Key,
14971586
1498# ifndef _LIBCPP_CXX03_LANG1587# ifndef _LIBCPP_CXX03_LANG
1499template <class _Key, class _Tp, class _Compare, class _Allocator>1588template <class _Key, class _Tp, class _Compare, class _Allocator>
1500_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {1589_LIBCPP_CONSTEXPR_SINCE_CXX26 _Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {
1501 return __tree_.__emplace_unique(std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())1590 return __tree_.__emplace_unique(std::piecewise_construct, std::forward_as_tuple(__k), std::forward_as_tuple())
1502 .first->second;1591 .first->second;
1503}1592}
15041593
1505template <class _Key, class _Tp, class _Compare, class _Allocator>1594template <class _Key, class _Tp, class _Compare, class _Allocator>
1506_Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) {1595_LIBCPP_CONSTEXPR_SINCE_CXX26 _Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) {
1507 return __tree_1596 return __tree_
1508 .__emplace_unique(std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())1597 .__emplace_unique(std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple())
1509 .first->second;1598 .first->second;
...@@ -1538,23 +1627,23 @@ _Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {...@@ -1538,23 +1627,23 @@ _Tp& map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) {
1538# endif // _LIBCPP_CXX03_LANG1627# endif // _LIBCPP_CXX03_LANG
15391628
1540template <class _Key, class _Tp, class _Compare, class _Allocator>1629template <class _Key, class _Tp, class _Compare, class _Allocator>
1541_Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) {1630_LIBCPP_CONSTEXPR_SINCE_CXX26 _Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) {
1542 auto [_, __child] = __tree_.__find_equal(__k);1631 auto [__dummy, __child] = __tree_.__find_equal(__k);
1543 if (__child == nullptr)1632 if (__child == nullptr)
1544 std::__throw_out_of_range("map::at: key not found");1633 std::__throw_out_of_range("map::at: key not found");
1545 return static_cast<__node_pointer>(__child)->__get_value().second;1634 return std::__static_fancy_pointer_cast<__node_pointer>(__child)->__get_value().second;
1546}1635}
15471636
1548template <class _Key, class _Tp, class _Compare, class _Allocator>1637template <class _Key, class _Tp, class _Compare, class _Allocator>
1549const _Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const {1638_LIBCPP_CONSTEXPR_SINCE_CXX26 const _Tp& map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const {
1550 auto [_, __child] = __tree_.__find_equal(__k);1639 auto [__dummy, __child] = __tree_.__find_equal(__k);
1551 if (__child == nullptr)1640 if (__child == nullptr)
1552 std::__throw_out_of_range("map::at: key not found");1641 std::__throw_out_of_range("map::at: key not found");
1553 return static_cast<__node_pointer>(__child)->__get_value().second;1642 return std::__static_fancy_pointer_cast<__node_pointer>(__child)->__get_value().second;
1554}1643}
15551644
1556template <class _Key, class _Tp, class _Compare, class _Allocator>1645template <class _Key, class _Tp, class _Compare, class _Allocator>
1557inline _LIBCPP_HIDE_FROM_ABI bool1646inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1558operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1647operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1559 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());1648 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
1560}1649}
...@@ -1562,31 +1651,31 @@ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp,...@@ -1562,31 +1651,31 @@ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp,
1562# if _LIBCPP_STD_VER <= 171651# if _LIBCPP_STD_VER <= 17
15631652
1564template <class _Key, class _Tp, class _Compare, class _Allocator>1653template <class _Key, class _Tp, class _Compare, class _Allocator>
1565inline _LIBCPP_HIDE_FROM_ABI bool1654inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1566operator<(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1655operator<(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1567 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());1656 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
1568}1657}
15691658
1570template <class _Key, class _Tp, class _Compare, class _Allocator>1659template <class _Key, class _Tp, class _Compare, class _Allocator>
1571inline _LIBCPP_HIDE_FROM_ABI bool1660inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1572operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1661operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1573 return !(__x == __y);1662 return !(__x == __y);
1574}1663}
15751664
1576template <class _Key, class _Tp, class _Compare, class _Allocator>1665template <class _Key, class _Tp, class _Compare, class _Allocator>
1577inline _LIBCPP_HIDE_FROM_ABI bool1666inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1578operator>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1667operator>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1579 return __y < __x;1668 return __y < __x;
1580}1669}
15811670
1582template <class _Key, class _Tp, class _Compare, class _Allocator>1671template <class _Key, class _Tp, class _Compare, class _Allocator>
1583inline _LIBCPP_HIDE_FROM_ABI bool1672inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1584operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1673operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1585 return !(__x < __y);1674 return !(__x < __y);
1586}1675}
15871676
1588template <class _Key, class _Tp, class _Compare, class _Allocator>1677template <class _Key, class _Tp, class _Compare, class _Allocator>
1589inline _LIBCPP_HIDE_FROM_ABI bool1678inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1590operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1679operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1591 return !(__y < __x);1680 return !(__y < __x);
1592}1681}
...@@ -1594,7 +1683,7 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp,...@@ -1594,7 +1683,7 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp,
1594# else // #if _LIBCPP_STD_VER <= 171683# else // #if _LIBCPP_STD_VER <= 17
15951684
1596template <class _Key, class _Tp, class _Compare, class _Allocator>1685template <class _Key, class _Tp, class _Compare, class _Allocator>
1597_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>1686_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<pair<const _Key, _Tp>>
1598operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {1687operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
1599 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);1688 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
1600}1689}
...@@ -1602,7 +1691,7 @@ operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp...@@ -1602,7 +1691,7 @@ operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp
1602# endif // #if _LIBCPP_STD_VER <= 171691# endif // #if _LIBCPP_STD_VER <= 17
16031692
1604template <class _Key, class _Tp, class _Compare, class _Allocator>1693template <class _Key, class _Tp, class _Compare, class _Allocator>
1605inline _LIBCPP_HIDE_FROM_ABI void1694inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1606swap(map<_Key, _Tp, _Compare, _Allocator>& __x, map<_Key, _Tp, _Compare, _Allocator>& __y)1695swap(map<_Key, _Tp, _Compare, _Allocator>& __x, map<_Key, _Tp, _Compare, _Allocator>& __y)
1607 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {1696 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
1608 __x.swap(__y);1697 __x.swap(__y);
...@@ -1610,7 +1699,7 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x, map<_Key, _Tp, _Compare, _Alloca...@@ -1610,7 +1699,7 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x, map<_Key, _Tp, _Compare, _Alloca
16101699
1611# if _LIBCPP_STD_VER >= 201700# if _LIBCPP_STD_VER >= 20
1612template <class _Key, class _Tp, class _Compare, class _Allocator, class _Predicate>1701template <class _Key, class _Tp, class _Compare, class _Allocator, class _Predicate>
1613inline _LIBCPP_HIDE_FROM_ABI typename map<_Key, _Tp, _Compare, _Allocator>::size_type1702inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename map<_Key, _Tp, _Compare, _Allocator>::size_type
1614erase_if(map<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {1703erase_if(map<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {
1615 return std::__libcpp_erase_if_container(__c, __pred);1704 return std::__libcpp_erase_if_container(__c, __pred);
1616}1705}
...@@ -1648,10 +1737,11 @@ public:...@@ -1648,10 +1737,11 @@ public:
1648 protected:1737 protected:
1649 key_compare comp;1738 key_compare comp;
16501739
1651 _LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : comp(__c) {}1740 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare(key_compare __c) : comp(__c) {}
16521741
1653 public:1742 public:
1654 _LIBCPP_HIDE_FROM_ABI bool operator()(const value_type& __x, const value_type& __y) const {1743 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1744 operator()(const value_type& __x, const value_type& __y) const {
1655 return comp(__x.first, __y.first);1745 return comp(__x.first, __y.first);
1656 }1746 }
1657 };1747 };
...@@ -1684,26 +1774,28 @@ public:...@@ -1684,26 +1774,28 @@ public:
1684 template <class _Key2, class _Value2, class _Comp2, class _Alloc2>1774 template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
1685 friend class multimap;1775 friend class multimap;
16861776
1687 _LIBCPP_HIDE_FROM_ABI multimap() _NOEXCEPT_(1777 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap() _NOEXCEPT_(
1688 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&1778 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&
1689 is_nothrow_copy_constructible<key_compare>::value)1779 is_nothrow_copy_constructible<key_compare>::value)
1690 : __tree_(__vc(key_compare())) {}1780 : __tree_(__vc(key_compare())) {}
16911781
1692 _LIBCPP_HIDE_FROM_ABI explicit multimap(const key_compare& __comp) _NOEXCEPT_(1782 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit multimap(const key_compare& __comp) _NOEXCEPT_(
1693 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)1783 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)
1694 : __tree_(__vc(__comp)) {}1784 : __tree_(__vc(__comp)) {}
16951785
1696 _LIBCPP_HIDE_FROM_ABI explicit multimap(const key_compare& __comp, const allocator_type& __a)1786 _LIBCPP_HIDE_FROM_ABI
1787 _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit multimap(const key_compare& __comp, const allocator_type& __a)
1697 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}1788 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}
16981789
1699 template <class _InputIterator>1790 template <class _InputIterator>
1700 _LIBCPP_HIDE_FROM_ABI multimap(_InputIterator __f, _InputIterator __l, const key_compare& __comp = key_compare())1791 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1792 multimap(_InputIterator __f, _InputIterator __l, const key_compare& __comp = key_compare())
1701 : __tree_(__vc(__comp)) {1793 : __tree_(__vc(__comp)) {
1702 insert(__f, __l);1794 insert(__f, __l);
1703 }1795 }
17041796
1705 template <class _InputIterator>1797 template <class _InputIterator>
1706 _LIBCPP_HIDE_FROM_ABI1798 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1707 multimap(_InputIterator __f, _InputIterator __l, const key_compare& __comp, const allocator_type& __a)1799 multimap(_InputIterator __f, _InputIterator __l, const key_compare& __comp, const allocator_type& __a)
1708 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {1800 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
1709 insert(__f, __l);1801 insert(__f, __l);
...@@ -1711,7 +1803,7 @@ public:...@@ -1711,7 +1803,7 @@ public:
17111803
1712# if _LIBCPP_STD_VER >= 231804# if _LIBCPP_STD_VER >= 23
1713 template <_ContainerCompatibleRange<value_type> _Range>1805 template <_ContainerCompatibleRange<value_type> _Range>
1714 _LIBCPP_HIDE_FROM_ABI1806 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1715 multimap(from_range_t,1807 multimap(from_range_t,
1716 _Range&& __range,1808 _Range&& __range,
1717 const key_compare& __comp = key_compare(),1809 const key_compare& __comp = key_compare(),
...@@ -1721,47 +1813,48 @@ public:...@@ -1721,47 +1813,48 @@ public:
1721 }1813 }
1722# endif1814# endif
17231815
1724# if _LIBCPP_STD_VER >= 14
1725 template <class _InputIterator>1816 template <class _InputIterator>
1726 _LIBCPP_HIDE_FROM_ABI multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)1817 _LIBCPP_HIDE_FROM_ABI
1818 _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
1727 : multimap(__f, __l, key_compare(), __a) {}1819 : multimap(__f, __l, key_compare(), __a) {}
1728# endif
17291820
1730# if _LIBCPP_STD_VER >= 231821# if _LIBCPP_STD_VER >= 23
1731 template <_ContainerCompatibleRange<value_type> _Range>1822 template <_ContainerCompatibleRange<value_type> _Range>
1732 _LIBCPP_HIDE_FROM_ABI multimap(from_range_t, _Range&& __range, const allocator_type& __a)1823 _LIBCPP_HIDE_FROM_ABI
1824 _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap(from_range_t, _Range&& __range, const allocator_type& __a)
1733 : multimap(from_range, std::forward<_Range>(__range), key_compare(), __a) {}1825 : multimap(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
1734# endif1826# endif
17351827
1736 _LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m) = default;1828 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap(const multimap& __m) = default;
17371829
1738 _LIBCPP_HIDE_FROM_ABI multimap& operator=(const multimap& __m) = default;1830 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap& operator=(const multimap& __m) = default;
17391831
1740# ifndef _LIBCPP_CXX03_LANG1832# ifndef _LIBCPP_CXX03_LANG
17411833
1742 _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m) = default;1834 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap(multimap&& __m) = default;
17431835
1744 _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a) : __tree_(std::move(__m.__tree_), __a) {}1836 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap(multimap&& __m, const allocator_type& __a)
1837 : __tree_(std::move(__m.__tree_), __a) {}
17451838
1746 _LIBCPP_HIDE_FROM_ABI multimap& operator=(multimap&& __m) = default;1839 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap& operator=(multimap&& __m) = default;
17471840
1748 _LIBCPP_HIDE_FROM_ABI multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())1841 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1842 multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
1749 : __tree_(__vc(__comp)) {1843 : __tree_(__vc(__comp)) {
1750 insert(__il.begin(), __il.end());1844 insert(__il.begin(), __il.end());
1751 }1845 }
17521846
1753 _LIBCPP_HIDE_FROM_ABI1847 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1754 multimap(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)1848 multimap(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
1755 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {1849 : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {
1756 insert(__il.begin(), __il.end());1850 insert(__il.begin(), __il.end());
1757 }1851 }
17581852
1759# if _LIBCPP_STD_VER >= 141853 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1760 _LIBCPP_HIDE_FROM_ABI multimap(initializer_list<value_type> __il, const allocator_type& __a)1854 multimap(initializer_list<value_type> __il, const allocator_type& __a)
1761 : multimap(__il, key_compare(), __a) {}1855 : multimap(__il, key_compare(), __a) {}
1762# endif
17631856
1764 _LIBCPP_HIDE_FROM_ABI multimap& operator=(initializer_list<value_type> __il) {1857 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap& operator=(initializer_list<value_type> __il) {
1765 clear();1858 clear();
1766 insert(__il.begin(), __il.end());1859 insert(__il.begin(), __il.end());
1767 return *this;1860 return *this;
...@@ -1769,234 +1862,309 @@ public:...@@ -1769,234 +1862,309 @@ public:
17691862
1770# endif // _LIBCPP_CXX03_LANG1863# endif // _LIBCPP_CXX03_LANG
17711864
1772 _LIBCPP_HIDE_FROM_ABI explicit multimap(const allocator_type& __a) : __tree_(typename __base::allocator_type(__a)) {}1865 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit multimap(const allocator_type& __a)
1866 : __tree_(typename __base::allocator_type(__a)) {}
17731867
1774 _LIBCPP_HIDE_FROM_ABI multimap(const multimap& __m, const allocator_type& __a) : __tree_(__m.__tree_, __a) {}1868 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multimap(const multimap& __m, const allocator_type& __a)
1869 : __tree_(__m.__tree_, __a) {}
17751870
1776 _LIBCPP_HIDE_FROM_ABI ~multimap() {1871 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~multimap() {
1777 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");1872 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");
1778 }1873 }
17791874
1780 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }1875 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT {
1781 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }1876 return __tree_.begin();
1782 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }1877 }
1783 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }1878 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT {
1879 return __tree_.begin();
1880 }
1881 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT {
1882 return __tree_.end();
1883 }
1884 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT {
1885 return __tree_.end();
1886 }
17841887
1785 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }1888 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT {
1786 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {1889 return reverse_iterator(end());
1890 }
1891 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
1892 rbegin() const _NOEXCEPT {
1787 return const_reverse_iterator(end());1893 return const_reverse_iterator(end());
1788 }1894 }
1789 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }1895 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT {
1790 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {1896 return reverse_iterator(begin());
1897 }
1898 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const _NOEXCEPT {
1791 return const_reverse_iterator(begin());1899 return const_reverse_iterator(begin());
1792 }1900 }
17931901
1794 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }1902 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT {
1795 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }1903 return begin();
1796 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }1904 }
1797 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1905 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT {
1906 return end();
1907 }
1908 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
1909 crbegin() const _NOEXCEPT {
1910 return rbegin();
1911 }
1912 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT {
1913 return rend();
1914 }
17981915
1799 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }1916 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const _NOEXCEPT {
1800 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }1917 return __tree_.size() == 0;
1801 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }1918 }
1919 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT {
1920 return __tree_.size();
1921 }
1922 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
1923 return __tree_.max_size();
1924 }
18021925
1803 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {1926 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const _NOEXCEPT {
1804 return allocator_type(__tree_.__alloc());1927 return allocator_type(__tree_.__alloc());
1805 }1928 }
1806 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp().key_comp(); }1929 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const {
1807 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const {1930 return __tree_.value_comp().key_comp();
1931 }
1932 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
1808 return value_compare(__tree_.value_comp().key_comp());1933 return value_compare(__tree_.value_comp().key_comp());
1809 }1934 }
18101935
1811# ifndef _LIBCPP_CXX03_LANG1936# ifndef _LIBCPP_CXX03_LANG
18121937
1813 template <class... _Args>1938 template <class... _Args>
1814 _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {1939 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace(_Args&&... __args) {
1815 return __tree_.__emplace_multi(std::forward<_Args>(__args)...);1940 return __tree_.__emplace_multi(std::forward<_Args>(__args)...);
1816 }1941 }
18171942
1818 template <class... _Args>1943 template <class... _Args>
1819 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {1944 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __p, _Args&&... __args) {
1820 return __tree_.__emplace_hint_multi(__p.__i_, std::forward<_Args>(__args)...);1945 return __tree_.__emplace_hint_multi(__p.__i_, std::forward<_Args>(__args)...);
1821 }1946 }
18221947
1823 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>1948 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
1824 _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __p) {1949 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(_Pp&& __p) {
1825 return __tree_.__emplace_multi(std::forward<_Pp>(__p));1950 return __tree_.__emplace_multi(std::forward<_Pp>(__p));
1826 }1951 }
18271952
1828 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>1953 template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
1829 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {1954 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __pos, _Pp&& __p) {
1830 return __tree_.__emplace_hint_multi(__pos.__i_, std::forward<_Pp>(__p));1955 return __tree_.__emplace_hint_multi(__pos.__i_, std::forward<_Pp>(__p));
1831 }1956 }
18321957
1833 _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__emplace_multi(std::move(__v)); }1958 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(value_type&& __v) {
1959 return __tree_.__emplace_multi(std::move(__v));
1960 }
18341961
1835 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {1962 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v) {
1836 return __tree_.__emplace_hint_multi(__p.__i_, std::move(__v));1963 return __tree_.__emplace_hint_multi(__p.__i_, std::move(__v));
1837 }1964 }
18381965
1839 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }1966 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
1967 insert(__il.begin(), __il.end());
1968 }
18401969
1841# endif // _LIBCPP_CXX03_LANG1970# endif // _LIBCPP_CXX03_LANG
18421971
1843 _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__emplace_multi(__v); }1972 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const value_type& __v) {
1973 return __tree_.__emplace_multi(__v);
1974 }
18441975
1845 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {1976 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v) {
1846 return __tree_.__emplace_hint_multi(__p.__i_, __v);1977 return __tree_.__emplace_hint_multi(__p.__i_, __v);
1847 }1978 }
18481979
1849 template <class _InputIterator>1980 template <class _InputIterator>
1850 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) {1981 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __f, _InputIterator __l) {
1851 __tree_.__insert_range_multi(__f, __l);1982 __tree_.__insert_range_multi(__f, __l);
1852 }1983 }
18531984
1854# if _LIBCPP_STD_VER >= 231985# if _LIBCPP_STD_VER >= 23
1855 template <_ContainerCompatibleRange<value_type> _Range>1986 template <_ContainerCompatibleRange<value_type> _Range>
1856 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {1987 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
1857 __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range));1988 __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range));
1858 }1989 }
1859# endif1990# endif
18601991
1861 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p.__i_); }1992 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __p) {
1862 _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }1993 return __tree_.erase(__p.__i_);
1863 _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); }1994 }
1864 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) {1995 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }
1996 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __k) {
1997 return __tree_.__erase_multi(__k);
1998 }
1999 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __f, const_iterator __l) {
1865 return __tree_.erase(__f.__i_, __l.__i_);2000 return __tree_.erase(__f.__i_, __l.__i_);
1866 }2001 }
18672002
1868# if _LIBCPP_STD_VER >= 172003# if _LIBCPP_STD_VER >= 17
1869 _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {2004 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(node_type&& __nh) {
1870 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),2005 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
1871 "node_type with incompatible allocator passed to multimap::insert()");2006 "node_type with incompatible allocator passed to multimap::insert()");
1872 return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));2007 return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));
1873 }2008 }
1874 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {2009 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, node_type&& __nh) {
1875 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),2010 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
1876 "node_type with incompatible allocator passed to multimap::insert()");2011 "node_type with incompatible allocator passed to multimap::insert()");
1877 return __tree_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));2012 return __tree_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
1878 }2013 }
1879 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {2014 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(key_type const& __key) {
1880 return __tree_.template __node_handle_extract<node_type>(__key);2015 return __tree_.template __node_handle_extract<node_type>(__key);
1881 }2016 }
1882 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {2017 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(const_iterator __it) {
1883 return __tree_.template __node_handle_extract<node_type>(__it.__i_);2018 return __tree_.template __node_handle_extract<node_type>(__it.__i_);
1884 }2019 }
1885 template <class _Compare2>2020 template <class _Compare2>
1886 _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source) {2021 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2022 merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source) {
1887 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(2023 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1888 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");2024 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1889 return __tree_.__node_handle_merge_multi(__source.__tree_);2025 return __tree_.__node_handle_merge_multi(__source.__tree_);
1890 }2026 }
1891 template <class _Compare2>2027 template <class _Compare2>
1892 _LIBCPP_HIDE_FROM_ABI void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source) {2028 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2029 merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
1893 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(2030 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1894 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");2031 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1895 return __tree_.__node_handle_merge_multi(__source.__tree_);2032 return __tree_.__node_handle_merge_multi(__source.__tree_);
1896 }2033 }
1897 template <class _Compare2>2034 template <class _Compare2>
1898 _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source) {2035 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2036 merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source) {
1899 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(2037 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1900 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");2038 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1901 return __tree_.__node_handle_merge_multi(__source.__tree_);2039 return __tree_.__node_handle_merge_multi(__source.__tree_);
1902 }2040 }
1903 template <class _Compare2>2041 template <class _Compare2>
1904 _LIBCPP_HIDE_FROM_ABI void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source) {2042 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2043 merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source) {
1905 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(2044 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1906 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");2045 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1907 return __tree_.__node_handle_merge_multi(__source.__tree_);2046 return __tree_.__node_handle_merge_multi(__source.__tree_);
1908 }2047 }
1909# endif2048# endif
19102049
1911 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }2050 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() _NOEXCEPT { __tree_.clear(); }
19122051
1913 _LIBCPP_HIDE_FROM_ABI void swap(multimap& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {2052 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(multimap& __m)
2053 _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {
1914 __tree_.swap(__m.__tree_);2054 __tree_.swap(__m.__tree_);
1915 }2055 }
19162056
1917 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }2057 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __k) {
1918 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }2058 return __tree_.find(__k);
2059 }
2060 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __k) const {
2061 return __tree_.find(__k);
2062 }
1919# if _LIBCPP_STD_VER >= 142063# if _LIBCPP_STD_VER >= 14
1920 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2064 template <typename _K2,
1921 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {2065 class _Comp = _Compare,
2066 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2067 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _K2& __k) {
1922 return __tree_.find(__k);2068 return __tree_.find(__k);
1923 }2069 }
1924 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2070 template <typename _K2,
1925 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {2071 class _Comp = _Compare,
2072 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2073 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _K2& __k) const {
1926 return __tree_.find(__k);2074 return __tree_.find(__k);
1927 }2075 }
1928# endif2076# endif
19292077
1930 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {2078 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __k) const {
1931 return __tree_.__count_multi(__k);2079 return __tree_.__count_multi(__k);
1932 }2080 }
1933# if _LIBCPP_STD_VER >= 142081# if _LIBCPP_STD_VER >= 14
1934 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2082 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1935 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {2083 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _K2& __k) const {
1936 return __tree_.__count_multi(__k);2084 return __tree_.__count_multi(__k);
1937 }2085 }
1938# endif2086# endif
19392087
1940# if _LIBCPP_STD_VER >= 202088# if _LIBCPP_STD_VER >= 20
1941 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }2089 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __k) const {
1942 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2090 return find(__k) != end();
1943 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {2091 }
2092 template <typename _K2,
2093 class _Comp = _Compare,
2094 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2095 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _K2& __k) const {
1944 return find(__k) != end();2096 return find(__k) != end();
1945 }2097 }
1946# endif // _LIBCPP_STD_VER >= 202098# endif // _LIBCPP_STD_VER >= 20
19472099
1948 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {2100 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __k) {
1949 return __tree_.__lower_bound_multi(__k);2101 return __tree_.__lower_bound_multi(__k);
1950 }2102 }
19512103
1952 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {2104 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
2105 lower_bound(const key_type& __k) const {
1953 return __tree_.__lower_bound_multi(__k);2106 return __tree_.__lower_bound_multi(__k);
1954 }2107 }
19552108
1956# if _LIBCPP_STD_VER >= 142109# if _LIBCPP_STD_VER >= 14
1957 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2110 template <typename _K2,
1958 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {2111 class _Comp = _Compare,
2112 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2113 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _K2& __k) {
1959 return __tree_.__lower_bound_multi(__k);2114 return __tree_.__lower_bound_multi(__k);
1960 }2115 }
19612116
1962 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2117 template <typename _K2,
1963 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {2118 class _Comp = _Compare,
2119 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2120 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
2121 lower_bound(const _K2& __k) const {
1964 return __tree_.__lower_bound_multi(__k);2122 return __tree_.__lower_bound_multi(__k);
1965 }2123 }
1966# endif2124# endif
19672125
1968 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {2126 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __k) {
1969 return __tree_.__upper_bound_multi(__k);2127 return __tree_.__upper_bound_multi(__k);
1970 }2128 }
19712129
1972 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {2130 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
2131 upper_bound(const key_type& __k) const {
1973 return __tree_.__upper_bound_multi(__k);2132 return __tree_.__upper_bound_multi(__k);
1974 }2133 }
19752134
1976# if _LIBCPP_STD_VER >= 142135# if _LIBCPP_STD_VER >= 14
1977 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2136 template <typename _K2,
1978 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {2137 class _Comp = _Compare,
2138 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2139 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _K2& __k) {
1979 return __tree_.__upper_bound_multi(__k);2140 return __tree_.__upper_bound_multi(__k);
1980 }2141 }
1981 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2142 template <typename _K2,
1982 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {2143 class _Comp = _Compare,
2144 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
2145 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
2146 upper_bound(const _K2& __k) const {
1983 return __tree_.__upper_bound_multi(__k);2147 return __tree_.__upper_bound_multi(__k);
1984 }2148 }
1985# endif2149# endif
19862150
1987 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {2151 [[__nodiscard__]]
2152 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __k) {
1988 return __tree_.__equal_range_multi(__k);2153 return __tree_.__equal_range_multi(__k);
1989 }2154 }
1990 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {2155 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
2156 equal_range(const key_type& __k) const {
1991 return __tree_.__equal_range_multi(__k);2157 return __tree_.__equal_range_multi(__k);
1992 }2158 }
1993# if _LIBCPP_STD_VER >= 142159# if _LIBCPP_STD_VER >= 14
1994 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2160 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1995 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {2161 [[__nodiscard__]]
2162 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _K2& __k) {
1996 return __tree_.__equal_range_multi(__k);2163 return __tree_.__equal_range_multi(__k);
1997 }2164 }
1998 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>2165 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1999 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {2166 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
2167 equal_range(const _K2& __k) const {
2000 return __tree_.__equal_range_multi(__k);2168 return __tree_.__equal_range_multi(__k);
2001 }2169 }
2002# endif2170# endif
...@@ -2070,8 +2238,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<multimap<_...@@ -2070,8 +2238,8 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<multimap<_
2070 static const bool __has_algorithm = true;2238 static const bool __has_algorithm = true;
20712239
2072 template <class _Map, class _Func, class _Proj>2240 template <class _Map, class _Func, class _Proj>
2073 _LIBCPP_HIDE_FROM_ABI static auto operator()(_Map&& __map, _Func __func, _Proj __proj) {2241 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto operator()(_Map&& __map, _Func __func, _Proj __proj) {
2074 auto [_, __func2] = __specialized_algorithm<_Algorithm::__for_each, __single_range<typename __map::__base>>()(2242 auto [__dummy, __func2] = __specialized_algorithm<_Algorithm::__for_each, __single_range<typename __map::__base>>()(
2075 __map.__tree_, std::move(__func), std::move(__proj));2243 __map.__tree_, std::move(__func), std::move(__proj));
2076 return std::make_pair(__map.end(), std::move(__func2));2244 return std::make_pair(__map.end(), std::move(__func2));
2077 }2245 }
...@@ -2079,7 +2247,7 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<multimap<_...@@ -2079,7 +2247,7 @@ struct __specialized_algorithm<_Algorithm::__for_each, __single_range<multimap<_
2079# endif2247# endif
20802248
2081template <class _Key, class _Tp, class _Compare, class _Allocator>2249template <class _Key, class _Tp, class _Compare, class _Allocator>
2082inline _LIBCPP_HIDE_FROM_ABI bool2250inline _LIBCPP_HIDE_FROM_ABI bool _LIBCPP_CONSTEXPR_SINCE_CXX26
2083operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2251operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2084 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());2252 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
2085}2253}
...@@ -2087,31 +2255,31 @@ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<...@@ -2087,31 +2255,31 @@ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<
2087# if _LIBCPP_STD_VER <= 172255# if _LIBCPP_STD_VER <= 17
20882256
2089template <class _Key, class _Tp, class _Compare, class _Allocator>2257template <class _Key, class _Tp, class _Compare, class _Allocator>
2090inline _LIBCPP_HIDE_FROM_ABI bool2258inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
2091operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2259operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2092 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());2260 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
2093}2261}
20942262
2095template <class _Key, class _Tp, class _Compare, class _Allocator>2263template <class _Key, class _Tp, class _Compare, class _Allocator>
2096inline _LIBCPP_HIDE_FROM_ABI bool2264inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
2097operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2265operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2098 return !(__x == __y);2266 return !(__x == __y);
2099}2267}
21002268
2101template <class _Key, class _Tp, class _Compare, class _Allocator>2269template <class _Key, class _Tp, class _Compare, class _Allocator>
2102inline _LIBCPP_HIDE_FROM_ABI bool2270inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
2103operator>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2271operator>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2104 return __y < __x;2272 return __y < __x;
2105}2273}
21062274
2107template <class _Key, class _Tp, class _Compare, class _Allocator>2275template <class _Key, class _Tp, class _Compare, class _Allocator>
2108inline _LIBCPP_HIDE_FROM_ABI bool2276inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
2109operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2277operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2110 return !(__x < __y);2278 return !(__x < __y);
2111}2279}
21122280
2113template <class _Key, class _Tp, class _Compare, class _Allocator>2281template <class _Key, class _Tp, class _Compare, class _Allocator>
2114inline _LIBCPP_HIDE_FROM_ABI bool2282inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
2115operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2283operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2116 return !(__y < __x);2284 return !(__y < __x);
2117}2285}
...@@ -2119,7 +2287,7 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<...@@ -2119,7 +2287,7 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x, const multimap<
2119# else // #if _LIBCPP_STD_VER <= 172287# else // #if _LIBCPP_STD_VER <= 17
21202288
2121template <class _Key, class _Tp, class _Compare, class _Allocator>2289template <class _Key, class _Tp, class _Compare, class _Allocator>
2122_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>2290_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<pair<const _Key, _Tp>>
2123operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,2291operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
2124 const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {2292 const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
2125 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);2293 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);
...@@ -2128,7 +2296,7 @@ operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,...@@ -2128,7 +2296,7 @@ operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
2128# endif // #if _LIBCPP_STD_VER <= 172296# endif // #if _LIBCPP_STD_VER <= 17
21292297
2130template <class _Key, class _Tp, class _Compare, class _Allocator>2298template <class _Key, class _Tp, class _Compare, class _Allocator>
2131inline _LIBCPP_HIDE_FROM_ABI void2299inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
2132swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x, multimap<_Key, _Tp, _Compare, _Allocator>& __y)2300swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x, multimap<_Key, _Tp, _Compare, _Allocator>& __y)
2133 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {2301 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
2134 __x.swap(__y);2302 __x.swap(__y);
...@@ -2136,7 +2304,7 @@ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x, multimap<_Key, _Tp, _Compar...@@ -2136,7 +2304,7 @@ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x, multimap<_Key, _Tp, _Compar
21362304
2137# if _LIBCPP_STD_VER >= 202305# if _LIBCPP_STD_VER >= 20
2138template <class _Key, class _Tp, class _Compare, class _Allocator, class _Predicate>2306template <class _Key, class _Tp, class _Compare, class _Allocator, class _Predicate>
2139inline _LIBCPP_HIDE_FROM_ABI typename multimap<_Key, _Tp, _Compare, _Allocator>::size_type2307inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename multimap<_Key, _Tp, _Compare, _Allocator>::size_type
2140erase_if(multimap<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {2308erase_if(multimap<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {
2141 return std::__libcpp_erase_if_container(__c, __pred);2309 return std::__libcpp_erase_if_container(__c, __pred);
2142}2310}
...@@ -2170,7 +2338,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -2170,7 +2338,7 @@ _LIBCPP_END_NAMESPACE_STD
21702338
2171_LIBCPP_POP_MACROS2339_LIBCPP_POP_MACROS
21722340
2173# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 202341# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
2174# include <concepts>2342# include <concepts>
2175# include <cstdlib>2343# include <cstdlib>
2176# include <functional>2344# include <functional>
lib/libcxx/include/mdspan+46-46
...@@ -46,15 +46,15 @@ namespace std {...@@ -46,15 +46,15 @@ namespace std {
46// extents synopsis46// extents synopsis
4747
48namespace std {48namespace std {
49 template<class _IndexType, size_t... _Extents>49 template<class IndexType, size_t... Extents>
50 class extents {50 class extents {
51 public:51 public:
52 using index_type = _IndexType;52 using index_type = IndexType;
53 using size_type = make_unsigned_t<index_type>;53 using size_type = make_unsigned_t<index_type>;
54 using rank_type = size_t;54 using rank_type = size_t;
5555
56 // [mdspan.extents.obs], observers of the multidimensional index space56 // [mdspan.extents.obs], observers of the multidimensional index space
57 static constexpr rank_type rank() noexcept { return sizeof...(_Extents); }57 static constexpr rank_type rank() noexcept { return sizeof...(Extents); }
58 static constexpr rank_type rank_dynamic() noexcept { return dynamic-index(rank()); }58 static constexpr rank_type rank_dynamic() noexcept { return dynamic-index(rank()); }
59 static constexpr size_t static_extent(rank_type) noexcept;59 static constexpr size_t static_extent(rank_type) noexcept;
60 constexpr index_type extent(rank_type) const noexcept;60 constexpr index_type extent(rank_type) const noexcept;
...@@ -62,20 +62,20 @@ namespace std {...@@ -62,20 +62,20 @@ namespace std {
62 // [mdspan.extents.cons], constructors62 // [mdspan.extents.cons], constructors
63 constexpr extents() noexcept = default;63 constexpr extents() noexcept = default;
6464
65 template<class _OtherIndexType, size_t... _OtherExtents>65 template<class OtherIndexType, size_t... OtherExtents>
66 constexpr explicit(see below)66 constexpr explicit(see below)
67 extents(const extents<_OtherIndexType, _OtherExtents...>&) noexcept;67 extents(const extents<OtherIndexType, OtherExtents...>&) noexcept;
68 template<class... _OtherIndexTypes>68 template<class... OtherIndexTypes>
69 constexpr explicit extents(_OtherIndexTypes...) noexcept;69 constexpr explicit extents(OtherIndexTypes...) noexcept;
70 template<class _OtherIndexType, size_t N>70 template<class OtherIndexType, size_t N>
71 constexpr explicit(N != rank_dynamic())71 constexpr explicit(N != rank_dynamic())
72 extents(span<_OtherIndexType, N>) noexcept;72 extents(span<OtherIndexType, N>) noexcept;
73 template<class _OtherIndexType, size_t N>73 template<class OtherIndexType, size_t N>
74 constexpr explicit(N != rank_dynamic())74 constexpr explicit(N != rank_dynamic())
75 extents(const array<_OtherIndexType, N>&) noexcept;75 extents(const array<OtherIndexType, N>&) noexcept;
7676
77 // [mdspan.extents.cmp], comparison operators77 // [mdspan.extents.cmp], comparison operators
78 template<class _OtherIndexType, size_t... _OtherExtents>78 template<class OtherIndexType, size_t... OtherExtents>
79 friend constexpr bool operator==(const extents&,79 friend constexpr bool operator==(const extents&,
80 const extents<_OtherIndexType, _OtherExtents...>&) noexcept;80 const extents<_OtherIndexType, _OtherExtents...>&) noexcept;
8181
...@@ -97,12 +97,12 @@ namespace std {...@@ -97,12 +97,12 @@ namespace std {
97 class layout_left::mapping {97 class layout_left::mapping {
98 public:98 public:
99 using extents_type = Extents;99 using extents_type = Extents;
100 using index_type = typename extents_type::index_type;100 using index_type = extents_type::index_type;
101 using size_type = typename extents_type::size_type;101 using size_type = extents_type::size_type;
102 using rank_type = typename extents_type::rank_type;102 using rank_type = extents_type::rank_type;
103 using layout_type = layout_left;103 using layout_type = layout_left;
104104
105 // [mdspan.layout.right.cons], constructors105 // [mdspan.layout.left.cons], constructors
106 constexpr mapping() noexcept = default;106 constexpr mapping() noexcept = default;
107 constexpr mapping(const mapping&) noexcept = default;107 constexpr mapping(const mapping&) noexcept = default;
108 constexpr mapping(const extents_type&) noexcept;108 constexpr mapping(const extents_type&) noexcept;
...@@ -118,7 +118,7 @@ namespace std {...@@ -118,7 +118,7 @@ namespace std {
118118
119 constexpr mapping& operator=(const mapping&) noexcept = default;119 constexpr mapping& operator=(const mapping&) noexcept = default;
120120
121 // [mdspan.layout.right.obs], observers121 // [mdspan.layout.left.obs], observers
122 constexpr const extents_type& extents() const noexcept { return extents_; }122 constexpr const extents_type& extents() const noexcept { return extents_; }
123123
124 constexpr index_type required_span_size() const noexcept;124 constexpr index_type required_span_size() const noexcept;
...@@ -151,9 +151,9 @@ namespace std {...@@ -151,9 +151,9 @@ namespace std {
151 class layout_right::mapping {151 class layout_right::mapping {
152 public:152 public:
153 using extents_type = Extents;153 using extents_type = Extents;
154 using index_type = typename extents_type::index_type;154 using index_type = extents_type::index_type;
155 using size_type = typename extents_type::size_type;155 using size_type = extents_type::size_type;
156 using rank_type = typename extents_type::rank_type;156 using rank_type = extents_type::rank_type;
157 using layout_type = layout_right;157 using layout_type = layout_right;
158158
159 // [mdspan.layout.right.cons], constructors159 // [mdspan.layout.right.cons], constructors
...@@ -205,9 +205,9 @@ namespace std {...@@ -205,9 +205,9 @@ namespace std {
205 class layout_stride::mapping {205 class layout_stride::mapping {
206 public:206 public:
207 using extents_type = Extents;207 using extents_type = Extents;
208 using index_type = typename extents_type::index_type;208 using index_type = extents_type::index_type;
209 using size_type = typename extents_type::size_type;209 using size_type = extents_type::size_type;
210 using rank_type = typename extents_type::rank_type;210 using rank_type = extents_type::rank_type;
211 using layout_type = layout_stride;211 using layout_type = layout_stride;
212212
213 private:213 private:
...@@ -237,7 +237,7 @@ namespace std {...@@ -237,7 +237,7 @@ namespace std {
237 constexpr index_type operator()(Indices...) const noexcept;237 constexpr index_type operator()(Indices...) const noexcept;
238238
239 static constexpr bool is_always_unique() noexcept { return true; }239 static constexpr bool is_always_unique() noexcept { return true; }
240 static constexpr bool is_always_exhaustive() noexcept { return false; }240 static constexpr bool is_always_exhaustive() noexcept;
241 static constexpr bool is_always_strided() noexcept { return true; }241 static constexpr bool is_always_strided() noexcept { return true; }
242242
243 static constexpr bool is_unique() noexcept { return true; }243 static constexpr bool is_unique() noexcept { return true; }
...@@ -286,22 +286,19 @@ namespace std {...@@ -286,22 +286,19 @@ namespace std {
286 static constexpr size_t byte_alignment = ByteAlignment;286 static constexpr size_t byte_alignment = ByteAlignment;
287287
288 constexpr aligned_accessor() noexcept = default;288 constexpr aligned_accessor() noexcept = default;
289
290 template<class OtherElementType, size_t OtherByteAlignment>289 template<class OtherElementType, size_t OtherByteAlignment>
291 constexpr aligned_accessor(290 constexpr aligned_accessor(
292 aligned_accessor<OtherElementType, OtherByteAlignment>) noexcept;291 aligned_accessor<OtherElementType, OtherByteAlignment>) noexcept;
293
294 template<class OtherElementType>292 template<class OtherElementType>
295 explicit constexpr aligned_accessor(293 constexpr explicit aligned_accessor(default_accessor<OtherElementType>) noexcept;
296 default_accessor<OtherElementType>) noexcept;
297294
298 template<class OtherElementType>295 template<class OtherElementType>
299 constexpr operator default_accessor<OtherElementType>() const noexcept;296 constexpr operator default_accessor<OtherElementType>() const noexcept;
300297
301 constexpr reference access(data_handle_type p, size_t i) const noexcept;298 constexpr reference access(data_handle_type p, size_t i) const noexcept;
302299
303 constexpr typename offset_policy::data_handle_type300 constexpr typename offset_policy::data_handle_type offset(
304 offset(data_handle_type p, size_t i) const noexcept;301 data_handle_type p, size_t i) const noexcept;
305 };302 };
306}303}
307304
...@@ -315,14 +312,14 @@ namespace std {...@@ -315,14 +312,14 @@ namespace std {
315 using extents_type = Extents;312 using extents_type = Extents;
316 using layout_type = LayoutPolicy;313 using layout_type = LayoutPolicy;
317 using accessor_type = AccessorPolicy;314 using accessor_type = AccessorPolicy;
318 using mapping_type = typename layout_type::template mapping<extents_type>;315 using mapping_type = layout_type::template mapping<extents_type>;
319 using element_type = ElementType;316 using element_type = ElementType;
320 using value_type = remove_cv_t<element_type>;317 using value_type = remove_cv_t<element_type>;
321 using index_type = typename extents_type::index_type;318 using index_type = extents_type::index_type;
322 using size_type = typename extents_type::size_type;319 using size_type = extents_type::size_type;
323 using rank_type = typename extents_type::rank_type;320 using rank_type = extents_type::rank_type;
324 using data_handle_type = typename accessor_type::data_handle_type;321 using data_handle_type = accessor_type::data_handle_type;
325 using reference = typename accessor_type::reference;322 using reference = accessor_type::reference;
326323
327 static constexpr rank_type rank() noexcept { return extents_type::rank(); }324 static constexpr rank_type rank() noexcept { return extents_type::rank(); }
328 static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }325 static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }
...@@ -364,8 +361,15 @@ namespace std {...@@ -364,8 +361,15 @@ namespace std {
364 template<class OtherIndexType>361 template<class OtherIndexType>
365 constexpr reference operator[](const array<OtherIndexType, rank()>& indices) const;362 constexpr reference operator[](const array<OtherIndexType, rank()>& indices) const;
366363
364 template<class... OtherIndexTypes>
365 constexpr reference at(OtherIndexTypes... indices) const;
366 template<class OtherIndexType>
367 constexpr reference at(span<OtherIndexType, rank()> indices) const;
368 template<class OtherIndexType>
369 constexpr reference at(const array<OtherIndexType, rank()>& indices) const;
370
367 constexpr size_type size() const noexcept;371 constexpr size_type size() const noexcept;
368 [[nodiscard]] constexpr bool empty() const noexcept;372 constexpr bool empty() const noexcept;
369373
370 friend constexpr void swap(mdspan& x, mdspan& y) noexcept;374 friend constexpr void swap(mdspan& x, mdspan& y) noexcept;
371375
...@@ -398,23 +402,19 @@ namespace std {...@@ -398,23 +402,19 @@ namespace std {
398 };402 };
399403
400 template<class CArray>404 template<class CArray>
401 requires(is_array_v<CArray> && rank_v<CArray> == 1)405 requires (is_array_v<CArray> && rank_v<CArray> == 1)
402 mdspan(CArray&)406 mdspan(CArray&)
403 -> mdspan<remove_all_extents_t<CArray>, extents<size_t, extent_v<CArray, 0>>>;407 -> mdspan<remove_all_extents_t<CArray>, extents<size_t, extent_v<CArray, 0>>>;
404408
405 template<class Pointer>409 template<class Pointer>
406 requires(is_pointer_v<remove_reference_t<Pointer>>)410 requires (is_pointer_v<remove_reference_t<Pointer>>)
407 mdspan(Pointer&&)411 mdspan(Pointer&&)
408 -> mdspan<remove_pointer_t<remove_reference_t<Pointer>>, extents<size_t>>;412 -> mdspan<remove_pointer_t<remove_reference_t<Pointer>>, extents<size_t>>;
409413
410 template<class ElementType, class... Integrals>414 template<class ElementType, class... Integrals>
411 requires((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)415 requires((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
412 explicit mdspan(ElementType*, Integrals...)416 explicit mdspan(ElementType*, Integrals...)
413 -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>; // until C++26417 -> mdspan<ElementType, extents<size_t, maybe-static-ext<Integrals>...>>;
414 template<class ElementType, class... Integrals>
415 requires((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
416 explicit mdspan(ElementType*, Integrals...)
417 -> mdspan<ElementType, extents<size_t, maybe-static-ext<Integrals>...>>; // since C++26
418418
419 template<class ElementType, class OtherIndexType, size_t N>419 template<class ElementType, class OtherIndexType, size_t N>
420 mdspan(ElementType*, span<OtherIndexType, N>)420 mdspan(ElementType*, span<OtherIndexType, N>)
...@@ -434,7 +434,7 @@ namespace std {...@@ -434,7 +434,7 @@ namespace std {
434 typename MappingType::layout_type>;434 typename MappingType::layout_type>;
435435
436 template<class MappingType, class AccessorType>436 template<class MappingType, class AccessorType>
437 mdspan(const typename AccessorType::data_handle_type&, const MappingType&,437 mdspan(typename AccessorType::data_handle_type, const MappingType&,
438 const AccessorType&)438 const AccessorType&)
439 -> mdspan<typename AccessorType::element_type, typename MappingType::extents_type,439 -> mdspan<typename AccessorType::element_type, typename MappingType::extents_type,
440 typename MappingType::layout_type, AccessorType>;440 typename MappingType::layout_type, AccessorType>;
lib/libcxx/include/memory+1-1
...@@ -987,7 +987,7 @@ template<class Pointer = void, class Smart, class... Args>...@@ -987,7 +987,7 @@ template<class Pointer = void, class Smart, class... Args>
987# pragma GCC system_header987# pragma GCC system_header
988# endif988# endif
989989
990# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20990# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
991# include <atomic>991# include <atomic>
992# include <concepts>992# include <concepts>
993# include <cstddef>993# include <cstddef>
lib/libcxx/include/memory_resource+2-2
...@@ -69,11 +69,11 @@ namespace std::pmr {...@@ -69,11 +69,11 @@ namespace std::pmr {
69# pragma GCC system_header69# pragma GCC system_header
70# endif70# endif
7171
72# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER >= 17 && _LIBCPP_STD_VER <= 2072# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER >= 17 && _LIBCPP_STD_VER <= 20
73# include <mutex>73# include <mutex>
74# endif74# endif
7575
76# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2076# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
77# include <stdexcept>77# include <stdexcept>
78# endif78# endif
79#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)79#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/mutex+20-11
...@@ -214,10 +214,11 @@ template<class Callable, class ...Args>...@@ -214,10 +214,11 @@ template<class Callable, class ...Args>
214_LIBCPP_PUSH_MACROS214_LIBCPP_PUSH_MACROS
215# include <__undef_macros>215# include <__undef_macros>
216216
217_LIBCPP_BEGIN_NAMESPACE_STD
218
219# if _LIBCPP_HAS_THREADS217# if _LIBCPP_HAS_THREADS
220218
219_LIBCPP_BEGIN_NAMESPACE_STD
220_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
221
221class _LIBCPP_EXPORTED_FROM_ABI recursive_mutex {222class _LIBCPP_EXPORTED_FROM_ABI recursive_mutex {
222 __libcpp_recursive_mutex_t __m_;223 __libcpp_recursive_mutex_t __m_;
223224
...@@ -457,7 +458,7 @@ public:...@@ -457,7 +458,7 @@ public:
457 __m_.lock();458 __m_.lock();
458 }459 }
459460
460 _LIBCPP_RELEASE_CAPABILITY _LIBCPP_HIDE_FROM_ABI ~scoped_lock() { __m_.unlock(); }461 _LIBCPP_RELEASE_CAPABILITY() _LIBCPP_HIDE_FROM_ABI ~scoped_lock() { __m_.unlock(); }
461462
462 [[nodiscard]]463 [[nodiscard]]
463 _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCPP_REQUIRES_CAPABILITY(__m)464 _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCPP_REQUIRES_CAPABILITY(__m)
...@@ -468,25 +469,31 @@ public:...@@ -468,25 +469,31 @@ public:
468};469};
469470
470template <class... _MArgs>471template <class... _MArgs>
471class scoped_lock {472class _LIBCPP_SCOPED_LOCKABLE scoped_lock {
472 static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required");473 static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required");
473 typedef tuple<_MArgs&...> _MutexTuple;474 typedef tuple<_MArgs&...> _MutexTuple;
474475
475public:476public:
476 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(_MArgs&... __margs) : __t_(__margs...) {477 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit scoped_lock(_MArgs&... __margs) _LIBCPP_ACQUIRE_CAPABILITY(__margs...)
478 : __t_(__margs...) {
477 std::lock(__margs...);479 std::lock(__margs...);
478 }480 }
479481
480 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) {}482 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI scoped_lock(adopt_lock_t, _MArgs&... __margs)
483 _LIBCPP_REQUIRES_CAPABILITY(__margs...)
484 : __t_(__margs...) {}
481485
482 _LIBCPP_HIDE_FROM_ABI ~scoped_lock() { __unlock_unpack(make_index_sequence<sizeof...(_MArgs)>(), __t_); }486 _LIBCPP_RELEASE_CAPABILITY() _LIBCPP_HIDE_FROM_ABI ~scoped_lock() {
487 __unlock_unpack(make_index_sequence<sizeof...(_MArgs)>(), __t_);
488 }
483489
484 scoped_lock(scoped_lock const&) = delete;490 scoped_lock(scoped_lock const&) = delete;
485 scoped_lock& operator=(scoped_lock const&) = delete;491 scoped_lock& operator=(scoped_lock const&) = delete;
486492
487private:493private:
488 template <size_t... _Indx>494 template <size_t... _Indx>
489 _LIBCPP_HIDE_FROM_ABI static void __unlock_unpack(index_sequence<_Indx...>, _MutexTuple& __mt) {495 _LIBCPP_HIDE_FROM_ABI static void __unlock_unpack(index_sequence<_Indx...>, _MutexTuple& __mt)
496 _LIBCPP_RELEASE_CAPABILITY(std::get<_Indx>(__mt)...) {
490 (std::get<_Indx>(__mt).unlock(), ...);497 (std::get<_Indx>(__mt).unlock(), ...);
491 }498 }
492499
...@@ -495,17 +502,19 @@ private:...@@ -495,17 +502,19 @@ private:
495_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);502_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);
496503
497# endif // _LIBCPP_STD_VER >= 17504# endif // _LIBCPP_STD_VER >= 17
498# endif // _LIBCPP_HAS_THREADS
499505
506_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
500_LIBCPP_END_NAMESPACE_STD507_LIBCPP_END_NAMESPACE_STD
501508
509# endif // _LIBCPP_HAS_THREADS
510
502_LIBCPP_POP_MACROS511_LIBCPP_POP_MACROS
503512
504# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23513# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
505# include <typeinfo>514# include <typeinfo>
506# endif515# endif
507516
508# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20517# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
509# include <atomic>518# include <atomic>
510# include <concepts>519# include <concepts>
511# include <cstdlib>520# include <cstdlib>
lib/libcxx/include/new+3-3
...@@ -81,8 +81,8 @@ void operator delete[](void* ptr, std::align_val_t alignment,...@@ -81,8 +81,8 @@ void operator delete[](void* ptr, std::align_val_t alignment,
8181
82void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++20, constexpr since C++2682void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++20, constexpr since C++26
83void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++20, constexpr since C++2683void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++20, constexpr since C++26
84void operator delete (void* ptr, void*) noexcept;84void operator delete (void* ptr, void*) noexcept; // constexpr since C++26
85void operator delete[](void* ptr, void*) noexcept;85void operator delete[](void* ptr, void*) noexcept; // constexpr since C++26
8686
87*/87*/
8888
...@@ -114,7 +114,7 @@ void operator delete[](void* ptr, void*) noexcept;...@@ -114,7 +114,7 @@ void operator delete[](void* ptr, void*) noexcept;
114# pragma GCC system_header114# pragma GCC system_header
115# endif115# endif
116116
117# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20117# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
118# include <cstddef>118# include <cstddef>
119# include <cstdlib>119# include <cstdlib>
120# include <type_traits>120# include <type_traits>
lib/libcxx/include/numbers+1-1
...@@ -159,7 +159,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -159,7 +159,7 @@ _LIBCPP_END_NAMESPACE_STD
159159
160# endif // _LIBCPP_STD_VER >= 20160# endif // _LIBCPP_STD_VER >= 20
161161
162# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20162# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
163# include <concepts>163# include <concepts>
164# include <cstddef>164# include <cstddef>
165# include <type_traits>165# include <type_traits>
lib/libcxx/include/numeric+7-7
...@@ -142,15 +142,15 @@ template<class T>...@@ -142,15 +142,15 @@ template<class T>
142142
143// [numeric.sat], saturation arithmetic143// [numeric.sat], saturation arithmetic
144template<class T>144template<class T>
145constexpr T add_sat(T x, T y) noexcept; // freestanding, Since C++26145constexpr T saturating_add(T x, T y) noexcept; // freestanding, Since C++26
146template<class T>146template<class T>
147constexpr T sub_sat(T x, T y) noexcept; // freestanding, Since C++26147constexpr T saturating_sub(T x, T y) noexcept; // freestanding, Since C++26
148template<class T>148template<class T>
149constexpr T mul_sat(T x, T y) noexcept; // freestanding, Since C++26149constexpr T saturating_mul(T x, T y) noexcept; // freestanding, Since C++26
150template<class T>150template<class T>
151constexpr T div_sat(T x, T y) noexcept; // freestanding, Since C++26151constexpr T saturating_div(T x, T y) noexcept; // freestanding, Since C++26
152template<class T, class U>152template<class T, class U>
153constexpr T saturate_cast(U x) noexcept; // freestanding, Since C++26153constexpr T saturating_cast(U x) noexcept; // freestanding, Since C++26
154154
155} // std155} // std
156156
...@@ -190,12 +190,12 @@ constexpr T saturate_cast(U x) noexcept; // freestanding, Sin...@@ -190,12 +190,12 @@ constexpr T saturate_cast(U x) noexcept; // freestanding, Sin
190# pragma GCC system_header190# pragma GCC system_header
191# endif191# endif
192192
193# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14193# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 14
194# include <initializer_list>194# include <initializer_list>
195# include <limits>195# include <limits>
196# endif196# endif
197197
198# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20198# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
199# include <climits>199# include <climits>
200# include <cmath>200# include <cmath>
201# include <concepts>201# include <concepts>
lib/libcxx/include/optional+341-383
...@@ -264,15 +264,14 @@ namespace std {...@@ -264,15 +264,14 @@ namespace std {
264# include <__compare/three_way_comparable.h>264# include <__compare/three_way_comparable.h>
265# include <__concepts/invocable.h>265# include <__concepts/invocable.h>
266# include <__config>266# include <__config>
267# include <__cstddef/ptrdiff_t.h>
268# include <__exception/exception.h>267# include <__exception/exception.h>
269# include <__format/range_format.h>
270# include <__functional/hash.h>268# include <__functional/hash.h>
271# include <__functional/invoke.h>269# include <__functional/invoke.h>
272# include <__functional/unary_function.h>270# include <__functional/unary_function.h>
271# include <__fwd/format.h>
273# include <__fwd/functional.h>272# include <__fwd/functional.h>
274# include <__iterator/bounded_iter.h>273# include <__iterator/bounded_iter.h>
275# include <__iterator/wrap_iter.h>274# include <__iterator/capacity_aware_iterator.h>
276# include <__memory/addressof.h>275# include <__memory/addressof.h>
277# include <__memory/construct_at.h>276# include <__memory/construct_at.h>
278# include <__ranges/enable_borrowed_range.h>277# include <__ranges/enable_borrowed_range.h>
...@@ -493,6 +492,61 @@ struct __optional_storage_base : __optional_destruct_base<_Tp> {...@@ -493,6 +492,61 @@ struct __optional_storage_base : __optional_destruct_base<_Tp> {
493 }492 }
494 }493 }
495 }494 }
495
496 // [optional.observe]
497 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp const> operator->() const noexcept {
498 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
499 return std::addressof(this->__get());
500 }
501
502 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> operator->() noexcept {
503 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
504 return std::addressof(this->__get());
505 }
506
507 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const& noexcept {
508 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
509 return this->__get();
510 }
511
512 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() & noexcept {
513 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
514 return this->__get();
515 }
516
517 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator*() && noexcept {
518 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
519 return std::move(this->__get());
520 }
521
522 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& operator*() const&& noexcept {
523 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
524 return std::move(this->__get());
525 }
526
527 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& value() const& {
528 if (!this->has_value())
529 std::__throw_bad_optional_access();
530 return this->__get();
531 }
532
533 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() & {
534 if (!this->has_value())
535 std::__throw_bad_optional_access();
536 return this->__get();
537 }
538
539 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& value() && {
540 if (!this->has_value())
541 std::__throw_bad_optional_access();
542 return std::move(this->__get());
543 }
544
545 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp const&& value() const&& {
546 if (!this->has_value())
547 std::__throw_bad_optional_access();
548 return std::move(this->__get());
549 }
496};550};
497551
498template <class _Tp>552template <class _Tp>
...@@ -504,7 +558,7 @@ struct __optional_storage_base<_Tp, true> {...@@ -504,7 +558,7 @@ struct __optional_storage_base<_Tp, true> {
504 _LIBCPP_HIDE_FROM_ABI constexpr __optional_storage_base() noexcept : __value_(nullptr) {}558 _LIBCPP_HIDE_FROM_ABI constexpr __optional_storage_base() noexcept : __value_(nullptr) {}
505559
506 template <class _Up>560 template <class _Up>
507 _LIBCPP_HIDE_FROM_ABI constexpr void __convert_init_ref_val(_Up&& __val) noexcept {561 _LIBCPP_HIDE_FROM_ABI constexpr void __convert_init_ref_val(_Up&& __val) {
508 _Tp& __r(std::forward<_Up>(__val));562 _Tp& __r(std::forward<_Up>(__val));
509 __value_ = std::addressof(__r);563 __value_ = std::addressof(__r);
510 }564 }
...@@ -517,6 +571,14 @@ struct __optional_storage_base<_Tp, true> {...@@ -517,6 +571,14 @@ struct __optional_storage_base<_Tp, true> {
517 __convert_init_ref_val(std::forward<_UArg>(__uarg));571 __convert_init_ref_val(std::forward<_UArg>(__uarg));
518 }572 }
519573
574# if _LIBCPP_STD_VER >= 23
575 template <class _Fp, class... _Args>
576 constexpr __optional_storage_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args) {
577 __convert_init_ref_val(std::forward<invoke_result_t<_Fp, _Args...>>(
578 std::invoke(std::forward<_Fp>(__f), std::forward<_Args>(__args)...)));
579 }
580# endif
581
520 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reset() noexcept { __value_ = nullptr; }582 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reset() noexcept { __value_ = nullptr; }
521583
522 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return __value_ != nullptr; }584 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return __value_ != nullptr; }
...@@ -525,7 +587,6 @@ struct __optional_storage_base<_Tp, true> {...@@ -525,7 +587,6 @@ struct __optional_storage_base<_Tp, true> {
525587
526 template <class _UArg>588 template <class _UArg>
527 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_UArg&& __val) {589 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_UArg&& __val) {
528 _LIBCPP_ASSERT_INTERNAL(!has_value(), "__construct called for engaged __optional_storage");
529 static_assert(!__reference_constructs_from_temporary_v<_Tp, _UArg>,590 static_assert(!__reference_constructs_from_temporary_v<_Tp, _UArg>,
530 "Attempted to construct a reference element in tuple from a "591 "Attempted to construct a reference element in tuple from a "
531 "possible temporary");592 "possible temporary");
...@@ -554,9 +615,26 @@ struct __optional_storage_base<_Tp, true> {...@@ -554,9 +615,26 @@ struct __optional_storage_base<_Tp, true> {
554 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __swap(__optional_storage_base& __rhs) noexcept {615 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __swap(__optional_storage_base& __rhs) noexcept {
555 std::swap(__value_, __rhs.__value_);616 std::swap(__value_, __rhs.__value_);
556 }617 }
618
619 // [optional.ref.observe]
620 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> operator->() const noexcept {
621 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
622 return std::addressof(this->__get());
623 }
624
625 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() const noexcept {
626 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
627 return this->__get();
628 }
629
630 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() const {
631 if (!this->has_value())
632 std::__throw_bad_optional_access();
633 return this->__get();
634 }
557};635};
558636
559template <class _Tp, bool = is_trivially_copy_constructible_v<_Tp> || is_lvalue_reference_v<_Tp>>637template <class _Tp, bool = is_trivially_copy_constructible_v<_Tp>>
560struct __optional_copy_base : __optional_storage_base<_Tp> {638struct __optional_copy_base : __optional_storage_base<_Tp> {
561 using __optional_storage_base<_Tp>::__optional_storage_base;639 using __optional_storage_base<_Tp>::__optional_storage_base;
562};640};
...@@ -576,7 +654,7 @@ struct __optional_copy_base<_Tp, false> : __optional_storage_base<_Tp> {...@@ -576,7 +654,7 @@ struct __optional_copy_base<_Tp, false> : __optional_storage_base<_Tp> {
576 _LIBCPP_HIDE_FROM_ABI __optional_copy_base& operator=(__optional_copy_base&&) = default;654 _LIBCPP_HIDE_FROM_ABI __optional_copy_base& operator=(__optional_copy_base&&) = default;
577};655};
578656
579template <class _Tp, bool = is_trivially_move_constructible_v<_Tp> || is_lvalue_reference_v<_Tp>>657template <class _Tp, bool = is_trivially_move_constructible_v<_Tp>>
580struct __optional_move_base : __optional_copy_base<_Tp> {658struct __optional_move_base : __optional_copy_base<_Tp> {
581 using __optional_copy_base<_Tp>::__optional_copy_base;659 using __optional_copy_base<_Tp>::__optional_copy_base;
582};660};
...@@ -600,8 +678,7 @@ struct __optional_move_base<_Tp, false> : __optional_copy_base<_Tp> {...@@ -600,8 +678,7 @@ struct __optional_move_base<_Tp, false> : __optional_copy_base<_Tp> {
600678
601template <class _Tp,679template <class _Tp,
602 bool = (is_trivially_destructible_v<_Tp> && is_trivially_copy_constructible_v<_Tp> &&680 bool = (is_trivially_destructible_v<_Tp> && is_trivially_copy_constructible_v<_Tp> &&
603 is_trivially_copy_assignable_v<_Tp>) ||681 is_trivially_copy_assignable_v<_Tp>)>
604 is_lvalue_reference_v<_Tp>>
605struct __optional_copy_assign_base : __optional_move_base<_Tp> {682struct __optional_copy_assign_base : __optional_move_base<_Tp> {
606 using __optional_move_base<_Tp>::__optional_move_base;683 using __optional_move_base<_Tp>::__optional_move_base;
607};684};
...@@ -625,8 +702,7 @@ struct __optional_copy_assign_base<_Tp, false> : __optional_move_base<_Tp> {...@@ -625,8 +702,7 @@ struct __optional_copy_assign_base<_Tp, false> : __optional_move_base<_Tp> {
625702
626template <class _Tp,703template <class _Tp,
627 bool = (is_trivially_destructible_v<_Tp> && is_trivially_move_constructible_v<_Tp> &&704 bool = (is_trivially_destructible_v<_Tp> && is_trivially_move_constructible_v<_Tp> &&
628 is_trivially_move_assignable_v<_Tp>) ||705 is_trivially_move_assignable_v<_Tp>)>
629 is_lvalue_reference_v<_Tp>>
630struct __optional_move_assign_base : __optional_copy_assign_base<_Tp> {706struct __optional_move_assign_base : __optional_copy_assign_base<_Tp> {
631 using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base;707 using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base;
632};708};
...@@ -655,8 +731,8 @@ using __optional_sfinae_ctor_base_t _LIBCPP_NODEBUG =...@@ -655,8 +731,8 @@ using __optional_sfinae_ctor_base_t _LIBCPP_NODEBUG =
655731
656template <class _Tp>732template <class _Tp>
657using __optional_sfinae_assign_base_t _LIBCPP_NODEBUG =733using __optional_sfinae_assign_base_t _LIBCPP_NODEBUG =
658 __sfinae_assign_base< (is_copy_constructible_v<_Tp> && is_copy_assignable_v<_Tp>) || is_lvalue_reference_v<_Tp>,734 __sfinae_assign_base< (is_copy_constructible_v<_Tp> && is_copy_assignable_v<_Tp>),
659 (is_move_constructible_v<_Tp> && is_move_assignable_v<_Tp>) || is_lvalue_reference_v<_Tp>>;735 (is_move_constructible_v<_Tp> && is_move_assignable_v<_Tp>)>;
660736
661template <class _Tp>737template <class _Tp>
662class optional;738class optional;
...@@ -685,126 +761,115 @@ struct __is_std_optional : false_type {};...@@ -685,126 +761,115 @@ struct __is_std_optional : false_type {};
685template <class _Tp>761template <class _Tp>
686struct __is_std_optional<optional<_Tp>> : true_type {};762struct __is_std_optional<optional<_Tp>> : true_type {};
687763
688template <class _Tp, class... _Args>764# if _LIBCPP_STD_VER < 26
689inline constexpr bool __is_constructible_for_optional_v = is_constructible_v<_Tp, _Args...>;765template <class _Tp>
690766inline constexpr bool __is_valid_optional_contained_type = is_object_v<_Tp>;
691template <class _Tp, class... _Args>767# else
692struct __is_constructible_for_optional : bool_constant<__is_constructible_for_optional_v<_Tp, _Args...>> {};768template <class _Tp>
769inline constexpr bool __is_valid_optional_contained_type = is_object_v<_Tp> || is_lvalue_reference_v<_Tp>;
770# endif
693771
694template <class _Tp, class _Up, class... _Args>772template <class _Tp>
695inline constexpr bool __is_constructible_for_optional_initializer_list_v =773struct __optional_iterator_base : __optional_move_assign_base<_Tp> {
696 is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>;774 using __optional_move_assign_base<_Tp>::__optional_move_assign_base;
775};
697776
698# if _LIBCPP_STD_VER >= 26777# if _LIBCPP_STD_VER >= 26
699template <class _Tp, class... _Args>778template <class _Tp>
700inline constexpr bool __is_constructible_for_optional_v<_Tp&, _Args...> = false;779struct __optional_iterator_base<_Tp&> : __optional_storage_base<_Tp&> {
701template <class _Tp, class _Arg>780 using __optional_storage_base<_Tp&>::__optional_storage_base;
702inline constexpr bool __is_constructible_for_optional_v<_Tp&, _Arg> =781};
703 is_constructible_v<_Tp&, _Arg> && !reference_constructs_from_temporary_v<_Tp&, _Arg>;
704
705template <class _Tp, class _Up, class... _Args>
706inline constexpr bool __is_constructible_for_optional_initializer_list_v<_Tp&, _Up, _Args...> = false;
707# endif
708782
709template <class _Tp, class = void>783# if _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
710struct __optional_iterator {};
711
712# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
713784
714template <class _Tp>785template <class _Tp>
715struct __optional_iterator<_Tp, enable_if_t<is_object_v<_Tp>>> {786 requires is_object_v<_Tp>
787struct __optional_iterator_base<_Tp> : __optional_move_assign_base<_Tp> {
716private:788private:
717 using __pointer _LIBCPP_NODEBUG = add_pointer_t<_Tp>;789 using __pointer _LIBCPP_NODEBUG = add_pointer_t<_Tp>;
718 using __const_pointer _LIBCPP_NODEBUG = add_pointer_t<const _Tp>;790 using __const_pointer _LIBCPP_NODEBUG = add_pointer_t<const _Tp>;
719791
720public:792public:
721# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL793 using __optional_move_assign_base<_Tp>::__optional_move_assign_base;
722 using iterator = __bounded_iter<__wrap_iter<__pointer>>;794
723 using const_iterator = __bounded_iter<__wrap_iter<__const_pointer>>;795# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
724# else796 using iterator = __bounded_iter<__pointer>;
725 using iterator = __wrap_iter<__pointer>;797 using const_iterator = __bounded_iter<__const_pointer>;
726 using const_iterator = __wrap_iter<__const_pointer>;798# else
727# endif799 using iterator = __capacity_aware_iterator<__pointer, optional<_Tp>, 1>;
800 using const_iterator = __capacity_aware_iterator<__const_pointer, optional<_Tp>, 1>;
801# endif
728802
729 // [optional.iterators], iterator support803 // [optional.iterators], iterator support
730 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() noexcept {804 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() noexcept {
731 auto& __derived_self = static_cast<optional<_Tp>&>(*this);805 auto* __ptr = std::addressof(this->__get());
732 auto* __ptr = std::addressof(__derived_self.__get());
733806
734# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL807# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
735 return std::__make_bounded_iter(808 return std::__make_bounded_iter(__ptr, __ptr, __ptr + (this->has_value() ? 1 : 0));
736 __wrap_iter<__pointer>(__ptr),809# else
737 __wrap_iter<__pointer>(__ptr),810 return std::__make_capacity_aware_iterator<__pointer, optional<_Tp>, 1>(__ptr);
738 __wrap_iter<__pointer>(__ptr) + (__derived_self.has_value() ? 1 : 0));811# endif
739# else
740 return iterator(__ptr);
741# endif
742 }812 }
743813
744 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {814 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {
745 auto& __derived_self = static_cast<const optional<_Tp>&>(*this);815 auto* __ptr = std::addressof(this->__get());
746 auto* __ptr = std::addressof(__derived_self.__get());
747816
748# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL817# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
749 return std::__make_bounded_iter(818 return std::__make_bounded_iter(__ptr, __ptr, __ptr + (this->has_value() ? 1 : 0));
750 __wrap_iter<__const_pointer>(__ptr),819# else
751 __wrap_iter<__const_pointer>(__ptr),820 return std::__make_capacity_aware_iterator<__const_pointer, optional<_Tp>, 1>(__ptr);
752 __wrap_iter<__const_pointer>(__ptr) + (__derived_self.has_value() ? 1 : 0));821# endif
753# else
754 return const_iterator(__ptr);
755# endif
756 }822 }
757823
758 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator end() noexcept {824 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator end() noexcept {
759 return begin() + (static_cast<optional<_Tp>&>(*this).has_value() ? 1 : 0);825 return begin() + (this->has_value() ? 1 : 0);
760 }826 }
761 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept {827 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept {
762 return begin() + (static_cast<const optional<_Tp>&>(*this).has_value() ? 1 : 0);828 return begin() + (this->has_value() ? 1 : 0);
763 }829 }
764};830};
765831
766template <class _Tp>832template <class _Tp>
767struct __optional_iterator<_Tp&, enable_if_t<is_object_v<_Tp> && !__is_unbounded_array_v<_Tp> >> {833 requires(is_object_v<_Tp> && !__is_unbounded_array_v<_Tp>)
834struct __optional_iterator_base<_Tp&> : __optional_storage_base<_Tp&> {
768private:835private:
769 using __pointer _LIBCPP_NODEBUG = add_pointer_t<_Tp>;836 using __pointer _LIBCPP_NODEBUG = add_pointer_t<_Tp>;
770837
771public:838public:
772# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL839 using __optional_storage_base<_Tp&>::__optional_storage_base;
773 using iterator = __bounded_iter<__wrap_iter<__pointer>>;840
774# else841# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
775 using iterator = __wrap_iter<__pointer>;842 using iterator = __bounded_iter<__pointer>;
776# endif843# else
844 using iterator = __capacity_aware_iterator<__pointer, optional<_Tp&>, 1>;
845# endif
777846
778 // [optional.ref.iterators], iterator support847 // [optional.ref.iterators], iterator support
779848
780 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const noexcept {849 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const noexcept {
781 auto& __derived_self = static_cast<const optional<_Tp&>&>(*this);850 auto* __ptr = this->has_value() ? std::addressof(this->__get()) : nullptr;
782 auto* __ptr = __derived_self.has_value() ? std::addressof(__derived_self.__get()) : nullptr;
783851
784# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL852# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
785 return std::__make_bounded_iter(853 return std::__make_bounded_iter(__ptr, __ptr, __ptr + (this->has_value() ? 1 : 0));
786 __wrap_iter<__pointer>(__ptr),854# else
787 __wrap_iter<__pointer>(__ptr),855 return std::__make_capacity_aware_iterator<__pointer, optional<_Tp&>, 1>(__ptr);
788 __wrap_iter<__pointer>(__ptr) + (__derived_self.has_value() ? 1 : 0));856# endif
789# else
790 return iterator(__ptr);
791# endif
792 }857 }
793858
794 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const noexcept {859 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const noexcept {
795 return begin() + (static_cast<const optional<_Tp&>&>(*this).has_value() ? 1 : 0);860 return begin() + (this->has_value() ? 1 : 0);
796 }861 }
797};862};
798863
799# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR864# endif // _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
865# endif // _LIBCPP_STD_VER >= 26
800866
801template <class _Tp>867template <class _Tp>
802class _LIBCPP_DECLSPEC_EMPTY_BASES optional868class _LIBCPP_DECLSPEC_EMPTY_BASES optional
803 : private __optional_move_assign_base<_Tp>,869 : public __optional_iterator_base<_Tp>,
804 private __optional_sfinae_ctor_base_t<_Tp>,870 private __optional_sfinae_ctor_base_t<_Tp>,
805 private __optional_sfinae_assign_base_t<_Tp>,871 private __optional_sfinae_assign_base_t<_Tp> {
806 public __optional_iterator<_Tp> {872 using __base _LIBCPP_NODEBUG = __optional_iterator_base<_Tp>;
807 using __base _LIBCPP_NODEBUG = __optional_move_assign_base<_Tp>;
808873
809public:874public:
810 using value_type = __libcpp_remove_reference_t<_Tp>;875 using value_type = __libcpp_remove_reference_t<_Tp>;
...@@ -813,9 +878,8 @@ public:...@@ -813,9 +878,8 @@ public:
813 conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, optional, void>;878 conditional_t<__libcpp_is_trivially_relocatable<_Tp>::value, optional, void>;
814879
815private:880private:
816 static_assert(!is_same_v<__remove_cvref_t<_Tp>, in_place_t>,881 static_assert(!is_same_v<remove_cv_t<_Tp>, in_place_t>, "instantiation of optional with in_place_t is ill-formed");
817 "instantiation of optional with in_place_t is ill-formed");882 static_assert(!is_same_v<remove_cv_t<_Tp>, nullopt_t>, "instantiation of optional with nullopt_t is ill-formed");
818 static_assert(!is_same_v<__remove_cvref_t<_Tp>, nullopt_t>, "instantiation of optional with nullopt_t is ill-formed");
819# if _LIBCPP_STD_VER >= 26883# if _LIBCPP_STD_VER >= 26
820 static_assert(!is_rvalue_reference_v<_Tp>, "instantiation of optional with an rvalue reference type is ill-formed");884 static_assert(!is_rvalue_reference_v<_Tp>, "instantiation of optional with an rvalue reference type is ill-formed");
821# else885# else
...@@ -824,16 +888,6 @@ private:...@@ -824,16 +888,6 @@ private:
824 static_assert(is_destructible_v<_Tp>, "instantiation of optional with a non-destructible type is ill-formed");888 static_assert(is_destructible_v<_Tp>, "instantiation of optional with a non-destructible type is ill-formed");
825 static_assert(!is_array_v<_Tp>, "instantiation of optional with an array type is ill-formed");889 static_assert(!is_array_v<_Tp>, "instantiation of optional with an array type is ill-formed");
826890
827# if _LIBCPP_STD_VER >= 26
828 template <class _Up>
829 constexpr static bool __libcpp_opt_ref_ctor_deleted =
830 is_lvalue_reference_v<_Tp> && reference_constructs_from_temporary_v<_Tp, _Up>;
831
832 template <class _Up>
833 constexpr static bool __ref_ctor_enabled =
834 is_lvalue_reference_v<_Tp> && !reference_constructs_from_temporary_v<_Tp, _Up>;
835# endif
836
837 // LWG2756: conditionally explicit conversion from _Up891 // LWG2756: conditionally explicit conversion from _Up
838 struct _CheckOptionalArgsConstructor {892 struct _CheckOptionalArgsConstructor {
839 template <class _Up>893 template <class _Up>
...@@ -905,131 +959,48 @@ public:...@@ -905,131 +959,48 @@ public:
905 _LIBCPP_HIDE_FROM_ABI constexpr optional(optional&&) = default;959 _LIBCPP_HIDE_FROM_ABI constexpr optional(optional&&) = default;
906 _LIBCPP_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {}960 _LIBCPP_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {}
907961
908 template <962 template <class _InPlaceT,
909 class _InPlaceT,963 class... _Args,
910 class... _Args,964 enable_if_t<_And<_IsSame<_InPlaceT, in_place_t>, is_constructible<_Tp, _Args...>>::value, int> = 0>
911 enable_if_t<_And<_IsSame<_InPlaceT, in_place_t>, __is_constructible_for_optional<_Tp, _Args...>>::value, int> = 0>
912 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_InPlaceT, _Args&&... __args)965 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_InPlaceT, _Args&&... __args)
913 : __base(in_place, std::forward<_Args>(__args)...) {}966 : __base(in_place, std::forward<_Args>(__args)...) {}
914967
915 template <class _Up,968 template <class _Up, class... _Args, enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>, int> = 0>
916 class... _Args,
917 enable_if_t<__is_constructible_for_optional_initializer_list_v<_Tp, _Up, _Args...>, int> = 0>
918 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)969 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
919 : __base(in_place, __il, std::forward<_Args>(__args)...) {}970 : __base(in_place, __il, std::forward<_Args>(__args)...) {}
920971
921 template <class _Up = _Tp, enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>(), int> = 0>972 template <class _Up = _Tp, enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>(), int> = 0>
922 _LIBCPP_HIDE_FROM_ABI constexpr optional(_Up&& __v)973 _LIBCPP_HIDE_FROM_ABI constexpr optional(_Up&& __v) noexcept(is_nothrow_constructible_v<_Tp, _Up>) // strengthened
923# if _LIBCPP_STD_VER >= 26974 : __base(in_place, std::forward<_Up>(__v)) {}
924 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
925# endif
926 : __base(in_place, std::forward<_Up>(__v)) {
927 }
928975
929 template <class _Up = remove_cv_t<_Tp>,976 template <class _Up = remove_cv_t<_Tp>,
930 enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>(), int> = 0>977 enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>(), int> = 0>
931 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_Up&& __v)978 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_Up&& __v) noexcept(
932# if _LIBCPP_STD_VER >= 26979 is_nothrow_constructible_v<_Tp, _Up>) // strengthened
933 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)980 : __base(in_place, std::forward<_Up>(__v)) {}
934# endif
935 : __base(in_place, std::forward<_Up>(__v)) {
936 }
937981
938 // LWG2756: conditionally explicit conversion from const optional<_Up>&982 // LWG2756: conditionally explicit conversion from const optional<_Up>&
939 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>(), int> = 0>983 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>(), int> = 0>
940 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>& __v)984 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>& __v) {
941# if _LIBCPP_STD_VER >= 26
942 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, const _Up&>)
943# endif
944 {
945 this->__construct_from(__v);985 this->__construct_from(__v);
946 }986 }
987
947 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>(), int> = 0>988 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>(), int> = 0>
948 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(const optional<_Up>& __v)989 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(const optional<_Up>& __v) {
949# if _LIBCPP_STD_VER >= 26
950 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, const _Up&>)
951# endif
952 {
953 this->__construct_from(__v);990 this->__construct_from(__v);
954 }991 }
955992
956 // LWG2756: conditionally explicit conversion from optional<_Up>&&993 // LWG2756: conditionally explicit conversion from optional<_Up>&&
957 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_implicit<_Up>(), int> = 0>994 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_implicit<_Up>(), int> = 0>
958 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(optional<_Up>&& __v)995 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(optional<_Up>&& __v) {
959# if _LIBCPP_STD_VER >= 26
960 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
961# endif
962 {
963 this->__construct_from(std::move(__v));
964 }
965 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_explicit<_Up>(), int> = 0>
966 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(optional<_Up>&& __v)
967# if _LIBCPP_STD_VER >= 26
968 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up>)
969# endif
970 {
971 this->__construct_from(std::move(__v));996 this->__construct_from(std::move(__v));
972 }997 }
973998
974 // deleted optional<T&> constructors and additional optional<T&> constructors
975# if _LIBCPP_STD_VER >= 26
976 // optional(U&&)
977 template <class _Up = _Tp, enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>(), int> = 0>
978 requires __libcpp_opt_ref_ctor_deleted<_Up>
979 optional(_Up&&) = delete;
980
981 template <class _Up = remove_cv_t<_Tp>,
982 enable_if_t<_CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>(), int> = 0>
983 requires __libcpp_opt_ref_ctor_deleted<_Up>
984 explicit optional(_Up&&) = delete;
985
986 // optional(optional<U>& rhs)
987 template <class _Up>
988 requires __ref_ctor_enabled<_Up&> && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) && (!is_same_v<_Tp&, _Up>) &&
989 is_constructible_v<_Tp&, _Up&>
990 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!is_convertible_v<_Up&, _Tp&>)
991 optional(optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up&>) {
992 this->__construct_from(__rhs);
993 }
994
995 template <class _Up>
996 requires __libcpp_opt_ref_ctor_deleted<_Up&> && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
997 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up&>
998 constexpr explicit optional(optional<_Up>& __rhs) noexcept = delete;
999
1000 // optional(const optional<U>&)
1001 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>(), int> = 0>
1002 requires __libcpp_opt_ref_ctor_deleted<const _Up&>
1003 optional(const optional<_Up>&) = delete;
1004
1005 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>(), int> = 0>
1006 requires __libcpp_opt_ref_ctor_deleted<const _Up&>
1007 explicit optional(const optional<_Up>&) = delete;
1008
1009 // optional(optional<U>&&)
1010 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_implicit<_Up>(), int> = 0>
1011 requires __libcpp_opt_ref_ctor_deleted<_Up>
1012 optional(optional<_Up>&&) = delete;
1013
1014 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_explicit<_Up>(), int> = 0>999 template <class _Up, enable_if_t<_CheckOptionalLikeCtor<_Up, _Up&&>::template __enable_explicit<_Up>(), int> = 0>
1015 requires __libcpp_opt_ref_ctor_deleted<_Up>1000 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(optional<_Up>&& __v) {
1016 explicit optional(optional<_Up>&&) = delete;
1017
1018 // optional(const optional<U>&&)
1019 template <class _Up>
1020 requires __ref_ctor_enabled<const _Up> && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
1021 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, const _Up>
1022 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!is_convertible_v<const _Up, _Tp&>)
1023 optional(const optional<_Up>&& __v) noexcept(is_nothrow_constructible_v<_Tp&, const _Up>) {
1024 this->__construct_from(std::move(__v));1001 this->__construct_from(std::move(__v));
1025 }1002 }
10261003
1027 template <class _Up>
1028 requires __libcpp_opt_ref_ctor_deleted<const _Up> && (!is_same_v<remove_cvref_t<_Tp>, optional<_Up>>) &&
1029 (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, const _Up>
1030 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>&& __v) noexcept = delete;
1031# endif
1032
1033# if _LIBCPP_STD_VER >= 231004# if _LIBCPP_STD_VER >= 23
1034 template <class _Tag,1005 template <class _Tag,
1035 class _Fp,1006 class _Fp,
...@@ -1052,8 +1023,7 @@ public:...@@ -1052,8 +1023,7 @@ public:
1052 enable_if_t<_And<_IsNotSame<__remove_cvref_t<_Up>, optional>,1023 enable_if_t<_And<_IsNotSame<__remove_cvref_t<_Up>, optional>,
1053 _Or<_IsNotSame<__remove_cvref_t<_Up>, _Tp>, _Not<is_scalar<_Tp>>>,1024 _Or<_IsNotSame<__remove_cvref_t<_Up>, _Tp>, _Not<is_scalar<_Tp>>>,
1054 is_constructible<_Tp, _Up>,1025 is_constructible<_Tp, _Up>,
1055 is_assignable<_Tp&, _Up>,1026 is_assignable<_Tp&, _Up>>::value,
1056 is_object<_Tp>>::value,
1057 int> = 0>1027 int> = 0>
1058 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional& operator=(_Up&& __v) {1028 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional& operator=(_Up&& __v) {
1059 if (this->has_value())1029 if (this->has_value())
...@@ -1077,138 +1047,35 @@ public:...@@ -1077,138 +1047,35 @@ public:
1077 return *this;1047 return *this;
1078 }1048 }
10791049
1080 template <class... _Args, enable_if_t<__is_constructible_for_optional_v<_Tp, _Args...>, int> = 0>1050 template <class... _Args, enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
1081 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args)1051 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) {
1082# if _LIBCPP_STD_VER >= 26
1083 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp, _Args...>)
1084# endif
1085 {
1086 reset();1052 reset();
1087 this->__construct(std::forward<_Args>(__args)...);1053 this->__construct(std::forward<_Args>(__args)...);
1088 return this->__get();1054 return this->__get();
1089 }1055 }
10901056
1091 template <class _Up,1057 template <class _Up, class... _Args, enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>, int> = 0>
1092 class... _Args,
1093 enable_if_t<__is_constructible_for_optional_initializer_list_v<_Tp, _Up, _Args...>, int> = 0>
1094 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {1058 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
1095 reset();1059 reset();
1096 this->__construct(__il, std::forward<_Args>(__args)...);1060 this->__construct(__il, std::forward<_Args>(__args)...);
1097 return this->__get();1061 return this->__get();
1098 }1062 }
10991063
1100 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(optional& __opt) noexcept(1064 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
1101 (is_nothrow_move_constructible_v<_Tp> && is_nothrow_swappable_v<_Tp>)1065 swap(optional& __opt) noexcept((is_nothrow_move_constructible_v<_Tp> && is_nothrow_swappable_v<_Tp>)) {
1102# if _LIBCPP_STD_VER >= 26
1103 || is_lvalue_reference_v<_Tp>
1104# endif
1105 ) {
1106 this->__swap(__opt);1066 this->__swap(__opt);
1107 }1067 }
11081068
1109 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp const> operator->() const noexcept1069 using __base::operator*;
1110# if _LIBCPP_STD_VER >= 261070 using __base::operator->;
1111 requires(is_object_v<_Tp>)
1112# endif
1113 {
1114 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
1115 return std::addressof(this->__get());
1116 }
1117
1118 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> operator->() noexcept
1119# if _LIBCPP_STD_VER >= 26
1120 requires(is_object_v<_Tp>)
1121# endif
1122 {
1123 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");
1124 return std::addressof(this->__get());
1125 }
1126
1127 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const& noexcept
1128# if _LIBCPP_STD_VER >= 26
1129 requires(is_object_v<_Tp>)
1130# endif
1131 {
1132 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
1133 return this->__get();
1134 }
1135
1136 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() & noexcept
1137# if _LIBCPP_STD_VER >= 26
1138 requires(is_object_v<_Tp>)
1139# endif
1140 {
1141 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
1142 return this->__get();
1143 }
1144
1145 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator*() && noexcept
1146# if _LIBCPP_STD_VER >= 26
1147 requires(is_object_v<_Tp>)
1148# endif
1149 {
1150 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
1151 return std::move(this->__get());
1152 }
1153
1154 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& operator*() const&& noexcept
1155# if _LIBCPP_STD_VER >= 26
1156 requires(is_object_v<_Tp>)
1157# endif
1158 {
1159 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");
1160 return std::move(this->__get());
1161 }
11621071
1163 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return has_value(); }1072 _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return has_value(); }
11641073
1165 using __base::__get;1074 using __base::__get;
1166 using __base::has_value;1075 using __base::has_value;
11671076 using __base::value;
1168 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& value() const&
1169# if _LIBCPP_STD_VER >= 26
1170 requires(is_object_v<_Tp>)
1171# endif
1172 {
1173 if (!this->has_value())
1174 std::__throw_bad_optional_access();
1175 return this->__get();
1176 }
1177
1178 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() &
1179# if _LIBCPP_STD_VER >= 26
1180 requires(is_object_v<_Tp>)
1181# endif
1182 {
1183 if (!this->has_value())
1184 std::__throw_bad_optional_access();
1185 return this->__get();
1186 }
1187
1188 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& value() &&
1189# if _LIBCPP_STD_VER >= 26
1190 requires(is_object_v<_Tp>)
1191# endif
1192 {
1193 if (!this->has_value())
1194 std::__throw_bad_optional_access();
1195 return std::move(this->__get());
1196 }
1197
1198 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp const&& value() const&&
1199# if _LIBCPP_STD_VER >= 26
1200 requires(is_object_v<_Tp>)
1201# endif
1202 {
1203 if (!this->has_value())
1204 std::__throw_bad_optional_access();
1205 return std::move(this->__get());
1206 }
12071077
1208 template <class _Up = remove_cv_t<_Tp>>1078 template <class _Up = remove_cv_t<_Tp>>
1209# if _LIBCPP_STD_VER >= 26
1210 requires(is_object_v<_Tp>)
1211# endif
1212 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) const& {1079 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) const& {
1213 static_assert(is_copy_constructible_v<_Tp>, "optional<T>::value_or: T must be copy constructible");1080 static_assert(is_copy_constructible_v<_Tp>, "optional<T>::value_or: T must be copy constructible");
1214 static_assert(is_convertible_v<_Up, _Tp>, "optional<T>::value_or: U must be convertible to T");1081 static_assert(is_convertible_v<_Up, _Tp>, "optional<T>::value_or: U must be convertible to T");
...@@ -1216,9 +1083,6 @@ public:...@@ -1216,9 +1083,6 @@ public:
1216 }1083 }
12171084
1218 template <class _Up = remove_cv_t<_Tp>>1085 template <class _Up = remove_cv_t<_Tp>>
1219# if _LIBCPP_STD_VER >= 26
1220 requires(is_object_v<_Tp>)
1221# endif
1222 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) && {1086 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp value_or(_Up&& __v) && {
1223 static_assert(is_move_constructible_v<_Tp>, "optional<T>::value_or: T must be move constructible");1087 static_assert(is_move_constructible_v<_Tp>, "optional<T>::value_or: T must be move constructible");
1224 static_assert(is_convertible_v<_Up, _Tp>, "optional<T>::value_or: U must be convertible to T");1088 static_assert(is_convertible_v<_Up, _Tp>, "optional<T>::value_or: U must be convertible to T");
...@@ -1227,9 +1091,6 @@ public:...@@ -1227,9 +1091,6 @@ public:
12271091
1228# if _LIBCPP_STD_VER >= 231092# if _LIBCPP_STD_VER >= 23
1229 template <class _Func>1093 template <class _Func>
1230# if _LIBCPP_STD_VER >= 26
1231 requires(is_object_v<_Tp>)
1232# endif
1233 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {1094 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {
1234 using _Up = invoke_result_t<_Func, _Tp&>;1095 using _Up = invoke_result_t<_Func, _Tp&>;
1235 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1096 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
...@@ -1240,9 +1101,6 @@ public:...@@ -1240,9 +1101,6 @@ public:
1240 }1101 }
12411102
1242 template <class _Func>1103 template <class _Func>
1243# if _LIBCPP_STD_VER >= 26
1244 requires(is_object_v<_Tp>)
1245# endif
1246 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {1104 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {
1247 using _Up = invoke_result_t<_Func, const _Tp&>;1105 using _Up = invoke_result_t<_Func, const _Tp&>;
1248 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1106 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
...@@ -1253,9 +1111,6 @@ public:...@@ -1253,9 +1111,6 @@ public:
1253 }1111 }
12541112
1255 template <class _Func>1113 template <class _Func>
1256# if _LIBCPP_STD_VER >= 26
1257 requires(is_object_v<_Tp>)
1258# endif
1259 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {1114 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {
1260 using _Up = invoke_result_t<_Func, _Tp&&>;1115 using _Up = invoke_result_t<_Func, _Tp&&>;
1261 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1116 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
...@@ -1266,9 +1121,6 @@ public:...@@ -1266,9 +1121,6 @@ public:
1266 }1121 }
12671122
1268 template <class _Func>1123 template <class _Func>
1269# if _LIBCPP_STD_VER >= 26
1270 requires(is_object_v<_Tp>)
1271# endif
1272 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {1124 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
1273 using _Up = invoke_result_t<_Func, const _Tp&&>;1125 using _Up = invoke_result_t<_Func, const _Tp&&>;
1274 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1126 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
...@@ -1279,60 +1131,52 @@ public:...@@ -1279,60 +1131,52 @@ public:
1279 }1131 }
12801132
1281 template <class _Func>1133 template <class _Func>
1282# if _LIBCPP_STD_VER >= 26
1283 requires(is_object_v<_Tp>)
1284# endif
1285 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {1134 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) & {
1286 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&>>;1135 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&>>;
1287 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");1136 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
1288 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");1137 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");
1289 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");1138 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");
1290 static_assert(is_object_v<_Up>, "Result of f(value()) should be an object type");1139 static_assert(
1140 __is_valid_optional_contained_type<_Up>, "Result of f(value()) should be a valid contained type for optional");
1291 if (*this)1141 if (*this)
1292 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());1142 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());
1293 return optional<_Up>();1143 return optional<_Up>();
1294 }1144 }
12951145
1296 template <class _Func>1146 template <class _Func>
1297# if _LIBCPP_STD_VER >= 26
1298 requires(is_object_v<_Tp>)
1299# endif
1300 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {1147 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const& {
1301 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&>>;1148 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&>>;
1302 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");1149 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
1303 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");1150 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");
1304 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");1151 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");
1305 static_assert(is_object_v<_Up>, "Result of f(value()) should be an object type");1152 static_assert(
1153 __is_valid_optional_contained_type<_Up>, "Result of f(value()) should be a valid contained type for optional");
1306 if (*this)1154 if (*this)
1307 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());1155 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());
1308 return optional<_Up>();1156 return optional<_Up>();
1309 }1157 }
13101158
1311 template <class _Func>1159 template <class _Func>
1312# if _LIBCPP_STD_VER >= 26
1313 requires(is_object_v<_Tp>)
1314# endif
1315 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {1160 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) && {
1316 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&&>>;1161 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&&>>;
1317 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");1162 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
1318 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");1163 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");
1319 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");1164 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");
1320 static_assert(is_object_v<_Up>, "Result of f(std::move(value())) should be an object type");1165 static_assert(
1166 __is_valid_optional_contained_type<_Up>, "Result of f(value()) should be a valid contained type for optional");
1321 if (*this)1167 if (*this)
1322 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), std::move(value()));1168 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), std::move(value()));
1323 return optional<_Up>();1169 return optional<_Up>();
1324 }1170 }
13251171
1326 template <class _Func>1172 template <class _Func>
1327# if _LIBCPP_STD_VER >= 26
1328 requires(is_object_v<_Tp>)
1329# endif
1330 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {1173 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto transform(_Func&& __f) const&& {
1331 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&&>>;1174 using _Up = remove_cv_t<invoke_result_t<_Func, const _Tp&&>>;
1332 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");1175 static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
1333 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");1176 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(std::move(value())) should not be std::in_place_t");
1334 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");1177 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(std::move(value())) should not be std::nullopt_t");
1335 static_assert(is_object_v<_Up>, "Result of f(std::move(value())) should be an object type");1178 static_assert(
1179 __is_valid_optional_contained_type<_Up>, "Result of f(value()) should be a valid contained type for optional");
1336 if (*this)1180 if (*this)
1337 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), std::move(value()));1181 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), std::move(value()));
1338 return optional<_Up>();1182 return optional<_Up>();
...@@ -1341,9 +1185,6 @@ public:...@@ -1341,9 +1185,6 @@ public:
1341 template <invocable _Func>1185 template <invocable _Func>
1342 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const&1186 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const&
1343 requires is_copy_constructible_v<_Tp>1187 requires is_copy_constructible_v<_Tp>
1344# if _LIBCPP_STD_VER >= 26
1345 && (is_object_v<_Tp>)
1346# endif
1347 {1188 {
1348 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,1189 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
1349 "Result of f() should be the same type as this optional");1190 "Result of f() should be the same type as this optional");
...@@ -1355,9 +1196,6 @@ public:...@@ -1355,9 +1196,6 @@ public:
1355 template <invocable _Func>1196 template <invocable _Func>
1356 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) &&1197 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) &&
1357 requires is_move_constructible_v<_Tp>1198 requires is_move_constructible_v<_Tp>
1358# if _LIBCPP_STD_VER >= 26
1359 && (is_object_v<_Tp>)
1360# endif
1361 {1199 {
1362 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,1200 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
1363 "Result of f() should be the same type as this optional");1201 "Result of f() should be the same type as this optional");
...@@ -1368,46 +1206,137 @@ public:...@@ -1368,46 +1206,137 @@ public:
1368# endif // _LIBCPP_STD_VER >= 231206# endif // _LIBCPP_STD_VER >= 23
13691207
1370 using __base::reset;1208 using __base::reset;
1209};
13711210
1372// optional<T&> overloads
1373# if _LIBCPP_STD_VER >= 261211# if _LIBCPP_STD_VER >= 26
1212template <class _Tp>
1213class optional<_Tp&> : public __optional_iterator_base<_Tp&> {
1214 using __base _LIBCPP_NODEBUG = __optional_iterator_base<_Tp&>;
13741215
1375 _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> operator->() const noexcept1216 template <class _Up, class _QualUp>
1376 requires(is_lvalue_reference_v<_Tp>)1217 static constexpr bool __check_optionalU_ctor =
1377 {1218 !is_same_v<remove_cv_t<_Tp>, optional<_Up>> && !is_same_v<_Tp&, _Up> && is_constructible_v<_Tp&, _QualUp>;
1378 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator-> called on a disengaged value");1219 static_assert(!is_same_v<remove_cv_t<_Tp>, in_place_t>, "instantiation of optional with in_place_t is ill-formed");
1379 return std::addressof(this->__get());1220 static_assert(!is_same_v<remove_cv_t<_Tp>, nullopt_t>, "instantiation of optional with nullopt_t is ill-formed");
1221
1222public:
1223 using value_type = _Tp;
1224
1225 constexpr optional() noexcept = default;
1226 constexpr optional(nullopt_t) noexcept {}
1227 constexpr optional(const optional&) noexcept = default;
1228
1229 template <class _Arg>
1230 requires(is_constructible_v<_Tp&, _Arg> && !reference_constructs_from_temporary_v<_Tp&, _Arg>)
1231 constexpr explicit optional(in_place_t, _Arg&& __arg) : __base(in_place, std::forward<_Arg>(__arg)) {}
1232
1233 template <class _Up>
1234 requires(!is_same_v<remove_cvref_t<_Up>, optional> && !is_same_v<remove_cvref_t<_Up>, in_place_t> &&
1235 is_constructible_v<_Tp&, _Up> && !reference_constructs_from_temporary_v<_Tp&, _Up>)
1236 constexpr explicit(!is_convertible_v<_Up, _Tp&>) optional(_Up&& __v) noexcept(is_nothrow_constructible_v<_Tp&, _Up>)
1237 : __base(in_place, std::forward<_Up>(__v)) {}
1238
1239 template <class _Up>
1240 requires(__check_optionalU_ctor<_Up, _Up&> && !reference_constructs_from_temporary_v<_Tp&, _Up&>)
1241 constexpr explicit(!is_convertible_v<_Up&, _Tp&>)
1242 optional(optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up&>) {
1243 this->__construct_from(__rhs);
1380 }1244 }
13811245
1382 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() const noexcept1246 template <class _Up>
1383 requires(is_lvalue_reference_v<_Tp>)1247 requires(__check_optionalU_ctor<_Up, const _Up&> && !reference_constructs_from_temporary_v<_Tp&, const _Up&>)
1384 {1248 constexpr explicit(!is_convertible_v<const _Up&, _Tp&>)
1385 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(this->has_value(), "optional operator* called on a disengaged value");1249 optional(const optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, const _Up&>) {
1386 return this->__get();1250 this->__construct_from(__rhs);
1387 }1251 }
13881252
1389 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp& value() const1253 template <class _Up>
1390 requires(is_lvalue_reference_v<_Tp>)1254 requires(__check_optionalU_ctor<_Up, _Up> && !reference_constructs_from_temporary_v<_Tp&, _Up>)
1391 {1255 constexpr explicit(!is_convertible_v<_Up, _Tp&>)
1392 if (!this->has_value())1256 optional(optional<_Up>&& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up>) {
1393 std::__throw_bad_optional_access();1257 this->__construct_from(std::move(__rhs));
1258 }
1259
1260 template <class _Up>
1261 requires(__check_optionalU_ctor<_Up, const _Up> && !reference_constructs_from_temporary_v<_Tp&, const _Up>)
1262 constexpr explicit(!is_convertible_v<const _Up, _Tp&>)
1263 optional(const optional<_Up>&& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, const _Up>) {
1264 this->__construct_from(std::move(__rhs));
1265 }
1266
1267 template <class _Tag, class _Fp, class... _Args>
1268 requires(is_same_v<_Tag, __optional_construct_from_invoke_tag>)
1269 _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_Tag, _Fp&& __f, _Args&&... __args)
1270 : __base(__optional_construct_from_invoke_tag{}, std::forward<_Fp>(__f), std::forward<_Args>(__args)...) {}
1271
1272 // deleted overloads
1273
1274 template <class _Up>
1275 requires(!is_same_v<remove_cvref_t<_Up>, optional> && !is_same_v<remove_cvref_t<_Up>, in_place_t> &&
1276 is_constructible_v<_Tp&, _Up> && reference_constructs_from_temporary_v<_Tp&, _Up>)
1277 constexpr explicit(!is_convertible_v<_Up, _Tp&>)
1278 optional(_Up&& __v) noexcept(is_nothrow_constructible_v<_Tp&, _Up>) = delete;
1279
1280 template <class _Up>
1281 requires(__check_optionalU_ctor<_Up, _Up&> && reference_constructs_from_temporary_v<_Tp&, _Up&>)
1282 constexpr explicit(!is_convertible_v<_Up&, _Tp&>)
1283 optional(optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up&>) = delete;
1284
1285 template <class _Up>
1286 requires(__check_optionalU_ctor<_Up, const _Up&> && reference_constructs_from_temporary_v<_Tp&, const _Up&>)
1287 constexpr explicit(!is_convertible_v<const _Up&, _Tp&>)
1288 optional(const optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, const _Up&>) = delete;
1289
1290 template <class _Up>
1291 requires(__check_optionalU_ctor<_Up, _Up> && reference_constructs_from_temporary_v<_Tp&, _Up>)
1292 constexpr explicit(!is_convertible_v<_Up, _Tp&>)
1293 optional(optional<_Up>&& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up>) = delete;
1294
1295 template <class _Up>
1296 requires(__check_optionalU_ctor<_Up, const _Up> && reference_constructs_from_temporary_v<_Tp&, const _Up>)
1297 constexpr explicit(!is_convertible_v<const _Up, _Tp&>)
1298 optional(const optional<_Up>&& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, const _Up>) = delete;
1299
1300 constexpr ~optional() = default;
1301
1302 using __base::__get;
1303
1304 _LIBCPP_HIDE_FROM_ABI constexpr optional& operator=(nullopt_t) noexcept {
1305 reset();
1306 return *this;
1307 }
1308
1309 constexpr optional& operator=(const optional&) noexcept = default;
1310
1311 template <class _Up>
1312 requires(is_constructible_v<_Tp&, _Up> && !reference_constructs_from_temporary_v<_Tp&, _Up>)
1313 constexpr _Tp& emplace(_Up&& __u) noexcept(is_nothrow_constructible_v<_Tp&, _Up>) {
1314 this->__construct(std::forward<_Up>(__u));
1315
1394 return this->__get();1316 return this->__get();
1395 }1317 }
13961318
1397 template <class _Up = remove_cvref_t<_Tp>>1319 constexpr void swap(optional& __rhs) noexcept { this->__swap(__rhs); }
1398 requires(is_lvalue_reference_v<_Tp> && is_object_v<__libcpp_remove_reference_t<_Tp>> &&1320
1399 !is_array_v<__libcpp_remove_reference_t<_Tp>>)1321 using __base::operator->;
1400 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decay_t<_Tp> value_or(_Up&& __v) const {1322 using __base::operator*;
1401 static_assert(1323
1402 is_constructible_v<remove_cvref_t<_Tp>, _Tp&>, "optional<T&>::value_or: remove_cv_t<T> must be constructible");1324 constexpr explicit operator bool() const noexcept { return has_value(); }
1403 static_assert(1325
1404 is_convertible_v<_Up, remove_cvref_t<_Tp>>, "optional<T&>::value_or: U must be convertible to remove_cv_t<T>");1326 using __base::has_value;
1405 return this->has_value() ? this->__get() : static_cast<remove_cvref_t<_Tp>>(std::forward<_Up>(__v));1327 using __base::value;
1328
1329 template <class _Up = remove_cv_t<_Tp>>
1330 requires(!is_array_v<_Tp> && is_object_v<_Tp>)
1331 [[nodiscard]] constexpr decay_t<_Tp> value_or(_Up&& __v) const {
1332 using _XTp = remove_cv_t<_Tp>;
1333 static_assert(is_constructible_v<_XTp, _Tp&>, "optional<T&>::value_or: remove_cv_t<T> must be constructible");
1334 static_assert(is_convertible_v<_Up, _XTp>, "optional<T&>::value_or: U must be convertible to remove_cv_t<T>");
1335 return this->has_value() ? this->__get() : static_cast<_XTp>(std::forward<_Up>(__v));
1406 }1336 }
14071337
1408 template <class _Func>1338 template <class _Func>
1409 requires(is_lvalue_reference_v<_Tp>)1339 [[nodiscard]] constexpr auto and_then(_Func&& __f) const {
1410 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const {
1411 using _Up = invoke_result_t<_Func, _Tp&>;1340 using _Up = invoke_result_t<_Func, _Tp&>;
1412 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,1341 static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
1413 "Result of f(value()) must be a specialization of std::optional");1342 "Result of f(value()) must be a specialization of std::optional");
...@@ -1417,30 +1346,31 @@ public:...@@ -1417,30 +1346,31 @@ public:
1417 }1346 }
14181347
1419 template <class _Func>1348 template <class _Func>
1420 requires(is_lvalue_reference_v<_Tp>)1349 [[nodiscard]] constexpr optional<remove_cv_t<invoke_result_t<_Func, _Tp&>>> transform(_Func&& __f) const {
1421 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional<remove_cv_t<invoke_result_t<_Func, _Tp&>>>1350 using _Up = remove_cv_t<invoke_result_t<_Func, _Tp&>>;
1422 transform(_Func&& __f) const {
1423 using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&>>;
1424 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");1351 static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
1425 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");1352 static_assert(!is_same_v<_Up, in_place_t>, "Result of f(value()) should not be std::in_place_t");
1426 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");1353 static_assert(!is_same_v<_Up, nullopt_t>, "Result of f(value()) should not be std::nullopt_t");
1427 static_assert(is_object_v<_Up>, "Result of f(value()) should be an object type");1354 static_assert(
1355 __is_valid_optional_contained_type<_Up>, "Result of f(value()) should be a valid contained type for optional");
1356
1428 if (*this)1357 if (*this)
1429 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());1358 return optional<_Up>(__optional_construct_from_invoke_tag{}, std::forward<_Func>(__f), value());
1430 return optional<_Up>();1359 return optional<_Up>();
1431 }1360 }
14321361
1433 template <invocable _Func>1362 template <invocable _Func>
1434 requires(is_lvalue_reference_v<_Tp>)1363 [[nodiscard]] constexpr optional or_else(_Func&& __f) const {
1435 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const {
1436 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,1364 static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
1437 "Result of f() should be the same type as this optional");1365 "Result of f() should be the same type as this optional");
1438 if (*this)1366 if (*this)
1439 return *this;1367 return *this;
1440 return std::forward<_Func>(__f)();1368 return std::forward<_Func>(__f)();
1441 }1369 }
1442# endif1370
1371 using __base::reset;
1443};1372};
1373# endif
14441374
1445template <class _Tp>1375template <class _Tp>
1446optional(_Tp) -> optional<_Tp>;1376optional(_Tp) -> optional<_Tp>;
...@@ -1749,7 +1679,13 @@ operator<=>(const optional<_Tp>& __x, const _Up& __v) {...@@ -1749,7 +1679,13 @@ operator<=>(const optional<_Tp>& __x, const _Up& __v) {
17491679
1750# endif // _LIBCPP_STD_VER >= 201680# endif // _LIBCPP_STD_VER >= 20
17511681
1752template <class _Tp, enable_if_t< is_move_constructible_v<_Tp> && is_swappable_v<_Tp>, int> = 0>1682template <class _Tp,
1683 enable_if_t<(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>)
1684# if _LIBCPP_STD_VER >= 26
1685 || is_reference_v<_Tp>
1686# endif
1687 ,
1688 int> = 0>
1753inline _LIBCPP_HIDE_FROM_ABI1689inline _LIBCPP_HIDE_FROM_ABI
1754_LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) {1690_LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) {
1755 __x.swap(__y);1691 __x.swap(__y);
...@@ -1759,6 +1695,28 @@ struct __make_optional_barrier_tag {...@@ -1759,6 +1695,28 @@ struct __make_optional_barrier_tag {
1759 explicit __make_optional_barrier_tag() = default;1695 explicit __make_optional_barrier_tag() = default;
1760};1696};
17611697
1698template <class _Tp, class... _Args>
1699inline constexpr bool __is_constructible_for_optional_v = is_constructible_v<_Tp, _Args...>;
1700
1701template <class _Tp, class... _Args>
1702struct __is_constructible_for_optional : bool_constant<__is_constructible_for_optional_v<_Tp, _Args...>> {};
1703
1704template <class _Tp, class _Up, class... _Args>
1705inline constexpr bool __is_constructible_for_optional_initializer_list_v =
1706 is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>;
1707
1708# if _LIBCPP_STD_VER >= 26
1709template <class _Tp, class... _Args>
1710inline constexpr bool __is_constructible_for_optional_v<_Tp&, _Args...> = false;
1711
1712template <class _Tp, class _Arg>
1713inline constexpr bool __is_constructible_for_optional_v<_Tp&, _Arg> =
1714 is_constructible_v<_Tp&, _Arg> && !reference_constructs_from_temporary_v<_Tp&, _Arg>;
1715
1716template <class _Tp, class _Up, class... _Args>
1717inline constexpr bool __is_constructible_for_optional_initializer_list_v<_Tp&, _Up, _Args...> = false;
1718# endif
1719
1762template <1720template <
1763# if _LIBCPP_STD_VER >= 261721# if _LIBCPP_STD_VER >= 26
1764 __make_optional_barrier_tag = __make_optional_barrier_tag{},1722 __make_optional_barrier_tag = __make_optional_barrier_tag{},
...@@ -1801,7 +1759,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -1801,7 +1759,7 @@ _LIBCPP_END_NAMESPACE_STD
18011759
1802_LIBCPP_POP_MACROS1760_LIBCPP_POP_MACROS
18031761
1804# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201762# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1805# include <atomic>1763# include <atomic>
1806# include <climits>1764# include <climits>
1807# include <concepts>1765# include <concepts>
lib/libcxx/include/ostream+2-2
...@@ -193,7 +193,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);...@@ -193,7 +193,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
193193
194# endif // _LIBCPP_HAS_LOCALIZATION194# endif // _LIBCPP_HAS_LOCALIZATION
195195
196# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20196# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
197# include <atomic>197# include <atomic>
198# include <concepts>198# include <concepts>
199# include <cstdio>199# include <cstdio>
...@@ -206,7 +206,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);...@@ -206,7 +206,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
206# include <type_traits>206# include <type_traits>
207# endif207# endif
208208
209# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23209# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
210# include <locale>210# include <locale>
211# endif211# endif
212212
lib/libcxx/include/print+56-80
...@@ -52,12 +52,15 @@ namespace std {...@@ -52,12 +52,15 @@ namespace std {
52# pragma GCC system_header52# pragma GCC system_header
53# endif53# endif
5454
55# if _LIBCPP_STD_VER >= 23
56
55_LIBCPP_BEGIN_NAMESPACE_STD57_LIBCPP_BEGIN_NAMESPACE_STD
5658
57# ifdef _LIBCPP_WIN32API59# ifdef _LIBCPP_WIN32API
60_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
58_LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream);61_LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream);
5962
60# if _LIBCPP_HAS_WIDE_CHARACTERS63# if _LIBCPP_HAS_WIDE_CHARACTERS
61// A wrapper for WriteConsoleW which is used to write to the Windows64// A wrapper for WriteConsoleW which is used to write to the Windows
62// console. This function is in the dylib to avoid pulling in windows.h65// console. This function is in the dylib to avoid pulling in windows.h
63// in the library headers. The function itself uses some private parts66// in the library headers. The function itself uses some private parts
...@@ -68,12 +71,9 @@ _LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream);...@@ -68,12 +71,9 @@ _LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream);
68//71//
69// Note the function is only implemented on the Windows platform.72// Note the function is only implemented on the Windows platform.
70_LIBCPP_EXPORTED_FROM_ABI void __write_to_windows_console(FILE* __stream, wstring_view __view);73_LIBCPP_EXPORTED_FROM_ABI void __write_to_windows_console(FILE* __stream, wstring_view __view);
71# endif // _LIBCPP_HAS_WIDE_CHARACTERS74# endif // _LIBCPP_HAS_WIDE_CHARACTERS
72# elif __has_include(<unistd.h>)75_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
73_LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream);76# endif // _LIBCPP_WIN32API
74# endif // _LIBCPP_WIN32API
75
76# if _LIBCPP_STD_VER >= 23
7777
78# if _LIBCPP_HAS_UNICODE78# if _LIBCPP_HAS_UNICODE
79// This is the code to transcode UTF-8 to UTF-16. This is used on79// This is the code to transcode UTF-8 to UTF-16. This is used on
...@@ -197,36 +197,30 @@ inline constexpr bool __use_unicode_execution_charset = _MSVC_EXECUTION_CHARACTE...@@ -197,36 +197,30 @@ inline constexpr bool __use_unicode_execution_charset = _MSVC_EXECUTION_CHARACTE
197inline constexpr bool __use_unicode_execution_charset = true;197inline constexpr bool __use_unicode_execution_charset = true;
198# endif198# endif
199199
200# ifdef _LIBCPP_WIN32API
200_LIBCPP_HIDE_FROM_ABI inline bool __is_terminal([[maybe_unused]] FILE* __stream) {201_LIBCPP_HIDE_FROM_ABI inline bool __is_terminal([[maybe_unused]] FILE* __stream) {
201 // The macro _LIBCPP_TESTING_PRINT_IS_TERMINAL is used to change202 // The macro _LIBCPP_TESTING_PRINT_IS_TERMINAL is used to change
202 // the behavior in the test. This is not part of the public API.203 // the behavior in the test. This is not part of the public API.
203# ifdef _LIBCPP_TESTING_PRINT_IS_TERMINAL204# ifdef _LIBCPP_TESTING_PRINT_IS_TERMINAL
204 return _LIBCPP_TESTING_PRINT_IS_TERMINAL(__stream);205 return _LIBCPP_TESTING_PRINT_IS_TERMINAL(__stream);
205# elif _LIBCPP_AVAILABILITY_HAS_PRINT == 0 || !_LIBCPP_HAS_TERMINAL206# else
206 return false;
207# elif defined(_LIBCPP_WIN32API)
208 return std::__is_windows_terminal(__stream);207 return std::__is_windows_terminal(__stream);
209# elif __has_include(<unistd.h>)208# endif
210 return std::__is_posix_terminal(__stream);209}
211# else210# endif // _LIBCPP_WIN32API
212# error "Provide a way to determine whether a FILE* is a terminal"211
213# endif212[[noreturn]] _LIBCPP_HIDE_FROM_ABI inline void __handle_output_error(FILE* __stream) {
213 if (std::feof(__stream))
214 std::__throw_system_error(EIO, "EOF while writing the formatted output");
215 std::__throw_system_error(std::ferror(__stream), "failed to write formatted output");
214}216}
215217
216template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).218template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
217_LIBCPP_HIDE_FROM_ABI inline void219_LIBCPP_HIDE_FROM_ABI inline void __output_nonunicode(FILE* __stream, string_view __text) {
218__vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl) {
219 _LIBCPP_ASSERT_NON_NULL(__stream, "__stream must be a valid pointer to an output C stream");220 _LIBCPP_ASSERT_NON_NULL(__stream, "__stream must be a valid pointer to an output C stream");
220 string __str = std::vformat(__fmt, __args);221 size_t __size = std::fwrite(__text.data(), 1, __text.size(), __stream);
221 if (__write_nl)222 if (__size < __text.size())
222 __str.push_back('\n');223 __print::__handle_output_error(__stream);
223
224 size_t __size = fwrite(__str.data(), 1, __str.size(), __stream);
225 if (__size < __str.size()) {
226 if (std::feof(__stream))
227 std::__throw_system_error(EIO, "EOF while writing the formatted output");
228 std::__throw_system_error(std::ferror(__stream), "failed to write formatted output");
229 }
230}224}
231225
232# if _LIBCPP_HAS_UNICODE226# if _LIBCPP_HAS_UNICODE
...@@ -236,27 +230,10 @@ __vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args, bool...@@ -236,27 +230,10 @@ __vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args, bool
236// terminal when the output is redirected. Typically during testing the230// terminal when the output is redirected. Typically during testing the
237// output is redirected to be able to capture it. This makes it hard to231// output is redirected to be able to capture it. This makes it hard to
238// test this code path.232// test this code path.
239template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
240_LIBCPP_HIDE_FROM_ABI inline void
241__vprint_unicode_posix(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl, bool __is_terminal) {
242 // TODO PRINT Should flush errors throw too?
243 if (__is_terminal)
244 std::fflush(__stream);
245
246 __print::__vprint_nonunicode(__stream, __fmt, __args, __write_nl);
247}
248233
249# if _LIBCPP_HAS_WIDE_CHARACTERS234# if _LIBCPP_HAS_WIDE_CHARACTERS
250template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).235template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
251_LIBCPP_HIDE_FROM_ABI inline void236_LIBCPP_HIDE_FROM_ABI inline void __output_unicode_windows([[maybe_unused]] FILE* __stream, string_view __text) {
252__vprint_unicode_windows(FILE* __stream, string_view __fmt, format_args __args, bool __write_nl, bool __is_terminal) {
253 if (!__is_terminal)
254 return __print::__vprint_nonunicode(__stream, __fmt, __args, __write_nl);
255
256 // TODO PRINT Should flush errors throw too?
257 std::fflush(__stream);
258
259 string __str = std::vformat(__fmt, __args);
260 // UTF-16 uses the same number or less code units than UTF-8.237 // UTF-16 uses the same number or less code units than UTF-8.
261 // However the size of the code unit is 16 bits instead of 8 bits.238 // However the size of the code unit is 16 bits instead of 8 bits.
262 //239 //
...@@ -266,11 +243,8 @@ __vprint_unicode_windows(FILE* __stream, string_view __fmt, format_args __args,...@@ -266,11 +243,8 @@ __vprint_unicode_windows(FILE* __stream, string_view __fmt, format_args __args,
266 // the final size might be larger when the estimate is wrong.243 // the final size might be larger when the estimate is wrong.
267 //244 //
268 // TODO PRINT profile and improve the speed of this code.245 // TODO PRINT profile and improve the speed of this code.
269 __format::__retarget_buffer<wchar_t> __buffer{__str.size()};246 __format::__retarget_buffer<wchar_t> __buffer{__text.size()};
270 __unicode::__transcode(__str.begin(), __str.end(), __buffer.__make_output_iterator());247 __unicode::__transcode(__text.begin(), __text.end(), __buffer.__make_output_iterator());
271 if (__write_nl)
272 __buffer.push_back(L'\n');
273
274 [[maybe_unused]] wstring_view __view = __buffer.__view();248 [[maybe_unused]] wstring_view __view = __buffer.__view();
275249
276 // The macro _LIBCPP_TESTING_PRINT_WRITE_TO_WINDOWS_CONSOLE_FUNCTION is used to change250 // The macro _LIBCPP_TESTING_PRINT_WRITE_TO_WINDOWS_CONSOLE_FUNCTION is used to change
...@@ -287,11 +261,7 @@ __vprint_unicode_windows(FILE* __stream, string_view __fmt, format_args __args,...@@ -287,11 +261,7 @@ __vprint_unicode_windows(FILE* __stream, string_view __fmt, format_args __args,
287# endif // _LIBCPP_HAS_WIDE_CHARACTERS261# endif // _LIBCPP_HAS_WIDE_CHARACTERS
288262
289template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).263template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
290_LIBCPP_HIDE_FROM_ABI inline void264_LIBCPP_HIDE_FROM_ABI inline void __output_unicode([[maybe_unused]] FILE* __stream, string_view __text) {
291__vprint_unicode([[maybe_unused]] FILE* __stream,
292 [[maybe_unused]] string_view __fmt,
293 [[maybe_unused]] format_args __args,
294 [[maybe_unused]] bool __write_nl) {
295 _LIBCPP_ASSERT_NON_NULL(__stream, "__stream must be a valid pointer to an output C stream");265 _LIBCPP_ASSERT_NON_NULL(__stream, "__stream must be a valid pointer to an output C stream");
296266
297 // [print.fun]267 // [print.fun]
...@@ -302,9 +272,6 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,...@@ -302,9 +272,6 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
302 // Otherwise writes out to stream unchanged. If the native272 // Otherwise writes out to stream unchanged. If the native
303 // Unicode API is used, the function flushes stream before273 // Unicode API is used, the function flushes stream before
304 // writing out.274 // writing out.
305 // 8 - Throws: Any exception thrown by the call to vformat
306 // ([format.err.report]). system_error if writing to the terminal
307 // or stream fails. May throw bad_alloc.
308 // 9 - Recommended practice: If invoking the native Unicode API275 // 9 - Recommended practice: If invoking the native Unicode API
309 // requires transcoding, implementations should substitute276 // requires transcoding, implementations should substitute
310 // invalid code units with U+FFFD replacement character per the277 // invalid code units with U+FFFD replacement character per the
...@@ -316,9 +283,15 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,...@@ -316,9 +283,15 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
316 // Windows there is a different API. This API requires transcoding.283 // Windows there is a different API. This API requires transcoding.
317284
318# ifndef _LIBCPP_WIN32API285# ifndef _LIBCPP_WIN32API
319 __print::__vprint_unicode_posix(__stream, __fmt, __args, __write_nl, __print::__is_terminal(__stream));286 __print::__output_nonunicode(__stream, __text);
320# elif _LIBCPP_HAS_WIDE_CHARACTERS287# elif _LIBCPP_HAS_WIDE_CHARACTERS
321 __print::__vprint_unicode_windows(__stream, __fmt, __args, __write_nl, __print::__is_terminal(__stream));288 if (__print::__is_terminal(__stream)) {
289 // TODO PRINT Should flush errors throw too?
290 std::fflush(__stream);
291 __print::__output_unicode_windows(__stream, __text);
292 } else {
293 __print::__output_nonunicode(__stream, __text);
294 }
322# else295# else
323# error "Windows builds with wchar_t disabled are not supported."296# error "Windows builds with wchar_t disabled are not supported."
324# endif297# endif
...@@ -329,51 +302,54 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,...@@ -329,51 +302,54 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
329} // namespace __print302} // namespace __print
330303
331template <class... _Args>304template <class... _Args>
332_LIBCPP_HIDE_FROM_ABI void305_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE void
333print(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt, _Args&&... __args) {306print(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt, _Args&&... __args) {
307 auto __result = std::vformat(__fmt.get(), std::make_format_args(__args...));
334# if _LIBCPP_HAS_UNICODE308# if _LIBCPP_HAS_UNICODE
335 if constexpr (__print::__use_unicode_execution_charset)309 if constexpr (__print::__use_unicode_execution_charset)
336 __print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), false);310 __print::__output_unicode(__stream, __result);
337 else311 else
338 __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), false);312 __print::__output_nonunicode(__stream, __result);
339# else // _LIBCPP_HAS_UNICODE313# else // _LIBCPP_HAS_UNICODE
340 __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), false);314 __print::__output_nonunicode(__stream, __result);
341# endif // _LIBCPP_HAS_UNICODE315# endif // _LIBCPP_HAS_UNICODE
342}316}
343317
344template <class... _Args>318template <class... _Args>
345_LIBCPP_HIDE_FROM_ABI void print(format_string<_Args...> __fmt, _Args&&... __args) {319_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE void print(format_string<_Args...> __fmt, _Args&&... __args) {
346 std::print(stdout, __fmt, std::forward<_Args>(__args)...);320 std::print(stdout, __fmt, std::forward<_Args>(__args)...);
347}321}
348322
349template <class... _Args>323template <class... _Args>
350_LIBCPP_HIDE_FROM_ABI void324_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE void
351println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt, _Args&&... __args) {325println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt, _Args&&... __args) {
326 auto __result = std::vformat(__fmt.get(), std::make_format_args(__args...));
327 __result.push_back('\n');
352# if _LIBCPP_HAS_UNICODE328# if _LIBCPP_HAS_UNICODE
353 // Note the wording in the Standard is inefficient. The output of329 // Note the wording in the Standard is inefficient. The output of
354 // std::format is a std::string which is then copied. This solution330 // std::format is a std::string which is then copied. This solution
355 // just appends a newline at the end of the output.331 // just appends a newline at the end of the output.
356 if constexpr (__print::__use_unicode_execution_charset)332 if constexpr (__print::__use_unicode_execution_charset)
357 __print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), true);333 __print::__output_unicode(__stream, __result);
358 else334 else
359 __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), true);335 __print::__output_nonunicode(__stream, __result);
360# else // _LIBCPP_HAS_UNICODE336# else // _LIBCPP_HAS_UNICODE
361 __print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), true);337 __print::__output_nonunicode(__stream, __result);
362# endif // _LIBCPP_HAS_UNICODE338# endif // _LIBCPP_HAS_UNICODE
363}339}
364340
365template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).341template <class _Void = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
366_LIBCPP_HIDE_FROM_ABI inline void println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream) {342_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE inline void println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream) {
367 std::print(__stream, "\n");343 std::print(__stream, (_Void(), "\n"));
368}344}
369345
370template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).346template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
371_LIBCPP_HIDE_FROM_ABI inline void println() {347_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE inline void println() {
372 println(stdout);348 println(stdout);
373}349}
374350
375template <class... _Args>351template <class... _Args>
376_LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __args) {352_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE void println(format_string<_Args...> __fmt, _Args&&... __args) {
377 std::println(stdout, __fmt, std::forward<_Args>(__args)...);353 std::println(stdout, __fmt, std::forward<_Args>(__args)...);
378}354}
379355
...@@ -381,7 +357,7 @@ _LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __a...@@ -381,7 +357,7 @@ _LIBCPP_HIDE_FROM_ABI void println(format_string<_Args...> __fmt, _Args&&... __a
381template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).357template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
382_LIBCPP_HIDE_FROM_ABI inline void358_LIBCPP_HIDE_FROM_ABI inline void
383vprint_unicode(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, string_view __fmt, format_args __args) {359vprint_unicode(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, string_view __fmt, format_args __args) {
384 __print::__vprint_unicode(__stream, __fmt, __args, false);360 __print::__output_unicode(__stream, std::vformat(__fmt, __args));
385}361}
386362
387template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).363template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
...@@ -394,7 +370,7 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(string_view __fmt, format_args...@@ -394,7 +370,7 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(string_view __fmt, format_args
394template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).370template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
395_LIBCPP_HIDE_FROM_ABI inline void371_LIBCPP_HIDE_FROM_ABI inline void
396vprint_nonunicode(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, string_view __fmt, format_args __args) {372vprint_nonunicode(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, string_view __fmt, format_args __args) {
397 __print::__vprint_nonunicode(__stream, __fmt, __args, false);373 __print::__output_nonunicode(__stream, std::vformat(__fmt, __args));
398}374}
399375
400template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).376template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
...@@ -402,10 +378,10 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(string_view __fmt, format_ar...@@ -402,10 +378,10 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(string_view __fmt, format_ar
402 std::vprint_nonunicode(stdout, __fmt, __args);378 std::vprint_nonunicode(stdout, __fmt, __args);
403}379}
404380
405# endif // _LIBCPP_STD_VER >= 23
406
407_LIBCPP_END_NAMESPACE_STD381_LIBCPP_END_NAMESPACE_STD
408382
383# endif // _LIBCPP_STD_VER >= 23
384
409#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)385#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
410386
411#endif // _LIBCPP_PRINT387#endif // _LIBCPP_PRINT
lib/libcxx/include/queue+1-1
...@@ -970,7 +970,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -970,7 +970,7 @@ _LIBCPP_END_NAMESPACE_STD
970970
971_LIBCPP_POP_MACROS971_LIBCPP_POP_MACROS
972972
973# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20973# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
974# include <concepts>974# include <concepts>
975# include <cstdlib>975# include <cstdlib>
976# include <functional>976# include <functional>
lib/libcxx/include/random+1-1
...@@ -1726,7 +1726,7 @@ class piecewise_linear_distribution...@@ -1726,7 +1726,7 @@ class piecewise_linear_distribution
1726# pragma GCC system_header1726# pragma GCC system_header
1727# endif1727# endif
17281728
1729# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201729# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1730# include <algorithm>1730# include <algorithm>
1731# include <climits>1731# include <climits>
1732# include <cmath>1732# include <cmath>
lib/libcxx/include/ranges+39-1
...@@ -201,6 +201,16 @@ namespace std::ranges {...@@ -201,6 +201,16 @@ namespace std::ranges {
201 inline constexpr unspecified filter = unspecified;201 inline constexpr unspecified filter = unspecified;
202 }202 }
203203
204 // [range.concat], concat view
205 template <input_range... Views>
206 requires (view<Views> && ...) && (sizeof...(Views) > 0) &&
207 concatable<Views...>
208 class concat_view;
209
210 namespace views {
211 inline constexpr unspecified concat = unspecified;
212 }
213
204 // [range.drop], drop view214 // [range.drop], drop view
205 template<view V>215 template<view V>
206 class drop_view;216 class drop_view;
...@@ -337,6 +347,17 @@ namespace std::ranges {...@@ -337,6 +347,17 @@ namespace std::ranges {
337347
338 namespace views { template<class T> inline constexpr unspecified istream = unspecified; }348 namespace views { template<class T> inline constexpr unspecified istream = unspecified; }
339349
350 // [range.enumerate], enumerate view
351 template<view View>
352 requires see below
353 class enumerate_view; // since C++23
354
355 template<class View>
356 constexpr bool enable_borrowed_range<enumerate_view<View>> = // since C++23
357 enable_borrowed_range<View>;
358
359 namespace views { inline constexpr unspecified enumerate = unspecified; } // since C++23
360
340 // [range.zip], zip view361 // [range.zip], zip view
341 template<input_range... Views>362 template<input_range... Views>
342 requires (view<Views> && ...) && (sizeof...(Views) > 0)363 requires (view<Views> && ...) && (sizeof...(Views) > 0)
...@@ -396,6 +417,17 @@ namespace std::ranges {...@@ -396,6 +417,17 @@ namespace std::ranges {
396 class chunk_by_view; // C++23417 class chunk_by_view; // C++23
397418
398 namespace views { inline constexpr unspecified chunk_by = unspecified; } // C++23419 namespace views { inline constexpr unspecified chunk_by = unspecified; } // C++23
420
421 // [range.stride.view], stride view
422 template<input_range V>
423 requires view<V>
424 class stride_view; // C++23
425
426 template<class V>
427 constexpr bool enable_borrowed_range<stride_view<V>> =
428 enable_borrowed_range<V>; // C++23
429
430 namespace views { inline constexpr unspecified stride = unspecified; } // C++23
399}431}
400432
401namespace std {433namespace std {
...@@ -482,14 +514,20 @@ namespace std {...@@ -482,14 +514,20 @@ namespace std {
482# include <__ranges/adjacent_view.h>514# include <__ranges/adjacent_view.h>
483# include <__ranges/as_rvalue_view.h>515# include <__ranges/as_rvalue_view.h>
484# include <__ranges/chunk_by_view.h>516# include <__ranges/chunk_by_view.h>
517# include <__ranges/enumerate_view.h>
485# include <__ranges/from_range.h>518# include <__ranges/from_range.h>
486# include <__ranges/join_with_view.h>519# include <__ranges/join_with_view.h>
487# include <__ranges/repeat_view.h>520# include <__ranges/repeat_view.h>
521# include <__ranges/stride_view.h>
488# include <__ranges/to.h>522# include <__ranges/to.h>
489# include <__ranges/zip_transform_view.h>523# include <__ranges/zip_transform_view.h>
490# include <__ranges/zip_view.h>524# include <__ranges/zip_view.h>
491# endif525# endif
492526
527# if _LIBCPP_STD_VER >= 26
528# include <__ranges/concat_view.h>
529# endif
530
493# include <version>531# include <version>
494532
495// standard-mandated includes533// standard-mandated includes
...@@ -507,7 +545,7 @@ namespace std {...@@ -507,7 +545,7 @@ namespace std {
507# pragma GCC system_header545# pragma GCC system_header
508# endif546# endif
509547
510# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20548# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
511# include <cstdlib>549# include <cstdlib>
512# include <iosfwd>550# include <iosfwd>
513# include <type_traits>551# include <type_traits>
lib/libcxx/include/ratio+1-1
...@@ -491,7 +491,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -491,7 +491,7 @@ _LIBCPP_END_NAMESPACE_STD
491491
492_LIBCPP_POP_MACROS492_LIBCPP_POP_MACROS
493493
494# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20494# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
495# include <type_traits>495# include <type_traits>
496# endif496# endif
497#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)497#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/regex+5-2
...@@ -817,6 +817,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;...@@ -817,6 +817,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
817# include <__iterator/wrap_iter.h>817# include <__iterator/wrap_iter.h>
818# include <__locale>818# include <__locale>
819# include <__memory/addressof.h>819# include <__memory/addressof.h>
820# include <__memory/pointer_traits.h>
820# include <__memory/shared_ptr.h>821# include <__memory/shared_ptr.h>
821# include <__memory_resource/polymorphic_allocator.h>822# include <__memory_resource/polymorphic_allocator.h>
822# include <__type_traits/is_swappable.h>823# include <__type_traits/is_swappable.h>
...@@ -840,6 +841,7 @@ _LIBCPP_PUSH_MACROS...@@ -840,6 +841,7 @@ _LIBCPP_PUSH_MACROS
840# define _LIBCPP_REGEX_COMPLEXITY_FACTOR 4096841# define _LIBCPP_REGEX_COMPLEXITY_FACTOR 4096
841842
842_LIBCPP_BEGIN_NAMESPACE_STD843_LIBCPP_BEGIN_NAMESPACE_STD
844_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
843845
844namespace regex_constants {846namespace regex_constants {
845847
...@@ -5167,7 +5169,7 @@ regex_search(__wrap_iter<_Iter> __first,...@@ -5167,7 +5169,7 @@ regex_search(__wrap_iter<_Iter> __first,
5167 const basic_regex<_CharT, _Traits>& __e,5169 const basic_regex<_CharT, _Traits>& __e,
5168 regex_constants::match_flag_type __flags = regex_constants::match_default) {5170 regex_constants::match_flag_type __flags = regex_constants::match_default) {
5169 match_results<const _CharT*> __mc;5171 match_results<const _CharT*> __mc;
5170 bool __r = __e.__search(__first.base(), __last.base(), __mc, __flags);5172 bool __r = __e.__search(std::__to_address(__first), std::__to_address(__last), __mc, __flags);
5171 __m.__assign(__first, __last, __mc, __flags & regex_constants::__no_update_pos);5173 __m.__assign(__first, __last, __mc, __flags & regex_constants::__no_update_pos);
5172 return __r;5174 return __r;
5173}5175}
...@@ -5807,6 +5809,7 @@ regex_replace(const _CharT* __s,...@@ -5807,6 +5809,7 @@ regex_replace(const _CharT* __s,
5807 return __r;5809 return __r;
5808}5810}
58095811
5812_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
5810_LIBCPP_END_NAMESPACE_STD5813_LIBCPP_END_NAMESPACE_STD
58115814
5812# if _LIBCPP_STD_VER >= 175815# if _LIBCPP_STD_VER >= 17
...@@ -5831,7 +5834,7 @@ _LIBCPP_POP_MACROS...@@ -5831,7 +5834,7 @@ _LIBCPP_POP_MACROS
58315834
5832# endif // _LIBCPP_HAS_LOCALIZATION5835# endif // _LIBCPP_HAS_LOCALIZATION
58335836
5834# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 205837# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
5835# include <atomic>5838# include <atomic>
5836# include <concepts>5839# include <concepts>
5837# include <cstdlib>5840# include <cstdlib>
lib/libcxx/include/scoped_allocator+5-5
...@@ -135,10 +135,10 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>...@@ -135,10 +135,10 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
135_LIBCPP_PUSH_MACROS135_LIBCPP_PUSH_MACROS
136# include <__undef_macros>136# include <__undef_macros>
137137
138_LIBCPP_BEGIN_NAMESPACE_STD
139
140# if !defined(_LIBCPP_CXX03_LANG)138# if !defined(_LIBCPP_CXX03_LANG)
141139
140_LIBCPP_BEGIN_NAMESPACE_STD
141
142// scoped_allocator_adaptor142// scoped_allocator_adaptor
143143
144template <class... _Allocs>144template <class... _Allocs>
...@@ -558,13 +558,13 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const scoped_allocator_adaptor<_Out...@@ -558,13 +558,13 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const scoped_allocator_adaptor<_Out
558558
559# endif // _LIBCPP_STD_VER <= 17559# endif // _LIBCPP_STD_VER <= 17
560560
561# endif // !defined(_LIBCPP_CXX03_LANG)
562
563_LIBCPP_END_NAMESPACE_STD561_LIBCPP_END_NAMESPACE_STD
564562
563# endif // !defined(_LIBCPP_CXX03_LANG)
564
565_LIBCPP_POP_MACROS565_LIBCPP_POP_MACROS
566566
567# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20567# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
568# include <atomic>568# include <atomic>
569# include <climits>569# include <climits>
570# include <concepts>570# include <concepts>
lib/libcxx/include/semaphore+1-1
...@@ -180,7 +180,7 @@ _LIBCPP_POP_MACROS...@@ -180,7 +180,7 @@ _LIBCPP_POP_MACROS
180180
181# endif // _LIBCPP_HAS_THREADS181# endif // _LIBCPP_HAS_THREADS
182182
183# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20183# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
184# include <atomic>184# include <atomic>
185# include <cstddef>185# include <cstddef>
186# endif186# endif
lib/libcxx/include/set+373-214
...@@ -71,12 +71,12 @@ public:...@@ -71,12 +71,12 @@ public:
71 const allocator_type& a);71 const allocator_type& a);
72 template <class InputIterator>72 template <class InputIterator>
73 set(InputIterator first, InputIterator last, const allocator_type& a)73 set(InputIterator first, InputIterator last, const allocator_type& a)
74 : set(first, last, Compare(), a) {} // C++1474 : set(first, last, Compare(), a) {}
75 template<container-compatible-range<value_type> R>75 template<container-compatible-range<value_type> R>
76 set(from_range_t, R&& rg, const Allocator& a))76 set(from_range_t, R&& rg, const Allocator& a))
77 : set(from_range, std::forward<R>(rg), Compare(), a) { } // C++2377 : set(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
78 set(initializer_list<value_type> il, const allocator_type& a)78 set(initializer_list<value_type> il, const allocator_type& a)
79 : set(il, Compare(), a) {} // C++1479 : set(il, Compare(), a) {}
80 ~set();80 ~set();
8181
82 set& operator=(const set& s);82 set& operator=(const set& s);
...@@ -316,12 +316,12 @@ public:...@@ -316,12 +316,12 @@ public:
316 const allocator_type& a);316 const allocator_type& a);
317 template <class InputIterator>317 template <class InputIterator>
318 multiset(InputIterator first, InputIterator last, const allocator_type& a)318 multiset(InputIterator first, InputIterator last, const allocator_type& a)
319 : set(first, last, Compare(), a) {} // C++14319 : set(first, last, Compare(), a) {}
320 template<container-compatible-range<value_type> R>320 template<container-compatible-range<value_type> R>
321 multiset(from_range_t, R&& rg, const Allocator& a))321 multiset(from_range_t, R&& rg, const Allocator& a))
322 : multiset(from_range, std::forward<R>(rg), Compare(), a) { } // C++23322 : multiset(from_range, std::forward<R>(rg), Compare(), a) { } // C++23
323 multiset(initializer_list<value_type> il, const allocator_type& a)323 multiset(initializer_list<value_type> il, const allocator_type& a)
324 : set(il, Compare(), a) {} // C++14324 : set(il, Compare(), a) {}
325 ~multiset();325 ~multiset();
326326
327 multiset& operator=(const multiset& s);327 multiset& operator=(const multiset& s);
...@@ -615,24 +615,27 @@ public:...@@ -615,24 +615,27 @@ public:
615 template <class _Key2, class _Compare2, class _Alloc2>615 template <class _Key2, class _Compare2, class _Alloc2>
616 friend class multiset;616 friend class multiset;
617617
618 _LIBCPP_HIDE_FROM_ABI set() _NOEXCEPT_(618 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set() _NOEXCEPT_(
619 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&619 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&
620 is_nothrow_copy_constructible<key_compare>::value)620 is_nothrow_copy_constructible<key_compare>::value)
621 : __tree_(value_compare()) {}621 : __tree_(value_compare()) {}
622622
623 _LIBCPP_HIDE_FROM_ABI explicit set(const value_compare& __comp) _NOEXCEPT_(623 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit set(const value_compare& __comp) _NOEXCEPT_(
624 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)624 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)
625 : __tree_(__comp) {}625 : __tree_(__comp) {}
626626
627 _LIBCPP_HIDE_FROM_ABI explicit set(const value_compare& __comp, const allocator_type& __a) : __tree_(__comp, __a) {}627 _LIBCPP_HIDE_FROM_ABI
628 _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit set(const value_compare& __comp, const allocator_type& __a)
629 : __tree_(__comp, __a) {}
628 template <class _InputIterator>630 template <class _InputIterator>
629 _LIBCPP_HIDE_FROM_ABI set(_InputIterator __f, _InputIterator __l, const value_compare& __comp = value_compare())631 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
632 set(_InputIterator __f, _InputIterator __l, const value_compare& __comp = value_compare())
630 : __tree_(__comp) {633 : __tree_(__comp) {
631 insert(__f, __l);634 insert(__f, __l);
632 }635 }
633636
634 template <class _InputIterator>637 template <class _InputIterator>
635 _LIBCPP_HIDE_FROM_ABI638 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
636 set(_InputIterator __f, _InputIterator __l, const value_compare& __comp, const allocator_type& __a)639 set(_InputIterator __f, _InputIterator __l, const value_compare& __comp, const allocator_type& __a)
637 : __tree_(__comp, __a) {640 : __tree_(__comp, __a) {
638 insert(__f, __l);641 insert(__f, __l);
...@@ -640,7 +643,7 @@ public:...@@ -640,7 +643,7 @@ public:
640643
641# if _LIBCPP_STD_VER >= 23644# if _LIBCPP_STD_VER >= 23
642 template <_ContainerCompatibleRange<value_type> _Range>645 template <_ContainerCompatibleRange<value_type> _Range>
643 _LIBCPP_HIDE_FROM_ABI646 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
644 set(from_range_t,647 set(from_range_t,
645 _Range&& __range,648 _Range&& __range,
646 const key_compare& __comp = key_compare(),649 const key_compare& __comp = key_compare(),
...@@ -650,263 +653,340 @@ public:...@@ -650,263 +653,340 @@ public:
650 }653 }
651# endif654# endif
652655
653# if _LIBCPP_STD_VER >= 14
654 template <class _InputIterator>656 template <class _InputIterator>
655 _LIBCPP_HIDE_FROM_ABI set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)657 _LIBCPP_HIDE_FROM_ABI
658 _LIBCPP_CONSTEXPR_SINCE_CXX26 set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
656 : set(__f, __l, key_compare(), __a) {}659 : set(__f, __l, key_compare(), __a) {}
657# endif
658660
659# if _LIBCPP_STD_VER >= 23661# if _LIBCPP_STD_VER >= 23
660 template <_ContainerCompatibleRange<value_type> _Range>662 template <_ContainerCompatibleRange<value_type> _Range>
661 _LIBCPP_HIDE_FROM_ABI set(from_range_t, _Range&& __range, const allocator_type& __a)663 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set(from_range_t, _Range&& __range, const allocator_type& __a)
662 : set(from_range, std::forward<_Range>(__range), key_compare(), __a) {}664 : set(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
663# endif665# endif
664666
665 _LIBCPP_HIDE_FROM_ABI set(const set& __s) = default;667 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set(const set& __s) = default;
666668
667 _LIBCPP_HIDE_FROM_ABI set& operator=(const set& __s) = default;669 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set& operator=(const set& __s) = default;
668670
669# ifndef _LIBCPP_CXX03_LANG671# ifndef _LIBCPP_CXX03_LANG
670 _LIBCPP_HIDE_FROM_ABI set(set&& __s) = default;672 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set(set&& __s) = default;
671# endif // _LIBCPP_CXX03_LANG673# endif // _LIBCPP_CXX03_LANG
672674
673 _LIBCPP_HIDE_FROM_ABI explicit set(const allocator_type& __a) : __tree_(__a) {}675 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit set(const allocator_type& __a) : __tree_(__a) {}
674676
675 _LIBCPP_HIDE_FROM_ABI set(const set& __s, const allocator_type& __alloc) : __tree_(__s.__tree_, __alloc) {}677 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set(const set& __s, const allocator_type& __alloc)
678 : __tree_(__s.__tree_, __alloc) {}
676679
677# ifndef _LIBCPP_CXX03_LANG680# ifndef _LIBCPP_CXX03_LANG
678 _LIBCPP_HIDE_FROM_ABI set(set&& __s, const allocator_type& __alloc) : __tree_(std::move(__s.__tree_), __alloc) {}681 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set(set&& __s, const allocator_type& __alloc)
682 : __tree_(std::move(__s.__tree_), __alloc) {}
679683
680 _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())684 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
685 set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
681 : __tree_(__comp) {686 : __tree_(__comp) {
682 insert(__il.begin(), __il.end());687 insert(__il.begin(), __il.end());
683 }688 }
684689
685 _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const value_compare& __comp, const allocator_type& __a)690 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
691 set(initializer_list<value_type> __il, const value_compare& __comp, const allocator_type& __a)
686 : __tree_(__comp, __a) {692 : __tree_(__comp, __a) {
687 insert(__il.begin(), __il.end());693 insert(__il.begin(), __il.end());
688 }694 }
689695
690# if _LIBCPP_STD_VER >= 14696 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set(initializer_list<value_type> __il, const allocator_type& __a)
691 _LIBCPP_HIDE_FROM_ABI set(initializer_list<value_type> __il, const allocator_type& __a)
692 : set(__il, key_compare(), __a) {}697 : set(__il, key_compare(), __a) {}
693# endif
694698
695 _LIBCPP_HIDE_FROM_ABI set& operator=(initializer_list<value_type> __il) {699 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set& operator=(initializer_list<value_type> __il) {
696 clear();700 clear();
697 insert(__il.begin(), __il.end());701 insert(__il.begin(), __il.end());
698 return *this;702 return *this;
699 }703 }
700704
701 _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) = default;705 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 set& operator=(set&& __s) = default;
702# endif // _LIBCPP_CXX03_LANG706# endif // _LIBCPP_CXX03_LANG
703707
704 _LIBCPP_HIDE_FROM_ABI ~set() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); }708 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~set() {
709 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");
710 }
705711
706 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }712 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT {
707 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }713 return __tree_.begin();
708 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }714 }
709 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }715 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT {
716 return __tree_.begin();
717 }
718 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT {
719 return __tree_.end();
720 }
721 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT {
722 return __tree_.end();
723 }
710724
711 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }725 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT {
712 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {726 return reverse_iterator(end());
727 }
728 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
729 rbegin() const _NOEXCEPT {
713 return const_reverse_iterator(end());730 return const_reverse_iterator(end());
714 }731 }
715 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }732 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT {
716 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {733 return reverse_iterator(begin());
734 }
735 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const _NOEXCEPT {
717 return const_reverse_iterator(begin());736 return const_reverse_iterator(begin());
718 }737 }
719738
720 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }739 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT {
721 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }740 return begin();
722 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }741 }
723 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }742 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT {
743 return end();
744 }
745 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
746 crbegin() const _NOEXCEPT {
747 return rbegin();
748 }
749 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT {
750 return rend();
751 }
724752
725 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }753 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const _NOEXCEPT {
726 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }754 return __tree_.size() == 0;
727 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }755 }
756 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT {
757 return __tree_.size();
758 }
759 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
760 return __tree_.max_size();
761 }
728762
729 // modifiers:763 // modifiers:
730# ifndef _LIBCPP_CXX03_LANG764# ifndef _LIBCPP_CXX03_LANG
731 template <class... _Args>765 template <class... _Args>
732 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {766 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> emplace(_Args&&... __args) {
733 return __tree_.__emplace_unique(std::forward<_Args>(__args)...);767 return __tree_.__emplace_unique(std::forward<_Args>(__args)...);
734 }768 }
735 template <class... _Args>769 template <class... _Args>
736 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {770 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __p, _Args&&... __args) {
737 return __tree_.__emplace_hint_unique(__p, std::forward<_Args>(__args)...).first;771 return __tree_.__emplace_hint_unique(__p, std::forward<_Args>(__args)...).first;
738 }772 }
739# endif // _LIBCPP_CXX03_LANG773# endif // _LIBCPP_CXX03_LANG
740774
741 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__emplace_unique(__v); }775 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(const value_type& __v) {
742 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {776 return __tree_.__emplace_unique(__v);
777 }
778 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v) {
743 return __tree_.__emplace_hint_unique(__p, __v).first;779 return __tree_.__emplace_hint_unique(__p, __v).first;
744 }780 }
745781
746 template <class _InputIterator>782 template <class _InputIterator>
747 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {783 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __first, _InputIterator __last) {
748 __tree_.__insert_range_unique(__first, __last);784 __tree_.__insert_range_unique(__first, __last);
749 }785 }
750786
751# if _LIBCPP_STD_VER >= 23787# if _LIBCPP_STD_VER >= 23
752 template <_ContainerCompatibleRange<value_type> _Range>788 template <_ContainerCompatibleRange<value_type> _Range>
753 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {789 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
754 __tree_.__insert_range_unique(ranges::begin(__range), ranges::end(__range));790 __tree_.__insert_range_unique(ranges::begin(__range), ranges::end(__range));
755 }791 }
756# endif792# endif
757793
758# ifndef _LIBCPP_CXX03_LANG794# ifndef _LIBCPP_CXX03_LANG
759 _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) {795 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(value_type&& __v) {
760 return __tree_.__emplace_unique(std::move(__v));796 return __tree_.__emplace_unique(std::move(__v));
761 }797 }
762798
763 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {799 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v) {
764 return __tree_.__emplace_hint_unique(__p, std::move(__v)).first;800 return __tree_.__emplace_hint_unique(__p, std::move(__v)).first;
765 }801 }
766802
767 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }803 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
804 insert(__il.begin(), __il.end());
805 }
768# endif // _LIBCPP_CXX03_LANG806# endif // _LIBCPP_CXX03_LANG
769807
770 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); }808 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __p) { return __tree_.erase(__p); }
771 _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); }809 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __k) {
772 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); }810 return __tree_.__erase_unique(__k);
773 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }811 }
812 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __f, const_iterator __l) {
813 return __tree_.erase(__f, __l);
814 }
815 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() _NOEXCEPT { __tree_.clear(); }
774816
775# if _LIBCPP_STD_VER >= 17817# if _LIBCPP_STD_VER >= 17
776 _LIBCPP_HIDE_FROM_ABI insert_return_type insert(node_type&& __nh) {818 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 insert_return_type insert(node_type&& __nh) {
777 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),819 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
778 "node_type with incompatible allocator passed to set::insert()");820 "node_type with incompatible allocator passed to set::insert()");
779 return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));821 return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
780 }822 }
781 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {823 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, node_type&& __nh) {
782 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),824 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
783 "node_type with incompatible allocator passed to set::insert()");825 "node_type with incompatible allocator passed to set::insert()");
784 return __tree_.template __node_handle_insert_unique<node_type>(__hint, std::move(__nh));826 return __tree_.template __node_handle_insert_unique<node_type>(__hint, std::move(__nh));
785 }827 }
786 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {828 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(key_type const& __key) {
787 return __tree_.template __node_handle_extract<node_type>(__key);829 return __tree_.template __node_handle_extract<node_type>(__key);
788 }830 }
789 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {831 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(const_iterator __it) {
790 return __tree_.template __node_handle_extract<node_type>(__it);832 return __tree_.template __node_handle_extract<node_type>(__it);
791 }833 }
792 template <class _Compare2>834 template <class _Compare2>
793 _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>& __source) {835 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void merge(set<key_type, _Compare2, allocator_type>& __source) {
794 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(836 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
795 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");837 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
796 __tree_.__node_handle_merge_unique(__source.__tree_);838 __tree_.__node_handle_merge_unique(__source.__tree_);
797 }839 }
798 template <class _Compare2>840 template <class _Compare2>
799 _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>&& __source) {841 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void merge(set<key_type, _Compare2, allocator_type>&& __source) {
800 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(842 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
801 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");843 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
802 __tree_.__node_handle_merge_unique(__source.__tree_);844 __tree_.__node_handle_merge_unique(__source.__tree_);
803 }845 }
804 template <class _Compare2>846 template <class _Compare2>
805 _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>& __source) {847 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
848 merge(multiset<key_type, _Compare2, allocator_type>& __source) {
806 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(849 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
807 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");850 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
808 __tree_.__node_handle_merge_unique(__source.__tree_);851 __tree_.__node_handle_merge_unique(__source.__tree_);
809 }852 }
810 template <class _Compare2>853 template <class _Compare2>
811 _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>&& __source) {854 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
855 merge(multiset<key_type, _Compare2, allocator_type>&& __source) {
812 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(856 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
813 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");857 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
814 __tree_.__node_handle_merge_unique(__source.__tree_);858 __tree_.__node_handle_merge_unique(__source.__tree_);
815 }859 }
816# endif860# endif
817861
818 _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); }862 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {
863 __tree_.swap(__s.__tree_);
864 }
819865
820 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }866 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const _NOEXCEPT {
821 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); }867 return __tree_.__alloc();
822 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }868 }
869 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const {
870 return __tree_.value_comp();
871 }
872 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
873 return __tree_.value_comp();
874 }
823875
824 // set operations:876 // set operations:
825 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }877 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __k) {
826 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }878 return __tree_.find(__k);
879 }
880 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __k) const {
881 return __tree_.find(__k);
882 }
827# if _LIBCPP_STD_VER >= 14883# if _LIBCPP_STD_VER >= 14
828 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>884 template <typename _K2,
829 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {885 class _Comp = _Compare,
886 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
887 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _K2& __k) {
830 return __tree_.find(__k);888 return __tree_.find(__k);
831 }889 }
832 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>890 template <typename _K2,
833 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {891 class _Comp = _Compare,
892 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
893 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _K2& __k) const {
834 return __tree_.find(__k);894 return __tree_.find(__k);
835 }895 }
836# endif896# endif
837897
838 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {898 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __k) const {
839 return __tree_.__count_unique(__k);899 return __tree_.__count_unique(__k);
840 }900 }
841# if _LIBCPP_STD_VER >= 14901# if _LIBCPP_STD_VER >= 14
842 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>902 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
843 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {903 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _K2& __k) const {
844 return __tree_.__count_multi(__k);904 return __tree_.__count_multi(__k);
845 }905 }
846# endif906# endif
847907
848# if _LIBCPP_STD_VER >= 20908# if _LIBCPP_STD_VER >= 20
849 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }909 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __k) const {
850 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>910 return find(__k) != end();
851 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {911 }
912 template <typename _K2,
913 class _Comp = _Compare,
914 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
915 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _K2& __k) const {
852 return find(__k) != end();916 return find(__k) != end();
853 }917 }
854# endif // _LIBCPP_STD_VER >= 20918# endif // _LIBCPP_STD_VER >= 20
855919
856 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {920 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __k) {
857 return __tree_.__lower_bound_unique(__k);921 return __tree_.__lower_bound_unique(__k);
858 }922 }
859923
860 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {924 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
925 lower_bound(const key_type& __k) const {
861 return __tree_.__lower_bound_unique(__k);926 return __tree_.__lower_bound_unique(__k);
862 }927 }
863928
864 // The transparent versions of the lookup functions use the _multi version, since a non-element key is allowed to929 // The transparent versions of the lookup functions use the _multi version, since a non-element key is allowed to
865 // match multiple elements.930 // match multiple elements.
866# if _LIBCPP_STD_VER >= 14931# if _LIBCPP_STD_VER >= 14
867 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>932 template <typename _K2,
868 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {933 class _Comp = _Compare,
934 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
935 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _K2& __k) {
869 return __tree_.__lower_bound_multi(__k);936 return __tree_.__lower_bound_multi(__k);
870 }937 }
871938
872 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>939 template <typename _K2,
873 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {940 class _Comp = _Compare,
941 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
942 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
943 lower_bound(const _K2& __k) const {
874 return __tree_.__lower_bound_multi(__k);944 return __tree_.__lower_bound_multi(__k);
875 }945 }
876# endif946# endif
877947
878 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {948 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __k) {
879 return __tree_.__upper_bound_unique(__k);949 return __tree_.__upper_bound_unique(__k);
880 }950 }
881951
882 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {952 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
953 upper_bound(const key_type& __k) const {
883 return __tree_.__upper_bound_unique(__k);954 return __tree_.__upper_bound_unique(__k);
884 }955 }
885956
886# if _LIBCPP_STD_VER >= 14957# if _LIBCPP_STD_VER >= 14
887 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>958 template <typename _K2,
888 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {959 class _Comp = _Compare,
960 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
961 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _K2& __k) {
889 return __tree_.__upper_bound_multi(__k);962 return __tree_.__upper_bound_multi(__k);
890 }963 }
891 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>964 template <typename _K2,
892 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {965 class _Comp = _Compare,
966 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
967 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
968 upper_bound(const _K2& __k) const {
893 return __tree_.__upper_bound_multi(__k);969 return __tree_.__upper_bound_multi(__k);
894 }970 }
895# endif971# endif
896972
897 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {973 [[__nodiscard__]]
974 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __k) {
898 return __tree_.__equal_range_unique(__k);975 return __tree_.__equal_range_unique(__k);
899 }976 }
900 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {977 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
978 equal_range(const key_type& __k) const {
901 return __tree_.__equal_range_unique(__k);979 return __tree_.__equal_range_unique(__k);
902 }980 }
903# if _LIBCPP_STD_VER >= 14981# if _LIBCPP_STD_VER >= 14
904 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>982 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
905 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {983 [[__nodiscard__]]
984 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _K2& __k) {
906 return __tree_.__equal_range_multi(__k);985 return __tree_.__equal_range_multi(__k);
907 }986 }
908 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>987 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
909 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {988 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
989 equal_range(const _K2& __k) const {
910 return __tree_.__equal_range_multi(__k);990 return __tree_.__equal_range_multi(__k);
911 }991 }
912# endif992# endif
...@@ -969,7 +1049,7 @@ struct __specialized_algorithm<_Alg, __single_range<set<_Key, _Compare, _Allocat...@@ -969,7 +1049,7 @@ struct __specialized_algorithm<_Alg, __single_range<set<_Key, _Compare, _Allocat
9691049
970 // set's begin() and end() are identical with and without const qualification1050 // set's begin() and end() are identical with and without const qualification
971 template <class... _Args>1051 template <class... _Args>
972 _LIBCPP_HIDE_FROM_ABI static auto operator()(const __set& __set, _Args&&... __args) {1052 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto operator()(const __set& __set, _Args&&... __args) {
973 return __specialized_algorithm<_Alg, __single_range<typename __set::__base>>()(1053 return __specialized_algorithm<_Alg, __single_range<typename __set::__base>>()(
974 __set.__tree_, std::forward<_Args>(__args)...);1054 __set.__tree_, std::forward<_Args>(__args)...);
975 }1055 }
...@@ -977,7 +1057,7 @@ struct __specialized_algorithm<_Alg, __single_range<set<_Key, _Compare, _Allocat...@@ -977,7 +1057,7 @@ struct __specialized_algorithm<_Alg, __single_range<set<_Key, _Compare, _Allocat
977# endif1057# endif
9781058
979template <class _Key, class _Compare, class _Allocator>1059template <class _Key, class _Compare, class _Allocator>
980inline _LIBCPP_HIDE_FROM_ABI bool1060inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
981operator==(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1061operator==(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
982 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());1062 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
983}1063}
...@@ -985,31 +1065,31 @@ operator==(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare,...@@ -985,31 +1065,31 @@ operator==(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare,
985# if _LIBCPP_STD_VER <= 171065# if _LIBCPP_STD_VER <= 17
9861066
987template <class _Key, class _Compare, class _Allocator>1067template <class _Key, class _Compare, class _Allocator>
988inline _LIBCPP_HIDE_FROM_ABI bool1068inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
989operator<(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1069operator<(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
990 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());1070 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
991}1071}
9921072
993template <class _Key, class _Compare, class _Allocator>1073template <class _Key, class _Compare, class _Allocator>
994inline _LIBCPP_HIDE_FROM_ABI bool1074inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
995operator!=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1075operator!=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
996 return !(__x == __y);1076 return !(__x == __y);
997}1077}
9981078
999template <class _Key, class _Compare, class _Allocator>1079template <class _Key, class _Compare, class _Allocator>
1000inline _LIBCPP_HIDE_FROM_ABI bool1080inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1001operator>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1081operator>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
1002 return __y < __x;1082 return __y < __x;
1003}1083}
10041084
1005template <class _Key, class _Compare, class _Allocator>1085template <class _Key, class _Compare, class _Allocator>
1006inline _LIBCPP_HIDE_FROM_ABI bool1086inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1007operator>=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1087operator>=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
1008 return !(__x < __y);1088 return !(__x < __y);
1009}1089}
10101090
1011template <class _Key, class _Compare, class _Allocator>1091template <class _Key, class _Compare, class _Allocator>
1012inline _LIBCPP_HIDE_FROM_ABI bool1092inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1013operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1093operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
1014 return !(__y < __x);1094 return !(__y < __x);
1015}1095}
...@@ -1017,7 +1097,7 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare,...@@ -1017,7 +1097,7 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare,
1017# else // _LIBCPP_STD_VER <= 171097# else // _LIBCPP_STD_VER <= 17
10181098
1019template <class _Key, class _Compare, class _Allocator>1099template <class _Key, class _Compare, class _Allocator>
1020_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>1100_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Key>
1021operator<=>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {1101operator<=>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
1022 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);1102 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
1023}1103}
...@@ -1026,14 +1106,14 @@ operator<=>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare...@@ -1026,14 +1106,14 @@ operator<=>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare
10261106
1027// specialized algorithms:1107// specialized algorithms:
1028template <class _Key, class _Compare, class _Allocator>1108template <class _Key, class _Compare, class _Allocator>
1029inline _LIBCPP_HIDE_FROM_ABI void swap(set<_Key, _Compare, _Allocator>& __x, set<_Key, _Compare, _Allocator>& __y)1109inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1030 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {1110swap(set<_Key, _Compare, _Allocator>& __x, set<_Key, _Compare, _Allocator>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
1031 __x.swap(__y);1111 __x.swap(__y);
1032}1112}
10331113
1034# if _LIBCPP_STD_VER >= 201114# if _LIBCPP_STD_VER >= 20
1035template <class _Key, class _Compare, class _Allocator, class _Predicate>1115template <class _Key, class _Compare, class _Allocator, class _Predicate>
1036inline _LIBCPP_HIDE_FROM_ABI typename set<_Key, _Compare, _Allocator>::size_type1116inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename set<_Key, _Compare, _Allocator>::size_type
1037erase_if(set<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {1117erase_if(set<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
1038 return std::__libcpp_erase_if_container(__c, __pred);1118 return std::__libcpp_erase_if_container(__c, __pred);
1039}1119}
...@@ -1092,31 +1172,32 @@ public:...@@ -1092,31 +1172,32 @@ public:
1092 friend class multiset;1172 friend class multiset;
10931173
1094 // construct/copy/destroy:1174 // construct/copy/destroy:
1095 _LIBCPP_HIDE_FROM_ABI multiset() _NOEXCEPT_(1175 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset() _NOEXCEPT_(
1096 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&1176 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_default_constructible<key_compare>::value&&
1097 is_nothrow_copy_constructible<key_compare>::value)1177 is_nothrow_copy_constructible<key_compare>::value)
1098 : __tree_(value_compare()) {}1178 : __tree_(value_compare()) {}
10991179
1100 _LIBCPP_HIDE_FROM_ABI explicit multiset(const value_compare& __comp) _NOEXCEPT_(1180 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit multiset(const value_compare& __comp) _NOEXCEPT_(
1101 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)1181 is_nothrow_default_constructible<allocator_type>::value&& is_nothrow_copy_constructible<key_compare>::value)
1102 : __tree_(__comp) {}1182 : __tree_(__comp) {}
11031183
1104 _LIBCPP_HIDE_FROM_ABI explicit multiset(const value_compare& __comp, const allocator_type& __a)1184 _LIBCPP_HIDE_FROM_ABI
1185 _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit multiset(const value_compare& __comp, const allocator_type& __a)
1105 : __tree_(__comp, __a) {}1186 : __tree_(__comp, __a) {}
1106 template <class _InputIterator>1187 template <class _InputIterator>
1107 _LIBCPP_HIDE_FROM_ABI multiset(_InputIterator __f, _InputIterator __l, const value_compare& __comp = value_compare())1188 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1189 multiset(_InputIterator __f, _InputIterator __l, const value_compare& __comp = value_compare())
1108 : __tree_(__comp) {1190 : __tree_(__comp) {
1109 insert(__f, __l);1191 insert(__f, __l);
1110 }1192 }
11111193
1112# if _LIBCPP_STD_VER >= 14
1113 template <class _InputIterator>1194 template <class _InputIterator>
1114 _LIBCPP_HIDE_FROM_ABI multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)1195 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1196 multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
1115 : multiset(__f, __l, key_compare(), __a) {}1197 : multiset(__f, __l, key_compare(), __a) {}
1116# endif
11171198
1118 template <class _InputIterator>1199 template <class _InputIterator>
1119 _LIBCPP_HIDE_FROM_ABI1200 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1120 multiset(_InputIterator __f, _InputIterator __l, const value_compare& __comp, const allocator_type& __a)1201 multiset(_InputIterator __f, _InputIterator __l, const value_compare& __comp, const allocator_type& __a)
1121 : __tree_(__comp, __a) {1202 : __tree_(__comp, __a) {
1122 insert(__f, __l);1203 insert(__f, __l);
...@@ -1124,7 +1205,7 @@ public:...@@ -1124,7 +1205,7 @@ public:
11241205
1125# if _LIBCPP_STD_VER >= 231206# if _LIBCPP_STD_VER >= 23
1126 template <_ContainerCompatibleRange<value_type> _Range>1207 template <_ContainerCompatibleRange<value_type> _Range>
1127 _LIBCPP_HIDE_FROM_ABI1208 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1128 multiset(from_range_t,1209 multiset(from_range_t,
1129 _Range&& __range,1210 _Range&& __range,
1130 const key_compare& __comp = key_compare(),1211 const key_compare& __comp = key_compare(),
...@@ -1134,254 +1215,332 @@ public:...@@ -1134,254 +1215,332 @@ public:
1134 }1215 }
11351216
1136 template <_ContainerCompatibleRange<value_type> _Range>1217 template <_ContainerCompatibleRange<value_type> _Range>
1137 _LIBCPP_HIDE_FROM_ABI multiset(from_range_t, _Range&& __range, const allocator_type& __a)1218 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1219 multiset(from_range_t, _Range&& __range, const allocator_type& __a)
1138 : multiset(from_range, std::forward<_Range>(__range), key_compare(), __a) {}1220 : multiset(from_range, std::forward<_Range>(__range), key_compare(), __a) {}
1139# endif1221# endif
11401222
1141 _LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s) = default;1223 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset(const multiset& __s) = default;
11421224
1143 _LIBCPP_HIDE_FROM_ABI multiset& operator=(const multiset& __s) = default;1225 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset& operator=(const multiset& __s) = default;
11441226
1145# ifndef _LIBCPP_CXX03_LANG1227# ifndef _LIBCPP_CXX03_LANG
1146 _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) = default;1228 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset(multiset&& __s) = default;
11471229
1148 _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a) : __tree_(std::move(__s.__tree_), __a) {}1230 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset(multiset&& __s, const allocator_type& __a)
1231 : __tree_(std::move(__s.__tree_), __a) {}
1149# endif // _LIBCPP_CXX03_LANG1232# endif // _LIBCPP_CXX03_LANG
1150 _LIBCPP_HIDE_FROM_ABI explicit multiset(const allocator_type& __a) : __tree_(__a) {}1233 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit multiset(const allocator_type& __a) : __tree_(__a) {}
1151 _LIBCPP_HIDE_FROM_ABI multiset(const multiset& __s, const allocator_type& __a) : __tree_(__s.__tree_, __a) {}1234 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset(const multiset& __s, const allocator_type& __a)
1235 : __tree_(__s.__tree_, __a) {}
11521236
1153# ifndef _LIBCPP_CXX03_LANG1237# ifndef _LIBCPP_CXX03_LANG
1154 _LIBCPP_HIDE_FROM_ABI multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())1238 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1239 multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
1155 : __tree_(__comp) {1240 : __tree_(__comp) {
1156 insert(__il.begin(), __il.end());1241 insert(__il.begin(), __il.end());
1157 }1242 }
11581243
1159 _LIBCPP_HIDE_FROM_ABI1244 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1160 multiset(initializer_list<value_type> __il, const value_compare& __comp, const allocator_type& __a)1245 multiset(initializer_list<value_type> __il, const value_compare& __comp, const allocator_type& __a)
1161 : __tree_(__comp, __a) {1246 : __tree_(__comp, __a) {
1162 insert(__il.begin(), __il.end());1247 insert(__il.begin(), __il.end());
1163 }1248 }
11641249
1165# if _LIBCPP_STD_VER >= 141250 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
1166 _LIBCPP_HIDE_FROM_ABI multiset(initializer_list<value_type> __il, const allocator_type& __a)1251 multiset(initializer_list<value_type> __il, const allocator_type& __a)
1167 : multiset(__il, key_compare(), __a) {}1252 : multiset(__il, key_compare(), __a) {}
1168# endif
11691253
1170 _LIBCPP_HIDE_FROM_ABI multiset& operator=(initializer_list<value_type> __il) {1254 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset& operator=(initializer_list<value_type> __il) {
1171 clear();1255 clear();
1172 insert(__il.begin(), __il.end());1256 insert(__il.begin(), __il.end());
1173 return *this;1257 return *this;
1174 }1258 }
11751259
1176 _LIBCPP_HIDE_FROM_ABI multiset& operator=(multiset&& __s) = default;1260 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 multiset& operator=(multiset&& __s) = default;
1177# endif // _LIBCPP_CXX03_LANG1261# endif // _LIBCPP_CXX03_LANG
11781262
1179 _LIBCPP_HIDE_FROM_ABI ~multiset() {1263 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~multiset() {
1180 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");1264 static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), "");
1181 }1265 }
11821266
1183 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }1267 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT {
1184 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }1268 return __tree_.begin();
1185 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }1269 }
1186 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }1270 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT {
1271 return __tree_.begin();
1272 }
1273 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT {
1274 return __tree_.end();
1275 }
1276 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT {
1277 return __tree_.end();
1278 }
11871279
1188 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }1280 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT {
1189 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {1281 return reverse_iterator(end());
1282 }
1283 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
1284 rbegin() const _NOEXCEPT {
1190 return const_reverse_iterator(end());1285 return const_reverse_iterator(end());
1191 }1286 }
1192 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }1287 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT {
1193 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {1288 return reverse_iterator(begin());
1289 }
1290 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const _NOEXCEPT {
1194 return const_reverse_iterator(begin());1291 return const_reverse_iterator(begin());
1195 }1292 }
11961293
1197 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }1294 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT {
1198 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }1295 return begin();
1199 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }1296 }
1200 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }1297 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT {
1298 return end();
1299 }
1300 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
1301 crbegin() const _NOEXCEPT {
1302 return rbegin();
1303 }
1304 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT {
1305 return rend();
1306 }
12011307
1202 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __tree_.size() == 0; }1308 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const _NOEXCEPT {
1203 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }1309 return __tree_.size() == 0;
1204 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }1310 }
1311 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT {
1312 return __tree_.size();
1313 }
1314 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
1315 return __tree_.max_size();
1316 }
12051317
1206 // modifiers:1318 // modifiers:
1207# ifndef _LIBCPP_CXX03_LANG1319# ifndef _LIBCPP_CXX03_LANG
1208 template <class... _Args>1320 template <class... _Args>
1209 _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {1321 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace(_Args&&... __args) {
1210 return __tree_.__emplace_multi(std::forward<_Args>(__args)...);1322 return __tree_.__emplace_multi(std::forward<_Args>(__args)...);
1211 }1323 }
1212 template <class... _Args>1324 template <class... _Args>
1213 _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {1325 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __p, _Args&&... __args) {
1214 return __tree_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...);1326 return __tree_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...);
1215 }1327 }
1216# endif // _LIBCPP_CXX03_LANG1328# endif // _LIBCPP_CXX03_LANG
12171329
1218 _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__emplace_multi(__v); }1330 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const value_type& __v) {
1219 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {1331 return __tree_.__emplace_multi(__v);
1332 }
1333 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v) {
1220 return __tree_.__emplace_hint_multi(__p, __v);1334 return __tree_.__emplace_hint_multi(__p, __v);
1221 }1335 }
12221336
1223 template <class _InputIterator>1337 template <class _InputIterator>
1224 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {1338 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __first, _InputIterator __last) {
1225 __tree_.__insert_range_multi(__first, __last);1339 __tree_.__insert_range_multi(__first, __last);
1226 }1340 }
12271341
1228# if _LIBCPP_STD_VER >= 231342# if _LIBCPP_STD_VER >= 23
1229 template <_ContainerCompatibleRange<value_type> _Range>1343 template <_ContainerCompatibleRange<value_type> _Range>
1230 _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {1344 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
1231 __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range));1345 __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range));
1232 }1346 }
1233# endif1347# endif
12341348
1235# ifndef _LIBCPP_CXX03_LANG1349# ifndef _LIBCPP_CXX03_LANG
1236 _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__emplace_multi(std::move(__v)); }1350 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(value_type&& __v) {
1351 return __tree_.__emplace_multi(std::move(__v));
1352 }
12371353
1238 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {1354 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v) {
1239 return __tree_.__emplace_hint_multi(__p, std::move(__v));1355 return __tree_.__emplace_hint_multi(__p, std::move(__v));
1240 }1356 }
12411357
1242 _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }1358 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
1359 insert(__il.begin(), __il.end());
1360 }
1243# endif // _LIBCPP_CXX03_LANG1361# endif // _LIBCPP_CXX03_LANG
12441362
1245 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); }1363 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __p) { return __tree_.erase(__p); }
1246 _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); }1364 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __k) {
1247 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); }1365 return __tree_.__erase_multi(__k);
1248 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }1366 }
1367 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __f, const_iterator __l) {
1368 return __tree_.erase(__f, __l);
1369 }
1370 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() _NOEXCEPT { __tree_.clear(); }
12491371
1250# if _LIBCPP_STD_VER >= 171372# if _LIBCPP_STD_VER >= 17
1251 _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {1373 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(node_type&& __nh) {
1252 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),1374 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
1253 "node_type with incompatible allocator passed to multiset::insert()");1375 "node_type with incompatible allocator passed to multiset::insert()");
1254 return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));1376 return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));
1255 }1377 }
1256 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {1378 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, node_type&& __nh) {
1257 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),1379 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
1258 "node_type with incompatible allocator passed to multiset::insert()");1380 "node_type with incompatible allocator passed to multiset::insert()");
1259 return __tree_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));1381 return __tree_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
1260 }1382 }
1261 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(key_type const& __key) {1383 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(key_type const& __key) {
1262 return __tree_.template __node_handle_extract<node_type>(__key);1384 return __tree_.template __node_handle_extract<node_type>(__key);
1263 }1385 }
1264 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract(const_iterator __it) {1386 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 node_type extract(const_iterator __it) {
1265 return __tree_.template __node_handle_extract<node_type>(__it);1387 return __tree_.template __node_handle_extract<node_type>(__it);
1266 }1388 }
1267 template <class _Compare2>1389 template <class _Compare2>
1268 _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>& __source) {1390 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1391 merge(multiset<key_type, _Compare2, allocator_type>& __source) {
1269 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1392 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1270 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1393 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1271 __tree_.__node_handle_merge_multi(__source.__tree_);1394 __tree_.__node_handle_merge_multi(__source.__tree_);
1272 }1395 }
1273 template <class _Compare2>1396 template <class _Compare2>
1274 _LIBCPP_HIDE_FROM_ABI void merge(multiset<key_type, _Compare2, allocator_type>&& __source) {1397 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1398 merge(multiset<key_type, _Compare2, allocator_type>&& __source) {
1275 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1399 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1276 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1400 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1277 __tree_.__node_handle_merge_multi(__source.__tree_);1401 __tree_.__node_handle_merge_multi(__source.__tree_);
1278 }1402 }
1279 template <class _Compare2>1403 template <class _Compare2>
1280 _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>& __source) {1404 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void merge(set<key_type, _Compare2, allocator_type>& __source) {
1281 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1405 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1282 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1406 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1283 __tree_.__node_handle_merge_multi(__source.__tree_);1407 __tree_.__node_handle_merge_multi(__source.__tree_);
1284 }1408 }
1285 template <class _Compare2>1409 template <class _Compare2>
1286 _LIBCPP_HIDE_FROM_ABI void merge(set<key_type, _Compare2, allocator_type>&& __source) {1410 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void merge(set<key_type, _Compare2, allocator_type>&& __source) {
1287 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(1411 _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
1288 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");1412 __source.get_allocator() == get_allocator(), "merging container with incompatible allocator");
1289 __tree_.__node_handle_merge_multi(__source.__tree_);1413 __tree_.__node_handle_merge_multi(__source.__tree_);
1290 }1414 }
1291# endif1415# endif
12921416
1293 _LIBCPP_HIDE_FROM_ABI void swap(multiset& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {1417 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(multiset& __s)
1418 _NOEXCEPT_(__is_nothrow_swappable_v<__base>) {
1294 __tree_.swap(__s.__tree_);1419 __tree_.swap(__s.__tree_);
1295 }1420 }
12961421
1297 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); }1422 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const _NOEXCEPT {
1298 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); }1423 return __tree_.__alloc();
1299 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }1424 }
1425 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const {
1426 return __tree_.value_comp();
1427 }
1428 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const {
1429 return __tree_.value_comp();
1430 }
13001431
1301 // set operations:1432 // set operations:
1302 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }1433 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __k) {
1303 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }1434 return __tree_.find(__k);
1435 }
1436 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __k) const {
1437 return __tree_.find(__k);
1438 }
1304# if _LIBCPP_STD_VER >= 141439# if _LIBCPP_STD_VER >= 14
1305 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1440 template <typename _K2,
1306 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1441 class _Comp = _Compare,
1442 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1443 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _K2& __k) {
1307 return __tree_.find(__k);1444 return __tree_.find(__k);
1308 }1445 }
1309 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1446 template <typename _K2,
1310 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1447 class _Comp = _Compare,
1448 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1449 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _K2& __k) const {
1311 return __tree_.find(__k);1450 return __tree_.find(__k);
1312 }1451 }
1313# endif1452# endif
13141453
1315 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const {1454 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __k) const {
1316 return __tree_.__count_multi(__k);1455 return __tree_.__count_multi(__k);
1317 }1456 }
1318# if _LIBCPP_STD_VER >= 141457# if _LIBCPP_STD_VER >= 14
1319 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1458 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1320 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1459 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _K2& __k) const {
1321 return __tree_.__count_multi(__k);1460 return __tree_.__count_multi(__k);
1322 }1461 }
1323# endif1462# endif
13241463
1325# if _LIBCPP_STD_VER >= 201464# if _LIBCPP_STD_VER >= 20
1326 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1465 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __k) const {
1327 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1466 return find(__k) != end();
1328 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1467 }
1468 template <typename _K2,
1469 class _Comp = _Compare,
1470 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1471 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _K2& __k) const {
1329 return find(__k) != end();1472 return find(__k) != end();
1330 }1473 }
1331# endif // _LIBCPP_STD_VER >= 201474# endif // _LIBCPP_STD_VER >= 20
13321475
1333 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) {1476 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __k) {
1334 return __tree_.__lower_bound_multi(__k);1477 return __tree_.__lower_bound_multi(__k);
1335 }1478 }
13361479
1337 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const {1480 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1481 lower_bound(const key_type& __k) const {
1338 return __tree_.__lower_bound_multi(__k);1482 return __tree_.__lower_bound_multi(__k);
1339 }1483 }
13401484
1341# if _LIBCPP_STD_VER >= 141485# if _LIBCPP_STD_VER >= 14
1342 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1486 template <typename _K2,
1343 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {1487 class _Comp = _Compare,
1488 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1489 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _K2& __k) {
1344 return __tree_.__lower_bound_multi(__k);1490 return __tree_.__lower_bound_multi(__k);
1345 }1491 }
13461492
1347 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1493 template <typename _K2,
1348 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {1494 class _Comp = _Compare,
1495 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1496 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1497 lower_bound(const _K2& __k) const {
1349 return __tree_.__lower_bound_multi(__k);1498 return __tree_.__lower_bound_multi(__k);
1350 }1499 }
1351# endif1500# endif
13521501
1353 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) {1502 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __k) {
1354 return __tree_.__upper_bound_multi(__k);1503 return __tree_.__upper_bound_multi(__k);
1355 }1504 }
13561505
1357 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const {1506 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1507 upper_bound(const key_type& __k) const {
1358 return __tree_.__upper_bound_multi(__k);1508 return __tree_.__upper_bound_multi(__k);
1359 }1509 }
13601510
1361# if _LIBCPP_STD_VER >= 141511# if _LIBCPP_STD_VER >= 14
1362 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1512 template <typename _K2,
1363 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {1513 class _Comp = _Compare,
1514 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1515 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _K2& __k) {
1364 return __tree_.__upper_bound_multi(__k);1516 return __tree_.__upper_bound_multi(__k);
1365 }1517 }
1366 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1518 template <typename _K2,
1367 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {1519 class _Comp = _Compare,
1520 enable_if_t<__is_transparent_v<_Comp> || __is_transparently_comparable_v<_Comp, key_type, _K2>, int> = 0>
1521 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator
1522 upper_bound(const _K2& __k) const {
1368 return __tree_.__upper_bound_multi(__k);1523 return __tree_.__upper_bound_multi(__k);
1369 }1524 }
1370# endif1525# endif
13711526
1372 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {1527 [[__nodiscard__]]
1528 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __k) {
1373 return __tree_.__equal_range_multi(__k);1529 return __tree_.__equal_range_multi(__k);
1374 }1530 }
1375 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {1531 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
1532 equal_range(const key_type& __k) const {
1376 return __tree_.__equal_range_multi(__k);1533 return __tree_.__equal_range_multi(__k);
1377 }1534 }
1378# if _LIBCPP_STD_VER >= 141535# if _LIBCPP_STD_VER >= 14
1379 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1536 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1380 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1537 [[__nodiscard__]]
1538 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _K2& __k) {
1381 return __tree_.__equal_range_multi(__k);1539 return __tree_.__equal_range_multi(__k);
1382 }1540 }
1383 template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>1541 template <typename _K2, class _Comp = _Compare, enable_if_t<__is_transparent_v<_Comp>, int> = 0>
1384 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1542 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
1543 equal_range(const _K2& __k) const {
1385 return __tree_.__equal_range_multi(__k);1544 return __tree_.__equal_range_multi(__k);
1386 }1545 }
1387# endif1546# endif
...@@ -1445,7 +1604,7 @@ struct __specialized_algorithm<_Alg, __single_range<multiset<_Key, _Compare, _Al...@@ -1445,7 +1604,7 @@ struct __specialized_algorithm<_Alg, __single_range<multiset<_Key, _Compare, _Al
14451604
1446 // set's begin() and end() are identical with and without const qualification1605 // set's begin() and end() are identical with and without const qualification
1447 template <class... _Args>1606 template <class... _Args>
1448 _LIBCPP_HIDE_FROM_ABI static auto operator()(const __set& __set, _Args&&... __args) {1607 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto operator()(const __set& __set, _Args&&... __args) {
1449 return __specialized_algorithm<_Alg, __single_range<typename __set::__base>>()(1608 return __specialized_algorithm<_Alg, __single_range<typename __set::__base>>()(
1450 __set.__tree_, std::forward<_Args>(__args)...);1609 __set.__tree_, std::forward<_Args>(__args)...);
1451 }1610 }
...@@ -1453,7 +1612,7 @@ struct __specialized_algorithm<_Alg, __single_range<multiset<_Key, _Compare, _Al...@@ -1453,7 +1612,7 @@ struct __specialized_algorithm<_Alg, __single_range<multiset<_Key, _Compare, _Al
1453# endif1612# endif
14541613
1455template <class _Key, class _Compare, class _Allocator>1614template <class _Key, class _Compare, class _Allocator>
1456inline _LIBCPP_HIDE_FROM_ABI bool1615inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1457operator==(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1616operator==(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1458 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());1617 return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
1459}1618}
...@@ -1461,31 +1620,31 @@ operator==(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key,...@@ -1461,31 +1620,31 @@ operator==(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key,
1461# if _LIBCPP_STD_VER <= 171620# if _LIBCPP_STD_VER <= 17
14621621
1463template <class _Key, class _Compare, class _Allocator>1622template <class _Key, class _Compare, class _Allocator>
1464inline _LIBCPP_HIDE_FROM_ABI bool1623inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1465operator<(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1624operator<(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1466 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());1625 return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
1467}1626}
14681627
1469template <class _Key, class _Compare, class _Allocator>1628template <class _Key, class _Compare, class _Allocator>
1470inline _LIBCPP_HIDE_FROM_ABI bool1629inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1471operator!=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1630operator!=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1472 return !(__x == __y);1631 return !(__x == __y);
1473}1632}
14741633
1475template <class _Key, class _Compare, class _Allocator>1634template <class _Key, class _Compare, class _Allocator>
1476inline _LIBCPP_HIDE_FROM_ABI bool1635inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1477operator>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1636operator>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1478 return __y < __x;1637 return __y < __x;
1479}1638}
14801639
1481template <class _Key, class _Compare, class _Allocator>1640template <class _Key, class _Compare, class _Allocator>
1482inline _LIBCPP_HIDE_FROM_ABI bool1641inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1483operator>=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1642operator>=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1484 return !(__x < __y);1643 return !(__x < __y);
1485}1644}
14861645
1487template <class _Key, class _Compare, class _Allocator>1646template <class _Key, class _Compare, class _Allocator>
1488inline _LIBCPP_HIDE_FROM_ABI bool1647inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1489operator<=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1648operator<=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1490 return !(__y < __x);1649 return !(__y < __x);
1491}1650}
...@@ -1493,7 +1652,7 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key,...@@ -1493,7 +1652,7 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key,
1493# else // _LIBCPP_STD_VER <= 171652# else // _LIBCPP_STD_VER <= 17
14941653
1495template <class _Key, class _Compare, class _Allocator>1654template <class _Key, class _Compare, class _Allocator>
1496_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>1655_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Key>
1497operator<=>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {1656operator<=>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
1498 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);1657 return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);
1499}1658}
...@@ -1501,7 +1660,7 @@ operator<=>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key...@@ -1501,7 +1660,7 @@ operator<=>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key
1501# endif // _LIBCPP_STD_VER <= 171660# endif // _LIBCPP_STD_VER <= 17
15021661
1503template <class _Key, class _Compare, class _Allocator>1662template <class _Key, class _Compare, class _Allocator>
1504inline _LIBCPP_HIDE_FROM_ABI void1663inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1505swap(multiset<_Key, _Compare, _Allocator>& __x, multiset<_Key, _Compare, _Allocator>& __y)1664swap(multiset<_Key, _Compare, _Allocator>& __x, multiset<_Key, _Compare, _Allocator>& __y)
1506 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {1665 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
1507 __x.swap(__y);1666 __x.swap(__y);
...@@ -1509,7 +1668,7 @@ swap(multiset<_Key, _Compare, _Allocator>& __x, multiset<_Key, _Compare, _Alloca...@@ -1509,7 +1668,7 @@ swap(multiset<_Key, _Compare, _Allocator>& __x, multiset<_Key, _Compare, _Alloca
15091668
1510# if _LIBCPP_STD_VER >= 201669# if _LIBCPP_STD_VER >= 20
1511template <class _Key, class _Compare, class _Allocator, class _Predicate>1670template <class _Key, class _Compare, class _Allocator, class _Predicate>
1512inline _LIBCPP_HIDE_FROM_ABI typename multiset<_Key, _Compare, _Allocator>::size_type1671inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename multiset<_Key, _Compare, _Allocator>::size_type
1513erase_if(multiset<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {1672erase_if(multiset<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
1514 return std::__libcpp_erase_if_container(__c, __pred);1673 return std::__libcpp_erase_if_container(__c, __pred);
1515}1674}
...@@ -1541,7 +1700,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -1541,7 +1700,7 @@ _LIBCPP_END_NAMESPACE_STD
15411700
1542_LIBCPP_POP_MACROS1701_LIBCPP_POP_MACROS
15431702
1544# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201703# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1545# include <concepts>1704# include <concepts>
1546# include <cstdlib>1705# include <cstdlib>
1547# include <functional>1706# include <functional>
lib/libcxx/include/shared_mutex+34-24
...@@ -153,6 +153,7 @@ _LIBCPP_PUSH_MACROS...@@ -153,6 +153,7 @@ _LIBCPP_PUSH_MACROS
153# endif153# endif
154154
155_LIBCPP_BEGIN_NAMESPACE_STD155_LIBCPP_BEGIN_NAMESPACE_STD
156_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
156157
157struct _LIBCPP_EXPORTED_FROM_ABI __shared_mutex_base {158struct _LIBCPP_EXPORTED_FROM_ABI __shared_mutex_base {
158 mutex __mut_;159 mutex __mut_;
...@@ -196,12 +197,14 @@ public:...@@ -196,12 +197,14 @@ public:
196197
197 // Exclusive ownership198 // Exclusive ownership
198 _LIBCPP_ACQUIRE_CAPABILITY() _LIBCPP_HIDE_FROM_ABI void lock() { return __base_.lock(); }199 _LIBCPP_ACQUIRE_CAPABILITY() _LIBCPP_HIDE_FROM_ABI void lock() { return __base_.lock(); }
199 _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool try_lock() { return __base_.try_lock(); }200 [[nodiscard]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool try_lock() {
200 _LIBCPP_RELEASE_CAPABILITY _LIBCPP_HIDE_FROM_ABI void unlock() { return __base_.unlock(); }201 return __base_.try_lock();
202 }
203 _LIBCPP_RELEASE_CAPABILITY() _LIBCPP_HIDE_FROM_ABI void unlock() { return __base_.unlock(); }
201204
202 // Shared ownership205 // Shared ownership
203 _LIBCPP_ACQUIRE_SHARED_CAPABILITY _LIBCPP_HIDE_FROM_ABI void lock_shared() { return __base_.lock_shared(); }206 _LIBCPP_ACQUIRE_SHARED_CAPABILITY _LIBCPP_HIDE_FROM_ABI void lock_shared() { return __base_.lock_shared(); }
204 _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool try_lock_shared() {207 [[nodiscard]] _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool try_lock_shared() {
205 return __base_.try_lock_shared();208 return __base_.try_lock_shared();
206 }209 }
207 _LIBCPP_RELEASE_SHARED_CAPABILITY _LIBCPP_HIDE_FROM_ABI void unlock_shared() { return __base_.unlock_shared(); }210 _LIBCPP_RELEASE_SHARED_CAPABILITY _LIBCPP_HIDE_FROM_ABI void unlock_shared() { return __base_.unlock_shared(); }
...@@ -223,15 +226,15 @@ public:...@@ -223,15 +226,15 @@ public:
223226
224 // Exclusive ownership227 // Exclusive ownership
225 void lock() _LIBCPP_ACQUIRE_CAPABILITY();228 void lock() _LIBCPP_ACQUIRE_CAPABILITY();
226 _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock();229 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) bool try_lock();
227 template <class _Rep, class _Period>230 template <class _Rep, class _Period>
228 _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool231 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool
229 try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time) {232 try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time) {
230 return try_lock_until(chrono::steady_clock::now() + __rel_time);233 return try_lock_until(chrono::steady_clock::now() + __rel_time);
231 }234 }
232235
233 template <class _Clock, class _Duration>236 template <class _Clock, class _Duration>
234 _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool237 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool
235 try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time) {238 try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time) {
236 unique_lock<mutex> __lk(__base_.__mut_);239 unique_lock<mutex> __lk(__base_.__mut_);
237 if (__base_.__state_ & __base_.__write_entered_) {240 if (__base_.__state_ & __base_.__write_entered_) {
...@@ -259,19 +262,19 @@ public:...@@ -259,19 +262,19 @@ public:
259 return true;262 return true;
260 }263 }
261264
262 _LIBCPP_RELEASE_CAPABILITY void unlock();265 _LIBCPP_RELEASE_CAPABILITY() void unlock();
263266
264 // Shared ownership267 // Shared ownership
265 _LIBCPP_ACQUIRE_SHARED_CAPABILITY void lock_shared();268 _LIBCPP_ACQUIRE_SHARED_CAPABILITY void lock_shared();
266 _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) bool try_lock_shared();269 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) bool try_lock_shared();
267 template <class _Rep, class _Period>270 template <class _Rep, class _Period>
268 _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool271 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool
269 try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time) {272 try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time) {
270 return try_lock_shared_until(chrono::steady_clock::now() + __rel_time);273 return try_lock_shared_until(chrono::steady_clock::now() + __rel_time);
271 }274 }
272275
273 template <class _Clock, class _Duration>276 template <class _Clock, class _Duration>
274 _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool277 [[__nodiscard__]] _LIBCPP_TRY_ACQUIRE_SHARED_CAPABILITY(true) _LIBCPP_HIDE_FROM_ABI bool
275 try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time) {278 try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time) {
276 unique_lock<mutex> __lk(__base_.__mut_);279 unique_lock<mutex> __lk(__base_.__mut_);
277 if ((__base_.__state_ & __base_.__write_entered_) ||280 if ((__base_.__state_ & __base_.__write_entered_) ||
...@@ -304,27 +307,31 @@ private:...@@ -304,27 +307,31 @@ private:
304 bool __owns_;307 bool __owns_;
305308
306public:309public:
307 _LIBCPP_HIDE_FROM_ABI shared_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}310 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
308311
309 _LIBCPP_HIDE_FROM_ABI explicit shared_lock(mutex_type& __m) : __m_(std::addressof(__m)), __owns_(true) {312 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI explicit shared_lock(mutex_type& __m)
313 : __m_(std::addressof(__m)), __owns_(true) {
310 __m_->lock_shared();314 __m_->lock_shared();
311 }315 }
312316
313 _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT317 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
314 : __m_(std::addressof(__m)),318 : __m_(std::addressof(__m)),
315 __owns_(false) {}319 __owns_(false) {}
316320
317 _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, try_to_lock_t)321 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, try_to_lock_t)
318 : __m_(std::addressof(__m)), __owns_(__m.try_lock_shared()) {}322 : __m_(std::addressof(__m)), __owns_(__m.try_lock_shared()) {}
319323
320 _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, adopt_lock_t) : __m_(std::addressof(__m)), __owns_(true) {}324 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, adopt_lock_t)
325 : __m_(std::addressof(__m)), __owns_(true) {}
321326
322 template <class _Clock, class _Duration>327 template <class _Clock, class _Duration>
323 _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __abs_time)328 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
329 shared_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __abs_time)
324 : __m_(std::addressof(__m)), __owns_(__m.try_lock_shared_until(__abs_time)) {}330 : __m_(std::addressof(__m)), __owns_(__m.try_lock_shared_until(__abs_time)) {}
325331
326 template <class _Rep, class _Period>332 template <class _Rep, class _Period>
327 _LIBCPP_HIDE_FROM_ABI shared_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __rel_time)333 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
334 shared_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __rel_time)
328 : __m_(std::addressof(__m)), __owns_(__m.try_lock_shared_for(__rel_time)) {}335 : __m_(std::addressof(__m)), __owns_(__m.try_lock_shared_for(__rel_time)) {}
329336
330 _LIBCPP_HIDE_FROM_ABI ~shared_lock() {337 _LIBCPP_HIDE_FROM_ABI ~shared_lock() {
...@@ -335,7 +342,9 @@ public:...@@ -335,7 +342,9 @@ public:
335 shared_lock(shared_lock const&) = delete;342 shared_lock(shared_lock const&) = delete;
336 shared_lock& operator=(shared_lock const&) = delete;343 shared_lock& operator=(shared_lock const&) = delete;
337344
338 _LIBCPP_HIDE_FROM_ABI shared_lock(shared_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) {345 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI shared_lock(shared_lock&& __u) _NOEXCEPT
346 : __m_(__u.__m_),
347 __owns_(__u.__owns_) {
339 __u.__m_ = nullptr;348 __u.__m_ = nullptr;
340 __u.__owns_ = false;349 __u.__owns_ = false;
341 }350 }
...@@ -347,11 +356,11 @@ public:...@@ -347,11 +356,11 @@ public:
347 }356 }
348357
349 _LIBCPP_HIDE_FROM_ABI void lock();358 _LIBCPP_HIDE_FROM_ABI void lock();
350 _LIBCPP_HIDE_FROM_ABI bool try_lock();359 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock();
351 template <class _Rep, class _Period>360 template <class _Rep, class _Period>
352 _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time);361 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time);
353 template <class _Clock, class _Duration>362 template <class _Clock, class _Duration>
354 _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time);363 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
355 _LIBCPP_HIDE_FROM_ABI void unlock();364 _LIBCPP_HIDE_FROM_ABI void unlock();
356365
357 // Setters366 // Setters
...@@ -368,11 +377,11 @@ public:...@@ -368,11 +377,11 @@ public:
368 }377 }
369378
370 // Getters379 // Getters
371 _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }380 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }
372381
373 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }382 _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }
374383
375 _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }384 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }
376};385};
377_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(shared_lock);386_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(shared_lock);
378387
...@@ -431,6 +440,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(shared_lock<_Mutex>& __x, shared_lock<_Mu...@@ -431,6 +440,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(shared_lock<_Mutex>& __x, shared_lock<_Mu
431 __x.swap(__y);440 __x.swap(__y);
432}441}
433442
443_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
434_LIBCPP_END_NAMESPACE_STD444_LIBCPP_END_NAMESPACE_STD
435445
436# endif // _LIBCPP_STD_VER >= 14446# endif // _LIBCPP_STD_VER >= 14
...@@ -439,7 +449,7 @@ _LIBCPP_POP_MACROS...@@ -439,7 +449,7 @@ _LIBCPP_POP_MACROS
439449
440# endif // _LIBCPP_HAS_THREADS450# endif // _LIBCPP_HAS_THREADS
441451
442# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20452# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
443# include <optional>453# include <optional>
444# include <system_error>454# include <system_error>
445# endif455# endif
lib/libcxx/include/source_location+4-4
...@@ -36,10 +36,10 @@ namespace std {...@@ -36,10 +36,10 @@ namespace std {
36# pragma GCC system_header36# pragma GCC system_header
37# endif37# endif
3838
39_LIBCPP_BEGIN_NAMESPACE_STD
40
41# if _LIBCPP_STD_VER >= 2039# if _LIBCPP_STD_VER >= 20
4240
41_LIBCPP_BEGIN_NAMESPACE_STD
42
43class source_location {43class source_location {
44 // The names source_location::__impl, _M_file_name, _M_function_name, _M_line, and _M_column44 // The names source_location::__impl, _M_file_name, _M_function_name, _M_line, and _M_column
45 // are hard-coded in the compiler and must not be changed here.45 // are hard-coded in the compiler and must not be changed here.
...@@ -81,10 +81,10 @@ public:...@@ -81,10 +81,10 @@ public:
81 }81 }
82};82};
8383
84# endif // _LIBCPP_STD_VER >= 20
85
86_LIBCPP_END_NAMESPACE_STD84_LIBCPP_END_NAMESPACE_STD
8785
86# endif // _LIBCPP_STD_VER >= 20
87
88#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)88#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
8989
90#endif // _LIBCPP_SOURCE_LOCATION90#endif // _LIBCPP_SOURCE_LOCATION
lib/libcxx/include/span+15-36
...@@ -19,16 +19,16 @@ namespace std {...@@ -19,16 +19,16 @@ namespace std {
19inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();19inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
2020
21template<class T>21template<class T>
22 concept integral-constant-like = // exposition only, since C++2622 concept integral-constant-like = // exposition only
23 is_integral_v<decltype(T::value)> &&23 is_integral_v<remove_cvref_t<decltype(T::value)>> &&
24 !is_same_v<bool, remove_const_t<decltype(T::value)>> &&24 !is_same_v<bool, remove_cvref_t<decltype(T::value)>> &&
25 convertible_to<T, decltype(T::value)> &&25 convertible_to<T, decltype(T::value)> &&
26 equality_comparable_with<T, decltype(T::value)> &&26 equality_comparable_with<T, decltype(T::value)> &&
27 bool_constant<T() == T::value>::value &&27 bool_constant<T() == T::value>::value &&
28 bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value;28 bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value;
2929
30template<class T>30template<class T>
31 constexpr size_t maybe-static-ext = dynamic_extent; // exposition only, since C++2631 constexpr size_t maybe-static-ext = dynamic_extent; // exposition only
32template<integral-constant-like T>32template<integral-constant-like T>
33 constexpr size_t maybe-static-ext<T> = {T::value};33 constexpr size_t maybe-static-ext<T> = {T::value};
3434
...@@ -82,7 +82,6 @@ public:...@@ -82,7 +82,6 @@ public:
82 constexpr span(const array<value_type, N>& arr) noexcept;82 constexpr span(const array<value_type, N>& arr) noexcept;
83 template<class R>83 template<class R>
84 constexpr explicit(Extent != dynamic_extent) span(R&& r);84 constexpr explicit(Extent != dynamic_extent) span(R&& r);
85 constexpr explicit(extent != dynamic_extent) span(std::initializer_list<value_type> il); // Since C++26
86 constexpr span(const span& other) noexcept = default;85 constexpr span(const span& other) noexcept = default;
87 template <class OtherElementType, size_t OtherExtent>86 template <class OtherElementType, size_t OtherExtent>
88 constexpr explicit(Extent != dynamic_extent) span(const span<OtherElementType, OtherExtent>& s) noexcept;87 constexpr explicit(Extent != dynamic_extent) span(const span<OtherElementType, OtherExtent>& s) noexcept;
...@@ -124,9 +123,7 @@ private:...@@ -124,9 +123,7 @@ private:
124};123};
125124
126template<class It, class EndOrSize>125template<class It, class EndOrSize>
127 span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>; // until C++26126 span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>, maybe-static-ext<EndOrSize>>;
128template<class It, class EndOrSize>
129 span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>, maybe-static-ext<EndOrSize>>; // since C++26
130127
131template<class T, size_t N>128template<class T, size_t N>
132 span(T (&)[N]) -> span<T, N>;129 span(T (&)[N]) -> span<T, N>;
...@@ -153,6 +150,7 @@ template<class R>...@@ -153,6 +150,7 @@ template<class R>
153# include <__config>150# include <__config>
154# include <__cstddef/byte.h>151# include <__cstddef/byte.h>
155# include <__cstddef/ptrdiff_t.h>152# include <__cstddef/ptrdiff_t.h>
153# include <__cstddef/size_t.h>
156# include <__fwd/array.h>154# include <__fwd/array.h>
157# include <__fwd/span.h>155# include <__fwd/span.h>
158# include <__iterator/bounded_iter.h>156# include <__iterator/bounded_iter.h>
...@@ -172,13 +170,13 @@ template<class R>...@@ -172,13 +170,13 @@ template<class R>
172# include <__type_traits/is_convertible.h>170# include <__type_traits/is_convertible.h>
173# include <__type_traits/is_integral.h>171# include <__type_traits/is_integral.h>
174# include <__type_traits/is_same.h>172# include <__type_traits/is_same.h>
173# include <__type_traits/is_volatile.h>
175# include <__type_traits/remove_const.h>174# include <__type_traits/remove_const.h>
176# include <__type_traits/remove_cv.h>175# include <__type_traits/remove_cv.h>
177# include <__type_traits/remove_cvref.h>176# include <__type_traits/remove_cvref.h>
178# include <__type_traits/remove_reference.h>177# include <__type_traits/remove_reference.h>
179# include <__type_traits/type_identity.h>178# include <__type_traits/type_identity.h>
180# include <__utility/forward.h>179# include <__utility/forward.h>
181# include <initializer_list>
182# include <stdexcept>180# include <stdexcept>
183# include <version>181# include <version>
184182
...@@ -198,10 +196,10 @@ template<class R>...@@ -198,10 +196,10 @@ template<class R>
198_LIBCPP_PUSH_MACROS196_LIBCPP_PUSH_MACROS
199# include <__undef_macros>197# include <__undef_macros>
200198
201_LIBCPP_BEGIN_NAMESPACE_STD
202
203# if _LIBCPP_STD_VER >= 20199# if _LIBCPP_STD_VER >= 20
204200
201_LIBCPP_BEGIN_NAMESPACE_STD
202
205template <class _Tp>203template <class _Tp>
206struct __is_std_span : false_type {};204struct __is_std_span : false_type {};
207205
...@@ -254,15 +252,6 @@ public:...@@ -254,15 +252,6 @@ public:
254 requires(_Sz == 0)252 requires(_Sz == 0)
255 _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr} {}253 _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr} {}
256254
257# if _LIBCPP_STD_VER >= 26
258 _LIBCPP_HIDE_FROM_ABI constexpr explicit span(std::initializer_list<value_type> __il)
259 requires is_const_v<element_type>
260 : __data_{__il.begin()} {
261 _LIBCPP_ASSERT_VALID_INPUT_RANGE(
262 _Extent == __il.size(), "Size mismatch in span's constructor _Extent != __il.size().");
263 }
264# endif
265
266 constexpr span(const span&) noexcept = default;255 constexpr span(const span&) noexcept = default;
267 constexpr span& operator=(const span&) noexcept = default;256 constexpr span& operator=(const span&) noexcept = default;
268257
...@@ -443,12 +432,6 @@ public:...@@ -443,12 +432,6 @@ public:
443 // [span.cons], span constructors, copy, assignment, and destructor432 // [span.cons], span constructors, copy, assignment, and destructor
444 _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr}, __size_{0} {}433 _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr}, __size_{0} {}
445434
446# if _LIBCPP_STD_VER >= 26
447 _LIBCPP_HIDE_FROM_ABI constexpr span(std::initializer_list<value_type> __il)
448 requires is_const_v<element_type>
449 : __data_{__il.begin()}, __size_{__il.size()} {}
450# endif
451
452 constexpr span(const span&) noexcept = default;435 constexpr span(const span&) noexcept = default;
453 constexpr span& operator=(const span&) noexcept = default;436 constexpr span& operator=(const span&) noexcept = default;
454437
...@@ -601,20 +584,20 @@ inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true;...@@ -601,20 +584,20 @@ inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true;
601584
602// as_bytes & as_writable_bytes585// as_bytes & as_writable_bytes
603template <class _Tp, size_t _Extent>586template <class _Tp, size_t _Extent>
587 requires(!is_volatile_v<_Tp>)
604[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto as_bytes(span<_Tp, _Extent> __s) noexcept {588[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto as_bytes(span<_Tp, _Extent> __s) noexcept {
605 return __s.__as_bytes();589 return __s.__as_bytes();
606}590}
607591
608template <class _Tp, size_t _Extent>592template <class _Tp, size_t _Extent>
609 requires(!is_const_v<_Tp>)593 requires(!is_const_v<_Tp> && !is_volatile_v<_Tp>)
610[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept {594[[nodiscard]] _LIBCPP_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept {
611 return __s.__as_writable_bytes();595 return __s.__as_writable_bytes();
612}596}
613597
614# if _LIBCPP_STD_VER >= 26
615template <class _Tp>598template <class _Tp>
616concept __integral_constant_like =599concept __integral_constant_like =
617 is_integral_v<decltype(_Tp::value)> && !is_same_v<bool, remove_const_t<decltype(_Tp::value)>> &&600 is_integral_v<remove_cvref_t<decltype(_Tp::value)>> && !is_same_v<bool, remove_cvref_t<decltype(_Tp::value)>> &&
618 convertible_to<_Tp, decltype(_Tp::value)> && equality_comparable_with<_Tp, decltype(_Tp::value)> &&601 convertible_to<_Tp, decltype(_Tp::value)> && equality_comparable_with<_Tp, decltype(_Tp::value)> &&
619 bool_constant<_Tp() == _Tp::value>::value &&602 bool_constant<_Tp() == _Tp::value>::value &&
620 bool_constant<static_cast<decltype(_Tp::value)>(_Tp()) == _Tp::value>::value;603 bool_constant<static_cast<decltype(_Tp::value)>(_Tp()) == _Tp::value>::value;
...@@ -627,10 +610,6 @@ inline constexpr size_t __maybe_static_ext<_Tp> = {_Tp::value};...@@ -627,10 +610,6 @@ inline constexpr size_t __maybe_static_ext<_Tp> = {_Tp::value};
627610
628template <contiguous_iterator _It, class _EndOrSize>611template <contiguous_iterator _It, class _EndOrSize>
629span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>, __maybe_static_ext<_EndOrSize>>;612span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>, __maybe_static_ext<_EndOrSize>>;
630# else
631template <contiguous_iterator _It, class _EndOrSize>
632span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>;
633# endif
634613
635template <class _Tp, size_t _Sz>614template <class _Tp, size_t _Sz>
636span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;615span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;
...@@ -644,13 +623,13 @@ span(const array<_Tp, _Sz>&) -> span<const _Tp, _Sz>;...@@ -644,13 +623,13 @@ span(const array<_Tp, _Sz>&) -> span<const _Tp, _Sz>;
644template <ranges::contiguous_range _Range>623template <ranges::contiguous_range _Range>
645span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>;624span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>;
646625
647# endif // _LIBCPP_STD_VER >= 20
648
649_LIBCPP_END_NAMESPACE_STD626_LIBCPP_END_NAMESPACE_STD
650627
628# endif // _LIBCPP_STD_VER >= 20
629
651_LIBCPP_POP_MACROS630_LIBCPP_POP_MACROS
652631
653# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20632# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
654# include <array>633# include <array>
655# include <concepts>634# include <concepts>
656# include <functional>635# include <functional>
lib/libcxx/include/sstream+3-1
...@@ -338,6 +338,7 @@ _LIBCPP_PUSH_MACROS...@@ -338,6 +338,7 @@ _LIBCPP_PUSH_MACROS
338# include <__undef_macros>338# include <__undef_macros>
339339
340_LIBCPP_BEGIN_NAMESPACE_STD340_LIBCPP_BEGIN_NAMESPACE_STD
341_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
341342
342// Class template basic_stringbuf [stringbuf]343// Class template basic_stringbuf [stringbuf]
343344
...@@ -1288,13 +1289,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>...@@ -1288,13 +1289,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>
1288extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>;1289extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>;
1289# endif1290# endif
12901291
1292_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1291_LIBCPP_END_NAMESPACE_STD1293_LIBCPP_END_NAMESPACE_STD
12921294
1293_LIBCPP_POP_MACROS1295_LIBCPP_POP_MACROS
12941296
1295# endif // _LIBCPP_HAS_LOCALIZATION1297# endif // _LIBCPP_HAS_LOCALIZATION
12961298
1297# if _LIBCPP_STD_VER <= 20 && !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)1299# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1298# include <ostream>1300# include <ostream>
1299# include <type_traits>1301# include <type_traits>
1300# endif1302# endif
lib/libcxx/include/stack+1-1
...@@ -377,7 +377,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -377,7 +377,7 @@ _LIBCPP_END_NAMESPACE_STD
377377
378_LIBCPP_POP_MACROS378_LIBCPP_POP_MACROS
379379
380# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20380# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
381# include <concepts>381# include <concepts>
382# include <functional>382# include <functional>
383# include <type_traits>383# include <type_traits>
lib/libcxx/include/stdatomic.h+1-1
...@@ -231,7 +231,7 @@ using std::atomic_store_explicit _LIBCPP_USING_IF_EXISTS;...@@ -231,7 +231,7 @@ using std::atomic_store_explicit _LIBCPP_USING_IF_EXISTS;
231using std::atomic_signal_fence _LIBCPP_USING_IF_EXISTS;231using std::atomic_signal_fence _LIBCPP_USING_IF_EXISTS;
232using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;232using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
233233
234# elif defined(_LIBCPP_COMPILER_CLANG_BASED)234# elif !defined(__cplusplus) || defined(_LIBCPP_COMPILER_CLANG_BASED)
235235
236// Before C++23, we include the next <stdatomic.h> on the path to avoid hijacking236// Before C++23, we include the next <stdatomic.h> on the path to avoid hijacking
237// the header. We do this because Clang has historically shipped a <stdatomic.h>237// the header. We do this because Clang has historically shipped a <stdatomic.h>
lib/libcxx/include/stdbool.h deleted-44
...@@ -1,44 +0,0 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_STDBOOL_H
11#define _LIBCPP_STDBOOL_H
12
13/*
14 stdbool.h synopsis
15
16Macros:
17
18 __bool_true_false_are_defined
19
20*/
21
22#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
23# include <__cxx03/stdbool.h>
24#else
25# include <__config>
26
27# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28# pragma GCC system_header
29# endif
30
31# if __has_include_next(<stdbool.h>)
32# include_next <stdbool.h>
33# endif
34
35# ifdef __cplusplus
36# undef bool
37# undef true
38# undef false
39# undef __bool_true_false_are_defined
40# define __bool_true_false_are_defined 1
41# endif
42#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
43
44#endif // _LIBCPP_STDBOOL_H
lib/libcxx/include/stdexcept+3-1
...@@ -212,7 +212,9 @@ public:...@@ -212,7 +212,9 @@ public:
212_LIBCPP_BEGIN_NAMESPACE_STD212_LIBCPP_BEGIN_NAMESPACE_STD
213213
214// in the dylib214// in the dylib
215_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
215[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void __throw_runtime_error(const char*);216[[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void __throw_runtime_error(const char*);
217_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
216218
217[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_logic_error(const char* __msg) {219[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_logic_error(const char* __msg) {
218# if _LIBCPP_HAS_EXCEPTIONS220# if _LIBCPP_HAS_EXCEPTIONS
...@@ -280,7 +282,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -280,7 +282,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
280282
281_LIBCPP_END_NAMESPACE_STD283_LIBCPP_END_NAMESPACE_STD
282284
283# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20285# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
284# include <cstddef>286# include <cstddef>
285# include <cstdlib>287# include <cstdlib>
286# include <exception>288# include <exception>
lib/libcxx/include/stop_token+5-1
...@@ -52,7 +52,11 @@ namespace std {...@@ -52,7 +52,11 @@ namespace std {
5252
53# endif // _LIBCPP_HAS_THREADS53# endif // _LIBCPP_HAS_THREADS
5454
55# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 2055# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
56# include <atomic>
57# endif
58
59# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
56# include <cstddef>60# include <cstddef>
57# include <iosfwd>61# include <iosfwd>
58# endif62# endif
lib/libcxx/include/streambuf+4-2
...@@ -117,8 +117,8 @@ protected:...@@ -117,8 +117,8 @@ protected:
117# include <__assert>117# include <__assert>
118# include <__fwd/streambuf.h>118# include <__fwd/streambuf.h>
119# include <__locale>119# include <__locale>
120# include <__memory/valid_range.h>
120# include <__type_traits/is_same.h>121# include <__type_traits/is_same.h>
121# include <__utility/is_valid_range.h>
122# include <__utility/scope_guard.h>122# include <__utility/scope_guard.h>
123# include <climits>123# include <climits>
124# include <ios>124# include <ios>
...@@ -133,6 +133,7 @@ _LIBCPP_PUSH_MACROS...@@ -133,6 +133,7 @@ _LIBCPP_PUSH_MACROS
133# include <__undef_macros>133# include <__undef_macros>
134134
135_LIBCPP_BEGIN_NAMESPACE_STD135_LIBCPP_BEGIN_NAMESPACE_STD
136_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
136137
137template <class _CharT, class _Traits>138template <class _CharT, class _Traits>
138class basic_streambuf {139class basic_streambuf {
...@@ -430,13 +431,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;...@@ -430,13 +431,14 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;
430extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;431extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
431# endif432# endif
432433
434_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
433_LIBCPP_END_NAMESPACE_STD435_LIBCPP_END_NAMESPACE_STD
434436
435_LIBCPP_POP_MACROS437_LIBCPP_POP_MACROS
436438
437# endif // _LIBCPP_HAS_LOCALIZATION439# endif // _LIBCPP_HAS_LOCALIZATION
438440
439# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20441# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
440# include <cstdint>442# include <cstdint>
441# include <optional>443# include <optional>
442# endif444# endif
lib/libcxx/include/string+164-224
...@@ -201,6 +201,7 @@ public:...@@ -201,6 +201,7 @@ public:
201 basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17, constexpr since C++20201 basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17, constexpr since C++20
202 basic_string& append(const value_type* s, size_type n); // constexpr since C++20202 basic_string& append(const value_type* s, size_type n); // constexpr since C++20
203 basic_string& append(const value_type* s); // constexpr since C++20203 basic_string& append(const value_type* s); // constexpr since C++20
204 basic_string& append(const value_type* s, size_type pos, size_type n); // constexpr since C++20
204 basic_string& append(size_type n, value_type c); // constexpr since C++20205 basic_string& append(size_type n, value_type c); // constexpr since C++20
205 template<class InputIterator>206 template<class InputIterator>
206 basic_string& append(InputIterator first, InputIterator last); // constexpr since C++20207 basic_string& append(InputIterator first, InputIterator last); // constexpr since C++20
...@@ -224,6 +225,7 @@ public:...@@ -224,6 +225,7 @@ public:
224 basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17, constexpr since C++20225 basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17, constexpr since C++20
225 basic_string& assign(const value_type* s, size_type n); // constexpr since C++20226 basic_string& assign(const value_type* s, size_type n); // constexpr since C++20
226 basic_string& assign(const value_type* s); // constexpr since C++20227 basic_string& assign(const value_type* s); // constexpr since C++20
228 basic_string& assign(const value_type* s, size_type pos, size_type n); // constexpr since C++20
227 basic_string& assign(size_type n, value_type c); // constexpr since C++20229 basic_string& assign(size_type n, value_type c); // constexpr since C++20
228 template<class InputIterator>230 template<class InputIterator>
229 basic_string& assign(InputIterator first, InputIterator last); // constexpr since C++20231 basic_string& assign(InputIterator first, InputIterator last); // constexpr since C++20
...@@ -597,6 +599,7 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -597,6 +599,7 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
597# include <__algorithm/remove_if.h>599# include <__algorithm/remove_if.h>
598# include <__assert>600# include <__assert>
599# include <__config>601# include <__config>
602# include <__cstddef/size_t.h>
600# include <__debug_utils/sanitizers.h>603# include <__debug_utils/sanitizers.h>
601# include <__format/enable_insertable.h>604# include <__format/enable_insertable.h>
602# include <__functional/hash.h>605# include <__functional/hash.h>
...@@ -625,9 +628,11 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -625,9 +628,11 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
625# include <__string/char_traits.h>628# include <__string/char_traits.h>
626# include <__string/extern_template_lists.h>629# include <__string/extern_template_lists.h>
627# include <__type_traits/conditional.h>630# include <__type_traits/conditional.h>
631# include <__type_traits/desugars_to.h>
628# include <__type_traits/enable_if.h>632# include <__type_traits/enable_if.h>
629# include <__type_traits/is_allocator.h>633# include <__type_traits/is_allocator.h>
630# include <__type_traits/is_array.h>634# include <__type_traits/is_array.h>
635# include <__type_traits/is_constant_evaluated.h>
631# include <__type_traits/is_convertible.h>636# include <__type_traits/is_convertible.h>
632# include <__type_traits/is_generic_transparent_comparator.h>637# include <__type_traits/is_generic_transparent_comparator.h>
633# include <__type_traits/is_nothrow_assignable.h>638# include <__type_traits/is_nothrow_assignable.h>
...@@ -637,9 +642,11 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -637,9 +642,11 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
637# include <__type_traits/is_trivially_constructible.h>642# include <__type_traits/is_trivially_constructible.h>
638# include <__type_traits/is_trivially_copyable.h>643# include <__type_traits/is_trivially_copyable.h>
639# include <__type_traits/is_trivially_relocatable.h>644# include <__type_traits/is_trivially_relocatable.h>
645# include <__type_traits/remove_cv.h>
640# include <__type_traits/remove_cvref.h>646# include <__type_traits/remove_cvref.h>
641# include <__utility/default_three_way_comparator.h>647# include <__utility/default_three_way_comparator.h>
642# include <__utility/exception_guard.h>648# include <__utility/exception_guard.h>
649# include <__utility/exchange.h>
643# include <__utility/forward.h>650# include <__utility/forward.h>
644# include <__utility/is_pointer_in_range.h>651# include <__utility/is_pointer_in_range.h>
645# include <__utility/move.h>652# include <__utility/move.h>
...@@ -678,18 +685,18 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );...@@ -678,18 +685,18 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
678_LIBCPP_PUSH_MACROS685_LIBCPP_PUSH_MACROS
679# include <__undef_macros>686# include <__undef_macros>
680687
681# if __has_feature(address_sanitizer) && _LIBCPP_INSTRUMENTED_WITH_ASAN688// Since std::string is partially instantiated in the built library, we require that the library
682# define _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS __attribute__((__no_sanitize__("address")))689// has been built with ASAN support in order to enable the container checks in std::string.
683// This macro disables AddressSanitizer (ASan) instrumentation for a specific function,690// Within the <string> implementation, use `_LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS_FOR_STRING`
684// allowing memory accesses that would normally trigger ASan errors to proceed without crashing.691// to determine whether ASAN container checks should be provided.
685// This is useful for accessing parts of objects memory, which should not be accessed,692# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS && _LIBCPP_INSTRUMENTED_WITH_ASAN
686// such as unused bytes in short strings, that should never be accessed693# define _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS_FOR_STRING 1
687// by other parts of the program.
688# else694# else
689# define _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS695# define _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS_FOR_STRING 0
690# endif696# endif
691697
692_LIBCPP_BEGIN_NAMESPACE_STD698_LIBCPP_BEGIN_NAMESPACE_STD
699_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
693700
694// basic_string701// basic_string
695702
...@@ -749,44 +756,10 @@ public:...@@ -749,44 +756,10 @@ public:
749 //756 //
750 // This string implementation doesn't contain any references into itself. It only contains a bit that says whether757 // This string implementation doesn't contain any references into itself. It only contains a bit that says whether
751 // it is in small or large string mode, so the entire structure is trivially relocatable if its members are.758 // it is in small or large string mode, so the entire structure is trivially relocatable if its members are.
752# if __has_feature(address_sanitizer) && _LIBCPP_INSTRUMENTED_WITH_ASAN
753 // When compiling with AddressSanitizer (ASan), basic_string cannot be trivially
754 // relocatable. Because the object's memory might be poisoned when its content
755 // is kept inside objects memory (short string optimization), instead of in allocated
756 // external memory. In such cases, the destructor is responsible for unpoisoning
757 // the memory to avoid triggering false positives.
758 // Therefore it's crucial to ensure the destructor is called.
759 using __trivially_relocatable _LIBCPP_NODEBUG = void;
760# else
761 using __trivially_relocatable _LIBCPP_NODEBUG = __conditional_t<759 using __trivially_relocatable _LIBCPP_NODEBUG = __conditional_t<
762 __libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value,760 __libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value,
763 basic_string,761 basic_string,
764 void>;762 void>;
765# endif
766
767# if __has_feature(address_sanitizer) && _LIBCPP_INSTRUMENTED_WITH_ASAN
768 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __asan_volatile_wrapper(pointer const& __ptr) const {
769 if (__libcpp_is_constant_evaluated())
770 return __ptr;
771
772 pointer volatile __copy_ptr = __ptr;
773
774 return const_cast<pointer&>(__copy_ptr);
775 }
776
777 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer
778 __asan_volatile_wrapper(const_pointer const& __ptr) const {
779 if (__libcpp_is_constant_evaluated())
780 return __ptr;
781
782 const_pointer volatile __copy_ptr = __ptr;
783
784 return const_cast<const_pointer&>(__copy_ptr);
785 }
786# define _LIBCPP_ASAN_VOLATILE_WRAPPER(PTR) __asan_volatile_wrapper(PTR)
787# else
788# define _LIBCPP_ASAN_VOLATILE_WRAPPER(PTR) PTR
789# endif
790763
791 static_assert(!is_array<value_type>::value, "Character type of basic_string must not be an array");764 static_assert(!is_array<value_type>::value, "Character type of basic_string must not be an array");
792 static_assert(is_standard_layout<value_type>::value, "Character type of basic_string must be standard-layout");765 static_assert(is_standard_layout<value_type>::value, "Character type of basic_string must be standard-layout");
...@@ -803,8 +776,8 @@ public:...@@ -803,8 +776,8 @@ public:
803 // Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's776 // Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's
804 // pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is777 // pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is
805 // considered contiguous.778 // considered contiguous.
806 using iterator = __bounded_iter<__wrap_iter<pointer> >;779 using iterator = __bounded_iter<pointer>;
807 using const_iterator = __bounded_iter<__wrap_iter<const_pointer> >;780 using const_iterator = __bounded_iter<const_pointer>;
808# else781# else
809 using iterator = __wrap_iter<pointer>;782 using iterator = __wrap_iter<pointer>;
810 using const_iterator = __wrap_iter<const_pointer>;783 using const_iterator = __wrap_iter<const_pointer>;
...@@ -949,10 +922,7 @@ private:...@@ -949,10 +922,7 @@ private:
949 // regardless of whether reallocation occurs. This allows us to check for out-of-bounds accesses using logical size,922 // regardless of whether reallocation occurs. This allows us to check for out-of-bounds accesses using logical size,
950 // a stricter check, since correct code can never rely on being able to access newly-added elements via an existing923 // a stricter check, since correct code can never rely on being able to access newly-added elements via an existing
951 // iterator.924 // iterator.
952 return std::__make_bounded_iter(925 return std::__make_bounded_iter(__p, __get_pointer(), __get_pointer() + size());
953 std::__wrap_iter<pointer>(__p),
954 std::__wrap_iter<pointer>(__get_pointer()),
955 std::__wrap_iter<pointer>(__get_pointer() + size()));
956# else926# else
957 return iterator(__p);927 return iterator(__p);
958# endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING928# endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING
...@@ -961,10 +931,7 @@ private:...@@ -961,10 +931,7 @@ private:
961 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator __make_const_iterator(const_pointer __p) const {931 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator __make_const_iterator(const_pointer __p) const {
962# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING932# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING
963 // Bound the iterator according to the size (and not the capacity, unlike vector).933 // Bound the iterator according to the size (and not the capacity, unlike vector).
964 return std::__make_bounded_iter(934 return std::__make_bounded_iter(__p, __get_pointer(), __get_pointer() + size());
965 std::__wrap_iter<const_pointer>(__p),
966 std::__wrap_iter<const_pointer>(__get_pointer()),
967 std::__wrap_iter<const_pointer>(__get_pointer() + size()));
968# else935# else
969 return const_iterator(__p);936 return const_iterator(__p);
970# endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING937# endif // _LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING
...@@ -975,12 +942,7 @@ public:...@@ -975,12 +942,7 @@ public:
975942
976 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()943 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
977 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)944 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
978# if _LIBCPP_STD_VER >= 20 // TODO(LLVM 23): Remove this condition; this is a workaround for https://llvm.org/PR154567945 : __rep_() {
979 : __rep_(__short())
980# else
981 : __rep_()
982# endif
983 {
984 __annotate_new(0);946 __annotate_new(0);
985 }947 }
986948
...@@ -990,16 +952,11 @@ public:...@@ -990,16 +952,11 @@ public:
990# else952# else
991 _NOEXCEPT953 _NOEXCEPT
992# endif954# endif
993# if _LIBCPP_STD_VER >= 20 // TODO(LLVM 23): Remove this condition; this is a workaround for https://llvm.org/PR154567955 : __rep_(), __alloc_(__a) {
994 : __rep_(__short()),
995# else
996 : __rep_(),
997# endif
998 __alloc_(__a) {
999 __annotate_new(0);956 __annotate_new(0);
1000 }957 }
1001958
1002 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS basic_string(const basic_string& __str)959 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str)
1003 : __alloc_(__alloc_traits::select_on_container_copy_construction(__str.__alloc_)) {960 : __alloc_(__alloc_traits::select_on_container_copy_construction(__str.__alloc_)) {
1004 if (!__str.__is_long()) {961 if (!__str.__is_long()) {
1005 __rep_ = __str.__rep_;962 __rep_ = __str.__rep_;
...@@ -1008,9 +965,7 @@ public:...@@ -1008,9 +965,7 @@ public:
1008 __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());965 __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
1009 }966 }
1010967
1011 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS968 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str, const allocator_type& __a) : __alloc_(__a) {
1012 basic_string(const basic_string& __str, const allocator_type& __a)
1013 : __alloc_(__a) {
1014 if (!__str.__is_long()) {969 if (!__str.__is_long()) {
1015 __rep_ = __str.__rep_;970 __rep_ = __str.__rep_;
1016 __annotate_new(__get_short_size());971 __annotate_new(__get_short_size());
...@@ -1025,15 +980,7 @@ public:...@@ -1025,15 +980,7 @@ public:
1025# else980# else
1026 _NOEXCEPT981 _NOEXCEPT
1027# endif982# endif
1028 // Turning off ASan instrumentation for variable initialization with _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS983 : __rep_(std::move(__str.__rep_)), __alloc_(std::move(__str.__alloc_)) {
1029 // does not work consistently during initialization of __r_, so we instead unpoison __str's memory manually first.
1030 // __str's memory needs to be unpoisoned only in the case where it's a short string.
1031 : __rep_([](basic_string& __s) -> decltype(__s.__rep_)&& {
1032 if (!__s.__is_long())
1033 __s.__annotate_delete();
1034 return std::move(__s.__rep_);
1035 }(__str)),
1036 __alloc_(std::move(__str.__alloc_)) {
1037 __str.__rep_ = __rep();984 __str.__rep_ = __rep();
1038 __str.__annotate_new(0);985 __str.__annotate_new(0);
1039 if (!__is_long())986 if (!__is_long())
...@@ -1058,15 +1005,9 @@ public:...@@ -1058,15 +1005,9 @@ public:
1058 }1005 }
1059# endif // _LIBCPP_CXX03_LANG1006# endif // _LIBCPP_CXX03_LANG
10601007
1061 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
1062 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) {
1063 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*) detected nullptr");
1064 __init(__s, traits_type::length(__s));
1065 }
1066
1067 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>1008 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
1068 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX201009 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1069 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a)1010 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a = _Allocator())
1070 : __alloc_(__a) {1011 : __alloc_(__a) {
1071 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");1012 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
1072 __init(__s, traits_type::length(__s));1013 __init(__s, traits_type::length(__s));
...@@ -1076,22 +1017,14 @@ public:...@@ -1076,22 +1017,14 @@ public:
1076 basic_string(nullptr_t) = delete;1017 basic_string(nullptr_t) = delete;
1077# endif1018# endif
10781019
1079 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n)1020 _LIBCPP_HIDE_FROM_ABI
1080 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero") {1021 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n, const _Allocator& __a = _Allocator())
1081 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
1082 __init(__s, __n);
1083 }
1084
1085 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1086 basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
1087 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero")1022 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero")
1088 : __alloc_(__a) {1023 : __alloc_(__a) {
1089 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");1024 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
1090 __init(__s, __n);1025 __init(__s, __n);
1091 }1026 }
10921027
1093 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c) { __init(__n, __c); }
1094
1095# if _LIBCPP_STD_VER >= 231028# if _LIBCPP_STD_VER >= 23
1096 _LIBCPP_HIDE_FROM_ABI constexpr basic_string(1029 _LIBCPP_HIDE_FROM_ABI constexpr basic_string(
1097 basic_string&& __str, size_type __pos, const _Allocator& __alloc = _Allocator())1030 basic_string&& __str, size_type __pos, const _Allocator& __alloc = _Allocator())
...@@ -1114,7 +1047,8 @@ public:...@@ -1114,7 +1047,8 @@ public:
1114# endif1047# endif
11151048
1116 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>1049 template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
1117 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)1050 _LIBCPP_HIDE_FROM_ABI
1051 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a = _Allocator())
1118 : __alloc_(__a) {1052 : __alloc_(__a) {
1119 __init(__n, __c);1053 __init(__n, __c);
1120 }1054 }
...@@ -1153,29 +1087,16 @@ public:...@@ -1153,29 +1087,16 @@ public:
1153 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&1087 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1154 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,1088 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1155 int> = 0>1089 int> = 0>
1156 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {1090 _LIBCPP_HIDE_FROM_ABI
1157 __self_view __sv = __t;1091 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a = allocator_type())
1158 __init(__sv.data(), __sv.size());
1159 }
1160
1161 template <class _Tp,
1162 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
1163 !is_same<__remove_cvref_t<_Tp>, basic_string>::value,
1164 int> = 0>
1165 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a)
1166 : __alloc_(__a) {1092 : __alloc_(__a) {
1167 __self_view __sv = __t;1093 __self_view __sv = __t;
1168 __init(__sv.data(), __sv.size());1094 __init(__sv.data(), __sv.size());
1169 }1095 }
11701096
1171 template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
1172 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last) {
1173 __init(__first, __last);
1174 }
1175
1176 template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>1097 template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
1177 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX201098 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
1178 basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a)1099 basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type())
1179 : __alloc_(__a) {1100 : __alloc_(__a) {
1180 __init(__first, __last);1101 __init(__first, __last);
1181 }1102 }
...@@ -1194,11 +1115,8 @@ public:...@@ -1194,11 +1115,8 @@ public:
1194# endif1115# endif
11951116
1196# ifndef _LIBCPP_CXX03_LANG1117# ifndef _LIBCPP_CXX03_LANG
1197 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il) {1118 _LIBCPP_HIDE_FROM_ABI
1198 __init(__il.begin(), __il.end());1119 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il, const _Allocator& __a = _Allocator())
1199 }
1200
1201 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il, const _Allocator& __a)
1202 : __alloc_(__a) {1120 : __alloc_(__a) {
1203 __init(__il.begin(), __il.end());1121 __init(__il.begin(), __il.end());
1204 }1122 }
...@@ -1213,8 +1131,7 @@ public:...@@ -1213,8 +1131,7 @@ public:
1213 return __self_view(typename __self_view::__assume_valid(), data(), size());1131 return __self_view(typename __self_view::__assume_valid(), data(), size());
1214 }1132 }
12151133
1216 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS basic_string&1134 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const basic_string& __str);
1217 operator=(const basic_string& __str);
12181135
1219 template <class _Tp,1136 template <class _Tp,
1220 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&1137 __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp> &&
...@@ -1427,6 +1344,8 @@ public:...@@ -1427,6 +1344,8 @@ public:
1427 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n)1344 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n)
1428 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");1345 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");
1429 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);1346 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
1347 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __pos, size_type __n)
1348 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");
1430 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);1349 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);
14311350
1432 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>1351 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
...@@ -1450,7 +1369,7 @@ public:...@@ -1450,7 +1369,7 @@ public:
1450 if (__cap - __sz < __n)1369 if (__cap - __sz < __n)
1451 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);1370 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
1452 __annotate_increase(__n);1371 __annotate_increase(__n);
1453 auto __end = __copy_non_overlapping_range(__first, __last, std::__to_address(__get_pointer() + __sz));1372 auto __end = __copy_non_overlapping_range(__first, __last, __data() + __sz);
1454 traits_type::assign(*__end, value_type());1373 traits_type::assign(*__end, value_type());
1455 __set_size(__sz + __n);1374 __set_size(__sz + __n);
1456 return *this;1375 return *this;
...@@ -1510,8 +1429,7 @@ public:...@@ -1510,8 +1429,7 @@ public:
1510 size_type __old_sz = __str.size();1429 size_type __old_sz = __str.size();
1511 if (!__str.__is_long())1430 if (!__str.__is_long())
1512 __str.__annotate_delete();1431 __str.__annotate_delete();
1513 __rep_ = __str.__rep_;1432 __rep_ = std::__exchange(__str.__rep_, __rep());
1514 __str.__rep_ = __rep();
1515 __str.__annotate_new(0);1433 __str.__annotate_new(0);
15161434
1517 _Traits::move(data(), data() + __pos, __len);1435 _Traits::move(data(), data() + __pos, __len);
...@@ -1554,6 +1472,8 @@ public:...@@ -1554,6 +1472,8 @@ public:
1554 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n)1472 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n)
1555 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");1473 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");
1556 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);1474 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
1475 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __pos, size_type __n)
1476 _LIBCPP_DIAGNOSE_NULLPTR_IF(__n != 0 && __s == nullptr, " if n is not zero");
1557 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c);1477 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c);
15581478
1559 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>1479 template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
...@@ -1807,6 +1727,13 @@ public:...@@ -1807,6 +1727,13 @@ public:
1807 }1727 }
1808# endif1728# endif
18091729
1730 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const value_type* __data() const _NOEXCEPT {
1731 return std::__to_address(__get_pointer());
1732 }
1733 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 value_type* __data() _NOEXCEPT {
1734 return std::__to_address(__get_pointer());
1735 }
1736
1810 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {1737 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator() const _NOEXCEPT {
1811 return __alloc_;1738 return __alloc_;
1812 }1739 }
...@@ -1815,14 +1742,14 @@ public:...@@ -1815,14 +1742,14 @@ public:
18151742
1816 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1743 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1817 find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {1744 find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {
1818 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __str.data(), __pos, __str.size());1745 return find(__str.data(), __pos, __str.size());
1819 }1746 }
18201747
1821 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>1748 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1822 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1749 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1823 find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {1750 find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {
1824 __self_view __sv = __t;1751 __self_view __sv = __t;
1825 return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __sv.data(), __pos, __sv.size());1752 return find(__sv.data(), __pos, __sv.size());
1826 }1753 }
18271754
1828 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1755 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1835,8 +1762,7 @@ public:...@@ -1835,8 +1762,7 @@ public:
1835 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1762 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1836 find(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {1763 find(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
1837 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find(): received nullptr");1764 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find(): received nullptr");
1838 return std::__str_find<value_type, size_type, traits_type, npos>(1765 return find(__s, __pos, traits_type::length(__s));
1839 data(), size(), __s, __pos, traits_type::length(__s));
1840 }1766 }
18411767
1842 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT {1768 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT {
...@@ -1847,15 +1773,14 @@ public:...@@ -1847,15 +1773,14 @@ public:
18471773
1848 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1774 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1849 rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {1775 rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {
1850 return std::__str_rfind<value_type, size_type, traits_type, npos>(1776 return rfind(__str.data(), __pos, __str.size());
1851 data(), size(), __str.data(), __pos, __str.size());
1852 }1777 }
18531778
1854 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>1779 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1855 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1780 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1856 rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {1781 rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {
1857 __self_view __sv = __t;1782 __self_view __sv = __t;
1858 return std::__str_rfind<value_type, size_type, traits_type, npos>(data(), size(), __sv.data(), __pos, __sv.size());1783 return rfind(__sv.data(), __pos, __sv.size());
1859 }1784 }
18601785
1861 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1786 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1868,8 +1793,7 @@ public:...@@ -1868,8 +1793,7 @@ public:
1868 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1793 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1869 rfind(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {1794 rfind(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
1870 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::rfind(): received nullptr");1795 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::rfind(): received nullptr");
1871 return std::__str_rfind<value_type, size_type, traits_type, npos>(1796 return rfind(__s, __pos, traits_type::length(__s));
1872 data(), size(), __s, __pos, traits_type::length(__s));
1873 }1797 }
18741798
1875 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1799 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1881,16 +1805,14 @@ public:...@@ -1881,16 +1805,14 @@ public:
18811805
1882 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1806 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1883 find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {1807 find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {
1884 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(1808 return find_first_of(__str.data(), __pos, __str.size());
1885 data(), size(), __str.data(), __pos, __str.size());
1886 }1809 }
18871810
1888 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>1811 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1889 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1812 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1890 find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {1813 find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {
1891 __self_view __sv = __t;1814 __self_view __sv = __t;
1892 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(1815 return find_first_of(__sv.data(), __pos, __sv.size());
1893 data(), size(), __sv.data(), __pos, __sv.size());
1894 }1816 }
18951817
1896 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1818 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1903,8 +1825,7 @@ public:...@@ -1903,8 +1825,7 @@ public:
1903 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1825 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1904 find_first_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {1826 find_first_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
1905 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_of(): received nullptr");1827 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_of(): received nullptr");
1906 return std::__str_find_first_of<value_type, size_type, traits_type, npos>(1828 return find_first_of(__s, __pos, traits_type::length(__s));
1907 data(), size(), __s, __pos, traits_type::length(__s));
1908 }1829 }
19091830
1910 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1831 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1916,16 +1837,14 @@ public:...@@ -1916,16 +1837,14 @@ public:
19161837
1917 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1838 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1918 find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {1839 find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {
1919 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(1840 return find_last_of(__str.data(), __pos, __str.size());
1920 data(), size(), __str.data(), __pos, __str.size());
1921 }1841 }
19221842
1923 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>1843 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1924 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1844 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1925 find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {1845 find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {
1926 __self_view __sv = __t;1846 __self_view __sv = __t;
1927 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(1847 return find_last_of(__sv.data(), __pos, __sv.size());
1928 data(), size(), __sv.data(), __pos, __sv.size());
1929 }1848 }
19301849
1931 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1850 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1938,8 +1857,7 @@ public:...@@ -1938,8 +1857,7 @@ public:
1938 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1857 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1939 find_last_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {1858 find_last_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
1940 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_of(): received nullptr");1859 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_of(): received nullptr");
1941 return std::__str_find_last_of<value_type, size_type, traits_type, npos>(1860 return find_last_of(__s, __pos, traits_type::length(__s));
1942 data(), size(), __s, __pos, traits_type::length(__s));
1943 }1861 }
19441862
1945 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1863 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1951,16 +1869,14 @@ public:...@@ -1951,16 +1869,14 @@ public:
19511869
1952 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1870 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1953 find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {1871 find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT {
1954 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(1872 return find_first_not_of(__str.data(), __pos, __str.size());
1955 data(), size(), __str.data(), __pos, __str.size());
1956 }1873 }
19571874
1958 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>1875 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1959 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1876 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1960 find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {1877 find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT {
1961 __self_view __sv = __t;1878 __self_view __sv = __t;
1962 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(1879 return find_first_not_of(__sv.data(), __pos, __sv.size());
1963 data(), size(), __sv.data(), __pos, __sv.size());
1964 }1880 }
19651881
1966 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1882 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1973,8 +1889,7 @@ public:...@@ -1973,8 +1889,7 @@ public:
1973 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1889 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1974 find_first_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {1890 find_first_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
1975 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_not_of(): received nullptr");1891 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_not_of(): received nullptr");
1976 return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(1892 return find_first_not_of(__s, __pos, traits_type::length(__s));
1977 data(), size(), __s, __pos, traits_type::length(__s));
1978 }1893 }
19791894
1980 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1895 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -1986,16 +1901,14 @@ public:...@@ -1986,16 +1901,14 @@ public:
19861901
1987 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1902 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1988 find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {1903 find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT {
1989 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(1904 return find_last_not_of(__str.data(), __pos, __str.size());
1990 data(), size(), __str.data(), __pos, __str.size());
1991 }1905 }
19921906
1993 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>1907 template <class _Tp, __enable_if_t<__can_be_converted_to_string_view_v<_CharT, _Traits, _Tp>, int> = 0>
1994 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1908 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1995 find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {1909 find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT {
1996 __self_view __sv = __t;1910 __self_view __sv = __t;
1997 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(1911 return find_last_not_of(__sv.data(), __pos, __sv.size());
1998 data(), size(), __sv.data(), __pos, __sv.size());
1999 }1912 }
20001913
2001 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1914 [[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -2008,8 +1921,7 @@ public:...@@ -2008,8 +1921,7 @@ public:
2008 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1921 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
2009 find_last_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {1922 find_last_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
2010 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_not_of(): received nullptr");1923 _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_not_of(): received nullptr");
2011 return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(1924 return find_last_not_of(__s, __pos, traits_type::length(__s));
2012 data(), size(), __s, __pos, traits_type::length(__s));
2013 }1925 }
20141926
2015 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type1927 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
...@@ -2134,8 +2046,7 @@ public:...@@ -2134,8 +2046,7 @@ public:
2134 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __invariants() const;2046 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __invariants() const;
21352047
2136private:2048private:
2137 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS bool2049 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_long() const _NOEXCEPT {
2138 __is_long() const _NOEXCEPT {
2139 if (__libcpp_is_constant_evaluated() && __builtin_constant_p(__rep_.__l.__is_long_)) {2050 if (__libcpp_is_constant_evaluated() && __builtin_constant_p(__rep_.__l.__is_long_)) {
2140 return __rep_.__l.__is_long_;2051 return __rep_.__l.__is_long_;
2141 }2052 }
...@@ -2180,7 +2091,7 @@ private:...@@ -2180,7 +2091,7 @@ private:
2180 value_type* __p;2091 value_type* __p;
2181 if (__cap - __sz >= __n) {2092 if (__cap - __sz >= __n) {
2182 __annotate_increase(__n);2093 __annotate_increase(__n);
2183 __p = std::__to_address(__get_pointer());2094 __p = __data();
2184 size_type __n_move = __sz - __ip;2095 size_type __n_move = __sz - __ip;
2185 if (__n_move != 0)2096 if (__n_move != 0)
2186 traits_type::move(__p + __ip + __n, __p + __ip, __n_move);2097 traits_type::move(__p + __ip + __n, __p + __ip, __n_move);
...@@ -2203,15 +2114,13 @@ private:...@@ -2203,15 +2114,13 @@ private:
2203 // internal buffer accessors2114 // internal buffer accessors
2204 // -------------------------2115 // -------------------------
22052116
2206 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void2117 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_short_size(size_type __s) _NOEXCEPT {
2207 __set_short_size(size_type __s) _NOEXCEPT {
2208 _LIBCPP_ASSERT_INTERNAL(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");2118 _LIBCPP_ASSERT_INTERNAL(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
2209 __rep_.__s.__size_ = __s;2119 __rep_.__s.__size_ = __s;
2210 __rep_.__s.__is_long_ = false;2120 __rep_.__s.__is_long_ = false;
2211 }2121 }
22122122
2213 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS size_type2123 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_short_size() const _NOEXCEPT {
2214 __get_short_size() const _NOEXCEPT {
2215 _LIBCPP_ASSERT_INTERNAL(!__rep_.__s.__is_long_, "String has to be short when trying to get the short size");2124 _LIBCPP_ASSERT_INTERNAL(!__rep_.__s.__is_long_, "String has to be short when trying to get the short size");
2216 return __rep_.__s.__size_;2125 return __rep_.__s.__size_;
2217 }2126 }
...@@ -2239,22 +2148,20 @@ private:...@@ -2239,22 +2148,20 @@ private:
22392148
2240 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_long_pointer() _NOEXCEPT {2149 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_long_pointer() _NOEXCEPT {
2241 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long pointer");2150 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long pointer");
2242 return _LIBCPP_ASAN_VOLATILE_WRAPPER(__rep_.__l.__data_);2151 return __rep_.__l.__data_;
2243 }2152 }
22442153
2245 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer __get_long_pointer() const _NOEXCEPT {2154 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer __get_long_pointer() const _NOEXCEPT {
2246 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long pointer");2155 _LIBCPP_ASSERT_INTERNAL(__rep_.__l.__is_long_, "String has to be long when trying to get the long pointer");
2247 return _LIBCPP_ASAN_VOLATILE_WRAPPER(__rep_.__l.__data_);2156 return __rep_.__l.__data_;
2248 }2157 }
22492158
2250 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS pointer2159 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_short_pointer() _NOEXCEPT {
2251 __get_short_pointer() _NOEXCEPT {2160 return pointer_traits<pointer>::pointer_to(__rep_.__s.__data_[0]);
2252 return _LIBCPP_ASAN_VOLATILE_WRAPPER(pointer_traits<pointer>::pointer_to(__rep_.__s.__data_[0]));
2253 }2161 }
22542162
2255 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS const_pointer2163 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_pointer __get_short_pointer() const _NOEXCEPT {
2256 __get_short_pointer() const _NOEXCEPT {2164 return pointer_traits<const_pointer>::pointer_to(__rep_.__s.__data_[0]);
2257 return _LIBCPP_ASAN_VOLATILE_WRAPPER(pointer_traits<const_pointer>::pointer_to(__rep_.__s.__data_[0]));
2258 }2165 }
22592166
2260 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_pointer() _NOEXCEPT {2167 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_pointer() _NOEXCEPT {
...@@ -2272,17 +2179,24 @@ private:...@@ -2272,17 +2179,24 @@ private:
22722179
2273 // Allocate a buffer of __capacity size with __alloc and return it2180 // Allocate a buffer of __capacity size with __alloc and return it
2274 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 __long2181 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 __long
2275 __allocate_long_buffer(_Allocator& __alloc, size_type __capacity) {2182 __allocate_long_buffer(_Allocator& __alloc, size_type __size, size_type __min_capacity) {
2276 _LIBCPP_ASSERT_INTERNAL(!__fits_in_sso(__capacity),2183 _LIBCPP_ASSERT_INTERNAL(
2184 __size <= __min_capacity, "Trying to allocate a long buffer with a smaller capacity than size");
2185 _LIBCPP_ASSERT_INTERNAL(!__fits_in_sso(__min_capacity),
2277 "Trying to allocate long buffer for a capacity what would fit into the small buffer");2186 "Trying to allocate long buffer for a capacity what would fit into the small buffer");
2278 auto __buffer = std::__allocate_at_least(__alloc, __align_allocation_size(__capacity));2187 auto __buffer = std::__allocate_at_least(__alloc, __align_allocation_size(__min_capacity));
22792188
2280 if (__libcpp_is_constant_evaluated()) {2189 if (__libcpp_is_constant_evaluated()) {
2281 for (size_type __i = 0; __i != __buffer.count; ++__i)2190 for (size_type __i = 0; __i != __buffer.count; ++__i)
2282 std::__construct_at(std::addressof(__buffer.ptr[__i]));2191 std::__construct_at(std::addressof(__buffer.ptr[__i]));
2283 }2192 }
22842193
2285 return __long(__buffer, __capacity);2194 return __long(__buffer, __size);
2195 }
2196
2197 _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX20 __long
2198 __allocate_long_buffer(_Allocator& __alloc, size_type __size) {
2199 return __allocate_long_buffer(__alloc, __size, __size);
2286 }2200 }
22872201
2288 // Replace the current buffer with __new_rep. Deallocate the old long buffer if it exists.2202 // Replace the current buffer with __new_rep. Deallocate the old long buffer if it exists.
...@@ -2321,13 +2235,9 @@ private:...@@ -2321,13 +2235,9 @@ private:
2321 __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {2235 __annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {
2322 (void)__old_mid;2236 (void)__old_mid;
2323 (void)__new_mid;2237 (void)__new_mid;
2324# if _LIBCPP_INSTRUMENTED_WITH_ASAN2238# if _LIBCPP_ENABLE_ASAN_CONTAINER_CHECKS_FOR_STRING
2325# if defined(__APPLE__)2239 if (__is_long())
2326 // TODO: remove after addressing issue #96099 (https://llvm.org/PR96099)2240 std::__annotate_contiguous_container<_Allocator>(data(), data() + capacity() + 1, __old_mid, __new_mid);
2327 if (!__is_long())
2328 return;
2329# endif
2330 std::__annotate_contiguous_container<_Allocator>(data(), data() + capacity() + 1, __old_mid, __new_mid);
2331# endif2241# endif
2332 }2242 }
23332243
...@@ -2366,7 +2276,17 @@ private:...@@ -2366,7 +2276,17 @@ private:
2366 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __align_it(size_type __s) _NOEXCEPT {2276 static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __align_it(size_type __s) _NOEXCEPT {
2367 return (__s + (__a - 1)) & ~(__a - 1);2277 return (__s + (__a - 1)) & ~(__a - 1);
2368 }2278 }
2369 enum { __alignment = 8 };2279
2280 // GCC currently doesn't define __STDCPP_DEFAULT_NEW_ALIGNMENT__ unconditionally
2281 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123872
2282# ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
2283 static inline const size_t
2284 __alignment = __is_std_allocator_v<allocator_type> && __STDCPP_DEFAULT_NEW_ALIGNMENT__ > sizeof(void*)
2285 ? __STDCPP_DEFAULT_NEW_ALIGNMENT__
2286 : sizeof(void*);
2287# else
2288 static inline const size_t __alignment = sizeof(void*);
2289# endif
23702290
2371 // This makes sure that we're using a capacity with some extra alignment, since allocators almost always over-align2291 // This makes sure that we're using a capacity with some extra alignment, since allocators almost always over-align
2372 // the allocations anyways, improving memory usage. More importantly, this ensures that the lowest bit is never set2292 // the allocations anyways, improving memory usage. More importantly, this ensures that the lowest bit is never set
...@@ -2458,7 +2378,7 @@ private:...@@ -2458,7 +2378,7 @@ private:
24582378
2459 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __erase_to_end(size_type __pos) {2379 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __erase_to_end(size_type __pos) {
2460 _LIBCPP_ASSERT_INTERNAL(__pos <= capacity(), "Trying to erase at position outside the strings capacity!");2380 _LIBCPP_ASSERT_INTERNAL(__pos <= capacity(), "Trying to erase at position outside the strings capacity!");
2461 __null_terminate_at(std::__to_address(__get_pointer()), __pos);2381 __null_terminate_at(__data(), __pos);
2462 }2382 }
24632383
2464 // __erase_external_with_move is invoked for erase() invocations where2384 // __erase_external_with_move is invoked for erase() invocations where
...@@ -2494,8 +2414,7 @@ private:...@@ -2494,8 +2414,7 @@ private:
2494# ifndef _LIBCPP_CXX03_LANG2414# ifndef _LIBCPP_CXX03_LANG
2495 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void2415 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
2496 __move_assign(basic_string& __str, false_type) noexcept(__alloc_traits::is_always_equal::value);2416 __move_assign(basic_string& __str, false_type) noexcept(__alloc_traits::is_always_equal::value);
2497 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void2417 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign(basic_string& __str, true_type)
2498 __move_assign(basic_string& __str, true_type)
2499# if _LIBCPP_STD_VER >= 172418# if _LIBCPP_STD_VER >= 17
2500 noexcept;2419 noexcept;
2501# else2420# else
...@@ -2610,19 +2529,29 @@ struct __default_three_way_comparator<basic_string<_CharT, _Traits, _Alloc>, bas...@@ -2610,19 +2529,29 @@ struct __default_three_way_comparator<basic_string<_CharT, _Traits, _Alloc>, bas
2610};2529};
2611# endif2530# endif
26122531
2613template <class _Comparator, class _CharT, class _Traits, class _Alloc>2532template <class _Comparator, class _CharT2, class _CharT, class _Traits, class _Alloc>
2614inline const bool __is_transparently_comparable_v<_Comparator,2533inline const bool __is_transparently_comparable_v<_Comparator, basic_string<_CharT, _Traits, _Alloc>, _CharT2*> =
2615 basic_string<_CharT, _Traits, _Alloc>,2534 is_same<_CharT, __remove_cv_t<_CharT2> >::value &&
2616 const _CharT*,2535 (__desugars_to_v<__less_tag,
2617 __enable_if_t<__is_generic_transparent_comparator_v<_Comparator> > > =2536 _Comparator,
2618 true;2537 basic_string<_CharT, _Traits, _Alloc>,
2538 basic_string<_CharT, _Traits, _Alloc> > ||
2539 __desugars_to_v<__greater_tag,
2540 _Comparator,
2541 basic_string<_CharT, _Traits, _Alloc>,
2542 basic_string<_CharT, _Traits, _Alloc> >);
2543
2544template <class _Comparator, class _CharT2, class _CharT, class _Traits, class _Alloc>
2545inline const bool __is_transparently_comparable_v<_Comparator, _CharT2*, basic_string<_CharT, _Traits, _Alloc> > =
2546 __is_transparently_comparable_v<_Comparator, basic_string<_CharT, _Traits, _Alloc>, _CharT2*>;
26192547
2620template <class _Comparator, class _CharT, class _Traits, class _Alloc, size_t _Np>2548template <class _Comparator, class _CharT, class _Traits, class _Alloc, size_t _Np>
2621inline const bool __is_transparently_comparable_v<_Comparator,2549inline const bool __is_transparently_comparable_v<_Comparator, basic_string<_CharT, _Traits, _Alloc>, _CharT[_Np]> =
2622 basic_string<_CharT, _Traits, _Alloc>,2550 __is_transparently_comparable_v<_Comparator, basic_string<_CharT, _Traits, _Alloc>, const _CharT*>;
2623 _CharT[_Np],2551
2624 __enable_if_t<__is_generic_transparent_comparator_v<_Comparator> > > =2552template <class _Comparator, class _CharT, class _Traits, class _Alloc, size_t _Np>
2625 true;2553inline const bool __is_transparently_comparable_v<_Comparator, _CharT[_Np], basic_string<_CharT, _Traits, _Alloc> > =
2554 __is_transparently_comparable_v<_Comparator, basic_string<_CharT, _Traits, _Alloc>, const _CharT*>;
26262555
2627# if _LIBCPP_STD_VER >= 172556# if _LIBCPP_STD_VER >= 17
2628template <class _InputIterator,2557template <class _InputIterator,
...@@ -2728,19 +2657,18 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__...@@ -2728,19 +2657,18 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
2728 size_type __n_del,2657 size_type __n_del,
2729 size_type __n_add,2658 size_type __n_add,
2730 const value_type* __p_new_stuff) {2659 const value_type* __p_new_stuff) {
2731 __long __buffer = __allocate_long_buffer(__alloc_, __get_amortized_growth_capacity(__old_cap + __delta_cap));2660 __long __buffer = __allocate_long_buffer(__alloc_, 0, __get_amortized_growth_capacity(__old_cap + __delta_cap));
2732 pointer __old_p = __get_pointer();2661 value_type* __old_p = __data();
2733 __annotate_delete();2662 __annotate_delete();
2734 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));2663 auto __guard = std::__make_scope_guard(__annotate_new_size(*this));
2735 if (__n_copy != 0)2664 if (__n_copy != 0)
2736 traits_type::copy(std::__to_address(__buffer.__data_), std::__to_address(__old_p), __n_copy);2665 traits_type::copy(std::__to_address(__buffer.__data_), __old_p, __n_copy);
2737 if (__n_add != 0)2666 if (__n_add != 0)
2738 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy, __p_new_stuff, __n_add);2667 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy, __p_new_stuff, __n_add);
2739 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;2668 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
2740 if (__sec_cp_sz != 0)2669 if (__sec_cp_sz != 0)
2741 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy + __n_add,2670 traits_type::copy(
2742 std::__to_address(__old_p) + __n_copy + __n_del,2671 std::__to_address(__buffer.__data_) + __n_copy + __n_add, __old_p + __n_copy + __n_del, __sec_cp_sz);
2743 __sec_cp_sz);
2744 __buffer.__size_ = __n_copy + __n_add + __sec_cp_sz;2672 __buffer.__size_ = __n_copy + __n_add + __sec_cp_sz;
2745 traits_type::assign(__buffer.__data_[__buffer.__size_], value_type());2673 traits_type::assign(__buffer.__data_[__buffer.__size_], value_type());
2746 __reset_internal_buffer(__buffer);2674 __reset_internal_buffer(__buffer);
...@@ -2761,16 +2689,14 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait...@@ -2761,16 +2689,14 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait
2761 size_type __n_copy,2689 size_type __n_copy,
2762 size_type __n_del,2690 size_type __n_del,
2763 size_type __n_add) {2691 size_type __n_add) {
2764 __long __buffer = __allocate_long_buffer(__alloc_, __get_amortized_growth_capacity(__old_cap + __delta_cap));2692 __long __buffer = __allocate_long_buffer(__alloc_, 0, __get_amortized_growth_capacity(__old_cap + __delta_cap));
2765 pointer __old_p = __get_pointer();2693 value_type* __old_p = __data();
2766 if (__n_copy != 0)2694 if (__n_copy != 0)
2767 traits_type::copy(std::__to_address(__buffer.__data_), std::__to_address(__old_p), __n_copy);2695 traits_type::copy(std::__to_address(__buffer.__data_), __old_p, __n_copy);
2768 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;2696 size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
2769 if (__sec_cp_sz != 0)2697 if (__sec_cp_sz != 0)
2770 traits_type::copy(std::__to_address(__buffer.__data_) + __n_copy + __n_add,2698 traits_type::copy(
2771 std::__to_address(__old_p) + __n_copy + __n_del,2699 std::__to_address(__buffer.__data_) + __n_copy + __n_add, __old_p + __n_copy + __n_del, __sec_cp_sz);
2772 __sec_cp_sz);
2773
2774 // This is -1 to make sure the caller sets the size properly, since old versions of this function didn't set the size2700 // This is -1 to make sure the caller sets the size properly, since old versions of this function didn't set the size
2775 // at all.2701 // at all.
2776 __buffer.__size_ = -1;2702 __buffer.__size_ = -1;
...@@ -2831,7 +2757,7 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_external(const value_type* _...@@ -2831,7 +2757,7 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_external(const value_type* _
2831 if (__cap >= __n) {2757 if (__cap >= __n) {
2832 if (__n > __size)2758 if (__n > __size)
2833 __annotate_increase(__n - __size);2759 __annotate_increase(__n - __size);
2834 value_type* __p = std::__to_address(__get_pointer());2760 value_type* __p = __data();
2835 traits_type::move(__p, __s, __n);2761 traits_type::move(__p, __s, __n);
2836 return __null_terminate_at(__p, __n);2762 return __null_terminate_at(__p, __n);
2837 } else {2763 } else {
...@@ -2847,6 +2773,13 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_ty...@@ -2847,6 +2773,13 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_ty
2847 return (__builtin_constant_p(__n) && __fits_in_sso(__n)) ? __assign_short(__s, __n) : __assign_external(__s, __n);2773 return (__builtin_constant_p(__n) && __fits_in_sso(__n)) ? __assign_short(__s, __n) : __assign_external(__s, __n);
2848}2774}
28492775
2776template <class _CharT, class _Traits, class _Allocator>
2777_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
2778basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __pos, size_type __n) {
2779 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::assign received nullptr");
2780 return assign(__self_view(__s).substr(__pos, __n));
2781}
2782
2850template <class _CharT, class _Traits, class _Allocator>2783template <class _CharT, class _Traits, class _Allocator>
2851_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&2784_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
2852basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c) {2785basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c) {
...@@ -2857,7 +2790,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)...@@ -2857,7 +2790,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)
2857 __annotate_increase(__n);2790 __annotate_increase(__n);
2858 } else if (__n > __old_size)2791 } else if (__n > __old_size)
2859 __annotate_increase(__n - __old_size);2792 __annotate_increase(__n - __old_size);
2860 value_type* __p = std::__to_address(__get_pointer());2793 value_type* __p = __data();
2861 traits_type::assign(__p, __n, __c);2794 traits_type::assign(__p, __n, __c);
2862 return __null_terminate_at(__p, __n);2795 return __null_terminate_at(__p, __n);
2863}2796}
...@@ -2884,7 +2817,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c) {...@@ -2884,7 +2817,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c) {
2884}2817}
28852818
2886template <class _CharT, class _Traits, class _Allocator>2819template <class _CharT, class _Traits, class _Allocator>
2887_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS basic_string<_CharT, _Traits, _Allocator>&2820_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
2888basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str) {2821basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str) {
2889 if (this == std::addressof(__str))2822 if (this == std::addressof(__str))
2890 return *this;2823 return *this;
...@@ -2916,7 +2849,7 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat...@@ -2916,7 +2849,7 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat
2916}2849}
29172850
2918template <class _CharT, class _Traits, class _Allocator>2851template <class _CharT, class _Traits, class _Allocator>
2919inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void2852inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
2920basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)2853basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
2921# if _LIBCPP_STD_VER >= 172854# if _LIBCPP_STD_VER >= 17
2922 noexcept2855 noexcept
...@@ -3042,7 +2975,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_ty...@@ -3042,7 +2975,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_ty
3042 return *this;2975 return *this;
30432976
3044 __annotate_increase(__n);2977 __annotate_increase(__n);
3045 value_type* __p = std::__to_address(__get_pointer());2978 value_type* __p = __data();
3046 traits_type::copy(__p + __sz, __s, __n);2979 traits_type::copy(__p + __sz, __s, __n);
3047 __sz += __n;2980 __sz += __n;
3048 __set_size(__sz);2981 __set_size(__sz);
...@@ -3061,7 +2994,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c)...@@ -3061,7 +2994,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c)
3061 if (__cap - __sz < __n)2994 if (__cap - __sz < __n)
3062 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);2995 __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
3063 __annotate_increase(__n);2996 __annotate_increase(__n);
3064 pointer __p = __get_pointer();2997 value_type* __p = __data();
3065 traits_type::assign(std::__to_address(__p) + __sz, __n, __c);2998 traits_type::assign(std::__to_address(__p) + __sz, __n, __c);
3066 __sz += __n;2999 __sz += __n;
3067 __set_size(__sz);3000 __set_size(__sz);
...@@ -3114,6 +3047,13 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s) {...@@ -3114,6 +3047,13 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s) {
3114 return append(__s, traits_type::length(__s));3047 return append(__s, traits_type::length(__s));
3115}3048}
31163049
3050template <class _CharT, class _Traits, class _Allocator>
3051_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
3052basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_type __pos, size_type __n) {
3053 _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::append received nullptr");
3054 return append(__self_view(__s).substr(__pos, __n));
3055}
3056
3117// insert3057// insert
31183058
3119template <class _CharT, class _Traits, class _Allocator>3059template <class _CharT, class _Traits, class _Allocator>
...@@ -3134,7 +3074,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_t...@@ -3134,7 +3074,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_t
3134 return *this;3074 return *this;
31353075
3136 __annotate_increase(__n);3076 __annotate_increase(__n);
3137 value_type* __p = std::__to_address(__get_pointer());3077 value_type* __p = __data();
3138 size_type __n_move = __sz - __pos;3078 size_type __n_move = __sz - __pos;
3139 if (__n_move != 0) {3079 if (__n_move != 0) {
3140 if (std::__is_pointer_in_range(__p + __pos, __p + __sz, __s))3080 if (std::__is_pointer_in_range(__p + __pos, __p + __sz, __s))
...@@ -3162,7 +3102,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n...@@ -3162,7 +3102,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n
3162 value_type* __p;3102 value_type* __p;
3163 if (__cap - __sz >= __n) {3103 if (__cap - __sz >= __n) {
3164 __annotate_increase(__n);3104 __annotate_increase(__n);
3165 __p = std::__to_address(__get_pointer());3105 __p = __data();
3166 size_type __n_move = __sz - __pos;3106 size_type __n_move = __sz - __pos;
3167 if (__n_move != 0)3107 if (__n_move != 0)
3168 traits_type::move(__p + __pos + __n, __p + __pos, __n_move);3108 traits_type::move(__p + __pos + __n, __p + __pos, __n_move);
...@@ -3223,7 +3163,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, value_ty...@@ -3223,7 +3163,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, value_ty
3223 __p = std::__to_address(__get_long_pointer());3163 __p = std::__to_address(__get_long_pointer());
3224 } else {3164 } else {
3225 __annotate_increase(1);3165 __annotate_increase(1);
3226 __p = std::__to_address(__get_pointer());3166 __p = __data();
3227 size_type __n_move = __sz - __ip;3167 size_type __n_move = __sz - __ip;
3228 if (__n_move != 0)3168 if (__n_move != 0)
3229 traits_type::move(__p + __ip + 1, __p + __ip, __n_move);3169 traits_type::move(__p + __ip + 1, __p + __ip, __n_move);
...@@ -3252,7 +3192,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(...@@ -3252,7 +3192,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(
3252 return *this;3192 return *this;
3253 }3193 }
32543194
3255 value_type* __p = std::__to_address(__get_pointer());3195 value_type* __p = __data();
3256 if (__n1 != __n2) {3196 if (__n1 != __n2) {
3257 if (__n2 > __n1)3197 if (__n2 > __n1)
3258 __annotate_increase(__n2 - __n1);3198 __annotate_increase(__n2 - __n1);
...@@ -3291,7 +3231,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __...@@ -3291,7 +3231,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
3291 size_type __cap = capacity();3231 size_type __cap = capacity();
3292 value_type* __p;3232 value_type* __p;
3293 if (__cap - __sz + __n1 >= __n2) {3233 if (__cap - __sz + __n1 >= __n2) {
3294 __p = std::__to_address(__get_pointer());3234 __p = __data();
3295 if (__n1 != __n2) {3235 if (__n1 != __n2) {
3296 if (__n2 > __n1)3236 if (__n2 > __n1)
3297 __annotate_increase(__n2 - __n1);3237 __annotate_increase(__n2 - __n1);
...@@ -3335,7 +3275,7 @@ basic_string<_CharT, _Traits, _Allocator>::__erase_external_with_move(size_type...@@ -3335,7 +3275,7 @@ basic_string<_CharT, _Traits, _Allocator>::__erase_external_with_move(size_type
3335 return;3275 return;
33363276
3337 size_type __sz = size();3277 size_type __sz = size();
3338 value_type* __p = std::__to_address(__get_pointer());3278 value_type* __p = __data();
3339 __n = std::min(__n, __sz - __pos);3279 __n = std::min(__n, __sz - __pos);
3340 size_type __n_move = __sz - __pos - __n;3280 size_type __n_move = __sz - __pos - __n;
3341 if (__n_move != 0)3281 if (__n_move != 0)
...@@ -3419,8 +3359,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::re...@@ -3419,8 +3359,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::re
3419 return;3359 return;
34203360
3421 __annotation_guard __g(*this);3361 __annotation_guard __g(*this);
3422 __long __buffer = __allocate_long_buffer(__alloc_, __requested_capacity);3362 __long __buffer = __allocate_long_buffer(__alloc_, size(), __requested_capacity);
3423 __buffer.__size_ = size();
3424 traits_type::copy(std::__to_address(__buffer.__data_), data(), __buffer.__size_ + 1);3363 traits_type::copy(std::__to_address(__buffer.__data_), data(), __buffer.__size_ + 1);
3425 __reset_internal_buffer(__buffer);3364 __reset_internal_buffer(__buffer);
3426}3365}
...@@ -3717,7 +3656,7 @@ __concatenate_strings(const _Allocator& __alloc,...@@ -3717,7 +3656,7 @@ __concatenate_strings(const _Allocator& __alloc,
3717 _String __r(__uninitialized_size_tag(),3656 _String __r(__uninitialized_size_tag(),
3718 __str1.size() + __str2.size(),3657 __str1.size() + __str2.size(),
3719 _String::__alloc_traits::select_on_container_copy_construction(__alloc));3658 _String::__alloc_traits::select_on_container_copy_construction(__alloc));
3720 auto __ptr = std::__to_address(__r.__get_pointer());3659 auto __ptr = __r.__data();
3721 _Traits::copy(__ptr, __str1.data(), __str1.size());3660 _Traits::copy(__ptr, __str1.data(), __str1.size());
3722 _Traits::copy(__ptr + __str1.size(), __str2.data(), __str2.size());3661 _Traits::copy(__ptr + __str1.size(), __str2.data(), __str2.size());
3723 _Traits::assign(__ptr[__str1.size() + __str2.size()], _CharT());3662 _Traits::assign(__ptr[__str1.size() + __str2.size()], _CharT());
...@@ -4019,11 +3958,12 @@ inline constexpr bool __format::__enable_insertable<std::basic_string<wchar_t>>...@@ -4019,11 +3958,12 @@ inline constexpr bool __format::__enable_insertable<std::basic_string<wchar_t>>
40193958
4020# endif3959# endif
40213960
3961_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
4022_LIBCPP_END_NAMESPACE_STD3962_LIBCPP_END_NAMESPACE_STD
40233963
4024_LIBCPP_POP_MACROS3964_LIBCPP_POP_MACROS
40253965
4026# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 203966# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
4027# include <algorithm>3967# include <algorithm>
4028# include <concepts>3968# include <concepts>
4029# include <cstdlib>3969# include <cstdlib>
lib/libcxx/include/string.h+2
...@@ -64,6 +64,8 @@ size_t strlen(const char* s);...@@ -64,6 +64,8 @@ size_t strlen(const char* s);
64# include_next <string.h>64# include_next <string.h>
65# endif65# endif
6666
67# include <stddef.h>
68
67// MSVCRT, GNU libc and its derivates may already have the correct prototype in69// MSVCRT, GNU libc and its derivates may already have the correct prototype in
68// <string.h>. This macro can be defined by users if their C library provides70// <string.h>. This macro can be defined by users if their C library provides
69// the right signature.71// the right signature.
lib/libcxx/include/string_view+1-1
...@@ -971,7 +971,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -971,7 +971,7 @@ _LIBCPP_END_NAMESPACE_STD
971971
972_LIBCPP_POP_MACROS972_LIBCPP_POP_MACROS
973973
974# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20974# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
975# include <algorithm>975# include <algorithm>
976# include <concepts>976# include <concepts>
977# include <cstdlib>977# include <cstdlib>
lib/libcxx/include/strstream+2
...@@ -151,6 +151,7 @@ _LIBCPP_PUSH_MACROS...@@ -151,6 +151,7 @@ _LIBCPP_PUSH_MACROS
151# include <__undef_macros>151# include <__undef_macros>
152152
153_LIBCPP_BEGIN_NAMESPACE_STD153_LIBCPP_BEGIN_NAMESPACE_STD
154_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
154155
155class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf : public streambuf {156class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf : public streambuf {
156public:157public:
...@@ -349,6 +350,7 @@ private:...@@ -349,6 +350,7 @@ private:
349 strstreambuf __sb_; // exposition only350 strstreambuf __sb_; // exposition only
350};351};
351352
353_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
352_LIBCPP_END_NAMESPACE_STD354_LIBCPP_END_NAMESPACE_STD
353355
354_LIBCPP_POP_MACROS356_LIBCPP_POP_MACROS
lib/libcxx/include/syncstream+6-5
...@@ -147,10 +147,10 @@ namespace std {...@@ -147,10 +147,10 @@ namespace std {
147_LIBCPP_PUSH_MACROS147_LIBCPP_PUSH_MACROS
148# include <__undef_macros>148# include <__undef_macros>
149149
150_LIBCPP_BEGIN_NAMESPACE_STD
151
152# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM150# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
153151
152_LIBCPP_BEGIN_NAMESPACE_STD
153
154// [syncstream.syncbuf.overview]/1154// [syncstream.syncbuf.overview]/1
155// Class template basic_syncbuf stores character data written to it,155// Class template basic_syncbuf stores character data written to it,
156// known as the associated output, into internal buffers allocated156// known as the associated output, into internal buffers allocated
...@@ -196,7 +196,8 @@ public:...@@ -196,7 +196,8 @@ public:
196 // calling __inc_reference.196 // calling __inc_reference.
197 //197 //
198 // pre: __ptr is in __lut_198 // pre: __ptr is in __lut_
199 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI lock_guard<mutex> __get_lock([[maybe_unused]] void* __ptr) noexcept {199 _LIBCPP_NO_THREAD_SAFETY_ANALYSIS [[nodiscard]] _LIBCPP_HIDE_FROM_ABI lock_guard<mutex>
200 __get_lock([[maybe_unused]] void* __ptr) noexcept {
200 shared_lock __lock{__mutex_};201 shared_lock __lock{__mutex_};
201 return lock_guard{__get_it(__ptr)->second.__mutex};202 return lock_guard{__get_it(__ptr)->second.__mutex};
202 }203 }
...@@ -511,10 +512,10 @@ using std::osyncstream;...@@ -511,10 +512,10 @@ using std::osyncstream;
511using std::wosyncstream;512using std::wosyncstream;
512# endif513# endif
513514
514# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
515
516_LIBCPP_END_NAMESPACE_STD515_LIBCPP_END_NAMESPACE_STD
517516
517# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
518
518_LIBCPP_POP_MACROS519_LIBCPP_POP_MACROS
519520
520# endif // _LIBCPP_HAS_LOCALIZATION521# endif // _LIBCPP_HAS_LOCALIZATION
lib/libcxx/include/system_error+1-1
...@@ -164,7 +164,7 @@ template <> struct hash<std::error_condition>;...@@ -164,7 +164,7 @@ template <> struct hash<std::error_condition>;
164# pragma GCC system_header164# pragma GCC system_header
165# endif165# endif
166166
167# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20167# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
168# include <cstdint>168# include <cstdint>
169# include <cstring>169# include <cstring>
170# include <limits>170# include <limits>
lib/libcxx/include/text_encoding created+835
...@@ -0,0 +1,835 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_TEXT_ENCODING
11#define _LIBCPP_TEXT_ENCODING
12
13/* text_encoding synopsis
14namespace std {
15
16struct text_encoding;
17
18// [text.encoding.hash], hash support
19template<class T> struct hash;
20template<> struct hash<text_encoding>;
21
22struct text_encoding
23{
24 static constexpr size_t max_name_length = 63;
25
26 // [text.encoding.id], enumeration text_encoding::id
27 enum class id : int_least32_t {
28 see below
29 };
30 using enum id;
31
32 constexpr text_encoding() = default;
33 constexpr explicit text_encoding(string_view enc) noexcept;
34 constexpr text_encoding(id i) noexcept;
35
36 constexpr id mib() const noexcept;
37 constexpr const char* name() const noexcept;
38
39 // [text.encoding.aliases], class text_encoding::aliases_view
40 // struct aliases_view;
41 constexpr aliases_view aliases() const noexcept;
42
43 friend constexpr bool operator==(const text_encoding& a,
44 const text_encoding& b) noexcept;
45 friend constexpr bool operator==(const text_encoding& encoding, id i) noexcept;
46
47 static consteval text_encoding literal() noexcept;
48 static text_encoding environment();
49 template<id i> static bool environment_is();
50
51 private:
52 id mib_ = id::unknown; // exposition only
53 char name_[max_name_length + 1] = {0}; // exposition only
54 static constexpr bool comp-name(string_view a, string_view b); // exposition only
55};
56}
57
58*/
59
60#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
61# include <__cxx03/__config>
62#else
63# include <__config>
64
65# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
66# pragma GCC system_header
67# endif
68
69# if _LIBCPP_STD_VER >= 26
70
71# include <__algorithm/count.h>
72# include <__algorithm/find_if.h>
73# include <__algorithm/lower_bound.h>
74# include <__cstddef/ptrdiff_t.h>
75# include <__functional/hash.h>
76# include <__iterator/iterator_traits.h>
77# include <__ranges/enable_borrowed_range.h>
78# include <__ranges/view_interface.h>
79# include <climits>
80# include <cstdint>
81# include <string_view>
82# include <version>
83
84_LIBCPP_BEGIN_NAMESPACE_STD
85struct text_encoding;
86
87_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
88
89_LIBCPP_AVAILABILITY_TEXT_ENCODING_ENVIRONMENT _LIBCPP_EXPORTED_FROM_ABI text_encoding
90__get_locale_encoding(const char* __name);
91
92_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
93
94struct text_encoding {
95 static_assert(CHAR_BIT == 8, "libc++ only supports platforms where CHAR_BIT == 8");
96 enum class id : int_least32_t {
97 other = 1,
98 unknown = 2,
99 ASCII = 3,
100 ISOLatin1 = 4,
101 ISOLatin2 = 5,
102 ISOLatin3 = 6,
103 ISOLatin4 = 7,
104 ISOLatinCyrillic = 8,
105 ISOLatinArabic = 9,
106 ISOLatinGreek = 10,
107 ISOLatinHebrew = 11,
108 ISOLatin5 = 12,
109 ISOLatin6 = 13,
110 ISOTextComm = 14,
111 HalfWidthKatakana = 15,
112 JISEncoding = 16,
113 ShiftJIS = 17,
114 EUCPkdFmtJapanese = 18,
115 EUCFixWidJapanese = 19,
116 ISO4UnitedKingdom = 20,
117 ISO11SwedishForNames = 21,
118 ISO15Italian = 22,
119 ISO17Spanish = 23,
120 ISO21German = 24,
121 ISO60DanishNorwegian = 25,
122 ISO69French = 26,
123 ISO10646UTF1 = 27,
124 ISO646basic1983 = 28,
125 INVARIANT = 29,
126 ISO2IntlRefVersion = 30,
127 NATSSEFI = 31,
128 NATSSEFIADD = 32, // NATS-DANO (33) and NATS-DANO-ADD (34) are omitted by the standard.
129 ISO10Swedish = 35,
130 KSC56011987 = 36,
131 ISO2022KR = 37,
132 EUCKR = 38,
133 ISO2022JP = 39,
134 ISO2022JP2 = 40,
135 ISO13JISC6220jp = 41,
136 ISO14JISC6220ro = 42,
137 ISO16Portuguese = 43,
138 ISO18Greek7Old = 44,
139 ISO19LatinGreek = 45,
140 ISO25French = 46,
141 ISO27LatinGreek1 = 47,
142 ISO5427Cyrillic = 48,
143 ISO42JISC62261978 = 49,
144 ISO47BSViewdata = 50,
145 ISO49INIS = 51,
146 ISO50INIS8 = 52,
147 ISO51INISCyrillic = 53,
148 ISO54271981 = 54,
149 ISO5428Greek = 55,
150 ISO57GB1988 = 56,
151 ISO58GB231280 = 57,
152 ISO61Norwegian2 = 58,
153 ISO70VideotexSupp1 = 59,
154 ISO84Portuguese2 = 60,
155 ISO85Spanish2 = 61,
156 ISO86Hungarian = 62,
157 ISO87JISX0208 = 63,
158 ISO88Greek7 = 64,
159 ISO89ASMO449 = 65,
160 ISO90 = 66,
161 ISO91JISC62291984a = 67,
162 ISO92JISC62991984b = 68,
163 ISO93JIS62291984badd = 69,
164 ISO94JIS62291984hand = 70,
165 ISO95JIS62291984handadd = 71,
166 ISO96JISC62291984kana = 72,
167 ISO2033 = 73,
168 ISO99NAPLPS = 74,
169 ISO102T617bit = 75,
170 ISO103T618bit = 76,
171 ISO111ECMACyrillic = 77,
172 ISO121Canadian1 = 78,
173 ISO122Canadian2 = 79,
174 ISO123CSAZ24341985gr = 80,
175 ISO88596E = 81,
176 ISO88596I = 82,
177 ISO128T101G2 = 83,
178 ISO88598E = 84,
179 ISO88598I = 85,
180 ISO139CSN369103 = 86,
181 ISO141JUSIB1002 = 87,
182 ISO143IECP271 = 88,
183 ISO146Serbian = 89,
184 ISO147Macedonian = 90,
185 ISO150 = 91,
186 ISO151Cuba = 92,
187 ISO6937Add = 93,
188 ISO153GOST1976874 = 94,
189 ISO8859Supp = 95,
190 ISO10367Box = 96,
191 ISO158Lap = 97,
192 ISO159JISX02121990 = 98,
193 ISO646Danish = 99,
194 USDK = 100,
195 DKUS = 101,
196 KSC5636 = 102,
197 Unicode11UTF7 = 103,
198 ISO2022CN = 104,
199 ISO2022CNEXT = 105,
200 UTF8 = 106,
201 ISO885913 = 109,
202 ISO885914 = 110,
203 ISO885915 = 111,
204 ISO885916 = 112,
205 GBK = 113,
206 GB18030 = 114,
207 OSDEBCDICDF0415 = 115,
208 OSDEBCDICDF03IRV = 116,
209 OSDEBCDICDF041 = 117,
210 ISO115481 = 118,
211 KZ1048 = 119,
212 UCS2 = 1000,
213 UCS4 = 1001,
214 UnicodeASCII = 1002,
215 UnicodeLatin1 = 1003,
216 UnicodeJapanese = 1004,
217 UnicodeIBM1261 = 1005,
218 UnicodeIBM1268 = 1006,
219 UnicodeIBM1276 = 1007,
220 UnicodeIBM1264 = 1008,
221 UnicodeIBM1265 = 1009,
222 Unicode11 = 1010,
223 SCSU = 1011,
224 UTF7 = 1012,
225 UTF16BE = 1013,
226 UTF16LE = 1014,
227 UTF16 = 1015,
228 CESU8 = 1016,
229 UTF32 = 1017,
230 UTF32BE = 1018,
231 UTF32LE = 1019,
232 BOCU1 = 1020,
233 UTF7IMAP = 1021,
234 Windows30Latin1 = 2000,
235 Windows31Latin1 = 2001,
236 Windows31Latin2 = 2002,
237 Windows31Latin5 = 2003,
238 HPRoman8 = 2004,
239 AdobeStandardEncoding = 2005,
240 VenturaUS = 2006,
241 VenturaInternational = 2007,
242 DECMCS = 2008,
243 PC850Multilingual = 2009,
244 PC8DanishNorwegian = 2012,
245 PC862LatinHebrew = 2013,
246 PC8Turkish = 2014,
247 IBMSymbols = 2015,
248 IBMThai = 2016,
249 HPLegal = 2017,
250 HPPiFont = 2018,
251 HPMath8 = 2019,
252 HPPSMath = 2020,
253 HPDesktop = 2021,
254 VenturaMath = 2022,
255 MicrosoftPublishing = 2023,
256 Windows31J = 2024,
257 GB2312 = 2025,
258 Big5 = 2026,
259 Macintosh = 2027,
260 IBM037 = 2028,
261 IBM038 = 2029,
262 IBM273 = 2030,
263 IBM274 = 2031,
264 IBM275 = 2032,
265 IBM277 = 2033,
266 IBM278 = 2034,
267 IBM280 = 2035,
268 IBM281 = 2036,
269 IBM284 = 2037,
270 IBM285 = 2038,
271 IBM290 = 2039,
272 IBM297 = 2040,
273 IBM420 = 2041,
274 IBM423 = 2042,
275 IBM424 = 2043,
276 PC8CodePage437 = 2011,
277 IBM500 = 2044,
278 IBM851 = 2045,
279 PCp852 = 2010,
280 IBM855 = 2046,
281 IBM857 = 2047,
282 IBM860 = 2048,
283 IBM861 = 2049,
284 IBM863 = 2050,
285 IBM864 = 2051,
286 IBM865 = 2052,
287 IBM868 = 2053,
288 IBM869 = 2054,
289 IBM870 = 2055,
290 IBM871 = 2056,
291 IBM880 = 2057,
292 IBM891 = 2058,
293 IBM903 = 2059,
294 IBM904 = 2060,
295 IBM905 = 2061,
296 IBM918 = 2062,
297 IBM1026 = 2063,
298 IBMEBCDICATDE = 2064,
299 EBCDICATDEA = 2065,
300 EBCDICCAFR = 2066,
301 EBCDICDKNO = 2067,
302 EBCDICDKNOA = 2068,
303 EBCDICFISE = 2069,
304 EBCDICFISEA = 2070,
305 EBCDICFR = 2071,
306 EBCDICIT = 2072,
307 EBCDICPT = 2073,
308 EBCDICES = 2074,
309 EBCDICESA = 2075,
310 EBCDICESS = 2076,
311 EBCDICUK = 2077,
312 EBCDICUS = 2078,
313 Unknown8BiT = 2079,
314 Mnemonic = 2080,
315 Mnem = 2081,
316 VISCII = 2082,
317 VIQR = 2083,
318 KOI8R = 2084,
319 HZGB2312 = 2085,
320 IBM866 = 2086,
321 PC775Baltic = 2087,
322 KOI8U = 2088,
323 IBM00858 = 2089,
324 IBM00924 = 2090,
325 IBM01140 = 2091,
326 IBM01141 = 2092,
327 IBM01142 = 2093,
328 IBM01143 = 2094,
329 IBM01144 = 2095,
330 IBM01145 = 2096,
331 IBM01146 = 2097,
332 IBM01147 = 2098,
333 IBM01148 = 2099,
334 IBM01149 = 2100,
335 Big5HKSCS = 2101,
336 IBM1047 = 2102,
337 PTCP154 = 2103,
338 Amiga1251 = 2104,
339 KOI7switched = 2105,
340 BRF = 2106,
341 TSCII = 2107,
342 CP51932 = 2108,
343 windows874 = 2109,
344 windows1250 = 2250,
345 windows1251 = 2251,
346 windows1252 = 2252,
347 windows1253 = 2253,
348 windows1254 = 2254,
349 windows1255 = 2255,
350 windows1256 = 2256,
351 windows1257 = 2257,
352 windows1258 = 2258,
353 TIS620 = 2259,
354 CP50220 = 2260
355 };
356
357private:
358 static constexpr int __nats_dano_ = 33;
359 static constexpr int __nats_dano_add_ = 34;
360
361 // A __te_data structure stores:
362 // Index into a table of offsets in the giant aliases string
363 // The MIB of that text encoding
364 // Number of aliases the current MIB holds
365 // We only need 6 bytes of information to store this information.
366
367 // The data is structured in three different locations:
368 // The mib table (array of __te_data)
369 // Aliases string
370 // Table of offsets into the aliases string
371
372 // All of the alias strings were transformed from an array of char* into one giant string split by '\0'.
373 // This allows us to reduce runtime memory footprint by not only removing the need to store ~884 pointers, it also
374 // significantly reduces the disk space taken by removing the need for relocation data for those pointers.
375 // We also know ahead of time that the total number of characters of all of these aliases combined can fit into 2
376 // bytes, so we can also save even more memory by using 2 byte offsets rather than a full pointer into the aliases
377 // string.
378
379 struct __te_data {
380 unsigned short __first_alias_index_;
381 unsigned short __mib_rep_;
382 unsigned char __num_aliases_;
383
384 friend constexpr bool operator<(const __te_data& __enc, id __i) noexcept {
385 return __enc.__mib_rep_ < static_cast<unsigned short>(__i);
386 }
387 };
388
389 static constexpr bool __comp_name(string_view __a, string_view __b) noexcept {
390 if (__a.empty() || __b.empty()) {
391 return false;
392 }
393
394 // Map any non-alphanumeric character to 255, skip prefix 0s, else get tolower(__n).
395 auto __map_char = [](char __n, bool& __in_number) -> unsigned char {
396 if (__n == '0') {
397 return __in_number ? '0' : 255;
398 }
399 __in_number = __n >= '1' && __n <= '9';
400
401 if ((__n >= '1' && __n <= '9') || (__n >= 'a' && __n <= 'z')) {
402 return __n;
403 }
404 if (__n >= 'A' && __n <= 'Z') {
405 return __n + ('a' - 'A'); // tolower
406 }
407
408 return 255;
409 };
410
411 auto __a_ptr = __a.begin(), __b_ptr = __b.begin();
412 bool __a_in_number = false, __b_in_number = false;
413
414 unsigned char __a_val = 255, __b_val = 255;
415 for (;; __a_ptr++, __b_ptr++) {
416 while (__a_ptr != __a.end() && (__a_val = __map_char(*__a_ptr, __a_in_number)) == 255)
417 __a_ptr++;
418 while (__b_ptr != __b.end() && (__b_val = __map_char(*__b_ptr, __b_in_number)) == 255)
419 __b_ptr++;
420
421 if (__a_ptr == __a.end())
422 return __b_ptr == __b.end();
423 if (__b_ptr == __b.end())
424 return false;
425 if (__a_val != __b_val)
426 return false;
427 }
428 return true;
429 }
430
431 static constexpr unsigned short __find_data_idx(string_view __a) noexcept {
432 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__a.size() <= max_name_length, "input string_view must have size <= 63");
433 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(!__a.contains('\0'), "input string_view must not contain '\\0'");
434
435 auto __pred = [&__a](const __te_data& __entry) -> bool {
436 // Search aliases of text encoding for string
437 aliases_view __aliases(__entry);
438 return std::find_if(__aliases.begin(), __aliases.end(), [&__a](auto __alias) {
439 return __comp_name(__a, __alias);
440 }) != __aliases.end();
441 };
442
443 const __te_data* __found = std::find_if(__entries + 2, std::end(__entries), __pred);
444 if (__found == std::end(__entries)) {
445 return __other_idx_; // other
446 }
447
448 return __found - __entries;
449 }
450
451 static constexpr unsigned short __find_data_idx_by_id(id __i) noexcept {
452 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__i >= id::other, "invalid text_encoding::id passed");
453 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__i <= id::CP50220, "invalid text_encoding::id passed");
454 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(int_least32_t(__i) != __nats_dano_, "Mib for NATS-DANO used");
455 _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(int_least32_t(__i) != __nats_dano_add_, "Mib for NATS-DANO-ADD used");
456 auto __found = std::lower_bound(std::begin(__entries), std::end(__entries), __i);
457
458 if (__found == std::end(__entries)) {
459 return __unknown_idx_; // unknown
460 }
461
462 return __found - __entries;
463 }
464
465public:
466 using enum id;
467 static constexpr size_t max_name_length = 63;
468
469 // [text.encoding.aliases], class text_encoding::aliases_view
470 struct aliases_view : ranges::view_interface<aliases_view> {
471 struct __iterator {
472 using iterator_concept = random_access_iterator_tag;
473 using iterator_category = random_access_iterator_tag;
474 using value_type = const char*;
475 using reference = const char*;
476 using difference_type = int;
477
478 constexpr __iterator() noexcept = default;
479
480 [[nodiscard]] constexpr reference operator*() const noexcept {
481 return __get_alias_from_offset_table(__current_idx_);
482 }
483
484 [[nodiscard]] constexpr reference operator[](difference_type __n) const noexcept {
485 auto __it = *this;
486 return *(__it + __n);
487 }
488
489 [[nodiscard]] friend constexpr __iterator operator+(__iterator __it, difference_type __n) noexcept {
490 __it += __n;
491 return __it;
492 }
493
494 [[nodiscard]] friend constexpr __iterator operator+(difference_type __n, __iterator __it) noexcept {
495 __it += __n;
496 return __it;
497 }
498
499 [[nodiscard]] friend constexpr __iterator operator-(__iterator __it, difference_type __n) noexcept {
500 __it -= __n;
501 return __it;
502 }
503
504 [[nodiscard]] constexpr difference_type operator-(const __iterator& __other) const noexcept {
505 return __current_idx_ - __other.__current_idx_;
506 }
507
508 constexpr __iterator& operator++() noexcept {
509 __current_idx_++;
510 return *this;
511 }
512
513 constexpr __iterator operator++(int) noexcept {
514 auto __old = *this;
515 __current_idx_++;
516 return __old;
517 }
518
519 constexpr __iterator& operator--() noexcept {
520 __current_idx_--;
521 return *this;
522 }
523
524 constexpr __iterator operator--(int) noexcept {
525 auto __old = *this;
526 __current_idx_--;
527 return __old;
528 }
529
530 constexpr __iterator& operator+=(difference_type __n) noexcept {
531 __current_idx_ += __n;
532 return *this;
533 }
534
535 constexpr __iterator& operator-=(difference_type __n) noexcept { return (*this += -__n); }
536
537 friend constexpr auto operator<=>(const __iterator& __it, const __iterator& __it2) noexcept = default;
538
539 private:
540 friend struct aliases_view;
541
542 constexpr __iterator(unsigned short __enc_d) noexcept : __current_idx_(__enc_d) {}
543
544 unsigned short __current_idx_;
545 }; // __iterator
546
547 [[nodiscard]] constexpr __iterator begin() const noexcept { return __iterator(__first_idx_); }
548
549 [[nodiscard]] constexpr __iterator end() const noexcept { return __iterator(__last_idx_); }
550
551 private:
552 friend struct text_encoding;
553
554 constexpr aliases_view(const __te_data& __d)
555 : __first_idx_(__d.__first_alias_index_), __last_idx_(__d.__first_alias_index_ + __d.__num_aliases_) {}
556
557 unsigned short __first_idx_;
558 unsigned short __last_idx_;
559 }; // aliases_view
560
561 constexpr text_encoding() = default;
562
563 constexpr explicit text_encoding(string_view __enc) noexcept : __encoding_idx_(__find_data_idx(__enc)) {
564 __enc.copy(__name_, max_name_length, 0);
565 }
566
567 constexpr text_encoding(id __i) noexcept : __encoding_idx_(__find_data_idx_by_id(__i)) {
568 const char* __alias = __get_alias_from_offset_table(__get().__first_alias_index_);
569 if (__alias[0] != '\0') {
570 string_view(__alias).copy(__name_, max_name_length);
571 }
572 }
573
574 [[nodiscard]] constexpr id mib() const noexcept { return id(__get().__mib_rep_); }
575
576 [[nodiscard]] constexpr const char* name() const noexcept { return __name_; }
577
578 [[nodiscard]] constexpr aliases_view aliases() const noexcept { return aliases_view(__get()); }
579
580 friend constexpr bool operator==(const text_encoding& __a, const text_encoding& __b) noexcept {
581 return __a.mib() == id::other && __b.mib() == id::other
582 ? __comp_name(__a.__name_, __b.__name_)
583 : __a.mib() == __b.mib();
584 }
585
586 friend constexpr bool operator==(const text_encoding& __encoding, id __i) noexcept { return __encoding.mib() == __i; }
587
588 [[nodiscard]] static consteval text_encoding literal() noexcept {
589 // TODO: Remove this branch once we have __GNUC_EXECUTION_CHARSET_NAME or __clang_literal_encoding__ unconditionally
590# ifdef __GNUC_EXECUTION_CHARSET_NAME
591 return text_encoding(__GNUC_EXECUTION_CHARSET_NAME);
592# elif defined(__clang_literal_encoding__)
593 return text_encoding(__clang_literal_encoding__);
594# else
595 return text_encoding();
596# endif
597 }
598
599# if _LIBCPP_HAS_LOCALIZATION
600 [[nodiscard]] _LIBCPP_AVAILABILITY_TEXT_ENCODING_ENVIRONMENT static text_encoding environment() {
601# if defined(_LIBCPP_WIN32API)
602 return __get_locale_encoding(nullptr);
603# else
604 return __get_locale_encoding("");
605# endif
606 }
607
608 template <id _Id>
609 [[nodiscard]] _LIBCPP_AVAILABILITY_TEXT_ENCODING_ENVIRONMENT static bool environment_is() {
610 // TODO: It may be worthwhile to implement an optimization for popular encodings, e.g. UTF-8,
611 // to allow checking the environment text encoding without needing to use the data tables.
612
613# if defined(__ANDROID__)
614 return _Id == std::text_encoding::id::UTF8;
615# else
616 return environment() == _Id;
617# endif
618 }
619# else
620 static text_encoding environment() = delete;
621
622 template <id>
623 static bool environment_is() = delete;
624# endif
625
626private:
627 constexpr const __te_data& __get() const { return __entries[__encoding_idx_]; }
628
629 static constexpr char const* __get_alias_from_offset_table(unsigned short __idx) {
630 return __aliases_string + __alias_offsets.__table[__idx];
631 }
632
633 static constexpr auto __other_idx_ = 0u;
634 static constexpr auto __unknown_idx_ = 1u;
635
636 char __name_[max_name_length + 1]{};
637 unsigned short __encoding_idx_{1u};
638
639 static constexpr __te_data __entries[] = {
640 {0, 1, 0}, {1, 2, 0}, {2, 3, 11}, {13, 4, 9}, {22, 5, 7}, {29, 6, 7}, {36, 7, 7},
641 {43, 8, 6}, {49, 9, 8}, {57, 10, 9}, {66, 11, 6}, {72, 12, 7}, {79, 13, 6}, {85, 14, 3},
642 {88, 15, 3}, {91, 16, 2}, {93, 17, 3}, {96, 18, 3}, {99, 19, 2}, {101, 20, 6}, {107, 21, 5},
643 {112, 22, 4}, {116, 23, 4}, {120, 24, 5}, {125, 25, 6}, {131, 26, 5}, {136, 27, 2}, {138, 28, 3},
644 {141, 29, 2}, {143, 30, 4}, {147, 31, 3}, {150, 32, 3}, {153, 35, 7}, {160, 36, 6}, {166, 37, 2},
645 {168, 38, 2}, {170, 39, 2}, {172, 40, 2}, {174, 41, 6}, {180, 42, 5}, {185, 43, 4}, {189, 44, 3},
646 {192, 45, 3}, {195, 46, 4}, {199, 47, 3}, {202, 48, 3}, {205, 49, 3}, {208, 50, 3}, {211, 51, 3},
647 {214, 52, 3}, {217, 53, 3}, {220, 54, 4}, {224, 55, 3}, {227, 56, 5}, {232, 57, 4}, {236, 58, 5},
648 {241, 59, 3}, {244, 60, 4}, {248, 61, 4}, {252, 62, 5}, {257, 63, 5}, {262, 64, 3}, {265, 65, 5},
649 {270, 66, 2}, {272, 67, 4}, {276, 68, 5}, {281, 69, 4}, {285, 70, 4}, {289, 71, 4}, {293, 72, 3},
650 {296, 73, 4}, {300, 74, 5}, {305, 75, 3}, {308, 76, 4}, {312, 77, 4}, {316, 78, 7}, {323, 79, 6},
651 {329, 80, 3}, {332, 81, 3}, {335, 82, 3}, {338, 83, 3}, {341, 84, 3}, {344, 85, 3}, {347, 86, 3},
652 {350, 87, 6}, {356, 88, 3}, {359, 89, 4}, {363, 90, 4}, {367, 91, 4}, {371, 92, 5}, {376, 93, 3},
653 {379, 94, 4}, {383, 95, 4}, {387, 96, 3}, {390, 97, 4}, {394, 98, 4}, {398, 99, 5}, {403, 100, 2},
654 {405, 101, 2}, {407, 102, 3}, {410, 103, 2}, {412, 104, 2}, {414, 105, 2}, {416, 106, 2}, {418, 109, 2},
655 {420, 110, 8}, {428, 111, 4}, {432, 112, 7}, {439, 113, 5}, {444, 114, 2}, {446, 115, 2}, {448, 116, 2},
656 {450, 117, 2}, {452, 118, 4}, {456, 119, 4}, {460, 1000, 2}, {462, 1001, 2}, {464, 1002, 2}, {466, 1003, 3},
657 {469, 1004, 2}, {471, 1005, 2}, {473, 1006, 2}, {475, 1007, 2}, {477, 1008, 2}, {479, 1009, 2}, {481, 1010, 2},
658 {483, 1011, 2}, {485, 1012, 2}, {487, 1013, 2}, {489, 1014, 2}, {491, 1015, 2}, {493, 1016, 3}, {496, 1017, 2},
659 {498, 1018, 2}, {500, 1019, 2}, {502, 1020, 3}, {505, 1021, 2}, {507, 2000, 2}, {509, 2001, 2}, {511, 2002, 2},
660 {513, 2003, 2}, {515, 2004, 4}, {519, 2005, 2}, {521, 2006, 2}, {523, 2007, 2}, {525, 2008, 3}, {528, 2009, 4},
661 {532, 2010, 4}, {536, 2011, 4}, {540, 2012, 2}, {542, 2013, 4}, {546, 2014, 2}, {548, 2015, 2}, {550, 2016, 2},
662 {552, 2017, 2}, {554, 2018, 2}, {556, 2019, 2}, {558, 2020, 2}, {560, 2021, 2}, {562, 2022, 2}, {564, 2023, 2},
663 {566, 2024, 2}, {568, 2025, 2}, {570, 2026, 2}, {572, 2027, 3}, {575, 2028, 7}, {582, 2029, 4}, {586, 2030, 3},
664 {589, 2031, 4}, {593, 2032, 4}, {597, 2033, 4}, {601, 2034, 5}, {606, 2035, 4}, {610, 2036, 4}, {614, 2037, 4},
665 {618, 2038, 4}, {622, 2039, 4}, {626, 2040, 4}, {630, 2041, 4}, {634, 2042, 4}, {638, 2043, 4}, {642, 2044, 5},
666 {647, 2045, 4}, {651, 2046, 4}, {655, 2047, 4}, {659, 2048, 4}, {663, 2049, 5}, {668, 2050, 4}, {672, 2051, 3},
667 {675, 2052, 4}, {679, 2053, 4}, {683, 2054, 5}, {688, 2055, 5}, {693, 2056, 4}, {697, 2057, 4}, {701, 2058, 3},
668 {704, 2059, 3}, {707, 2060, 4}, {711, 2061, 4}, {715, 2062, 4}, {719, 2063, 3}, {722, 2064, 2}, {724, 2065, 2},
669 {726, 2066, 2}, {728, 2067, 2}, {730, 2068, 2}, {732, 2069, 2}, {734, 2070, 2}, {736, 2071, 2}, {738, 2072, 2},
670 {740, 2073, 2}, {742, 2074, 2}, {744, 2075, 2}, {746, 2076, 2}, {748, 2077, 2}, {750, 2078, 2}, {752, 2079, 2},
671 {754, 2080, 2}, {756, 2081, 2}, {758, 2082, 2}, {760, 2083, 2}, {762, 2084, 2}, {764, 2085, 1}, {765, 2086, 4},
672 {769, 2087, 3}, {772, 2088, 2}, {774, 2089, 5}, {779, 2090, 5}, {784, 2091, 5}, {789, 2092, 5}, {794, 2093, 6},
673 {800, 2094, 6}, {806, 2095, 5}, {811, 2096, 5}, {816, 2097, 5}, {821, 2098, 5}, {826, 2099, 5}, {831, 2100, 5},
674 {836, 2101, 2}, {838, 2102, 3}, {841, 2103, 5}, {846, 2104, 5}, {851, 2105, 2}, {853, 2106, 2}, {855, 2107, 2},
675 {857, 2108, 2}, {859, 2109, 2}, {861, 2250, 2}, {863, 2251, 2}, {865, 2252, 2}, {867, 2253, 2}, {869, 2254, 2},
676 {871, 2255, 2}, {873, 2256, 2}, {875, 2257, 2}, {877, 2258, 2}, {879, 2259, 3}, {882, 2260, 2}};
677
678 static constexpr char __aliases_string[] =
679 "US-ASCII\0iso-ir-6\0ANSI_X3.4-1968\0ANSI_X3.4-1986\0ISO_646.irv:1991\0ISO646-"
680 "US\0us\0IBM367\0cp367\0csASCII\0ASCII\0ISO_8859-1:1987\0iso-ir-100\0ISO_8859-1\0ISO-8859-"
681 "1\0latin1\0l1\0IBM819\0CP819\0csISOLatin1\0ISO_8859-2:1987\0iso-ir-101\0ISO_8859-2\0ISO-8859-"
682 "2\0latin2\0l2\0csISOLatin2\0ISO_8859-3:1988\0iso-ir-109\0ISO_8859-3\0ISO-8859-3\0latin3\0l3\0csISOLatin3\0ISO_"
683 "8859-4:1988\0iso-ir-110\0ISO_8859-4\0ISO-8859-4\0latin4\0l4\0csISOLatin4\0ISO_8859-5:1988\0iso-ir-144\0ISO_8859-"
684 "5\0ISO-8859-5\0cyrillic\0csISOLatinCyrillic\0ISO_8859-6:1987\0iso-ir-127\0ISO_8859-6\0ISO-8859-6\0ECMA-"
685 "114\0ASMO-708\0arabic\0csISOLatinArabic\0ISO_8859-7:1987\0iso-ir-126\0ISO_8859-7\0ISO-8859-7\0ELOT_928\0ECMA-"
686 "118\0greek\0greek8\0csISOLatinGreek\0ISO_8859-8:1988\0iso-ir-138\0ISO_8859-8\0ISO-8859-"
687 "8\0hebrew\0csISOLatinHebrew\0ISO_8859-9:1989\0iso-ir-148\0ISO_8859-9\0ISO-8859-9\0latin5\0l5\0csISOLatin5\0ISO-"
688 "8859-10\0iso-ir-157\0l6\0ISO_8859-10:1992\0csISOLatin6\0latin6\0ISO_6937-2-add\0iso-ir-142\0csISOTextComm\0JIS_"
689 "X0201\0X0201\0csHalfWidthKatakana\0JIS_Encoding\0csJISEncoding\0Shift_JIS\0MS_Kanji\0csShiftJIS\0Extended_UNIX_"
690 "Code_Packed_Format_for_Japanese\0csEUCPkdFmtJapanese\0EUC-JP\0Extended_UNIX_Code_Fixed_Width_for_"
691 "Japanese\0csEUCFixWidJapanese\0BS_4730\0iso-ir-4\0ISO646-GB\0gb\0uk\0csISO4UnitedKingdom\0SEN_850200_C\0iso-ir-"
692 "11\0ISO646-SE2\0se2\0csISO11SwedishForNames\0IT\0iso-ir-15\0ISO646-IT\0csISO15Italian\0ES\0iso-ir-17\0ISO646-"
693 "ES\0csISO17Spanish\0DIN_66003\0iso-ir-21\0de\0ISO646-DE\0csISO21German\0NS_4551-1\0iso-ir-60\0ISO646-"
694 "NO\0no\0csISO60DanishNorwegian\0csISO60Norwegian1\0NF_Z_62-010\0iso-ir-69\0ISO646-FR\0fr\0csISO69French\0ISO-"
695 "10646-UTF-1\0csISO10646UTF1\0ISO_646.basic:1983\0ref\0csISO646basic1983\0INVARIANT\0csINVARIANT\0ISO_646.irv:"
696 "1983\0iso-ir-2\0irv\0csISO2IntlRefVersion\0NATS-SEFI\0iso-ir-8-1\0csNATSSEFI\0NATS-SEFI-ADD\0iso-ir-8-"
697 "2\0csNATSSEFIADD\0SEN_850200_B\0iso-ir-10\0FI\0ISO646-FI\0ISO646-SE\0se\0csISO10Swedish\0KS_C_5601-1987\0iso-ir-"
698 "149\0KS_C_5601-1989\0KSC_5601\0korean\0csKSC56011987\0ISO-2022-KR\0csISO2022KR\0EUC-KR\0csEUCKR\0ISO-2022-"
699 "JP\0csISO2022JP\0ISO-2022-JP-2\0csISO2022JP2\0JIS_C6220-1969-jp\0JIS_C6220-1969\0iso-ir-13\0katakana\0x0201-"
700 "7\0csISO13JISC6220jp\0JIS_C6220-1969-ro\0iso-ir-14\0jp\0ISO646-JP\0csISO14JISC6220ro\0PT\0iso-ir-16\0ISO646-"
701 "PT\0csISO16Portuguese\0greek7-old\0iso-ir-18\0csISO18Greek7Old\0latin-greek\0iso-ir-19\0csISO19LatinGreek\0NF_Z_"
702 "62-010_(1973)\0iso-ir-25\0ISO646-FR1\0csISO25French\0Latin-greek-1\0iso-ir-27\0csISO27LatinGreek1\0ISO_"
703 "5427\0iso-ir-37\0csISO5427Cyrillic\0JIS_C6226-1978\0iso-ir-42\0csISO42JISC62261978\0BS_viewdata\0iso-ir-"
704 "47\0csISO47BSViewdata\0INIS\0iso-ir-49\0csISO49INIS\0INIS-8\0iso-ir-50\0csISO50INIS8\0INIS-cyrillic\0iso-ir-"
705 "51\0csISO51INISCyrillic\0ISO_5427:1981\0iso-ir-54\0ISO5427Cyrillic1981\0csISO54271981\0ISO_5428:1980\0iso-ir-"
706 "55\0csISO5428Greek\0GB_1988-80\0iso-ir-57\0cn\0ISO646-CN\0csISO57GB1988\0GB_2312-80\0iso-ir-"
707 "58\0chinese\0csISO58GB231280\0NS_4551-2\0ISO646-NO2\0iso-ir-61\0no2\0csISO61Norwegian2\0videotex-suppl\0iso-ir-"
708 "70\0csISO70VideotexSupp1\0PT2\0iso-ir-84\0ISO646-PT2\0csISO84Portuguese2\0ES2\0iso-ir-85\0ISO646-"
709 "ES2\0csISO85Spanish2\0MSZ_7795.3\0iso-ir-86\0ISO646-HU\0hu\0csISO86Hungarian\0JIS_C6226-1983\0iso-ir-"
710 "87\0x0208\0JIS_X0208-1983\0csISO87JISX0208\0greek7\0iso-ir-88\0csISO88Greek7\0ASMO_449\0ISO_9036\0arabic7\0iso-"
711 "ir-89\0csISO89ASMO449\0iso-ir-90\0csISO90\0JIS_C6229-1984-a\0iso-ir-91\0jp-ocr-a\0csISO91JISC62291984a\0JIS_"
712 "C6229-1984-b\0iso-ir-92\0ISO646-JP-OCR-B\0jp-ocr-b\0csISO92JISC62991984b\0JIS_C6229-1984-b-add\0iso-ir-93\0jp-"
713 "ocr-b-add\0csISO93JIS62291984badd\0JIS_C6229-1984-hand\0iso-ir-94\0jp-ocr-hand\0csISO94JIS62291984hand\0JIS_"
714 "C6229-1984-hand-add\0iso-ir-95\0jp-ocr-hand-add\0csISO95JIS62291984handadd\0JIS_C6229-1984-kana\0iso-ir-"
715 "96\0csISO96JISC62291984kana\0ISO_2033-1983\0iso-ir-98\0e13b\0csISO2033\0ANSI_X3.110-1983\0iso-ir-99\0CSA_T500-"
716 "1983\0NAPLPS\0csISO99NAPLPS\0T.61-7bit\0iso-ir-102\0csISO102T617bit\0T.61-8bit\0T.61\0iso-ir-"
717 "103\0csISO103T618bit\0ECMA-cyrillic\0iso-ir-111\0KOI8-E\0csISO111ECMACyrillic\0CSA_Z243.4-1985-1\0iso-ir-"
718 "121\0ISO646-CA\0csa7-1\0csa71\0ca\0csISO121Canadian1\0CSA_Z243.4-1985-2\0iso-ir-122\0ISO646-CA2\0csa7-"
719 "2\0csa72\0csISO122Canadian2\0CSA_Z243.4-1985-gr\0iso-ir-123\0csISO123CSAZ24341985gr\0ISO_8859-6-"
720 "E\0csISO88596E\0ISO-8859-6-E\0ISO_8859-6-I\0csISO88596I\0ISO-8859-6-I\0T.101-G2\0iso-ir-"
721 "128\0csISO128T101G2\0ISO_8859-8-E\0csISO88598E\0ISO-8859-8-E\0ISO_8859-8-I\0csISO88598I\0ISO-8859-8-I\0CSN_"
722 "369103\0iso-ir-139\0csISO139CSN369103\0JUS_I.B1.002\0iso-ir-141\0ISO646-YU\0js\0yu\0csISO141JUSIB1002\0IEC_P27-"
723 "1\0iso-ir-143\0csISO143IECP271\0JUS_I.B1.003-serb\0iso-ir-146\0serbian\0csISO146Serbian\0JUS_I.B1.003-"
724 "mac\0macedonian\0iso-ir-147\0csISO147Macedonian\0greek-ccitt\0iso-ir-150\0csISO150\0csISO150GreekCCITT\0NC_NC00-"
725 "10:81\0cuba\0iso-ir-151\0ISO646-CU\0csISO151Cuba\0ISO_6937-2-25\0iso-ir-152\0csISO6937Add\0GOST_19768-74\0ST_"
726 "SEV_358-88\0iso-ir-153\0csISO153GOST1976874\0ISO_8859-supp\0iso-ir-154\0latin1-2-5\0csISO8859Supp\0ISO_10367-"
727 "box\0iso-ir-155\0csISO10367Box\0latin-lap\0lap\0iso-ir-158\0csISO158Lap\0JIS_X0212-1990\0x0212\0iso-ir-"
728 "159\0csISO159JISX02121990\0DS_2089\0DS2089\0ISO646-DK\0dk\0csISO646Danish\0us-dk\0csUSDK\0dk-"
729 "us\0csDKUS\0KSC5636\0ISO646-KR\0csKSC5636\0UNICODE-1-1-UTF-7\0csUnicode11UTF7\0ISO-2022-CN\0csISO2022CN\0ISO-"
730 "2022-CN-EXT\0csISO2022CNEXT\0UTF-8\0csUTF8\0ISO-8859-13\0csISO885913\0ISO-8859-14\0iso-ir-199\0ISO_8859-14:"
731 "1998\0ISO_8859-14\0latin8\0iso-celtic\0l8\0csISO885914\0ISO-8859-15\0ISO_8859-15\0Latin-9\0csISO885915\0ISO-"
732 "8859-16\0iso-ir-226\0ISO_8859-16:2001\0ISO_8859-16\0latin10\0l10\0csISO885916\0GBK\0CP936\0MS936\0windows-"
733 "936\0csGBK\0GB18030\0csGB18030\0OSD_EBCDIC_DF04_15\0csOSDEBCDICDF0415\0OSD_EBCDIC_DF03_"
734 "IRV\0csOSDEBCDICDF03IRV\0OSD_EBCDIC_DF04_1\0csOSDEBCDICDF041\0ISO-11548-1\0ISO_11548-1\0ISO_TR_11548-"
735 "1\0csISO115481\0KZ-1048\0STRK1048-2002\0RK1048\0csKZ1048\0ISO-10646-UCS-2\0csUnicode\0ISO-10646-UCS-"
736 "4\0csUCS4\0ISO-10646-UCS-Basic\0csUnicodeASCII\0ISO-10646-Unicode-Latin1\0csUnicodeLatin1\0ISO-10646\0ISO-10646-"
737 "J-1\0csUnicodeJapanese\0ISO-Unicode-IBM-1261\0csUnicodeIBM1261\0ISO-Unicode-IBM-1268\0csUnicodeIBM1268\0ISO-"
738 "Unicode-IBM-1276\0csUnicodeIBM1276\0ISO-Unicode-IBM-1264\0csUnicodeIBM1264\0ISO-Unicode-IBM-"
739 "1265\0csUnicodeIBM1265\0UNICODE-1-1\0csUnicode11\0SCSU\0csSCSU\0UTF-7\0csUTF7\0UTF-16BE\0csUTF16BE\0UTF-"
740 "16LE\0csUTF16LE\0UTF-16\0csUTF16\0CESU-8\0csCESU8\0csCESU-8\0UTF-32\0csUTF32\0UTF-32BE\0csUTF32BE\0UTF-"
741 "32LE\0csUTF32LE\0BOCU-1\0csBOCU1\0csBOCU-1\0UTF-7-IMAP\0csUTF7IMAP\0ISO-8859-1-Windows-3.0-Latin-"
742 "1\0csWindows30Latin1\0ISO-8859-1-Windows-3.1-Latin-1\0csWindows31Latin1\0ISO-8859-2-Windows-Latin-"
743 "2\0csWindows31Latin2\0ISO-8859-9-Windows-Latin-5\0csWindows31Latin5\0hp-roman8\0roman8\0r8\0csHPRoman8\0Adobe-"
744 "Standard-Encoding\0csAdobeStandardEncoding\0Ventura-US\0csVenturaUS\0Ventura-"
745 "International\0csVenturaInternational\0DEC-"
746 "MCS\0dec\0csDECMCS\0IBM850\0cp850\0850\0csPC850Multilingual\0IBM852\0cp852\0852\0csPCp852\0IBM437\0cp437\0"
747 "437\0csPC8CodePage437\0PC8-Danish-Norwegian\0csPC8DanishNorwegian\0IBM862\0cp862\0862\0csPC862LatinHebrew\0PC8-"
748 "Turkish\0csPC8Turkish\0IBM-Symbols\0csIBMSymbols\0IBM-Thai\0csIBMThai\0HP-Legal\0csHPLegal\0HP-Pi-"
749 "font\0csHPPiFont\0HP-Math8\0csHPMath8\0Adobe-Symbol-Encoding\0csHPPSMath\0HP-DeskTop\0csHPDesktop\0Ventura-"
750 "Math\0csVenturaMath\0Microsoft-Publishing\0csMicrosoftPublishing\0Windows-"
751 "31J\0csWindows31J\0GB2312\0csGB2312\0Big5\0csBig5\0macintosh\0mac\0csMacintosh\0IBM037\0cp037\0ebcdic-cp-"
752 "us\0ebcdic-cp-ca\0ebcdic-cp-wt\0ebcdic-cp-nl\0csIBM037\0IBM038\0EBCDIC-"
753 "INT\0cp038\0csIBM038\0IBM273\0CP273\0csIBM273\0IBM274\0EBCDIC-BE\0CP274\0csIBM274\0IBM275\0EBCDIC-"
754 "BR\0cp275\0csIBM275\0IBM277\0EBCDIC-CP-DK\0EBCDIC-CP-NO\0csIBM277\0IBM278\0CP278\0ebcdic-cp-fi\0ebcdic-cp-"
755 "se\0csIBM278\0IBM280\0CP280\0ebcdic-cp-it\0csIBM280\0IBM281\0EBCDIC-JP-"
756 "E\0cp281\0csIBM281\0IBM284\0CP284\0ebcdic-cp-es\0csIBM284\0IBM285\0CP285\0ebcdic-cp-"
757 "gb\0csIBM285\0IBM290\0cp290\0EBCDIC-JP-kana\0csIBM290\0IBM297\0cp297\0ebcdic-cp-"
758 "fr\0csIBM297\0IBM420\0cp420\0ebcdic-cp-ar1\0csIBM420\0IBM423\0cp423\0ebcdic-cp-"
759 "gr\0csIBM423\0IBM424\0cp424\0ebcdic-cp-he\0csIBM424\0IBM500\0CP500\0ebcdic-cp-be\0ebcdic-cp-"
760 "ch\0csIBM500\0IBM851\0cp851\0851\0csIBM851\0IBM855\0cp855\0855\0csIBM855\0IBM857\0cp857\0857\0csIBM857\0IBM860\0"
761 "cp860\0860\0csIBM860\0IBM861\0cp861\0861\0cp-"
762 "is\0csIBM861\0IBM863\0cp863\0863\0csIBM863\0IBM864\0cp864\0csIBM864\0IBM865\0cp865\0865\0csIBM865\0IBM868\0CP868"
763 "\0cp-ar\0csIBM868\0IBM869\0cp869\0869\0cp-gr\0csIBM869\0IBM870\0CP870\0ebcdic-cp-roece\0ebcdic-cp-"
764 "yu\0csIBM870\0IBM871\0CP871\0ebcdic-cp-is\0csIBM871\0IBM880\0cp880\0EBCDIC-"
765 "Cyrillic\0csIBM880\0IBM891\0cp891\0csIBM891\0IBM903\0cp903\0csIBM903\0IBM904\0cp904\0904\0csIBBM904\0IBM905\0CP9"
766 "05\0ebcdic-cp-tr\0csIBM905\0IBM918\0CP918\0ebcdic-cp-ar2\0csIBM918\0IBM1026\0CP1026\0csIBM1026\0EBCDIC-AT-"
767 "DE\0csIBMEBCDICATDE\0EBCDIC-AT-DE-A\0csEBCDICATDEA\0EBCDIC-CA-FR\0csEBCDICCAFR\0EBCDIC-DK-"
768 "NO\0csEBCDICDKNO\0EBCDIC-DK-NO-A\0csEBCDICDKNOA\0EBCDIC-FI-SE\0csEBCDICFISE\0EBCDIC-FI-SE-"
769 "A\0csEBCDICFISEA\0EBCDIC-FR\0csEBCDICFR\0EBCDIC-IT\0csEBCDICIT\0EBCDIC-PT\0csEBCDICPT\0EBCDIC-"
770 "ES\0csEBCDICES\0EBCDIC-ES-A\0csEBCDICESA\0EBCDIC-ES-S\0csEBCDICESS\0EBCDIC-UK\0csEBCDICUK\0EBCDIC-"
771 "US\0csEBCDICUS\0UNKNOWN-"
772 "8BIT\0csUnknown8BiT\0MNEMONIC\0csMnemonic\0MNEM\0csMnem\0VISCII\0csVISCII\0VIQR\0csVIQR\0KOI8-R\0csKOI8R\0HZ-GB-"
773 "2312\0IBM866\0cp866\0866\0csIBM866\0IBM775\0cp775\0csPC775Baltic\0KOI8-"
774 "U\0csKOI8U\0IBM00858\0CCSID00858\0CP00858\0PC-Multilingual-850+"
775 "euro\0csIBM00858\0IBM00924\0CCSID00924\0CP00924\0ebcdic-Latin9--"
776 "euro\0csIBM00924\0IBM01140\0CCSID01140\0CP01140\0ebcdic-us-37+"
777 "euro\0csIBM01140\0IBM01141\0CCSID01141\0CP01141\0ebcdic-de-273+"
778 "euro\0csIBM01141\0IBM01142\0CCSID01142\0CP01142\0ebcdic-dk-277+euro\0ebcdic-no-277+"
779 "euro\0csIBM01142\0IBM01143\0CCSID01143\0CP01143\0ebcdic-fi-278+euro\0ebcdic-se-278+"
780 "euro\0csIBM01143\0IBM01144\0CCSID01144\0CP01144\0ebcdic-it-280+"
781 "euro\0csIBM01144\0IBM01145\0CCSID01145\0CP01145\0ebcdic-es-284+"
782 "euro\0csIBM01145\0IBM01146\0CCSID01146\0CP01146\0ebcdic-gb-285+"
783 "euro\0csIBM01146\0IBM01147\0CCSID01147\0CP01147\0ebcdic-fr-297+"
784 "euro\0csIBM01147\0IBM01148\0CCSID01148\0CP01148\0ebcdic-international-500+"
785 "euro\0csIBM01148\0IBM01149\0CCSID01149\0CP01149\0ebcdic-is-871+euro\0csIBM01149\0Big5-"
786 "HKSCS\0csBig5HKSCS\0IBM1047\0IBM-1047\0csIBM1047\0PTCP154\0csPTCP154\0PT154\0CP154\0Cyrillic-Asian\0Amiga-"
787 "1251\0Ami1251\0Amiga1251\0Ami-1251\0csAmiga1251\0KOI7-"
788 "switched\0csKOI7switched\0BRF\0csBRF\0TSCII\0csTSCII\0CP51932\0csCP51932\0windows-874\0cswindows874\0windows-"
789 "1250\0cswindows1250\0windows-1251\0cswindows1251\0windows-1252\0cswindows1252\0windows-"
790 "1253\0cswindows1253\0windows-1254\0cswindows1254\0windows-1255\0cswindows1255\0windows-"
791 "1256\0cswindows1256\0windows-1257\0cswindows1257\0windows-1258\0cswindows1258\0TIS-620\0csTIS620\0ISO-8859-"
792 "11\0CP50220\0csCP50220\0";
793
794 struct __offset_table {
795 constexpr static unsigned long long __num_aliases =
796 std::count(__aliases_string, __aliases_string + sizeof(__aliases_string), '\0') + 1;
797 unsigned short __table[__num_aliases];
798 };
799
800 static constexpr __offset_table __alias_offsets = [] {
801 __offset_table __aliases{};
802 __aliases.__table[0] = sizeof(__aliases_string) - 1;
803 __aliases.__table[1] = sizeof(__aliases_string) - 1;
804 __aliases.__table[2] = 0;
805
806 unsigned long long __idx = 3;
807
808 for (unsigned short __pos = 0; __pos < sizeof(__aliases_string) - 1 && __idx < __offset_table::__num_aliases;
809 __pos++) {
810 if (__aliases_string[__pos] == '\0') {
811 __aliases.__table[__idx++] = __pos + 1;
812 }
813 }
814
815 return __aliases;
816 }();
817};
818
819template <>
820struct hash<text_encoding> {
821 [[nodiscard]] static size_t operator()(const text_encoding& __enc) noexcept {
822 return std::hash<std::text_encoding::id>()(__enc.mib());
823 }
824};
825
826template <>
827inline constexpr bool ranges::enable_borrowed_range<text_encoding::aliases_view> = true;
828
829_LIBCPP_END_NAMESPACE_STD
830
831# endif // _LIBCPP_STD_VER >= 26
832
833#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
834
835#endif // _LIBCPP_TEXT_ENCODING
lib/libcxx/include/thread+13-7
...@@ -91,6 +91,11 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);...@@ -91,6 +91,11 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
91#else91#else
92# include <__config>92# include <__config>
9393
94// standard-mandated includes
95
96// [thread.syn]
97# include <compare>
98
94# if _LIBCPP_HAS_THREADS99# if _LIBCPP_HAS_THREADS
95100
96# include <__thread/this_thread.h>101# include <__thread/this_thread.h>
...@@ -106,28 +111,29 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);...@@ -106,28 +111,29 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
106111
107# include <version>112# include <version>
108113
109// standard-mandated includes
110
111// [thread.syn]
112# include <compare>
113
114# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)114# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
115# pragma GCC system_header115# pragma GCC system_header
116# endif116# endif
117117
118# endif // _LIBCPP_HAS_THREADS118# endif // _LIBCPP_HAS_THREADS
119119
120# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17120# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 17
121# include <chrono>121# include <chrono>
122# endif122# endif
123123
124# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20124# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
125# include <cstring>125# include <cstring>
126# include <functional>126# include <functional>
127# include <new>127# include <new>
128# include <system_error>128# include <system_error>
129# include <type_traits>129# include <type_traits>
130# endif130# endif
131
132# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
133# include <atomic>
134# include <sstream>
135# endif
136
131#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)137#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
132138
133#endif // _LIBCPP_THREAD139#endif // _LIBCPP_THREAD
lib/libcxx/include/tuple+53-65
...@@ -255,7 +255,6 @@ template <class... Types>...@@ -255,7 +255,6 @@ template <class... Types>
255# include <__type_traits/is_same.h>255# include <__type_traits/is_same.h>
256# include <__type_traits/is_swappable.h>256# include <__type_traits/is_swappable.h>
257# include <__type_traits/is_trivially_relocatable.h>257# include <__type_traits/is_trivially_relocatable.h>
258# include <__type_traits/lazy.h>
259# include <__type_traits/maybe_const.h>258# include <__type_traits/maybe_const.h>
260# include <__type_traits/nat.h>259# include <__type_traits/nat.h>
261# include <__type_traits/negation.h>260# include <__type_traits/negation.h>
...@@ -284,10 +283,10 @@ template <class... Types>...@@ -284,10 +283,10 @@ template <class... Types>
284_LIBCPP_PUSH_MACROS283_LIBCPP_PUSH_MACROS
285# include <__undef_macros>284# include <__undef_macros>
286285
287_LIBCPP_BEGIN_NAMESPACE_STD
288
289# ifndef _LIBCPP_CXX03_LANG286# ifndef _LIBCPP_CXX03_LANG
290287
288_LIBCPP_BEGIN_NAMESPACE_STD
289
291template <size_t _Ip, class _Tp, class _Up>290template <size_t _Ip, class _Tp, class _Up>
292_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool __tuple_compare_equal(const _Tp& __x, const _Up& __y) {291_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool __tuple_compare_equal(const _Tp& __x, const _Up& __y) {
293 if constexpr (_Ip == 0)292 if constexpr (_Ip == 0)
...@@ -296,20 +295,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool __tuple_compare_equal(c...@@ -296,20 +295,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool __tuple_compare_equal(c
296 return std::__tuple_compare_equal<_Ip - 1>(__x, __y) && std::get<_Ip - 1>(__x) == std::get<_Ip - 1>(__y);295 return std::__tuple_compare_equal<_Ip - 1>(__x, __y) && std::get<_Ip - 1>(__x) == std::get<_Ip - 1>(__y);
297}296}
298297
299# if _LIBCPP_STD_VER >= 26
300template <class _Tp, class _Up, class _IndexSeq = make_index_sequence<tuple_size_v<_Tp>>>
301inline constexpr bool __can_tuple_compare_equal = false;
302
303// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
304// because the resolution of CWG2369 landed in LLVM-21.
305template <class _Tp, class _Up, size_t... _Is>
306 requires(tuple_size_v<_Tp> == tuple_size_v<_Up>)
307inline constexpr bool __can_tuple_compare_equal<_Tp, _Up, index_sequence<_Is...>> =
308 __all<requires(const tuple_element_t<_Is, _Tp>& __t, const tuple_element_t<_Is, _Up>& __u) {
309 { __t == __u } -> __boolean_testable;
310 }...>::value;
311# endif // _LIBCPP_STD_VER >= 26
312
313# if _LIBCPP_STD_VER >= 20298# if _LIBCPP_STD_VER >= 20
314template <class _Ret, class _Tp, class _Up, size_t... _Is>299template <class _Ret, class _Tp, class _Up, size_t... _Is>
315_LIBCPP_HIDE_FROM_ABI constexpr _Ret __tuple_compare_three_way(const _Tp& __x, const _Up& __y, index_sequence<_Is...>) {300_LIBCPP_HIDE_FROM_ABI constexpr _Ret __tuple_compare_three_way(const _Tp& __x, const _Up& __y, index_sequence<_Is...>) {
...@@ -324,24 +309,16 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Ret __tuple_compare_three_way(const _Tp& __x, c...@@ -324,24 +309,16 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Ret __tuple_compare_three_way(const _Tp& __x, c
324template <class _Tp>309template <class _Tp>
325concept __tuple_like_no_tuple = __tuple_like<_Tp> && !__is_tuple_v<_Tp>;310concept __tuple_like_no_tuple = __tuple_like<_Tp> && !__is_tuple_v<_Tp>;
326311
327template <class _Tp, class _Up, class _IndexSeq>312template <__tuple_like _Tp, class _IndexSequence = make_index_sequence<tuple_size_v<_Tp>>>
328struct __tuple_common_comparison_category_impl {};313struct __to_tuple;
329314
330// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends315template <__tuple_like _Tp, size_t... _Index>
331// because the resolution of CWG2369 landed in LLVM-21.316struct __to_tuple<_Tp, index_sequence<_Index...>> {
332template <class _Tp, class _Up, size_t... _Is>317 using type _LIBCPP_NODEBUG = tuple<tuple_element_t<_Index, _Tp>...>;
333 requires(tuple_size_v<_Tp> == tuple_size_v<_Up>) && requires {
334 typename common_comparison_category_t<
335 __synth_three_way_result<tuple_element_t<_Is, _Tp>, tuple_element_t<_Is, _Up>>...>;
336 }
337struct __tuple_common_comparison_category_impl<_Tp, _Up, index_sequence<_Is...>> {
338 using type _LIBCPP_NODEBUG =
339 common_comparison_category_t<__synth_three_way_result<tuple_element_t<_Is, _Tp>, tuple_element_t<_Is, _Up>>...>;
340};318};
341319
342template <__tuple_like _Tp, __tuple_like _Up>320template <__tuple_like _Tp>
343using __tuple_common_comparison_category _LIBCPP_NODEBUG =321using __to_tuple_t _LIBCPP_NODEBUG = typename __to_tuple<_Tp>::type;
344 __tuple_common_comparison_category_impl<_Tp, _Up, make_index_sequence<tuple_size_v<_Tp>>>::type;
345# endif // _LIBCPP_STD_VER >= 23322# endif // _LIBCPP_STD_VER >= 23
346323
347// __tuple_leaf324// __tuple_leaf
...@@ -602,30 +579,28 @@ public:...@@ -602,30 +579,28 @@ public:
602 template <template <class...> class _IsImpDefault = __is_implicitly_default_constructible,579 template <template <class...> class _IsImpDefault = __is_implicitly_default_constructible,
603 template <class...> class _IsDefault = is_default_constructible,580 template <class...> class _IsDefault = is_default_constructible,
604 __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>581 __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>
605 _LIBCPP_HIDE_FROM_ABI constexpr explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)582 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<_IsImpDefault<_Tp>...>::value)
606 tuple() noexcept(_And<is_nothrow_default_constructible<_Tp>...>::value) {}583 tuple() noexcept(_And<is_nothrow_default_constructible<_Tp>...>::value) {}
607584
608 template <class _Alloc,585 template <class _Alloc,
609 template <class...> class _IsImpDefault = __is_implicitly_default_constructible,586 template <class...> class _IsImpDefault = __is_implicitly_default_constructible,
610 template <class...> class _IsDefault = is_default_constructible,587 template <class...> class _IsDefault = is_default_constructible,
611 __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>588 __enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>
612 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)589 _LIBCPP_HIDE_FROM_ABI
613 tuple(allocator_arg_t, _Alloc const& __a)590 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<_IsImpDefault<_Tp>...>::value) tuple(allocator_arg_t, _Alloc const& __a)
614 : __base_(allocator_arg_t(), __a, __value_init{}) {}591 : __base_(allocator_arg_t(), __a, __value_init{}) {}
615592
616 // tuple(const T&...) constructors (including allocator_arg_t variants)593 // tuple(const T&...) constructors (including allocator_arg_t variants)
617 template <template <class...> class _And = _And,594 template <template <class...> class _And = _And,
618 __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>595 __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>
619 _LIBCPP_HIDE_FROM_ABI596 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<const _Tp&, _Tp>...>::value)
620 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
621 tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value)597 tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value)
622 : __base_(__forward_args{}, __t...) {}598 : __base_(__forward_args{}, __t...) {}
623599
624 template <class _Alloc,600 template <class _Alloc,
625 template <class...> class _And = _And,601 template <class...> class _And = _And,
626 __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>602 __enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>
627 _LIBCPP_HIDE_FROM_ABI603 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<const _Tp&, _Tp>...>::value)
628 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
629 tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t)604 tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t)
630 : __base_(allocator_arg_t(), __a, __forward_args{}, __t...) {}605 : __base_(allocator_arg_t(), __a, __forward_args{}, __t...) {}
631606
...@@ -644,7 +619,7 @@ public:...@@ -644,7 +619,7 @@ public:
644 template <class... _Up,619 template <class... _Up,
645 __enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,620 __enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,
646 int> = 0>621 int> = 0>
647 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)622 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
648 tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)623 tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
649 : __base_(__forward_args{}, std::forward<_Up>(__u)...) {}624 : __base_(__forward_args{}, std::forward<_Up>(__u)...) {}
650625
...@@ -652,7 +627,7 @@ public:...@@ -652,7 +627,7 @@ public:
652 class... _Up,627 class... _Up,
653 __enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,628 __enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,
654 int> = 0>629 int> = 0>
655 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)630 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
656 tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)631 tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
657 : __base_(allocator_arg_t(), __a, __forward_args{}, std::forward<_Up>(__u)...) {}632 : __base_(allocator_arg_t(), __a, __forward_args{}, std::forward<_Up>(__u)...) {}
658633
...@@ -690,26 +665,22 @@ public:...@@ -690,26 +665,22 @@ public:
690 _Not<is_same<_OtherTuple, const tuple&> >,665 _Not<is_same<_OtherTuple, const tuple&> >,
691 _Not<is_same<_OtherTuple, tuple&&> >,666 _Not<is_same<_OtherTuple, tuple&&> >,
692 is_constructible<_Tp, __copy_cvref_t<_OtherTuple, _Up> >...,667 is_constructible<_Tp, __copy_cvref_t<_OtherTuple, _Up> >...,
693 _Lazy<_Or,668 _Or<_BoolConstant<sizeof...(_Tp) != 1>,
694 _BoolConstant<sizeof...(_Tp) != 1>,669 // _Tp and _Up are 1-element packs - the pack expansions look
695 // _Tp and _Up are 1-element packs - the pack expansions look670 // weird to avoid tripping up the type traits in degenerate cases
696 // weird to avoid tripping up the type traits in degenerate cases671 _And<_Not<is_same<_Tp, _Up> >...,
697 _Lazy<_And,672 _Not<is_convertible<_OtherTuple, _Tp> >...,
698 _Not<is_same<_Tp, _Up> >...,673 _Not<is_constructible<_Tp, _OtherTuple> >... > > > {};
699 _Not<is_convertible<_OtherTuple, _Tp> >...,
700 _Not<is_constructible<_Tp, _OtherTuple> >... > > > {};
701674
702 template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0>675 template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0>
703 _LIBCPP_HIDE_FROM_ABI676 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<const _Up&, _Tp>...>::value)
704 _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
705 tuple(const tuple<_Up...>& __t) noexcept(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value)677 tuple(const tuple<_Up...>& __t) noexcept(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value)
706 : __base_(__from_tuple(), __t) {}678 : __base_(__from_tuple(), __t) {}
707679
708 template <class... _Up,680 template <class... _Up,
709 class _Alloc,681 class _Alloc,
710 __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0>682 __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0>
711 _LIBCPP_HIDE_FROM_ABI683 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<const _Up&, _Tp>...>::value)
712 _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
713 tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)684 tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)
714 : __base_(allocator_arg_t(), __a, __from_tuple(), __t) {}685 : __base_(allocator_arg_t(), __a, __from_tuple(), __t) {}
715686
...@@ -717,25 +688,25 @@ public:...@@ -717,25 +688,25 @@ public:
717 // tuple(tuple<U...>&) constructors (including allocator_arg_t variants)688 // tuple(tuple<U...>&) constructors (including allocator_arg_t variants)
718689
719 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>690 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>
720 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t)691 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t)
721 : __base_(__from_tuple(), __t) {}692 : __base_(__from_tuple(), __t) {}
722693
723 template <class _Alloc, class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>694 template <class _Alloc, class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>
724 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value)695 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<_Up&, _Tp>...>::value)
725 tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t)696 tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t)
726 : __base_(allocator_arg_t(), __alloc, __from_tuple(), __t) {}697 : __base_(allocator_arg_t(), __alloc, __from_tuple(), __t) {}
727# endif // _LIBCPP_STD_VER >= 23698# endif // _LIBCPP_STD_VER >= 23
728699
729 // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)700 // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
730 template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>701 template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>
731 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)702 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
732 tuple(tuple<_Up...>&& __t) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)703 tuple(tuple<_Up...>&& __t) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
733 : __base_(__from_tuple(), std::move(__t)) {}704 : __base_(__from_tuple(), std::move(__t)) {}
734705
735 template <class _Alloc,706 template <class _Alloc,
736 class... _Up,707 class... _Up,
737 __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>708 __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>
738 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)709 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
739 tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)710 tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)
740 : __base_(allocator_arg_t(), __a, __from_tuple(), std::move(__t)) {}711 : __base_(allocator_arg_t(), __a, __from_tuple(), std::move(__t)) {}
741712
...@@ -743,14 +714,14 @@ public:...@@ -743,14 +714,14 @@ public:
743 // tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)714 // tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)
744715
745 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>716 template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>
746 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)717 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<const _Up&&, _Tp>...>::value)
747 tuple(const tuple<_Up...>&& __t)718 tuple(const tuple<_Up...>&& __t)
748 : __base_(__from_tuple(), std::move(__t)) {}719 : __base_(__from_tuple(), std::move(__t)) {}
749720
750 template <class _Alloc,721 template <class _Alloc,
751 class... _Up,722 class... _Up,
752 enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>723 enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>
753 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)724 _LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<const _Up&&, _Tp>...>::value)
754 tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)725 tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)
755 : __base_(allocator_arg_t(), __alloc, __from_tuple(), std::move(__t)) {}726 : __base_(allocator_arg_t(), __alloc, __from_tuple(), std::move(__t)) {}
756# endif // _LIBCPP_STD_VER >= 23727# endif // _LIBCPP_STD_VER >= 23
...@@ -1011,20 +982,37 @@ public:...@@ -1011,20 +982,37 @@ public:
1011 __base_.swap(__t.__base_);982 __base_.swap(__t.__base_);
1012 }983 }
1013984
985 template <class _Tuple>
986 static constexpr bool __can_compare_equal = false;
987
988 template <class... _Up>
989 static constexpr bool __can_compare_equal<tuple<_Up...>> = __all<requires(const _Tp& __t, const _Up& __u) {
990 { __t == __u } -> __boolean_testable;
991 }...>::value;
992
1014 template <__tuple_like_no_tuple _UTuple>993 template <__tuple_like_no_tuple _UTuple>
1015# if _LIBCPP_STD_VER >= 26994# if _LIBCPP_STD_VER >= 26
1016 requires __can_tuple_compare_equal<tuple, _UTuple> && (sizeof...(_Tp) == tuple_size_v<_UTuple>)995 requires(sizeof...(_Tp) == tuple_size_v<_UTuple>) && __can_compare_equal<__to_tuple_t<_UTuple>>
1017# endif // _LIBCPP_STD_VER >= 26996# endif // _LIBCPP_STD_VER >= 26
1018 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const tuple& __x, const _UTuple& __y) {997 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const tuple& __x, const _UTuple& __y) {
1019 static_assert(sizeof...(_Tp) == tuple_size_v<_UTuple>, "Can't compare tuple-like values of different sizes");998 static_assert(sizeof...(_Tp) == tuple_size_v<_UTuple>, "Can't compare tuple-like values of different sizes");
1020 return std::__tuple_compare_equal<sizeof...(_Tp)>(__x, __y);999 return std::__tuple_compare_equal<sizeof...(_Tp)>(__x, __y);
1021 }1000 }
10221001
1002 template <class _Tuple>
1003 struct __common_comparison_category_with;
1004
1005 template <class... _Up>
1006 requires requires { typename common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>; }
1007 struct __common_comparison_category_with<tuple<_Up...>> {
1008 using type _LIBCPP_NODEBUG = common_comparison_category_t<__synth_three_way_result<_Tp, _Up>...>;
1009 };
1010
1023 template <__tuple_like_no_tuple _UTuple>1011 template <__tuple_like_no_tuple _UTuple>
1024 requires(sizeof...(_Tp) == tuple_size_v<_UTuple>)1012 requires(sizeof...(_Tp) == tuple_size_v<_UTuple>)
1025 _LIBCPP_HIDE_FROM_ABI friend constexpr __tuple_common_comparison_category<tuple, _UTuple>1013 _LIBCPP_HIDE_FROM_ABI friend constexpr typename __common_comparison_category_with<__to_tuple_t<_UTuple>>::type
1026 operator<=>(const tuple& __x, const _UTuple& __y) {1014 operator<=>(const tuple& __x, const _UTuple& __y) {
1027 return std::__tuple_compare_three_way<__tuple_common_comparison_category<tuple, _UTuple>>(1015 return std::__tuple_compare_three_way<typename __common_comparison_category_with<__to_tuple_t<_UTuple>>::type>(
1028 __x, __y, index_sequence_for<_Tp...>{});1016 __x, __y, index_sequence_for<_Tp...>{});
1029 }1017 }
1030# endif // _LIBCPP_STD_VER >= 231018# endif // _LIBCPP_STD_VER >= 23
...@@ -1455,15 +1443,15 @@ template <class _Tp, class _Tuple, class = enable_if_t<__can_make_from_tuple<_Tp...@@ -1455,15 +1443,15 @@ template <class _Tp, class _Tuple, class = enable_if_t<__can_make_from_tuple<_Tp
14551443
1456# endif // _LIBCPP_STD_VER >= 171444# endif // _LIBCPP_STD_VER >= 17
14571445
1458#endif // !defined(_LIBCPP_CXX03_LANG)
1459
1460_LIBCPP_END_NAMESPACE_STD1446_LIBCPP_END_NAMESPACE_STD
14611447
1448#endif // !defined(_LIBCPP_CXX03_LANG)
1449
1462_LIBCPP_POP_MACROS1450_LIBCPP_POP_MACROS
14631451
1464// clang-format on1452// clang-format on
14651453
1466# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201454# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1467# include <cstddef>1455# include <cstddef>
1468# include <exception>1456# include <exception>
1469# include <iosfwd>1457# include <iosfwd>
lib/libcxx/include/typeindex+1-1
...@@ -102,7 +102,7 @@ struct hash<type_index> : public __unary_function<type_index, size_t> {...@@ -102,7 +102,7 @@ struct hash<type_index> : public __unary_function<type_index, size_t> {
102102
103_LIBCPP_END_NAMESPACE_STD103_LIBCPP_END_NAMESPACE_STD
104104
105# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20105# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
106# include <cstddef>106# include <cstddef>
107# include <iosfwd>107# include <iosfwd>
108# include <new>108# include <new>
lib/libcxx/include/typeinfo+2-2
...@@ -302,7 +302,7 @@ class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH type_info...@@ -302,7 +302,7 @@ class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH type_info
302protected:302protected:
303 typedef __type_info_implementations::__impl __impl;303 typedef __type_info_implementations::__impl __impl;
304304
305 __impl::__type_name_t __type_name;305 _LIBCPP_DISABLE_POINTER_FIELD_PROTECTION __impl::__type_name_t __type_name;
306306
307 _LIBCPP_HIDE_FROM_ABI explicit type_info(const char* __n) : __type_name(__impl::__string_to_type_name(__n)) {}307 _LIBCPP_HIDE_FROM_ABI explicit type_info(const char* __n) : __type_name(__impl::__string_to_type_name(__n)) {}
308308
...@@ -389,7 +389,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -389,7 +389,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
389}389}
390_LIBCPP_END_NAMESPACE_STD390_LIBCPP_END_NAMESPACE_STD
391391
392# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20392# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
393# include <cstddef>393# include <cstddef>
394# include <cstdlib>394# include <cstdlib>
395# include <type_traits>395# include <type_traits>
lib/libcxx/include/unordered_map+67-31
...@@ -77,16 +77,16 @@ public:...@@ -77,16 +77,16 @@ public:
77 const hasher& hf = hasher(), const key_equal& eql = key_equal(),77 const hasher& hf = hasher(), const key_equal& eql = key_equal(),
78 const allocator_type& a = allocator_type());78 const allocator_type& a = allocator_type());
79 unordered_map(size_type n, const allocator_type& a)79 unordered_map(size_type n, const allocator_type& a)
80 : unordered_map(n, hasher(), key_equal(), a) {} // C++1480 : unordered_map(n, hasher(), key_equal(), a) {}
81 unordered_map(size_type n, const hasher& hf, const allocator_type& a)81 unordered_map(size_type n, const hasher& hf, const allocator_type& a)
82 : unordered_map(n, hf, key_equal(), a) {} // C++1482 : unordered_map(n, hf, key_equal(), a) {}
83 template <class InputIterator>83 template <class InputIterator>
84 unordered_map(InputIterator f, InputIterator l, size_type n, const allocator_type& a)84 unordered_map(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
85 : unordered_map(f, l, n, hasher(), key_equal(), a) {} // C++1485 : unordered_map(f, l, n, hasher(), key_equal(), a) {}
86 template <class InputIterator>86 template <class InputIterator>
87 unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf,87 unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf,
88 const allocator_type& a)88 const allocator_type& a)
89 : unordered_map(f, l, n, hf, key_equal(), a) {} // C++1489 : unordered_map(f, l, n, hf, key_equal(), a) {}
90 template<container-compatible-range<value_type> R>90 template<container-compatible-range<value_type> R>
91 unordered_map(from_range_t, R&& rg, size_type n, const allocator_type& a)91 unordered_map(from_range_t, R&& rg, size_type n, const allocator_type& a)
92 : unordered_map(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++2392 : unordered_map(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
...@@ -94,10 +94,10 @@ public:...@@ -94,10 +94,10 @@ public:
94 unordered_map(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)94 unordered_map(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
95 : unordered_map(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++2395 : unordered_map(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
96 unordered_map(initializer_list<value_type> il, size_type n, const allocator_type& a)96 unordered_map(initializer_list<value_type> il, size_type n, const allocator_type& a)
97 : unordered_map(il, n, hasher(), key_equal(), a) {} // C++1497 : unordered_map(il, n, hasher(), key_equal(), a) {}
98 unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf,98 unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf,
99 const allocator_type& a)99 const allocator_type& a)
100 : unordered_map(il, n, hf, key_equal(), a) {} // C++14100 : unordered_map(il, n, hf, key_equal(), a) {}
101 ~unordered_map();101 ~unordered_map();
102 unordered_map& operator=(const unordered_map&);102 unordered_map& operator=(const unordered_map&);
103 unordered_map& operator=(unordered_map&&)103 unordered_map& operator=(unordered_map&&)
...@@ -363,16 +363,16 @@ public:...@@ -363,16 +363,16 @@ public:
363 const hasher& hf = hasher(), const key_equal& eql = key_equal(),363 const hasher& hf = hasher(), const key_equal& eql = key_equal(),
364 const allocator_type& a = allocator_type());364 const allocator_type& a = allocator_type());
365 unordered_multimap(size_type n, const allocator_type& a)365 unordered_multimap(size_type n, const allocator_type& a)
366 : unordered_multimap(n, hasher(), key_equal(), a) {} // C++14366 : unordered_multimap(n, hasher(), key_equal(), a) {}
367 unordered_multimap(size_type n, const hasher& hf, const allocator_type& a)367 unordered_multimap(size_type n, const hasher& hf, const allocator_type& a)
368 : unordered_multimap(n, hf, key_equal(), a) {} // C++14368 : unordered_multimap(n, hf, key_equal(), a) {}
369 template <class InputIterator>369 template <class InputIterator>
370 unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a)370 unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
371 : unordered_multimap(f, l, n, hasher(), key_equal(), a) {} // C++14371 : unordered_multimap(f, l, n, hasher(), key_equal(), a) {}
372 template <class InputIterator>372 template <class InputIterator>
373 unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,373 unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
374 const allocator_type& a)374 const allocator_type& a)
375 : unordered_multimap(f, l, n, hf, key_equal(), a) {} // C++14375 : unordered_multimap(f, l, n, hf, key_equal(), a) {}
376 template<container-compatible-range<value_type> R>376 template<container-compatible-range<value_type> R>
377 unordered_multimap(from_range_t, R&& rg, size_type n, const allocator_type& a)377 unordered_multimap(from_range_t, R&& rg, size_type n, const allocator_type& a)
378 : unordered_multimap(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23378 : unordered_multimap(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
...@@ -380,10 +380,10 @@ public:...@@ -380,10 +380,10 @@ public:
380 unordered_multimap(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)380 unordered_multimap(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
381 : unordered_multimap(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23381 : unordered_multimap(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
382 unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)382 unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
383 : unordered_multimap(il, n, hasher(), key_equal(), a) {} // C++14383 : unordered_multimap(il, n, hasher(), key_equal(), a) {}
384 unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,384 unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
385 const allocator_type& a)385 const allocator_type& a)
386 : unordered_multimap(il, n, hf, key_equal(), a) {} // C++14386 : unordered_multimap(il, n, hf, key_equal(), a) {}
387 ~unordered_multimap();387 ~unordered_multimap();
388 unordered_multimap& operator=(const unordered_multimap&);388 unordered_multimap& operator=(const unordered_multimap&);
389 unordered_multimap& operator=(unordered_multimap&&)389 unordered_multimap& operator=(unordered_multimap&&)
...@@ -993,7 +993,6 @@ public:...@@ -993,7 +993,6 @@ public:
993 const key_equal& __eql,993 const key_equal& __eql,
994 const allocator_type& __a);994 const allocator_type& __a);
995# endif // _LIBCPP_CXX03_LANG995# endif // _LIBCPP_CXX03_LANG
996# if _LIBCPP_STD_VER >= 14
997 _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const allocator_type& __a)996 _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const allocator_type& __a)
998 : unordered_map(__n, hasher(), key_equal(), __a) {}997 : unordered_map(__n, hasher(), key_equal(), __a) {}
999 _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf, const allocator_type& __a)998 _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf, const allocator_type& __a)
...@@ -1007,7 +1006,7 @@ public:...@@ -1007,7 +1006,7 @@ public:
1007 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)1006 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
1008 : unordered_map(__first, __last, __n, __hf, key_equal(), __a) {}1007 : unordered_map(__first, __last, __n, __hf, key_equal(), __a) {}
10091008
1010# if _LIBCPP_STD_VER >= 231009# if _LIBCPP_STD_VER >= 23
1011 template <_ContainerCompatibleRange<value_type> _Range>1010 template <_ContainerCompatibleRange<value_type> _Range>
1012 _LIBCPP_HIDE_FROM_ABI unordered_map(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)1011 _LIBCPP_HIDE_FROM_ABI unordered_map(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
1013 : unordered_map(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}1012 : unordered_map(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
...@@ -1016,8 +1015,9 @@ public:...@@ -1016,8 +1015,9 @@ public:
1016 _LIBCPP_HIDE_FROM_ABI1015 _LIBCPP_HIDE_FROM_ABI
1017 unordered_map(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)1016 unordered_map(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
1018 : unordered_map(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}1017 : unordered_map(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
1019# endif1018# endif
10201019
1020# ifndef _LIBCPP_CXX03_LANG
1021 _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)1021 _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
1022 : unordered_map(__il, __n, hasher(), key_equal(), __a) {}1022 : unordered_map(__il, __n, hasher(), key_equal(), __a) {}
1023 _LIBCPP_HIDE_FROM_ABI1023 _LIBCPP_HIDE_FROM_ABI
...@@ -1216,11 +1216,17 @@ public:...@@ -1216,11 +1216,17 @@ public:
1216 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }1216 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
1217 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }1217 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
1218# if _LIBCPP_STD_VER >= 201218# if _LIBCPP_STD_VER >= 20
1219 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1219 template <class _K2,
1220 class _Hasher = hasher,
1221 class _Comp = key_equal,
1222 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1220 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1223 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1221 return __table_.find(__k);1224 return __table_.find(__k);
1222 }1225 }
1223 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1226 template <class _K2,
1227 class _Hasher = hasher,
1228 class _Comp = key_equal,
1229 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1224 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1230 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1225 return __table_.find(__k);1231 return __table_.find(__k);
1226 }1232 }
...@@ -1230,7 +1236,10 @@ public:...@@ -1230,7 +1236,10 @@ public:
1230 return __table_.__count_unique(__k);1236 return __table_.__count_unique(__k);
1231 }1237 }
1232# if _LIBCPP_STD_VER >= 201238# if _LIBCPP_STD_VER >= 20
1233 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1239 template <class _K2,
1240 class _Hasher = hasher,
1241 class _Comp = key_equal,
1242 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1234 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1243 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1235 return __table_.__count_unique(__k);1244 return __table_.__count_unique(__k);
1236 }1245 }
...@@ -1239,7 +1248,10 @@ public:...@@ -1239,7 +1248,10 @@ public:
1239# if _LIBCPP_STD_VER >= 201248# if _LIBCPP_STD_VER >= 20
1240 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1249 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
12411250
1242 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1251 template <class _K2,
1252 class _Hasher = hasher,
1253 class _Comp = key_equal,
1254 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1243 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1255 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1244 return find(__k) != end();1256 return find(__k) != end();
1245 }1257 }
...@@ -1252,11 +1264,17 @@ public:...@@ -1252,11 +1264,17 @@ public:
1252 return __table_.__equal_range_unique(__k);1264 return __table_.__equal_range_unique(__k);
1253 }1265 }
1254# if _LIBCPP_STD_VER >= 201266# if _LIBCPP_STD_VER >= 20
1255 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1267 template <class _K2,
1268 class _Hasher = hasher,
1269 class _Comp = key_equal,
1270 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1256 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1271 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1257 return __table_.__equal_range_unique(__k);1272 return __table_.__equal_range_unique(__k);
1258 }1273 }
1259 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1274 template <class _K2,
1275 class _Hasher = hasher,
1276 class _Comp = key_equal,
1277 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1260 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1278 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1261 return __table_.__equal_range_unique(__k);1279 return __table_.__equal_range_unique(__k);
1262 }1280 }
...@@ -1769,7 +1787,6 @@ public:...@@ -1769,7 +1787,6 @@ public:
1769 const key_equal& __eql,1787 const key_equal& __eql,
1770 const allocator_type& __a);1788 const allocator_type& __a);
1771# endif // _LIBCPP_CXX03_LANG1789# endif // _LIBCPP_CXX03_LANG
1772# if _LIBCPP_STD_VER >= 14
1773 _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const allocator_type& __a)1790 _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const allocator_type& __a)
1774 : unordered_multimap(__n, hasher(), key_equal(), __a) {}1791 : unordered_multimap(__n, hasher(), key_equal(), __a) {}
1775 _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf, const allocator_type& __a)1792 _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf, const allocator_type& __a)
...@@ -1783,7 +1800,7 @@ public:...@@ -1783,7 +1800,7 @@ public:
1783 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)1800 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
1784 : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a) {}1801 : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a) {}
17851802
1786# if _LIBCPP_STD_VER >= 231803# if _LIBCPP_STD_VER >= 23
1787 template <_ContainerCompatibleRange<value_type> _Range>1804 template <_ContainerCompatibleRange<value_type> _Range>
1788 _LIBCPP_HIDE_FROM_ABI unordered_multimap(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)1805 _LIBCPP_HIDE_FROM_ABI unordered_multimap(from_range_t, _Range&& __range, size_type __n, const allocator_type& __a)
1789 : unordered_multimap(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}1806 : unordered_multimap(from_range, std::forward<_Range>(__range), __n, hasher(), key_equal(), __a) {}
...@@ -1792,8 +1809,9 @@ public:...@@ -1792,8 +1809,9 @@ public:
1792 _LIBCPP_HIDE_FROM_ABI1809 _LIBCPP_HIDE_FROM_ABI
1793 unordered_multimap(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)1810 unordered_multimap(from_range_t, _Range&& __range, size_type __n, const hasher& __hf, const allocator_type& __a)
1794 : unordered_multimap(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}1811 : unordered_multimap(from_range, std::forward<_Range>(__range), __n, __hf, key_equal(), __a) {}
1795# endif1812# endif
17961813
1814# ifndef _LIBCPP_CXX03_LANG
1797 _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)1815 _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
1798 : unordered_multimap(__il, __n, hasher(), key_equal(), __a) {}1816 : unordered_multimap(__il, __n, hasher(), key_equal(), __a) {}
1799 _LIBCPP_HIDE_FROM_ABI1817 _LIBCPP_HIDE_FROM_ABI
...@@ -1936,11 +1954,17 @@ public:...@@ -1936,11 +1954,17 @@ public:
1936 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }1954 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
1937 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }1955 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
1938# if _LIBCPP_STD_VER >= 201956# if _LIBCPP_STD_VER >= 20
1939 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1957 template <class _K2,
1958 class _Hasher = hasher,
1959 class _Comp = key_equal,
1960 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1940 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1961 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1941 return __table_.find(__k);1962 return __table_.find(__k);
1942 }1963 }
1943 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1964 template <class _K2,
1965 class _Hasher = hasher,
1966 class _Comp = key_equal,
1967 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1944 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1968 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1945 return __table_.find(__k);1969 return __table_.find(__k);
1946 }1970 }
...@@ -1950,7 +1974,10 @@ public:...@@ -1950,7 +1974,10 @@ public:
1950 return __table_.__count_multi(__k);1974 return __table_.__count_multi(__k);
1951 }1975 }
1952# if _LIBCPP_STD_VER >= 201976# if _LIBCPP_STD_VER >= 20
1953 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1977 template <class _K2,
1978 class _Hasher = hasher,
1979 class _Comp = key_equal,
1980 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1954 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1981 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1955 return __table_.__count_multi(__k);1982 return __table_.__count_multi(__k);
1956 }1983 }
...@@ -1959,7 +1986,10 @@ public:...@@ -1959,7 +1986,10 @@ public:
1959# if _LIBCPP_STD_VER >= 201986# if _LIBCPP_STD_VER >= 20
1960 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1987 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
19611988
1962 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1989 template <class _K2,
1990 class _Hasher = hasher,
1991 class _Comp = key_equal,
1992 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1963 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1993 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1964 return find(__k) != end();1994 return find(__k) != end();
1965 }1995 }
...@@ -1972,11 +2002,17 @@ public:...@@ -1972,11 +2002,17 @@ public:
1972 return __table_.__equal_range_multi(__k);2002 return __table_.__equal_range_multi(__k);
1973 }2003 }
1974# if _LIBCPP_STD_VER >= 202004# if _LIBCPP_STD_VER >= 20
1975 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>2005 template <class _K2,
2006 class _Hasher = hasher,
2007 class _Comp = key_equal,
2008 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1976 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {2009 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1977 return __table_.__equal_range_multi(__k);2010 return __table_.__equal_range_multi(__k);
1978 }2011 }
1979 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>2012 template <class _K2,
2013 class _Hasher = hasher,
2014 class _Comp = key_equal,
2015 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1980 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {2016 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1981 return __table_.__equal_range_multi(__k);2017 return __table_.__equal_range_multi(__k);
1982 }2018 }
...@@ -2345,7 +2381,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -2345,7 +2381,7 @@ _LIBCPP_END_NAMESPACE_STD
23452381
2346_LIBCPP_POP_MACROS2382_LIBCPP_POP_MACROS
23472383
2348# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 202384# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
2349# include <algorithm>2385# include <algorithm>
2350# include <bit>2386# include <bit>
2351# include <cmath>2387# include <cmath>
lib/libcxx/include/unordered_set+61-37
...@@ -76,22 +76,22 @@ public:...@@ -76,22 +76,22 @@ public:
76 unordered_set(initializer_list<value_type>, size_type n = 0,76 unordered_set(initializer_list<value_type>, size_type n = 0,
77 const hasher& hf = hasher(), const key_equal& eql = key_equal(),77 const hasher& hf = hasher(), const key_equal& eql = key_equal(),
78 const allocator_type& a = allocator_type());78 const allocator_type& a = allocator_type());
79 unordered_set(size_type n, const allocator_type& a); // C++1479 unordered_set(size_type n, const allocator_type& a);
80 unordered_set(size_type n, const hasher& hf, const allocator_type& a); // C++1480 unordered_set(size_type n, const hasher& hf, const allocator_type& a);
81 template <class InputIterator>81 template <class InputIterator>
82 unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++1482 unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a);
83 template <class InputIterator>83 template <class InputIterator>
84 unordered_set(InputIterator f, InputIterator l, size_type n,84 unordered_set(InputIterator f, InputIterator l, size_type n,
85 const hasher& hf, const allocator_type& a); // C++1485 const hasher& hf, const allocator_type& a);
86 template<container-compatible-range<value_type> R>86 template<container-compatible-range<value_type> R>
87 unordered_set(from_range_t, R&& rg, size_type n, const allocator_type& a)87 unordered_set(from_range_t, R&& rg, size_type n, const allocator_type& a)
88 : unordered_set(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++2388 : unordered_set(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
89 template<container-compatible-range<value_type> R>89 template<container-compatible-range<value_type> R>
90 unordered_set(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)90 unordered_set(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
91 : unordered_set(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++2391 : unordered_set(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
92 unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++1492 unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a);
93 unordered_set(initializer_list<value_type> il, size_type n,93 unordered_set(initializer_list<value_type> il, size_type n,
94 const hasher& hf, const allocator_type& a); // C++1494 const hasher& hf, const allocator_type& a);
95 ~unordered_set();95 ~unordered_set();
96 unordered_set& operator=(const unordered_set&);96 unordered_set& operator=(const unordered_set&);
97 unordered_set& operator=(unordered_set&&)97 unordered_set& operator=(unordered_set&&)
...@@ -324,22 +324,22 @@ public:...@@ -324,22 +324,22 @@ public:
324 unordered_multiset(initializer_list<value_type>, size_type n = /see below/,324 unordered_multiset(initializer_list<value_type>, size_type n = /see below/,
325 const hasher& hf = hasher(), const key_equal& eql = key_equal(),325 const hasher& hf = hasher(), const key_equal& eql = key_equal(),
326 const allocator_type& a = allocator_type());326 const allocator_type& a = allocator_type());
327 unordered_multiset(size_type n, const allocator_type& a); // C++14327 unordered_multiset(size_type n, const allocator_type& a);
328 unordered_multiset(size_type n, const hasher& hf, const allocator_type& a); // C++14328 unordered_multiset(size_type n, const hasher& hf, const allocator_type& a);
329 template <class InputIterator>329 template <class InputIterator>
330 unordered_multiset(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++14330 unordered_multiset(InputIterator f, InputIterator l, size_type n, const allocator_type& a);
331 template <class InputIterator>331 template <class InputIterator>
332 unordered_multiset(InputIterator f, InputIterator l, size_type n,332 unordered_multiset(InputIterator f, InputIterator l, size_type n,
333 const hasher& hf, const allocator_type& a); // C++14333 const hasher& hf, const allocator_type& a);
334 template<container-compatible-range<value_type> R>334 template<container-compatible-range<value_type> R>
335 unordered_multiset(from_range_t, R&& rg, size_type n, const allocator_type& a)335 unordered_multiset(from_range_t, R&& rg, size_type n, const allocator_type& a)
336 : unordered_multiset(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23336 : unordered_multiset(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { } // C++23
337 template<container-compatible-range<value_type> R>337 template<container-compatible-range<value_type> R>
338 unordered_multiset(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)338 unordered_multiset(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
339 : unordered_multiset(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23339 : unordered_multiset(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { } // C++23
340 unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14340 unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a);
341 unordered_multiset(initializer_list<value_type> il, size_type n,341 unordered_multiset(initializer_list<value_type> il, size_type n,
342 const hasher& hf, const allocator_type& a); // C++14342 const hasher& hf, const allocator_type& a);
343 ~unordered_multiset();343 ~unordered_multiset();
344 unordered_multiset& operator=(const unordered_multiset&);344 unordered_multiset& operator=(const unordered_multiset&);
345 unordered_multiset& operator=(unordered_multiset&&)345 unordered_multiset& operator=(unordered_multiset&&)
...@@ -634,12 +634,10 @@ public:...@@ -634,12 +634,10 @@ public:
634 _LIBCPP_HIDE_FROM_ABI unordered_set() _NOEXCEPT_(is_nothrow_default_constructible<__table>::value) {}634 _LIBCPP_HIDE_FROM_ABI unordered_set() _NOEXCEPT_(is_nothrow_default_constructible<__table>::value) {}
635 explicit _LIBCPP_HIDE_FROM_ABI635 explicit _LIBCPP_HIDE_FROM_ABI
636 unordered_set(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal());636 unordered_set(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
637# if _LIBCPP_STD_VER >= 14
638 inline _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const allocator_type& __a)637 inline _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const allocator_type& __a)
639 : unordered_set(__n, hasher(), key_equal(), __a) {}638 : unordered_set(__n, hasher(), key_equal(), __a) {}
640 inline _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf, const allocator_type& __a)639 inline _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf, const allocator_type& __a)
641 : unordered_set(__n, __hf, key_equal(), __a) {}640 : unordered_set(__n, __hf, key_equal(), __a) {}
642# endif
643 _LIBCPP_HIDE_FROM_ABI641 _LIBCPP_HIDE_FROM_ABI
644 unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a);642 unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a);
645 template <class _InputIterator>643 template <class _InputIterator>
...@@ -677,7 +675,6 @@ public:...@@ -677,7 +675,6 @@ public:
677 }675 }
678# endif676# endif
679677
680# if _LIBCPP_STD_VER >= 14
681 template <class _InputIterator>678 template <class _InputIterator>
682 inline _LIBCPP_HIDE_FROM_ABI679 inline _LIBCPP_HIDE_FROM_ABI
683 unordered_set(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)680 unordered_set(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)
...@@ -686,7 +683,6 @@ public:...@@ -686,7 +683,6 @@ public:
686 _LIBCPP_HIDE_FROM_ABI unordered_set(683 _LIBCPP_HIDE_FROM_ABI unordered_set(
687 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)684 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
688 : unordered_set(__first, __last, __n, __hf, key_equal(), __a) {}685 : unordered_set(__first, __last, __n, __hf, key_equal(), __a) {}
689# endif
690686
691# if _LIBCPP_STD_VER >= 23687# if _LIBCPP_STD_VER >= 23
692 template <_ContainerCompatibleRange<value_type> _Range>688 template <_ContainerCompatibleRange<value_type> _Range>
...@@ -717,14 +713,12 @@ public:...@@ -717,14 +713,12 @@ public:
717 const hasher& __hf,713 const hasher& __hf,
718 const key_equal& __eql,714 const key_equal& __eql,
719 const allocator_type& __a);715 const allocator_type& __a);
720# if _LIBCPP_STD_VER >= 14
721 inline _LIBCPP_HIDE_FROM_ABI716 inline _LIBCPP_HIDE_FROM_ABI
722 unordered_set(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)717 unordered_set(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
723 : unordered_set(__il, __n, hasher(), key_equal(), __a) {}718 : unordered_set(__il, __n, hasher(), key_equal(), __a) {}
724 inline _LIBCPP_HIDE_FROM_ABI719 inline _LIBCPP_HIDE_FROM_ABI
725 unordered_set(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)720 unordered_set(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
726 : unordered_set(__il, __n, __hf, key_equal(), __a) {}721 : unordered_set(__il, __n, __hf, key_equal(), __a) {}
727# endif
728# endif // _LIBCPP_CXX03_LANG722# endif // _LIBCPP_CXX03_LANG
729 _LIBCPP_HIDE_FROM_ABI ~unordered_set() {723 _LIBCPP_HIDE_FROM_ABI ~unordered_set() {
730 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");724 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
...@@ -844,11 +838,17 @@ public:...@@ -844,11 +838,17 @@ public:
844 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }838 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
845 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }839 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
846# if _LIBCPP_STD_VER >= 20840# if _LIBCPP_STD_VER >= 20
847 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>841 template <class _K2,
842 class _Hasher = hasher,
843 class _Comp = key_equal,
844 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
848 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {845 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
849 return __table_.find(__k);846 return __table_.find(__k);
850 }847 }
851 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>848 template <class _K2,
849 class _Hasher = hasher,
850 class _Comp = key_equal,
851 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
852 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {852 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
853 return __table_.find(__k);853 return __table_.find(__k);
854 }854 }
...@@ -858,7 +858,10 @@ public:...@@ -858,7 +858,10 @@ public:
858 return __table_.__count_unique(__k);858 return __table_.__count_unique(__k);
859 }859 }
860# if _LIBCPP_STD_VER >= 20860# if _LIBCPP_STD_VER >= 20
861 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>861 template <class _K2,
862 class _Hasher = hasher,
863 class _Comp = key_equal,
864 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
862 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {865 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
863 return __table_.__count_unique(__k);866 return __table_.__count_unique(__k);
864 }867 }
...@@ -867,7 +870,10 @@ public:...@@ -867,7 +870,10 @@ public:
867# if _LIBCPP_STD_VER >= 20870# if _LIBCPP_STD_VER >= 20
868 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }871 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
869872
870 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>873 template <class _K2,
874 class _Hasher = hasher,
875 class _Comp = key_equal,
876 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
871 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {877 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
872 return find(__k) != end();878 return find(__k) != end();
873 }879 }
...@@ -880,11 +886,17 @@ public:...@@ -880,11 +886,17 @@ public:
880 return __table_.__equal_range_unique(__k);886 return __table_.__equal_range_unique(__k);
881 }887 }
882# if _LIBCPP_STD_VER >= 20888# if _LIBCPP_STD_VER >= 20
883 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>889 template <class _K2,
890 class _Hasher = hasher,
891 class _Comp = key_equal,
892 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
884 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {893 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
885 return __table_.__equal_range_unique(__k);894 return __table_.__equal_range_unique(__k);
886 }895 }
887 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>896 template <class _K2,
897 class _Hasher = hasher,
898 class _Comp = key_equal,
899 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
888 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {900 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
889 return __table_.__equal_range_unique(__k);901 return __table_.__equal_range_unique(__k);
890 }902 }
...@@ -1232,12 +1244,10 @@ public:...@@ -1232,12 +1244,10 @@ public:
1232 unordered_multiset(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal());1244 unordered_multiset(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
1233 _LIBCPP_HIDE_FROM_ABI1245 _LIBCPP_HIDE_FROM_ABI
1234 unordered_multiset(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a);1246 unordered_multiset(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a);
1235# if _LIBCPP_STD_VER >= 14
1236 inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const allocator_type& __a)1247 inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const allocator_type& __a)
1237 : unordered_multiset(__n, hasher(), key_equal(), __a) {}1248 : unordered_multiset(__n, hasher(), key_equal(), __a) {}
1238 inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf, const allocator_type& __a)1249 inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf, const allocator_type& __a)
1239 : unordered_multiset(__n, __hf, key_equal(), __a) {}1250 : unordered_multiset(__n, __hf, key_equal(), __a) {}
1240# endif
1241 template <class _InputIterator>1251 template <class _InputIterator>
1242 _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last);1252 _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last);
1243 template <class _InputIterator>1253 template <class _InputIterator>
...@@ -1273,7 +1283,6 @@ public:...@@ -1273,7 +1283,6 @@ public:
1273 }1283 }
1274# endif1284# endif
12751285
1276# if _LIBCPP_STD_VER >= 14
1277 template <class _InputIterator>1286 template <class _InputIterator>
1278 inline _LIBCPP_HIDE_FROM_ABI1287 inline _LIBCPP_HIDE_FROM_ABI
1279 unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)1288 unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type& __a)
...@@ -1282,7 +1291,6 @@ public:...@@ -1282,7 +1291,6 @@ public:
1282 inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(1291 inline _LIBCPP_HIDE_FROM_ABI unordered_multiset(
1283 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)1292 _InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a)
1284 : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a) {}1293 : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a) {}
1285# endif
12861294
1287# if _LIBCPP_STD_VER >= 231295# if _LIBCPP_STD_VER >= 23
1288 template <_ContainerCompatibleRange<value_type> _Range>1296 template <_ContainerCompatibleRange<value_type> _Range>
...@@ -1313,14 +1321,12 @@ public:...@@ -1313,14 +1321,12 @@ public:
1313 const hasher& __hf,1321 const hasher& __hf,
1314 const key_equal& __eql,1322 const key_equal& __eql,
1315 const allocator_type& __a);1323 const allocator_type& __a);
1316# if _LIBCPP_STD_VER >= 14
1317 inline _LIBCPP_HIDE_FROM_ABI1324 inline _LIBCPP_HIDE_FROM_ABI
1318 unordered_multiset(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)1325 unordered_multiset(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
1319 : unordered_multiset(__il, __n, hasher(), key_equal(), __a) {}1326 : unordered_multiset(__il, __n, hasher(), key_equal(), __a) {}
1320 inline _LIBCPP_HIDE_FROM_ABI1327 inline _LIBCPP_HIDE_FROM_ABI
1321 unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)1328 unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
1322 : unordered_multiset(__il, __n, __hf, key_equal(), __a) {}1329 : unordered_multiset(__il, __n, __hf, key_equal(), __a) {}
1323# endif
1324# endif // _LIBCPP_CXX03_LANG1330# endif // _LIBCPP_CXX03_LANG
1325 _LIBCPP_HIDE_FROM_ABI ~unordered_multiset() {1331 _LIBCPP_HIDE_FROM_ABI ~unordered_multiset() {
1326 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");1332 static_assert(sizeof(std::__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), "");
...@@ -1443,11 +1449,17 @@ public:...@@ -1443,11 +1449,17 @@ public:
1443 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }1449 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
1444 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }1450 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
1445# if _LIBCPP_STD_VER >= 201451# if _LIBCPP_STD_VER >= 20
1446 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1452 template <class _K2,
1453 class _Hasher = hasher,
1454 class _Comp = key_equal,
1455 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1447 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {1456 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
1448 return __table_.find(__k);1457 return __table_.find(__k);
1449 }1458 }
1450 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1459 template <class _K2,
1460 class _Hasher = hasher,
1461 class _Comp = key_equal,
1462 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1451 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {1463 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
1452 return __table_.find(__k);1464 return __table_.find(__k);
1453 }1465 }
...@@ -1457,7 +1469,10 @@ public:...@@ -1457,7 +1469,10 @@ public:
1457 return __table_.__count_multi(__k);1469 return __table_.__count_multi(__k);
1458 }1470 }
1459# if _LIBCPP_STD_VER >= 201471# if _LIBCPP_STD_VER >= 20
1460 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1472 template <class _K2,
1473 class _Hasher = hasher,
1474 class _Comp = key_equal,
1475 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1461 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {1476 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
1462 return __table_.__count_multi(__k);1477 return __table_.__count_multi(__k);
1463 }1478 }
...@@ -1466,7 +1481,10 @@ public:...@@ -1466,7 +1481,10 @@ public:
1466# if _LIBCPP_STD_VER >= 201481# if _LIBCPP_STD_VER >= 20
1467 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }1482 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
14681483
1469 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1484 template <class _K2,
1485 class _Hasher = hasher,
1486 class _Comp = key_equal,
1487 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1470 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {1488 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
1471 return find(__k) != end();1489 return find(__k) != end();
1472 }1490 }
...@@ -1479,11 +1497,17 @@ public:...@@ -1479,11 +1497,17 @@ public:
1479 return __table_.__equal_range_multi(__k);1497 return __table_.__equal_range_multi(__k);
1480 }1498 }
1481# if _LIBCPP_STD_VER >= 201499# if _LIBCPP_STD_VER >= 20
1482 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1500 template <class _K2,
1501 class _Hasher = hasher,
1502 class _Comp = key_equal,
1503 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1483 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {1504 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
1484 return __table_.__equal_range_multi(__k);1505 return __table_.__equal_range_multi(__k);
1485 }1506 }
1486 template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>1507 template <class _K2,
1508 class _Hasher = hasher,
1509 class _Comp = key_equal,
1510 enable_if_t<__is_transparent_v<_Hasher> && __is_transparent_v<_Comp>>* = nullptr>
1487 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {1511 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
1488 return __table_.__equal_range_multi(__k);1512 return __table_.__equal_range_multi(__k);
1489 }1513 }
...@@ -1812,7 +1836,7 @@ _LIBCPP_END_NAMESPACE_STD...@@ -1812,7 +1836,7 @@ _LIBCPP_END_NAMESPACE_STD
18121836
1813_LIBCPP_POP_MACROS1837_LIBCPP_POP_MACROS
18141838
1815# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201839# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1816# include <cmath>1840# include <cmath>
1817# include <concepts>1841# include <concepts>
1818# include <cstdlib>1842# include <cstdlib>
lib/libcxx/include/utility+16-5
...@@ -195,6 +195,19 @@ template<class T1, class T2>...@@ -195,6 +195,19 @@ template<class T1, class T2>
195template<class T1, class T2>195template<class T1, class T2>
196 constexpr const T1&& get(const pair<T2, T1>&&) noexcept; // C++14196 constexpr const T1&& get(const pair<T2, T1>&&) noexcept; // C++14
197197
198// [const.wrap.class], class template constant_wrapper
199template<auto X, class = decltype(X)>
200 struct constant_wrapper; // since C++26
201
202template<class T>
203 concept constexpr-param = // exposition only, since C++26
204 requires { typename constant_wrapper<T::value>; };
205
206struct cw-operators; // exposition only, since C++26
207
208template<auto X>
209 constexpr auto cw = constant_wrapper<X>{}; // since C++26
210
198// C++14211// C++14
199212
200template<class T, T... I>213template<class T, T... I>
...@@ -292,6 +305,7 @@ template <class T>...@@ -292,6 +305,7 @@ template <class T>
292# endif305# endif
293306
294# if _LIBCPP_STD_VER >= 26307# if _LIBCPP_STD_VER >= 26
308# include <__utility/constant_wrapper.h>
295# include <__variant/monostate.h>309# include <__variant/monostate.h>
296# endif310# endif
297311
...@@ -315,14 +329,11 @@ template <class T>...@@ -315,14 +329,11 @@ template <class T>
315# pragma GCC system_header329# pragma GCC system_header
316# endif330# endif
317331
318# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20332# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
319# include <limits>
320# endif
321
322# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
323# include <cstddef>333# include <cstddef>
324# include <cstdlib>334# include <cstdlib>
325# include <iosfwd>335# include <iosfwd>
336# include <limits>
326# include <type_traits>337# include <type_traits>
327# endif338# endif
328#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)339#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/valarray+3-1
...@@ -381,6 +381,7 @@ _LIBCPP_PUSH_MACROS...@@ -381,6 +381,7 @@ _LIBCPP_PUSH_MACROS
381# include <__undef_macros>381# include <__undef_macros>
382382
383_LIBCPP_BEGIN_NAMESPACE_STD383_LIBCPP_BEGIN_NAMESPACE_STD
384_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
384385
385template <class _Tp>386template <class _Tp>
386class valarray;387class valarray;
...@@ -3300,11 +3301,12 @@ template <class _Tp>...@@ -3300,11 +3301,12 @@ template <class _Tp>
3300 return __v.__end_;3301 return __v.__end_;
3301}3302}
33023303
3304_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
3303_LIBCPP_END_NAMESPACE_STD3305_LIBCPP_END_NAMESPACE_STD
33043306
3305_LIBCPP_POP_MACROS3307_LIBCPP_POP_MACROS
33063308
3307# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 203309# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
3308# include <algorithm>3310# include <algorithm>
3309# include <concepts>3311# include <concepts>
3310# include <cstdlib>3312# include <cstdlib>
lib/libcxx/include/variant+39-19
...@@ -235,7 +235,6 @@ namespace std {...@@ -235,7 +235,6 @@ namespace std {
235# include <__type_traits/conditional.h>235# include <__type_traits/conditional.h>
236# include <__type_traits/conjunction.h>236# include <__type_traits/conjunction.h>
237# include <__type_traits/decay.h>237# include <__type_traits/decay.h>
238# include <__type_traits/dependent_type.h>
239# include <__type_traits/enable_if.h>238# include <__type_traits/enable_if.h>
240# include <__type_traits/invoke.h>239# include <__type_traits/invoke.h>
241# include <__type_traits/is_array.h>240# include <__type_traits/is_array.h>
...@@ -285,18 +284,33 @@ _LIBCPP_PUSH_MACROS...@@ -285,18 +284,33 @@ _LIBCPP_PUSH_MACROS
285# include <__undef_macros>284# include <__undef_macros>
286285
287_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD286_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
287_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
288288
289class _LIBCPP_EXPORTED_FROM_ABI bad_variant_access : public exception {289class _LIBCPP_EXPORTED_FROM_ABI bad_variant_access : public exception {
290public:290public:
291 [[__nodiscard__]] const char* what() const _NOEXCEPT override;291 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
292};292};
293293
294_LIBCPP_END_UNVERSIONED_NAMESPACE_STD294class _LIBCPP_EXPORTED_FROM_ABI __bad_variant_access_with_msg : public bad_variant_access {
295public:
296 _LIBCPP_HIDE_FROM_ABI explicit __bad_variant_access_with_msg(const char* __msg) _NOEXCEPT : __msg_(__msg) {}
297# if _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS_WITH_MSG_KEY_FUNCTION
298 [[__nodiscard__]] const char* what() const _NOEXCEPT override;
299# else
300 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const _NOEXCEPT override { return __msg_; }
301# endif
295302
296_LIBCPP_BEGIN_NAMESPACE_STD303private:
304 const char* __msg_;
305};
306
307_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
308_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
297309
298# if _LIBCPP_STD_VER >= 17310# if _LIBCPP_STD_VER >= 17
299311
312_LIBCPP_BEGIN_NAMESPACE_STD
313
300// Light N-dimensional array of function pointers. Used in place of std::array to avoid314// Light N-dimensional array of function pointers. Used in place of std::array to avoid
301// adding a dependency.315// adding a dependency.
302template <class _Tp, size_t _Size>316template <class _Tp, size_t _Size>
...@@ -307,11 +321,11 @@ struct __farray {...@@ -307,11 +321,11 @@ struct __farray {
307 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __n) const noexcept { return __buf_[__n]; }321 _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __n) const noexcept { return __buf_[__n]; }
308};322};
309323
310[[noreturn]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_variant_access() {324[[noreturn]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_variant_access(const char* __msg) {
311# if _LIBCPP_HAS_EXCEPTIONS325# if _LIBCPP_HAS_EXCEPTIONS
312 throw bad_variant_access();326 throw __bad_variant_access_with_msg(__msg);
313# else327# else
314 _LIBCPP_VERBOSE_ABORT("bad_variant_access was thrown in -fno-exceptions mode");328 _LIBCPP_VERBOSE_ABORT("bad_variant_access was thrown in -fno-exceptions mode: %s", __msg);
315# endif329# endif
316}330}
317331
...@@ -539,9 +553,12 @@ private:...@@ -539,9 +553,12 @@ private:
539 return __dispatcher<_Is...>::template __dispatch<_Fp, _Vs...>;553 return __dispatcher<_Is...>::template __dispatch<_Fp, _Vs...>;
540 }554 }
541555
556 template <class, class _Tp>
557 using __expander _LIBCPP_NODEBUG = _Tp;
558
542 template <size_t _Ip, class _Fp, class... _Vs>559 template <size_t _Ip, class _Fp, class... _Vs>
543 _LIBCPP_HIDE_FROM_ABI static constexpr auto __make_fdiagonal_impl() {560 _LIBCPP_HIDE_FROM_ABI static constexpr auto __make_fdiagonal_impl() {
544 return __make_dispatch<_Fp, _Vs...>(index_sequence<((void)__type_identity<_Vs>{}, _Ip)...>{});561 return __make_dispatch<_Fp, _Vs...>(index_sequence<static_cast<__expander<_Vs, size_t>>(_Ip)...>{});
545 }562 }
546563
547 template <class _Fp, class... _Vs, size_t... _Is>564 template <class _Fp, class... _Vs, size_t... _Is>
...@@ -614,7 +631,8 @@ private:...@@ -614,7 +631,8 @@ private:
614 template <class _Visitor>631 template <class _Visitor>
615 struct __value_visitor {632 struct __value_visitor {
616 template <class... _Alts>633 template <class... _Alts>
617 _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Alts&&... __alts) const {634 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Alts&&... __alts) const
635 -> invoke_result_t<_Visitor&&, decltype((std::forward<_Alts>(__alts).__value))...> {
618 __std_visit_exhaustive_visitor_check< _Visitor, decltype((std::forward<_Alts>(__alts).__value))...>();636 __std_visit_exhaustive_visitor_check< _Visitor, decltype((std::forward<_Alts>(__alts).__value))...>();
619 return std::__invoke(std::forward<_Visitor>(__visitor), std::forward<_Alts>(__alts).__value...);637 return std::__invoke(std::forward<_Visitor>(__visitor), std::forward<_Alts>(__alts).__value...);
620 }638 }
...@@ -1164,8 +1182,7 @@ public:...@@ -1164,8 +1182,7 @@ public:
1164 using __trivially_relocatable _LIBCPP_NODEBUG =1182 using __trivially_relocatable _LIBCPP_NODEBUG =
1165 conditional_t<_And<__libcpp_is_trivially_relocatable<_Types>...>::value, variant, void>;1183 conditional_t<_And<__libcpp_is_trivially_relocatable<_Types>...>::value, variant, void>;
11661184
1167 template <bool _Dummy = true,1185 template <class _FirstType = __first_type, enable_if_t<is_default_constructible_v<_FirstType>, int> = 0>
1168 enable_if_t<__dependent_type<is_default_constructible<__first_type>, _Dummy>::value, int> = 0>
1169 _LIBCPP_HIDE_FROM_ABI constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>)1186 _LIBCPP_HIDE_FROM_ABI constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>)
1170 : __impl_(in_place_index<0>) {}1187 : __impl_(in_place_index<0>) {}
11711188
...@@ -1280,10 +1297,10 @@ public:...@@ -1280,10 +1297,10 @@ public:
12801297
1281 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t index() const noexcept { return __impl_.index(); }1298 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t index() const noexcept { return __impl_.index(); }
12821299
1283 template < bool _Dummy = true,1300 template <
1284 enable_if_t< __all<(__dependent_type<is_move_constructible<_Types>, _Dummy>::value &&1301 bool _Dummy = true,
1285 __dependent_type<is_swappable<_Types>, _Dummy>::value)...>::value,1302 enable_if_t<_And<_And<bool_constant<_Dummy>, is_move_constructible<_Types>, is_swappable<_Types>>...>::value,
1286 int> = 0>1303 int> = 0>
1287 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(variant& __that) noexcept(1304 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(variant& __that) noexcept(
1288 __all<(is_nothrow_move_constructible_v<_Types> && is_nothrow_swappable_v<_Types>)...>::value) {1305 __all<(is_nothrow_move_constructible_v<_Types> && is_nothrow_swappable_v<_Types>)...>::value) {
1289 __impl_.__swap(__that.__impl_);1306 __impl_.__swap(__that.__impl_);
...@@ -1329,7 +1346,9 @@ template <size_t _Ip, class _Vp>...@@ -1329,7 +1346,9 @@ template <size_t _Ip, class _Vp>
1329_LIBCPP_HIDE_FROM_ABI constexpr auto&& __generic_get(_Vp&& __v) {1346_LIBCPP_HIDE_FROM_ABI constexpr auto&& __generic_get(_Vp&& __v) {
1330 using __variant_detail::__access::__variant;1347 using __variant_detail::__access::__variant;
1331 if (!std::__holds_alternative<_Ip>(__v)) {1348 if (!std::__holds_alternative<_Ip>(__v)) {
1332 std::__throw_bad_variant_access();1349 if (__v.valueless_by_exception())
1350 std::__throw_bad_variant_access("std::get: variant is valueless");
1351 std::__throw_bad_variant_access("std::get: wrong alternative for variant");
1333 }1352 }
1334 return __variant::__get_alt<_Ip>(std::forward<_Vp>(__v)).__value;1353 return __variant::__get_alt<_Ip>(std::forward<_Vp>(__v)).__value;
1335}1354}
...@@ -1566,7 +1585,7 @@ template <class... _Vs>...@@ -1566,7 +1585,7 @@ template <class... _Vs>
1566_LIBCPP_HIDE_FROM_ABI constexpr void __throw_if_valueless(_Vs&&... __vs) {1585_LIBCPP_HIDE_FROM_ABI constexpr void __throw_if_valueless(_Vs&&... __vs) {
1567 const bool __valueless = (... || std::__as_variant(__vs).valueless_by_exception());1586 const bool __valueless = (... || std::__as_variant(__vs).valueless_by_exception());
1568 if (__valueless) {1587 if (__valueless) {
1569 std::__throw_bad_variant_access();1588 std::__throw_bad_variant_access("std::visit: variant is valueless");
1570 }1589 }
1571}1590}
15721591
...@@ -1574,6 +1593,7 @@ template < class _Visitor, class... _Vs, typename>...@@ -1574,6 +1593,7 @@ template < class _Visitor, class... _Vs, typename>
1574_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {1593_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
1575 using __variant_detail::__visitation::__variant;1594 using __variant_detail::__visitation::__variant;
1576 std::__throw_if_valueless(std::forward<_Vs>(__vs)...);1595 std::__throw_if_valueless(std::forward<_Vs>(__vs)...);
1596 // NOLINTNEXTLINE(bugprone-use-after-move) __throw_if_valueless doesn't actually forward the variants
1577 return __variant::__visit_value(std::forward<_Visitor>(__visitor), std::forward<_Vs>(__vs)...);1597 return __variant::__visit_value(std::forward<_Visitor>(__visitor), std::forward<_Vs>(__vs)...);
1578}1598}
15791599
...@@ -1635,13 +1655,13 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto&& __unchecked_get(variant<_Types...>& __v)...@@ -1635,13 +1655,13 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto&& __unchecked_get(variant<_Types...>& __v)
1635 return std::__unchecked_get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);1655 return std::__unchecked_get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
1636}1656}
16371657
1638# endif // _LIBCPP_STD_VER >= 17
1639
1640_LIBCPP_END_NAMESPACE_STD1658_LIBCPP_END_NAMESPACE_STD
16411659
1660# endif // _LIBCPP_STD_VER >= 17
1661
1642_LIBCPP_POP_MACROS1662_LIBCPP_POP_MACROS
16431663
1644# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 201664# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
1645# include <cstddef>1665# include <cstddef>
1646# include <exception>1666# include <exception>
1647# include <tuple>1667# include <tuple>
lib/libcxx/include/vector+12-8
...@@ -39,7 +39,7 @@ public:...@@ -39,7 +39,7 @@ public:
39 noexcept(is_nothrow_default_constructible<allocator_type>::value);39 noexcept(is_nothrow_default_constructible<allocator_type>::value);
40 explicit vector(const allocator_type&);40 explicit vector(const allocator_type&);
41 explicit vector(size_type n);41 explicit vector(size_type n);
42 explicit vector(size_type n, const allocator_type&); // C++1442 explicit vector(size_type n, const allocator_type&);
43 vector(size_type n, const value_type& value, const allocator_type& = allocator_type());43 vector(size_type n, const value_type& value, const allocator_type& = allocator_type());
44 template <class InputIterator>44 template <class InputIterator>
45 vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());45 vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
...@@ -171,7 +171,7 @@ public:...@@ -171,7 +171,7 @@ public:
171 vector()171 vector()
172 noexcept(is_nothrow_default_constructible<allocator_type>::value);172 noexcept(is_nothrow_default_constructible<allocator_type>::value);
173 explicit vector(const allocator_type&) noexcept;173 explicit vector(const allocator_type&) noexcept;
174 explicit vector(size_type n, const allocator_type& a = allocator_type()); // C++14174 explicit vector(size_type n, const allocator_type& a = allocator_type());
175 vector(size_type n, const value_type& value, const allocator_type& = allocator_type());175 vector(size_type n, const value_type& value, const allocator_type& = allocator_type());
176 template <class InputIterator>176 template <class InputIterator>
177 vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());177 vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
...@@ -348,16 +348,21 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++...@@ -348,16 +348,21 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
348# pragma GCC system_header348# pragma GCC system_header
349# endif349# endif
350350
351# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20351# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 23
352# include <algorithm>
353# include <array>352# include <array>
354# include <atomic>
355# include <cctype>
356# include <cerrno>353# include <cerrno>
357# include <clocale>354# include <clocale>
355# include <cstddef>
356# include <cstdlib>
357# include <typeinfo>
358# endif
359
360# if defined(_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23) && _LIBCPP_STD_VER <= 20
361# include <algorithm>
362# include <atomic>
363# include <cctype>
358# include <concepts>364# include <concepts>
359# include <cstdint>365# include <cstdint>
360# include <cstdlib>
361# include <iosfwd>366# include <iosfwd>
362# if _LIBCPP_HAS_LOCALIZATION367# if _LIBCPP_HAS_LOCALIZATION
363# include <locale>368# include <locale>
...@@ -367,7 +372,6 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++...@@ -367,7 +372,6 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
367# include <string_view>372# include <string_view>
368# include <tuple>373# include <tuple>
369# include <type_traits>374# include <type_traits>
370# include <typeinfo>
371# include <utility>375# include <utility>
372# endif376# endif
373#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)377#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
lib/libcxx/include/version+27-11
...@@ -37,7 +37,7 @@ __cpp_lib_atomic_float 201711L <atomic>...@@ -37,7 +37,7 @@ __cpp_lib_atomic_float 201711L <atomic>
37__cpp_lib_atomic_is_always_lock_free 201603L <atomic>37__cpp_lib_atomic_is_always_lock_free 201603L <atomic>
38__cpp_lib_atomic_lock_free_type_aliases 201907L <atomic>38__cpp_lib_atomic_lock_free_type_aliases 201907L <atomic>
39__cpp_lib_atomic_min_max 202403L <atomic>39__cpp_lib_atomic_min_max 202403L <atomic>
40__cpp_lib_atomic_ref 202411L <atomic>40__cpp_lib_atomic_ref 202603L <atomic>
41 201806L // C++2041 201806L // C++20
42__cpp_lib_atomic_shared_ptr 201711L <atomic>42__cpp_lib_atomic_shared_ptr 201711L <atomic>
43__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>43__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>
...@@ -64,6 +64,7 @@ __cpp_lib_common_reference 202302L <type_traits>...@@ -64,6 +64,7 @@ __cpp_lib_common_reference 202302L <type_traits>
64__cpp_lib_common_reference_wrapper 202302L <functional>64__cpp_lib_common_reference_wrapper 202302L <functional>
65__cpp_lib_complex_udls 201309L <complex>65__cpp_lib_complex_udls 201309L <complex>
66__cpp_lib_concepts 202207L <concepts>66__cpp_lib_concepts 202207L <concepts>
67__cpp_lib_constant_wrapper 202606L <utility>
67__cpp_lib_constexpr_algorithms 202306L <algorithm> <utility>68__cpp_lib_constexpr_algorithms 202306L <algorithm> <utility>
68 201806L // C++2069 201806L // C++20
69__cpp_lib_constexpr_bitset 202207L <bitset>70__cpp_lib_constexpr_bitset 202207L <bitset>
...@@ -77,11 +78,13 @@ __cpp_lib_constexpr_forward_list 202502L <forward_list>...@@ -77,11 +78,13 @@ __cpp_lib_constexpr_forward_list 202502L <forward_list>
77__cpp_lib_constexpr_functional 201907L <functional>78__cpp_lib_constexpr_functional 201907L <functional>
78__cpp_lib_constexpr_iterator 201811L <iterator>79__cpp_lib_constexpr_iterator 201811L <iterator>
79__cpp_lib_constexpr_list 202502L <list>80__cpp_lib_constexpr_list 202502L <list>
81__cpp_lib_constexpr_map 202502L <map>
80__cpp_lib_constexpr_memory 202202L <memory>82__cpp_lib_constexpr_memory 202202L <memory>
81 201811L // C++2083 201811L // C++20
82__cpp_lib_constexpr_new 202406L <new>84__cpp_lib_constexpr_new 202406L <new>
83__cpp_lib_constexpr_numeric 201911L <numeric>85__cpp_lib_constexpr_numeric 201911L <numeric>
84__cpp_lib_constexpr_queue 202502L <queue>86__cpp_lib_constexpr_queue 202502L <queue>
87__cpp_lib_constexpr_set 202502L <set>
85__cpp_lib_constexpr_string 201907L <string>88__cpp_lib_constexpr_string 201907L <string>
86__cpp_lib_constexpr_string_view 201811L <string_view>89__cpp_lib_constexpr_string_view 201811L <string_view>
87__cpp_lib_constexpr_tuple 201811L <tuple>90__cpp_lib_constexpr_tuple 201811L <tuple>
...@@ -209,17 +212,21 @@ __cpp_lib_ranges_chunk 202202L <ranges>...@@ -209,17 +212,21 @@ __cpp_lib_ranges_chunk 202202L <ranges>
209__cpp_lib_ranges_chunk_by 202202L <ranges>212__cpp_lib_ranges_chunk_by 202202L <ranges>
210__cpp_lib_ranges_concat 202403L <ranges>213__cpp_lib_ranges_concat 202403L <ranges>
211__cpp_lib_ranges_contains 202207L <algorithm>214__cpp_lib_ranges_contains 202207L <algorithm>
215__cpp_lib_ranges_enumerate 202302L <ranges>
212__cpp_lib_ranges_find_last 202207L <algorithm>216__cpp_lib_ranges_find_last 202207L <algorithm>
217__cpp_lib_ranges_fold 202207L <algorithm>
213__cpp_lib_ranges_indices 202506L <ranges>218__cpp_lib_ranges_indices 202506L <ranges>
214__cpp_lib_ranges_iota 202202L <numeric>219__cpp_lib_ranges_iota 202202L <numeric>
215__cpp_lib_ranges_join_with 202202L <ranges>220__cpp_lib_ranges_join_with 202202L <ranges>
216__cpp_lib_ranges_repeat 202207L <ranges>221__cpp_lib_ranges_repeat 202207L <ranges>
217__cpp_lib_ranges_slide 202202L <ranges>222__cpp_lib_ranges_slide 202202L <ranges>
218__cpp_lib_ranges_starts_ends_with 202106L <algorithm>223__cpp_lib_ranges_starts_ends_with 202106L <algorithm>
224__cpp_lib_ranges_stride 202207L <ranges>
219__cpp_lib_ranges_to_container 202202L <ranges>225__cpp_lib_ranges_to_container 202202L <ranges>
220__cpp_lib_ranges_zip 202110L <ranges> <tuple> <utility>226__cpp_lib_ranges_zip 202110L <ranges> <tuple> <utility>
221__cpp_lib_ratio 202306L <ratio>227__cpp_lib_ratio 202306L <ratio>
222__cpp_lib_raw_memory_algorithms 201606L <memory>228__cpp_lib_raw_memory_algorithms 202411L <memory>
229 201606L // C++17
223__cpp_lib_rcu 202306L <rcu>230__cpp_lib_rcu 202306L <rcu>
224__cpp_lib_reference_from_temporary 202202L <type_traits>231__cpp_lib_reference_from_temporary 202202L <type_traits>
225__cpp_lib_reference_wrapper 202403L <functional>232__cpp_lib_reference_wrapper 202403L <functional>
...@@ -227,7 +234,7 @@ __cpp_lib_remove_cvref 201711L <type_traits>...@@ -227,7 +234,7 @@ __cpp_lib_remove_cvref 201711L <type_traits>
227__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>234__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
228__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>235__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>
229__cpp_lib_sample 201603L <algorithm>236__cpp_lib_sample 201603L <algorithm>
230__cpp_lib_saturation_arithmetic 202311L <numeric>237__cpp_lib_saturation_arithmetic 202603L <numeric>
231__cpp_lib_scoped_lock 201703L <mutex>238__cpp_lib_scoped_lock 201703L <mutex>
232__cpp_lib_semaphore 201907L <semaphore>239__cpp_lib_semaphore 201907L <semaphore>
233__cpp_lib_senders 202406L <execution>240__cpp_lib_senders 202406L <execution>
...@@ -236,13 +243,13 @@ __cpp_lib_shared_ptr_arrays 201707L <memory>...@@ -236,13 +243,13 @@ __cpp_lib_shared_ptr_arrays 201707L <memory>
236 201611L // C++17243 201611L // C++17
237__cpp_lib_shared_ptr_weak_type 201606L <memory>244__cpp_lib_shared_ptr_weak_type 201606L <memory>
238__cpp_lib_shared_timed_mutex 201402L <shared_mutex>245__cpp_lib_shared_timed_mutex 201402L <shared_mutex>
239__cpp_lib_shift 201806L <algorithm>246__cpp_lib_shift 202202L <algorithm>
247 201806L // C++20
240__cpp_lib_smart_ptr_for_overwrite 202002L <memory>248__cpp_lib_smart_ptr_for_overwrite 202002L <memory>
241__cpp_lib_smart_ptr_owner_equality 202306L <memory>249__cpp_lib_smart_ptr_owner_equality 202306L <memory>
242__cpp_lib_source_location 201907L <source_location>250__cpp_lib_source_location 201907L <source_location>
243__cpp_lib_span 202002L <span>251__cpp_lib_span 202002L <span>
244__cpp_lib_span_at 202311L <span>252__cpp_lib_span_at 202311L <span>
245__cpp_lib_span_initializer_list 202311L <span>
246__cpp_lib_spanstream 202106L <spanstream>253__cpp_lib_spanstream 202106L <spanstream>
247__cpp_lib_ssize 201902L <iterator>254__cpp_lib_ssize 201902L <iterator>
248__cpp_lib_sstream_from_string_view 202306L <sstream>255__cpp_lib_sstream_from_string_view 202306L <sstream>
...@@ -423,7 +430,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -423,7 +430,7 @@ __cpp_lib_void_t 201411L <type_traits>
423# define __cpp_lib_constexpr_utility 201811L430# define __cpp_lib_constexpr_utility 201811L
424# define __cpp_lib_constexpr_vector 201907L431# define __cpp_lib_constexpr_vector 201907L
425# define __cpp_lib_coroutine 201902L432# define __cpp_lib_coroutine 201902L
426# if _LIBCPP_STD_VER >= 20 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L433# if defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
427# define __cpp_lib_destroying_delete 201806L434# define __cpp_lib_destroying_delete 201806L
428# endif435# endif
429# define __cpp_lib_endian 201907L436# define __cpp_lib_endian 201907L
...@@ -524,15 +531,20 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -524,15 +531,20 @@ __cpp_lib_void_t 201411L <type_traits>
524// # define __cpp_lib_ranges_chunk 202202L531// # define __cpp_lib_ranges_chunk 202202L
525# define __cpp_lib_ranges_chunk_by 202202L532# define __cpp_lib_ranges_chunk_by 202202L
526# define __cpp_lib_ranges_contains 202207L533# define __cpp_lib_ranges_contains 202207L
534# define __cpp_lib_ranges_enumerate 202302L
527# define __cpp_lib_ranges_find_last 202207L535# define __cpp_lib_ranges_find_last 202207L
536# define __cpp_lib_ranges_fold 202207L
528# define __cpp_lib_ranges_iota 202202L537# define __cpp_lib_ranges_iota 202202L
529# define __cpp_lib_ranges_join_with 202202L538# define __cpp_lib_ranges_join_with 202202L
530# define __cpp_lib_ranges_repeat 202207L539# define __cpp_lib_ranges_repeat 202207L
531// # define __cpp_lib_ranges_slide 202202L540// # define __cpp_lib_ranges_slide 202202L
532# define __cpp_lib_ranges_starts_ends_with 202106L541# define __cpp_lib_ranges_starts_ends_with 202106L
542# define __cpp_lib_ranges_stride 202207L
533# define __cpp_lib_ranges_to_container 202202L543# define __cpp_lib_ranges_to_container 202202L
534# define __cpp_lib_ranges_zip 202110L544# define __cpp_lib_ranges_zip 202110L
535// # define __cpp_lib_reference_from_temporary 202202L545// # define __cpp_lib_reference_from_temporary 202202L
546# undef __cpp_lib_shift
547# define __cpp_lib_shift 202202L
536// # define __cpp_lib_spanstream 202106L548// # define __cpp_lib_spanstream 202106L
537// # define __cpp_lib_stacktrace 202011L549// # define __cpp_lib_stacktrace 202011L
538# define __cpp_lib_stdatomic_h 202011L550# define __cpp_lib_stdatomic_h 202011L
...@@ -548,20 +560,23 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -548,20 +560,23 @@ __cpp_lib_void_t 201411L <type_traits>
548// # define __cpp_lib_associative_heterogeneous_insertion 202306L560// # define __cpp_lib_associative_heterogeneous_insertion 202306L
549// # define __cpp_lib_atomic_min_max 202403L561// # define __cpp_lib_atomic_min_max 202403L
550# undef __cpp_lib_atomic_ref562# undef __cpp_lib_atomic_ref
551# define __cpp_lib_atomic_ref 202411L563# define __cpp_lib_atomic_ref 202603L
552# undef __cpp_lib_bind_front564# undef __cpp_lib_bind_front
553# define __cpp_lib_bind_front 202306L565# define __cpp_lib_bind_front 202306L
554# define __cpp_lib_bitset 202306L566# define __cpp_lib_bitset 202306L
567# define __cpp_lib_constant_wrapper 202606L
555# undef __cpp_lib_constexpr_algorithms568# undef __cpp_lib_constexpr_algorithms
556# define __cpp_lib_constexpr_algorithms 202306L569# define __cpp_lib_constexpr_algorithms 202306L
557# define __cpp_lib_constexpr_flat_map 202502L570# define __cpp_lib_constexpr_flat_map 202502L
558# define __cpp_lib_constexpr_flat_set 202502L571# define __cpp_lib_constexpr_flat_set 202502L
559# define __cpp_lib_constexpr_forward_list 202502L572# define __cpp_lib_constexpr_forward_list 202502L
560# define __cpp_lib_constexpr_list 202502L573# define __cpp_lib_constexpr_list 202502L
574# define __cpp_lib_constexpr_map 202502L
561# if !defined(_LIBCPP_ABI_VCRUNTIME)575# if !defined(_LIBCPP_ABI_VCRUNTIME)
562# define __cpp_lib_constexpr_new 202406L576# define __cpp_lib_constexpr_new 202406L
563# endif577# endif
564# define __cpp_lib_constexpr_queue 202502L578# define __cpp_lib_constexpr_queue 202502L
579# define __cpp_lib_constexpr_set 202502L
565# define __cpp_lib_constrained_equality 202411L580# define __cpp_lib_constrained_equality 202411L
566// # define __cpp_lib_copyable_function 202306L581// # define __cpp_lib_copyable_function 202306L
567// # define __cpp_lib_debugging 202311L582// # define __cpp_lib_debugging 202311L
...@@ -604,22 +619,23 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -604,22 +619,23 @@ __cpp_lib_void_t 201411L <type_traits>
604# undef __cpp_lib_out_ptr619# undef __cpp_lib_out_ptr
605# define __cpp_lib_out_ptr 202311L620# define __cpp_lib_out_ptr 202311L
606// # define __cpp_lib_philox_engine 202406L621// # define __cpp_lib_philox_engine 202406L
607// # define __cpp_lib_ranges_concat 202403L622# define __cpp_lib_ranges_concat 202403L
608# define __cpp_lib_ranges_indices 202506L623# define __cpp_lib_ranges_indices 202506L
609# define __cpp_lib_ratio 202306L624# define __cpp_lib_ratio 202306L
625# undef __cpp_lib_raw_memory_algorithms
626# define __cpp_lib_raw_memory_algorithms 202411L
610// # define __cpp_lib_rcu 202306L627// # define __cpp_lib_rcu 202306L
611# define __cpp_lib_reference_wrapper 202403L628# define __cpp_lib_reference_wrapper 202403L
612# define __cpp_lib_saturation_arithmetic 202311L629# define __cpp_lib_saturation_arithmetic 202603L
613// # define __cpp_lib_senders 202406L630// # define __cpp_lib_senders 202406L
614// # define __cpp_lib_smart_ptr_owner_equality 202306L631// # define __cpp_lib_smart_ptr_owner_equality 202306L
615# define __cpp_lib_span_at 202311L632# define __cpp_lib_span_at 202311L
616# define __cpp_lib_span_initializer_list 202311L
617# define __cpp_lib_sstream_from_string_view 202306L633# define __cpp_lib_sstream_from_string_view 202306L
618# define __cpp_lib_string_subview 202506L634# define __cpp_lib_string_subview 202506L
619# undef __cpp_lib_string_view635# undef __cpp_lib_string_view
620# define __cpp_lib_string_view 202403L636# define __cpp_lib_string_view 202403L
621// # define __cpp_lib_submdspan 202306L637// # define __cpp_lib_submdspan 202306L
622// # define __cpp_lib_text_encoding 202306L638# define __cpp_lib_text_encoding 202306L
623# undef __cpp_lib_to_chars639# undef __cpp_lib_to_chars
624// # define __cpp_lib_to_chars 202306L640// # define __cpp_lib_to_chars 202306L
625// # define __cpp_lib_to_string 202306L641// # define __cpp_lib_to_string 202306L
lib/libcxx/include/wchar.h+2
...@@ -133,6 +133,8 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,...@@ -133,6 +133,8 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
133# if defined(_CRT_CONST_CORRECT_OVERLOADS)133# if defined(_CRT_CONST_CORRECT_OVERLOADS)
134# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1134# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
135# endif135# endif
136# elif _LIBCPP_LIBC_LLVM_LIBC
137# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
136# endif138# endif
137139
138# if _LIBCPP_HAS_WIDE_CHARACTERS140# if _LIBCPP_HAS_WIDE_CHARACTERS
lib/libcxx/libc/hdr/errno_macros.h+1-1
...@@ -25,6 +25,6 @@...@@ -25,6 +25,6 @@
2525
26#include <errno.h>26#include <errno.h>
2727
28#endif // LLVM_LIBC_FULL_BUILD28#endif // LIBC_FULL_BUILD
2929
30#endif // LLVM_LIBC_HDR_ERRNO_MACROS_H30#endif // LLVM_LIBC_HDR_ERRNO_MACROS_H
lib/libcxx/libc/hdr/fenv_macros.h+1-1
...@@ -56,6 +56,6 @@...@@ -56,6 +56,6 @@
56#define FE_UPWARD 0x80056#define FE_UPWARD 0x800
57#endif // FE_UPWARD57#endif // FE_UPWARD
5858
59#endif // LLVM_LIBC_FULL_BUILD59#endif // LIBC_FULL_BUILD
6060
61#endif // LLVM_LIBC_HDR_FENV_MACROS_H61#endif // LLVM_LIBC_HDR_FENV_MACROS_H
lib/libcxx/libc/hdr/float_macros.h+1-1
...@@ -17,6 +17,6 @@...@@ -17,6 +17,6 @@
1717
18#include <float.h>18#include <float.h>
1919
20#endif // LLVM_LIBC_FULL_BUILD20#endif // LIBC_FULL_BUILD
2121
22#endif // LLVM_LIBC_HDR_FLOAT_MACROS_H22#endif // LLVM_LIBC_HDR_FLOAT_MACROS_H
lib/libcxx/libc/hdr/limits_macros.h+1-1
...@@ -17,6 +17,6 @@...@@ -17,6 +17,6 @@
1717
18#include <limits.h>18#include <limits.h>
1919
20#endif // LLVM_LIBC_FULL_BUILD20#endif // LIBC_FULL_BUILD
2121
22#endif // LLVM_LIBC_HDR_LIMITS_MACROS_H22#endif // LLVM_LIBC_HDR_LIMITS_MACROS_H
lib/libcxx/libc/hdr/types/size_t.h created+23
...@@ -0,0 +1,23 @@
1//===-- Proxy for size_t --------------------------------------------------===//
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#ifndef LLVM_LIBC_HDR_TYPES_SIZE_T_H
9#define LLVM_LIBC_HDR_TYPES_SIZE_T_H
10
11#ifdef LIBC_FULL_BUILD
12
13#include "include/llvm-libc-types/size_t.h"
14
15#else
16
17#define __need_size_t
18#include <stddef.h>
19#undef __need_size_t
20
21#endif // LIBC_FULL_BUILD
22
23#endif // LLVM_LIBC_HDR_TYPES_SIZE_T_H
lib/libcxx/libc/hdr/types/wchar_t.h+1-1
...@@ -18,6 +18,6 @@...@@ -18,6 +18,6 @@
1818
19#include "hdr/wchar_overlay.h"19#include "hdr/wchar_overlay.h"
2020
21#endif // LLVM_LIBC_FULL_BUILD21#endif // LIBC_FULL_BUILD
2222
23#endif // LLVM_LIBC_HDR_TYPES_WCHAR_T_H23#endif // LLVM_LIBC_HDR_TYPES_WCHAR_T_H
lib/libcxx/libc/hdr/types/wint_t.h created+23
...@@ -0,0 +1,23 @@
1//===-- Definition of wint_t.h --------------------------------------------===//
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
10#ifndef LLVM_LIBC_HDR_TYPES_WINT_T_H
11#define LLVM_LIBC_HDR_TYPES_WINT_T_H
12
13#ifdef LIBC_FULL_BUILD
14
15#include "include/llvm-libc-types/wint_t.h"
16
17#else // overlay mode
18
19#include "hdr/wchar_overlay.h"
20
21#endif // LIBC_FULL_BUILD
22
23#endif // LLVM_LIBC_HDR_TYPES_WINT_T_H
lib/libcxx/libc/include/llvm-libc-macros/cfloat128-macros.h+1-1
...@@ -27,7 +27,7 @@...@@ -27,7 +27,7 @@
27#define LIBC_TYPES_HAS_CFLOAT12827#define LIBC_TYPES_HAS_CFLOAT128
28#endif28#endif
29#elif defined(__GNUC__)29#elif defined(__GNUC__)
30#if (defined(__STDC_IEC_60559_COMPLEX__) || defined(__SIZEOF_FLOAT128__)) && \30#if (defined(__STDC_IEC_60559_COMPLEX__) && defined(__SIZEOF_FLOAT128__)) && \
31 (__GNUC__ >= 13 || (!defined(__cplusplus)))31 (__GNUC__ >= 13 || (!defined(__cplusplus)))
32#define LIBC_TYPES_HAS_CFLOAT12832#define LIBC_TYPES_HAS_CFLOAT128
33#endif33#endif
lib/libcxx/libc/include/llvm-libc-macros/float-macros.h+6
...@@ -9,6 +9,12 @@...@@ -9,6 +9,12 @@
9#ifndef LLVM_LIBC_MACROS_FLOAT_MACROS_H9#ifndef LLVM_LIBC_MACROS_FLOAT_MACROS_H
10#define LLVM_LIBC_MACROS_FLOAT_MACROS_H10#define LLVM_LIBC_MACROS_FLOAT_MACROS_H
1111
12// __has_builtin is a Clang extension; GCC < 10 doesn't define it, which
13// turns a bare `#if __has_builtin(...)` into a preprocessor syntax error.
14#ifndef __has_builtin
15#define __has_builtin(x) 0
16#endif
17
12#ifndef FLT_RADIX18#ifndef FLT_RADIX
13#define FLT_RADIX __FLT_RADIX__19#define FLT_RADIX __FLT_RADIX__
14#endif // FLT_RADIX20#endif // FLT_RADIX
lib/libcxx/libc/include/llvm-libc-macros/float16-macros.h+2-1
...@@ -12,7 +12,8 @@...@@ -12,7 +12,8 @@
12#include "../llvm-libc-types/float128.h"12#include "../llvm-libc-types/float128.h"
1313
14#if defined(__FLT16_MANT_DIG__) && \14#if defined(__FLT16_MANT_DIG__) && \
15 (!defined(__GNUC__) || __GNUC__ >= 13 || defined(__clang__)) && \15 (!defined(__GNUC__) || __GNUC__ >= 13 || \
16 (defined(__clang__) && __clang_major__ >= 12)) && \
16 !defined(__arm__) && !defined(_M_ARM) && !defined(__riscv) && \17 !defined(__arm__) && !defined(_M_ARM) && !defined(__riscv) && \
17 !defined(_WIN32)18 !defined(_WIN32)
18#define LIBC_TYPES_HAS_FLOAT1619#define LIBC_TYPES_HAS_FLOAT16
lib/libcxx/libc/include/llvm-libc-macros/stdfix-macros.h+1-1
...@@ -9,7 +9,7 @@...@@ -9,7 +9,7 @@
9#ifndef LLVM_LIBC_MACROS_STDFIX_MACROS_H9#ifndef LLVM_LIBC_MACROS_STDFIX_MACROS_H
10#define LLVM_LIBC_MACROS_STDFIX_MACROS_H10#define LLVM_LIBC_MACROS_STDFIX_MACROS_H
1111
12#ifdef __FRACT_FBIT__12#if defined(__FRACT_FBIT__) && defined(__clang__)
13// _Fract and _Accum types are available13// _Fract and _Accum types are available
14#define LIBC_COMPILER_HAS_FIXED_POINT14#define LIBC_COMPILER_HAS_FIXED_POINT
15#endif // __FRACT_FBIT__15#endif // __FRACT_FBIT__
lib/libcxx/libc/include/llvm-libc-types/size_t.h created+14
...@@ -0,0 +1,14 @@
1//===-- Definition of size_t types ----------------------------------------===//
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#ifndef LLVM_LIBC_TYPES_SIZE_T_H
10#define LLVM_LIBC_TYPES_SIZE_T_H
11
12typedef __SIZE_TYPE__ size_t;
13
14#endif // LLVM_LIBC_TYPES_SIZE_T_H
lib/libcxx/libc/src/__support/CPP/bit.h+46-14
...@@ -6,7 +6,7 @@...@@ -6,7 +6,7 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
8// This is inspired by LLVM ADT/bit.h header.8// This is inspired by LLVM ADT/bit.h header.
9// Some functions are missing, we can add them as needed (popcount, byteswap).9// Some functions are missing, we can add them as needed.
1010
11#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H11#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
12#define LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H12#define LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
...@@ -27,9 +27,14 @@ namespace cpp {...@@ -27,9 +27,14 @@ namespace cpp {
27#endif27#endif
2828
29template <unsigned N>29template <unsigned N>
30LIBC_INLINE static void inline_copy(const char *from, char *to) {30LIBC_INLINE constexpr void inline_copy(const char *from, char *to) {
31#if __has_builtin(__builtin_memcpy_inline)31#if __has_builtin(__builtin_memcpy_inline) && \
32 __builtin_memcpy_inline(to, from, N);32 defined(LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED)
33 if (cpp::is_constant_evaluated())
34 for (unsigned i = 0; i < N; ++i)
35 to[i] = from[i];
36 else
37 __builtin_memcpy_inline(to, from, N);
33#else38#else
34 for (unsigned i = 0; i < N; ++i)39 for (unsigned i = 0; i < N; ++i)
35 to[i] = from[i];40 to[i] = from[i];
...@@ -39,15 +44,14 @@ LIBC_INLINE static void inline_copy(const char *from, char *to) {...@@ -39,15 +44,14 @@ LIBC_INLINE static void inline_copy(const char *from, char *to) {
39// This implementation of bit_cast requires trivially-constructible To, to avoid44// This implementation of bit_cast requires trivially-constructible To, to avoid
40// UB in the implementation.45// UB in the implementation.
41template <typename To, typename From>46template <typename To, typename From>
42LIBC_INLINE constexpr cpp::enable_if_t<47LIBC_INLINE static constexpr cpp::enable_if_t<
43 (sizeof(To) == sizeof(From)) &&48 (sizeof(To) == sizeof(From)) &&
44 cpp::is_trivially_constructible<To>::value &&49 cpp::is_trivially_constructible<To>::value &&
45 cpp::is_trivially_copyable<To>::value &&50 cpp::is_trivially_copyable<To>::value &&
46 cpp::is_trivially_copyable<From>::value,51 cpp::is_trivially_copyable<From>::value,
47 To>52 To>
48bit_cast(const From &from) {53bit_cast(const From &from) {
49 MSAN_UNPOISON(&from, sizeof(From));54#if LIBC_HAS_BUILTIN_BIT_CAST
50#if __has_builtin(__builtin_bit_cast) || defined(LIBC_COMPILER_IS_MSVC)
51 return __builtin_bit_cast(To, from);55 return __builtin_bit_cast(To, from);
52#else56#else
53 To to{};57 To to{};
...@@ -60,14 +64,12 @@ bit_cast(const From &from) {...@@ -60,14 +64,12 @@ bit_cast(const From &from) {
6064
61// The following simple bit copy from a smaller type to maybe-larger type.65// The following simple bit copy from a smaller type to maybe-larger type.
62template <typename To, typename From>66template <typename To, typename From>
63LIBC_INLINE constexpr cpp::enable_if_t<67LIBC_INLINE cpp::enable_if_t<(sizeof(To) >= sizeof(From)) &&
64 (sizeof(To) >= sizeof(From)) &&68 cpp::is_trivially_constructible<To>::value &&
65 cpp::is_trivially_constructible<To>::value &&69 cpp::is_trivially_copyable<To>::value &&
66 cpp::is_trivially_copyable<To>::value &&70 cpp::is_trivially_copyable<From>::value,
67 cpp::is_trivially_copyable<From>::value,71 void>
68 void>
69bit_copy(const From &from, To &to) {72bit_copy(const From &from, To &to) {
70 MSAN_UNPOISON(&from, sizeof(From));
71 char *dst = reinterpret_cast<char *>(&to);73 char *dst = reinterpret_cast<char *>(&to);
72 const char *src = reinterpret_cast<const char *>(&from);74 const char *src = reinterpret_cast<const char *>(&from);
73 inline_copy<sizeof(From)>(src, dst);75 inline_copy<sizeof(From)>(src, dst);
...@@ -330,6 +332,36 @@ ADD_SPECIALIZATION(unsigned long long, __builtin_popcountll)...@@ -330,6 +332,36 @@ ADD_SPECIALIZATION(unsigned long long, __builtin_popcountll)
330#endif // __builtin_popcountg332#endif // __builtin_popcountg
331#undef ADD_SPECIALIZATION333#undef ADD_SPECIALIZATION
332334
335/// Reverses the bytes in the given integer value.
336///
337/// All integral types are allowed, matching C++23 std::byteswap semantics.
338/// Signed types delegate to the unsigned path via static_cast.
339///
340/// The recursive decomposition generates optimal 'bswap' or 'rolw'
341/// instructions on Clang at -O2 without requiring compiler intrinsics.
342template <typename T>
343[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_integral_v<T>, T>
344byteswap(T value) {
345 static_assert(sizeof(T) <= 16, "byteswap: unsupported type size");
346 if constexpr (!cpp::is_unsigned_v<T>) {
347 using U = cpp::make_unsigned_t<T>;
348 return static_cast<T>(byteswap(static_cast<U>(value)));
349 } else if constexpr (sizeof(T) == 1) {
350 return value;
351 } else {
352 constexpr unsigned half_bits = sizeof(T) * 8 / 2;
353 using Half = cpp::conditional_t<
354 sizeof(T) == 2, uint8_t,
355 cpp::conditional_t<
356 sizeof(T) == 4, uint16_t,
357 cpp::conditional_t<sizeof(T) == 8, uint32_t, uint64_t>>>;
358 Half lo = static_cast<Half>(value);
359 Half hi = static_cast<Half>(value >> half_bits);
360 return static_cast<T>((static_cast<T>(byteswap(lo)) << half_bits) |
361 static_cast<T>(byteswap(hi)));
362 }
363}
364
333} // namespace cpp365} // namespace cpp
334} // namespace LIBC_NAMESPACE_DECL366} // namespace LIBC_NAMESPACE_DECL
335367
lib/libcxx/libc/src/__support/CPP/iterator.h+29
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_ITERATOR_H9#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_ITERATOR_H
10#define LLVM_LIBC_SRC___SUPPORT_CPP_ITERATOR_H10#define LLVM_LIBC_SRC___SUPPORT_CPP_ITERATOR_H
1111
12#include "hdr/types/size_t.h"
12#include "src/__support/CPP/type_traits/enable_if.h"13#include "src/__support/CPP/type_traits/enable_if.h"
13#include "src/__support/CPP/type_traits/is_convertible.h"14#include "src/__support/CPP/type_traits/is_convertible.h"
14#include "src/__support/CPP/type_traits/is_same.h"15#include "src/__support/CPP/type_traits/is_same.h"
...@@ -18,9 +19,13 @@...@@ -18,9 +19,13 @@
18namespace LIBC_NAMESPACE_DECL {19namespace LIBC_NAMESPACE_DECL {
19namespace cpp {20namespace cpp {
2021
22struct input_iterator_tag {};
23struct random_access_iterator_tag : input_iterator_tag {};
24
21template <typename T> struct iterator_traits;25template <typename T> struct iterator_traits;
22template <typename T> struct iterator_traits<T *> {26template <typename T> struct iterator_traits<T *> {
23 using reference = T &;27 using reference = T &;
28 using iterator_category = random_access_iterator_tag;
24 using value_type = T;29 using value_type = T;
25};30};
2631
...@@ -93,6 +98,30 @@ public:...@@ -93,6 +98,30 @@ public:
93 }98 }
94};99};
95100
101namespace cpp_internal {
102
103template <typename It>
104LIBC_INLINE constexpr size_t distance(It first, It last,
105 random_access_iterator_tag) {
106 return last - first;
107}
108
109template <typename It>
110LIBC_INLINE constexpr auto distance(It first, It last, input_iterator_tag) {
111 size_t n = 0;
112 for (; first != last; ++first) {
113 ++n;
114 }
115 return n;
116}
117
118} // namespace cpp_internal
119
120template <typename It> LIBC_INLINE constexpr auto distance(It first, It last) {
121 return cpp_internal::distance(
122 first, last, typename iterator_traits<It>::iterator_category{});
123}
124
96} // namespace cpp125} // namespace cpp
97} // namespace LIBC_NAMESPACE_DECL126} // namespace LIBC_NAMESPACE_DECL
98127
lib/libcxx/libc/src/__support/CPP/limits.h+26-62
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1//===-- A self contained equivalent of std::limits --------------*- C++ -*-===//1//===-- A self contained equivalent of <limits> ----------------*- C++ -*-===//
2//2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.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.4// See https://llvm.org/LICENSE.txt for license information.
...@@ -13,78 +13,42 @@...@@ -13,78 +13,42 @@
13#include "src/__support/CPP/type_traits/is_integral.h"13#include "src/__support/CPP/type_traits/is_integral.h"
14#include "src/__support/CPP/type_traits/is_signed.h"14#include "src/__support/CPP/type_traits/is_signed.h"
15#include "src/__support/macros/attributes.h" // LIBC_INLINE15#include "src/__support/macros/attributes.h" // LIBC_INLINE
16#include "src/__support/macros/config.h"
17#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
1816
19namespace LIBC_NAMESPACE_DECL {17namespace LIBC_NAMESPACE_DECL {
20namespace cpp {18namespace cpp {
2119
22namespace internal {20namespace internal {
2321
24template <typename T, T min_value, T max_value> struct integer_impl {22template <typename T, bool is_integral> struct numeric_limits_impl {};
25 static_assert(cpp::is_integral_v<T>);23
26 LIBC_INLINE static constexpr T max() { return max_value; }24template <typename T> struct numeric_limits_impl<T, true> {
27 LIBC_INLINE static constexpr T min() { return min_value; }25 LIBC_INLINE_VAR static constexpr bool is_signed = T(-1) < T(0);
26
28 LIBC_INLINE_VAR static constexpr int digits =27 LIBC_INLINE_VAR static constexpr int digits =
29 CHAR_BIT * sizeof(T) - cpp::is_signed_v<T>;28 (CHAR_BIT * sizeof(T)) - is_signed;
29
30 LIBC_INLINE static constexpr T min() {
31 if constexpr (is_signed) {
32 return T(T(1) << digits);
33 } else {
34 return 0;
35 }
36 }
37
38 LIBC_INLINE static constexpr T max() {
39 if constexpr (is_signed) {
40 return T(T(~0) ^ min());
41 } else {
42 return T(~0);
43 }
44 }
30};45};
3146
32} // namespace internal47} // namespace internal
3348
34template <class T> struct numeric_limits {};49template <typename T>
3550struct numeric_limits
36// TODO: Add numeric_limits specializations as needed for new types.51 : public internal::numeric_limits_impl<T, is_integral_v<T>> {};
37template <>
38struct numeric_limits<short>
39 : public internal::integer_impl<short, SHRT_MIN, SHRT_MAX> {};
40
41template <>
42struct numeric_limits<unsigned short>
43 : public internal::integer_impl<unsigned short, 0, USHRT_MAX> {};
44
45template <>
46struct numeric_limits<int>
47 : public internal::integer_impl<int, INT_MIN, INT_MAX> {};
48
49template <>
50struct numeric_limits<unsigned int>
51 : public internal::integer_impl<unsigned int, 0, UINT_MAX> {};
52
53template <>
54struct numeric_limits<long>
55 : public internal::integer_impl<long, LONG_MIN, LONG_MAX> {};
56
57template <>
58struct numeric_limits<unsigned long>
59 : public internal::integer_impl<unsigned long, 0, ULONG_MAX> {};
60
61template <>
62struct numeric_limits<long long>
63 : public internal::integer_impl<long long, LLONG_MIN, LLONG_MAX> {};
64
65template <>
66struct numeric_limits<unsigned long long>
67 : public internal::integer_impl<unsigned long long, 0, ULLONG_MAX> {};
68
69template <>
70struct numeric_limits<char>
71 : public internal::integer_impl<char, CHAR_MIN, CHAR_MAX> {};
72
73template <>
74struct numeric_limits<signed char>
75 : public internal::integer_impl<signed char, SCHAR_MIN, SCHAR_MAX> {};
76
77template <>
78struct numeric_limits<unsigned char>
79 : public internal::integer_impl<unsigned char, 0, UCHAR_MAX> {};
80
81#ifdef LIBC_TYPES_HAS_INT128
82// On platform where UInt128 resolves to __uint128_t, this specialization
83// provides the limits of UInt128.
84template <>
85struct numeric_limits<__uint128_t>
86 : public internal::integer_impl<__uint128_t, 0, ~__uint128_t(0)> {};
87#endif
8852
89} // namespace cpp53} // namespace cpp
90} // namespace LIBC_NAMESPACE_DECL54} // namespace LIBC_NAMESPACE_DECL
lib/libcxx/libc/src/__support/CPP/string_view.h+79-62
...@@ -18,46 +18,52 @@...@@ -18,46 +18,52 @@
18namespace LIBC_NAMESPACE_DECL {18namespace LIBC_NAMESPACE_DECL {
19namespace cpp {19namespace cpp {
2020
21// This is very simple alternate of the std::string_view class. There is no21template <typename CharT> class basic_string_view;
22// bounds check performed in any of the methods. The callers are expected to22
23// do the checks before invoking the methods.23using string_view = basic_string_view<char>;
24using wstring_view = basic_string_view<wchar_t>;
25
26// This is a very simple alternate of the std::basic_string_view class template.
27// There is no bounds check performed in any of the methods. The callers are
28// expected to do the checks before invoking the methods.
24//29//
25// This class will be extended as needed in future.30// This class will be extended as needed in future.
26class string_view {31template <typename CharT> class basic_string_view {
27private:32private:
28 const char *Data;33 const CharT *Data;
29 size_t Len;34 size_t Len;
3035
31 LIBC_INLINE static size_t min(size_t A, size_t B) { return A <= B ? A : B; }36 LIBC_INLINE static constexpr size_t min(size_t A, size_t B) {
37 return A <= B ? A : B;
38 }
3239
33 LIBC_INLINE static int compareMemory(const char *Lhs, const char *Rhs,40 LIBC_INLINE static constexpr int compareN(const CharT *Lhs, const CharT *Rhs,
34 size_t Length) {41 size_t Length) {
35 for (size_t i = 0; i < Length; ++i)42 for (size_t i = 0; i < Length; ++i)
36 if (int Diff = (int)Lhs[i] - (int)Rhs[i])43 if (Lhs[i] != Rhs[i])
37 return Diff;44 return Lhs[i] < Rhs[i] ? -1 : 1;
38 return 0;45 return 0;
39 }46 }
4047
41 LIBC_INLINE static constexpr size_t length(const char *Str) {48 LIBC_INLINE static constexpr size_t length(const CharT *Str) {
42 for (const char *End = Str;; ++End)49 for (const CharT *End = Str;; ++End)
43 if (*End == '\0')50 if (*End == CharT{0})
44 return static_cast<size_t>(End - Str);51 return static_cast<size_t>(End - Str);
45 }52 }
4653
47 LIBC_INLINE bool equals(string_view Other) const {54 LIBC_INLINE constexpr bool equals(basic_string_view Other) const {
48 return (Len == Other.Len &&55 return (Len == Other.Len && compareN(Data, Other.Data, Other.Len) == 0);
49 compareMemory(Data, Other.Data, Other.Len) == 0);
50 }56 }
5157
52public:58public:
53 using value_type = char;59 using value_type = CharT;
54 using size_type = size_t;60 using size_type = size_t;
55 using difference_type = ptrdiff_t;61 using difference_type = ptrdiff_t;
56 using pointer = char *;62 using pointer = CharT *;
57 using const_pointer = const char *;63 using const_pointer = const CharT *;
58 using reference = char &;64 using reference = CharT &;
59 using const_reference = const char &;65 using const_reference = const CharT &;
60 using const_iterator = char *;66 using const_iterator = CharT *;
61 using iterator = const_iterator;67 using iterator = const_iterator;
6268
63 // special value equal to the maximum value representable by the type69 // special value equal to the maximum value representable by the type
...@@ -65,124 +71,126 @@ public:...@@ -65,124 +71,126 @@ public:
65 LIBC_INLINE_VAR static constexpr size_t npos =71 LIBC_INLINE_VAR static constexpr size_t npos =
66 cpp::numeric_limits<size_t>::max();72 cpp::numeric_limits<size_t>::max();
6773
68 LIBC_INLINE constexpr string_view() : Data(nullptr), Len(0) {}74 LIBC_INLINE constexpr basic_string_view() : Data(nullptr), Len(0) {}
6975
70 // Assumes Str is a null-terminated string. The length of the string does76 // Assumes Str is a null-terminated string. The length of the string does
71 // not include the terminating null character.77 // not include the terminating null character.
72 // Preconditions: [Str, Str + ​length(Str)) is a valid range.78 // Preconditions: [Str, Str + ​length(Str)) is a valid range.
73 LIBC_INLINE constexpr string_view(const char *Str)79 LIBC_INLINE constexpr basic_string_view(const CharT *Str)
74 : Data(Str), Len(length(Str)) {}80 : Data(Str), Len(length(Str)) {}
7581
76 // Preconditions: [Str, Str + N) is a valid range.82 // Preconditions: [Str, Str + N) is a valid range.
77 LIBC_INLINE constexpr string_view(const char *Str, size_t N)83 LIBC_INLINE constexpr basic_string_view(const CharT *Str, size_t N)
78 : Data(Str), Len(N) {}84 : Data(Str), Len(N) {}
7985
80 LIBC_INLINE constexpr const char *data() const { return Data; }86 LIBC_INLINE constexpr const CharT *data() const { return Data; }
8187
82 // Returns the size of the string_view.88 // Returns the size of the basic_string_view.
83 LIBC_INLINE constexpr size_t size() const { return Len; }89 LIBC_INLINE constexpr size_t size() const { return Len; }
8490
85 // Returns whether the string_view is empty.91 // Returns whether the basic_string_view is empty.
86 LIBC_INLINE constexpr bool empty() const { return Len == 0; }92 LIBC_INLINE constexpr bool empty() const { return Len == 0; }
8793
88 // Returns an iterator to the first character of the view.94 // Returns an iterator to the first character of the view.
89 LIBC_INLINE const char *begin() const { return Data; }95 LIBC_INLINE constexpr const CharT *begin() const { return Data; }
9096
91 // Returns an iterator to the character following the last character of the97 // Returns an iterator to the character following the last character of the
92 // view.98 // view.
93 LIBC_INLINE const char *end() const { return Data + Len; }99 LIBC_INLINE constexpr const CharT *end() const { return Data + Len; }
94100
95 // Returns a const reference to the character at specified location pos.101 // Returns a const reference to the character at specified location pos.
96 // No bounds checking is performed: the behavior is undefined if pos >=102 // No bounds checking is performed: the behavior is undefined if pos >=
97 // size().103 // size().
98 LIBC_INLINE constexpr const char &operator[](size_t Index) const {104 LIBC_INLINE constexpr const CharT &operator[](size_t Index) const {
99 return Data[Index];105 return Data[Index];
100 }106 }
101107
102 /// compare - Compare two strings; the result is -1, 0, or 1 if this string108 /// compare - Compare two strings; the result is -1, 0, or 1 if this string
103 /// is lexicographically less than, equal to, or greater than the \p Other.109 /// is lexicographically less than, equal to, or greater than the \p Other.
104 LIBC_INLINE int compare(string_view Other) const {110 LIBC_INLINE constexpr int compare(basic_string_view Other) const {
105 // Check the prefix for a mismatch.111 // Check the prefix for a mismatch.
106 if (int Res = compareMemory(Data, Other.Data, min(Len, Other.Len)))112 if (int Res = compareN(Data, Other.Data, min(Len, Other.Len)))
107 return Res < 0 ? -1 : 1;113 return Res;
108 // Otherwise the prefixes match, so we only need to check the lengths.114 // Otherwise the prefixes match, so we only need to check the lengths.
109 if (Len == Other.Len)115 if (Len == Other.Len)
110 return 0;116 return 0;
111 return Len < Other.Len ? -1 : 1;117 return Len < Other.Len ? -1 : 1;
112 }118 }
113119
114 LIBC_INLINE bool operator==(string_view Other) const { return equals(Other); }120 LIBC_INLINE constexpr bool operator==(basic_string_view Other) const {
115 LIBC_INLINE bool operator!=(string_view Other) const {121 return equals(Other);
122 }
123 LIBC_INLINE constexpr bool operator!=(basic_string_view Other) const {
116 return !(*this == Other);124 return !(*this == Other);
117 }125 }
118 LIBC_INLINE bool operator<(string_view Other) const {126 LIBC_INLINE constexpr bool operator<(basic_string_view Other) const {
119 return compare(Other) == -1;127 return compare(Other) == -1;
120 }128 }
121 LIBC_INLINE bool operator<=(string_view Other) const {129 LIBC_INLINE constexpr bool operator<=(basic_string_view Other) const {
122 return compare(Other) != 1;130 return compare(Other) != 1;
123 }131 }
124 LIBC_INLINE bool operator>(string_view Other) const {132 LIBC_INLINE constexpr bool operator>(basic_string_view Other) const {
125 return compare(Other) == 1;133 return compare(Other) == 1;
126 }134 }
127 LIBC_INLINE bool operator>=(string_view Other) const {135 LIBC_INLINE constexpr bool operator>=(basic_string_view Other) const {
128 return compare(Other) != -1;136 return compare(Other) != -1;
129 }137 }
130138
131 // Moves the start of the view forward by n characters.139 // Moves the start of the view forward by n characters.
132 // The behavior is undefined if n > size().140 // The behavior is undefined if n > size().
133 LIBC_INLINE void remove_prefix(size_t N) {141 LIBC_INLINE constexpr void remove_prefix(size_t N) {
134 Len -= N;142 Len -= N;
135 Data += N;143 Data += N;
136 }144 }
137145
138 // Moves the end of the view back by n characters.146 // Moves the end of the view back by n characters.
139 // The behavior is undefined if n > size().147 // The behavior is undefined if n > size().
140 LIBC_INLINE void remove_suffix(size_t N) { Len -= N; }148 LIBC_INLINE constexpr void remove_suffix(size_t N) { Len -= N; }
141149
142 // Check if this string starts with the given Prefix.150 // Check if this string starts with the given Prefix.
143 LIBC_INLINE bool starts_with(string_view Prefix) const {151 LIBC_INLINE constexpr bool starts_with(basic_string_view Prefix) const {
144 return Len >= Prefix.Len &&152 return Len >= Prefix.Len && compareN(Data, Prefix.Data, Prefix.Len) == 0;
145 compareMemory(Data, Prefix.Data, Prefix.Len) == 0;
146 }153 }
147154
148 // Check if this string starts with the given Prefix.155 // Check if this string starts with the given Prefix.
149 LIBC_INLINE bool starts_with(const char Prefix) const {156 LIBC_INLINE constexpr bool starts_with(const CharT Prefix) const {
150 return !empty() && front() == Prefix;157 return !empty() && front() == Prefix;
151 }158 }
152159
153 // Check if this string ends with the given Prefix.160 // Check if this string ends with the given Prefix.
154 LIBC_INLINE bool ends_with(const char Suffix) const {161 LIBC_INLINE constexpr bool ends_with(const CharT Suffix) const {
155 return !empty() && back() == Suffix;162 return !empty() && back() == Suffix;
156 }163 }
157164
158 // Check if this string ends with the given Suffix.165 // Check if this string ends with the given Suffix.
159 LIBC_INLINE bool ends_with(string_view Suffix) const {166 LIBC_INLINE constexpr bool ends_with(basic_string_view Suffix) const {
160 return Len >= Suffix.Len &&167 return Len >= Suffix.Len &&
161 compareMemory(end() - Suffix.Len, Suffix.Data, Suffix.Len) == 0;168 compareN(end() - Suffix.Len, Suffix.Data, Suffix.Len) == 0;
162 }169 }
163170
164 // Return a reference to the substring from [Start, Start + N).171 // Return a reference to the substring from [Start, Start + N).
165 //172 //
166 // Start The index of the starting character in the substring; if the index is173 // Start The index of the starting character in the substring; if the index
167 // npos or greater than the length of the string then the empty substring will174 // is npos or greater than the length of the string then the empty substring
168 // be returned.175 // will be returned.
169 //176 //
170 // N The number of characters to included in the substring. If N exceeds the177 // N The number of characters to included in the substring. If N exceeds the
171 // number of characters remaining in the string, the string suffix (starting178 // number of characters remaining in the string, the string suffix (starting
172 // with Start) will be returned.179 // with Start) will be returned.
173 LIBC_INLINE string_view substr(size_t Start, size_t N = npos) const {180 LIBC_INLINE constexpr basic_string_view substr(size_t Start,
181 size_t N = npos) const {
174 Start = min(Start, Len);182 Start = min(Start, Len);
175 return string_view(Data + Start, min(N, Len - Start));183 return basic_string_view(Data + Start, min(N, Len - Start));
176 }184 }
177185
178 // front - Get the first character in the string.186 // front - Get the first character in the string.
179 LIBC_INLINE char front() const { return Data[0]; }187 LIBC_INLINE constexpr CharT front() const { return Data[0]; }
180188
181 // back - Get the last character in the string.189 // back - Get the last character in the string.
182 LIBC_INLINE char back() const { return Data[Len - 1]; }190 LIBC_INLINE constexpr CharT back() const { return Data[Len - 1]; }
183191
184 // Finds the first occurence of c in this view, starting at position From.192 // Finds the first occurence of c in this view, starting at position From.
185 LIBC_INLINE constexpr size_t find_first_of(const char c,193 LIBC_INLINE constexpr size_t find_first_of(const CharT c,
186 size_t From = 0) const {194 size_t From = 0) const {
187 for (size_t Pos = From; Pos < size(); ++Pos)195 for (size_t Pos = From; Pos < size(); ++Pos)
188 if ((*this)[Pos] == c)196 if ((*this)[Pos] == c)
...@@ -191,7 +199,7 @@ public:...@@ -191,7 +199,7 @@ public:
191 }199 }
192200
193 // Finds the last occurence of c in this view, ending at position End.201 // Finds the last occurence of c in this view, ending at position End.
194 LIBC_INLINE constexpr size_t find_last_of(const char c,202 LIBC_INLINE constexpr size_t find_last_of(const CharT c,
195 size_t End = npos) const {203 size_t End = npos) const {
196 End = End >= size() ? size() : End + 1;204 End = End >= size() ? size() : End + 1;
197 for (; End > 0; --End)205 for (; End > 0; --End)
...@@ -200,9 +208,18 @@ public:...@@ -200,9 +208,18 @@ public:
200 return npos;208 return npos;
201 }209 }
202210
203 // Finds the first character not equal to c in this view, starting at position211 LIBC_INLINE constexpr size_t find_last_not_of(const char c,
204 // From.212 size_t end = npos) const {
205 LIBC_INLINE constexpr size_t find_first_not_of(const char c,213 end = end >= size() ? size() : end + 1;
214 for (; end > 0; --end)
215 if ((*this)[end - 1] != c)
216 return end - 1;
217 return npos;
218 }
219
220 // Finds the first character not equal to c in this view, starting at
221 // position From.
222 LIBC_INLINE constexpr size_t find_first_not_of(const CharT c,
206 size_t From = 0) const {223 size_t From = 0) const {
207 for (size_t Pos = From; Pos < size(); ++Pos)224 for (size_t Pos = From; Pos < size(); ++Pos)
208 if ((*this)[Pos] != c)225 if ((*this)[Pos] != c)
...@@ -211,7 +228,7 @@ public:...@@ -211,7 +228,7 @@ public:
211 }228 }
212229
213 // Check if this view contains the given character.230 // Check if this view contains the given character.
214 LIBC_INLINE constexpr bool contains(char c) const {231 LIBC_INLINE constexpr bool contains(CharT c) const {
215 return find_first_of(c) != npos;232 return find_first_of(c) != npos;
216 }233 }
217};234};
lib/libcxx/libc/src/__support/CPP/type_traits/is_assignable.h created+63
...@@ -0,0 +1,63 @@
1//===------------------------------------------------------------*- C++ -*-===//
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// \file
10// This file contains a free-standing implementation of is_assignable
11// type trait.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_ASSIGNABLE_H
16#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_ASSIGNABLE_H
17
18#include "src/__support/CPP/type_traits/bool_constant.h"
19#include "src/__support/CPP/utility/declval.h"
20#include "src/__support/macros/attributes.h"
21#include "src/__support/macros/config.h"
22
23namespace LIBC_NAMESPACE_DECL {
24namespace cpp {
25
26namespace is_assignable_detail {
27
28#if LIBC_HAS_BUILTIN_IS_ASSIGNABLE
29
30template <typename T, typename U>
31struct is_assignable_impl : public bool_constant<__is_assignable(T, U)> {};
32
33#else
34// Fallback SFINAE implementation for GCC 7 and older toolchains
35
36template <typename T, typename U> struct is_assignable_impl {
37private:
38 template <typename T1, typename U1>
39 LIBC_INLINE static auto test(int)
40 -> decltype(declval<T1>() = declval<U1>(), bool_constant<true>());
41
42 template <typename, typename>
43 LIBC_INLINE static auto test(...) -> bool_constant<false>;
44
45public:
46 using type = decltype(test<T, U>(0));
47};
48
49#endif // LIBC_HAS_BUILTIN_IS_ASSIGNABLE
50
51} // namespace is_assignable_detail
52
53// is_assignable
54template <typename T, typename U>
55struct is_assignable : public is_assignable_detail::is_assignable_impl<T, U> {};
56
57template <typename T, typename U>
58LIBC_INLINE_VAR constexpr bool is_assignable_v = is_assignable<T, U>::value;
59
60} // namespace cpp
61} // namespace LIBC_NAMESPACE_DECL
62
63#endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_ASSIGNABLE_H
lib/libcxx/libc/src/__support/CPP/type_traits/is_constant_evaluated.h+4
...@@ -15,7 +15,11 @@ namespace LIBC_NAMESPACE_DECL {...@@ -15,7 +15,11 @@ namespace LIBC_NAMESPACE_DECL {
15namespace cpp {15namespace cpp {
1616
17LIBC_INLINE constexpr bool is_constant_evaluated() {17LIBC_INLINE constexpr bool is_constant_evaluated() {
18#if LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED
18 return __builtin_is_constant_evaluated();19 return __builtin_is_constant_evaluated();
20#else
21 return false;
22#endif
19}23}
2024
21} // namespace cpp25} // namespace cpp
lib/libcxx/libc/src/__support/CPP/type_traits/is_constructible.h created+65
...@@ -0,0 +1,65 @@
1//===------------------------------------------------------------*- C++ -*-===//
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// \file
10// This file contains a free-standing implementation of is_constructible
11// type trait.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_CONSTRUCTIBLE_H
16#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_CONSTRUCTIBLE_H
17
18#include "src/__support/CPP/type_traits/bool_constant.h"
19#include "src/__support/CPP/utility/declval.h"
20#include "src/__support/macros/attributes.h"
21#include "src/__support/macros/config.h"
22
23namespace LIBC_NAMESPACE_DECL {
24namespace cpp {
25
26namespace is_contructible_detail {
27
28#if LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE
29
30template <typename T, typename... Args>
31struct is_constructible_impl
32 : public bool_constant<__is_constructible(T, Args...)> {};
33
34#else
35// Fallback SFINAE implementation for GCC 7 and older toolchains
36
37template <typename T, typename... Args> struct is_constructible_impl {
38private:
39 template <typename T1, typename... Args1>
40 LIBC_INLINE static auto test(int)
41 -> decltype(T1(declval<Args1>()...), bool_constant<true>());
42
43 template <typename, typename...>
44 LIBC_INLINE static auto test(...) -> bool_constant<false>;
45
46public:
47 using type = decltype(test<T, Args...>(0));
48};
49
50#endif // LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE
51
52} // namespace is_contructible_detail
53
54template <typename T, typename... Args>
55struct is_constructible
56 : public is_contructible_detail::is_constructible_impl<T, Args...> {};
57
58template <typename T, typename... Args>
59LIBC_INLINE_VAR constexpr bool is_constructible_v =
60 is_constructible<T, Args...>::value;
61
62} // namespace cpp
63} // namespace LIBC_NAMESPACE_DECL
64
65#endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_CONSTRUCTIBLE_H
lib/libcxx/libc/src/__support/CPP/type_traits/is_copy_assignable.h+3-4
...@@ -9,7 +9,7 @@...@@ -9,7 +9,7 @@
9#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_COPY_ASSIGNABLE_H9#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_COPY_ASSIGNABLE_H
1010
11#include "src/__support/CPP/type_traits/add_lvalue_reference.h"11#include "src/__support/CPP/type_traits/add_lvalue_reference.h"
12#include "src/__support/CPP/type_traits/integral_constant.h"12#include "src/__support/CPP/type_traits/is_assignable.h"
13#include "src/__support/macros/config.h"13#include "src/__support/macros/config.h"
1414
15namespace LIBC_NAMESPACE_DECL {15namespace LIBC_NAMESPACE_DECL {
...@@ -18,9 +18,8 @@ namespace cpp {...@@ -18,9 +18,8 @@ namespace cpp {
18// is copy assignable18// is copy assignable
19template <class T>19template <class T>
20struct is_copy_assignable20struct is_copy_assignable
21 : public integral_constant<21 : public cpp::is_assignable<cpp::add_lvalue_reference_t<T>,
22 bool, __is_assignable(cpp::add_lvalue_reference_t<T>,22 cpp::add_lvalue_reference_t<const T>> {};
23 cpp::add_lvalue_reference_t<const T>)> {};
2423
25template <class T>24template <class T>
26LIBC_INLINE_VAR constexpr bool is_copy_assignable_v =25LIBC_INLINE_VAR constexpr bool is_copy_assignable_v =
lib/libcxx/libc/src/__support/CPP/type_traits/is_copy_constructible.h+2-3
...@@ -9,7 +9,7 @@...@@ -9,7 +9,7 @@
9#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H9#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H
1010
11#include "src/__support/CPP/type_traits/add_lvalue_reference.h"11#include "src/__support/CPP/type_traits/add_lvalue_reference.h"
12#include "src/__support/CPP/type_traits/integral_constant.h"12#include "src/__support/CPP/type_traits/is_constructible.h"
13#include "src/__support/macros/config.h"13#include "src/__support/macros/config.h"
1414
15namespace LIBC_NAMESPACE_DECL {15namespace LIBC_NAMESPACE_DECL {
...@@ -18,8 +18,7 @@ namespace cpp {...@@ -18,8 +18,7 @@ namespace cpp {
18// is copy constructible18// is copy constructible
19template <class T>19template <class T>
20struct is_copy_constructible20struct is_copy_constructible
21 : public integral_constant<21 : public cpp::is_constructible<T, cpp::add_lvalue_reference_t<const T>> {};
22 bool, __is_constructible(T, cpp::add_lvalue_reference_t<const T>)> {};
2322
24template <class T>23template <class T>
25LIBC_INLINE_VAR constexpr bool is_copy_constructible_v =24LIBC_INLINE_VAR constexpr bool is_copy_constructible_v =
lib/libcxx/libc/src/__support/CPP/type_traits/is_integral.h+10-5
...@@ -26,13 +26,18 @@ private:...@@ -26,13 +26,18 @@ private:
26 }26 }
2727
28public:28public:
29 LIBC_INLINE_VAR static constexpr bool value = __is_unqualified_any_of<29 LIBC_INLINE_VAR static constexpr bool value =
30 T,30 __is_unqualified_any_of<T,
31#ifdef LIBC_TYPES_HAS_INT12831#ifdef LIBC_TYPES_HAS_INT128
32 __int128_t, __uint128_t,32 __int128_t, __uint128_t,
33#endif33#endif
34 char, signed char, unsigned char, short, unsigned short, int,34#ifdef __cpp_char8_t
35 unsigned int, long, unsigned long, long long, unsigned long long, bool>();35 char8_t,
36#endif
37 char16_t, char32_t, wchar_t, char, signed char,
38 unsigned char, short, unsigned short, int,
39 unsigned int, long, unsigned long, long long,
40 unsigned long long, bool>();
36};41};
37template <typename T>42template <typename T>
38LIBC_INLINE_VAR constexpr bool is_integral_v = is_integral<T>::value;43LIBC_INLINE_VAR constexpr bool is_integral_v = is_integral<T>::value;
lib/libcxx/libc/src/__support/CPP/type_traits/is_move_assignable.h+3-4
...@@ -10,7 +10,7 @@...@@ -10,7 +10,7 @@
1010
11#include "src/__support/CPP/type_traits/add_lvalue_reference.h"11#include "src/__support/CPP/type_traits/add_lvalue_reference.h"
12#include "src/__support/CPP/type_traits/add_rvalue_reference.h"12#include "src/__support/CPP/type_traits/add_rvalue_reference.h"
13#include "src/__support/CPP/type_traits/integral_constant.h"13#include "src/__support/CPP/type_traits/is_assignable.h"
14#include "src/__support/macros/config.h"14#include "src/__support/macros/config.h"
1515
16namespace LIBC_NAMESPACE_DECL {16namespace LIBC_NAMESPACE_DECL {
...@@ -19,9 +19,8 @@ namespace cpp {...@@ -19,9 +19,8 @@ namespace cpp {
19// is move assignable19// is move assignable
20template <class T>20template <class T>
21struct is_move_assignable21struct is_move_assignable
22 : public integral_constant<bool, __is_assignable(22 : public cpp::is_assignable<cpp::add_lvalue_reference_t<T>,
23 cpp::add_lvalue_reference_t<T>,23 cpp::add_rvalue_reference_t<T>> {};
24 cpp::add_rvalue_reference_t<T>)> {};
2524
26template <class T>25template <class T>
27LIBC_INLINE_VAR constexpr bool is_move_assignable_v =26LIBC_INLINE_VAR constexpr bool is_move_assignable_v =
lib/libcxx/libc/src/__support/CPP/type_traits/is_move_constructible.h+2-3
...@@ -9,7 +9,7 @@...@@ -9,7 +9,7 @@
9#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H9#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
1010
11#include "src/__support/CPP/type_traits/add_rvalue_reference.h"11#include "src/__support/CPP/type_traits/add_rvalue_reference.h"
12#include "src/__support/CPP/type_traits/integral_constant.h"12#include "src/__support/CPP/type_traits/is_constructible.h"
13#include "src/__support/macros/config.h"13#include "src/__support/macros/config.h"
1414
15namespace LIBC_NAMESPACE_DECL {15namespace LIBC_NAMESPACE_DECL {
...@@ -18,8 +18,7 @@ namespace cpp {...@@ -18,8 +18,7 @@ namespace cpp {
18// is move constructible18// is move constructible
19template <class T>19template <class T>
20struct is_move_constructible20struct is_move_constructible
21 : public integral_constant<bool, __is_constructible(21 : public cpp::is_constructible<T, cpp::add_rvalue_reference_t<T>> {};
22 T, cpp::add_rvalue_reference_t<T>)> {};
2322
24template <class T>23template <class T>
25LIBC_INLINE_VAR constexpr bool is_move_constructible_v =24LIBC_INLINE_VAR constexpr bool is_move_constructible_v =
lib/libcxx/libc/src/__support/CPP/type_traits/is_unsigned.h+3-3
...@@ -10,7 +10,7 @@...@@ -10,7 +10,7 @@
1010
11#include "include/llvm-libc-macros/stdfix-macros.h"11#include "include/llvm-libc-macros/stdfix-macros.h"
12#include "src/__support/CPP/type_traits/bool_constant.h"12#include "src/__support/CPP/type_traits/bool_constant.h"
13#include "src/__support/CPP/type_traits/is_arithmetic.h"13#include "src/__support/CPP/type_traits/is_integral.h"
14#include "src/__support/CPP/type_traits/is_same.h"14#include "src/__support/CPP/type_traits/is_same.h"
15#include "src/__support/CPP/type_traits/remove_cv.h"15#include "src/__support/CPP/type_traits/remove_cv.h"
16#include "src/__support/macros/attributes.h"16#include "src/__support/macros/attributes.h"
...@@ -23,7 +23,7 @@ namespace cpp {...@@ -23,7 +23,7 @@ namespace cpp {
2323
24#ifndef LIBC_COMPILER_HAS_FIXED_POINT24#ifndef LIBC_COMPILER_HAS_FIXED_POINT
25template <typename T>25template <typename T>
26struct is_unsigned : bool_constant<(is_arithmetic_v<T> && (T(-1) > T(0)))> {26struct is_unsigned : bool_constant<(is_integral_v<T> && (T(-1) > T(0)))> {
27 LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }27 LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
28 LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }28 LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
29};29};
...@@ -37,7 +37,7 @@ private:...@@ -37,7 +37,7 @@ private:
3737
38public:38public:
39 LIBC_INLINE_VAR static constexpr bool value =39 LIBC_INLINE_VAR static constexpr bool value =
40 (is_arithmetic_v<T> && (T(-1) > T(0))) ||40 (is_integral_v<T> && (T(-1) > T(0))) ||
41 __is_unqualified_any_of<T, unsigned short fract, unsigned fract,41 __is_unqualified_any_of<T, unsigned short fract, unsigned fract,
42 unsigned long fract, unsigned short accum,42 unsigned long fract, unsigned short accum,
43 unsigned accum, unsigned long accum,43 unsigned accum, unsigned long accum,
lib/libcxx/libc/src/__support/FPUtil/FPBits.h+16-13
...@@ -798,7 +798,9 @@ template <typename T> LIBC_INLINE static constexpr FPType get_fp_type() {...@@ -798,7 +798,9 @@ template <typename T> LIBC_INLINE static constexpr FPType get_fp_type() {
798 return FPType::IEEE754_Binary64;798 return FPType::IEEE754_Binary64;
799 else if constexpr (LDBL_MANT_DIG == 64)799 else if constexpr (LDBL_MANT_DIG == 64)
800 return FPType::X86_Binary80;800 return FPType::X86_Binary80;
801 else if constexpr (LDBL_MANT_DIG == 113)801 // TODO: properly treat double-double type.
802 // else if constexpr (LDBL_MANT_DIG == 113)
803 else
802 return FPType::IEEE754_Binary128;804 return FPType::IEEE754_Binary128;
803 }805 }
804#if defined(LIBC_TYPES_HAS_FLOAT16)806#if defined(LIBC_TYPES_HAS_FLOAT16)
...@@ -833,21 +835,22 @@ struct FPBits final : public internal::FPRepImpl<get_fp_type<T>(), FPBits<T>> {...@@ -833,21 +835,22 @@ struct FPBits final : public internal::FPRepImpl<get_fp_type<T>(), FPBits<T>> {
833 // Constructors.835 // Constructors.
834 LIBC_INLINE constexpr FPBits() = default;836 LIBC_INLINE constexpr FPBits() = default;
835837
836 template <typename XType> LIBC_INLINE constexpr explicit FPBits(XType x) {838 template <
837 using Unqual = typename cpp::remove_cv_t<XType>;839 typename XType,
838 if constexpr (cpp::is_same_v<Unqual, T>) {840 cpp::enable_if_t<cpp::is_same_v<cpp::remove_cv_t<XType>, T>, int> = 0>
839 UP::bits = cpp::bit_cast<StorageType>(x);841 LIBC_INLINE LIBC_BIT_CAST_CONSTEXPR explicit FPBits(XType x) {
840 } else if constexpr (cpp::is_same_v<Unqual, StorageType>) {842 UP::bits = cpp::bit_cast<StorageType>(x);
841 UP::bits = x;
842 } else {
843 // We don't want accidental type promotions/conversions, so we require
844 // exact type match.
845 static_assert(cpp::always_false<XType>);
846 }
847 }843 }
848844
845 template <typename XType,
846 cpp::enable_if_t<
847 cpp::is_same_v<cpp::remove_cv_t<XType>, StorageType>, int> = 0>
848 LIBC_INLINE constexpr explicit FPBits(XType x) : UP(x) {}
849
849 // Floating-point conversions.850 // Floating-point conversions.
850 LIBC_INLINE constexpr T get_val() const { return cpp::bit_cast<T>(UP::bits); }851 LIBC_INLINE LIBC_BIT_CAST_CONSTEXPR T get_val() const {
852 return cpp::bit_cast<T>(UP::bits);
853 }
851};854};
852855
853} // namespace fputil856} // namespace fputil
lib/libcxx/libc/src/__support/FPUtil/rounding_mode.h+25-5
...@@ -24,8 +24,12 @@ namespace generic {...@@ -24,8 +24,12 @@ namespace generic {
24// 1.0f + 2^-25 = 1.0f for FE_TONEAREST, FE_DOWNWARD, FE_TOWARDZERO24// 1.0f + 2^-25 = 1.0f for FE_TONEAREST, FE_DOWNWARD, FE_TOWARDZERO
25// = 0x1.000002f for FE_UPWARD.25// = 0x1.000002f for FE_UPWARD.
26LIBC_INLINE bool fenv_is_round_up() {26LIBC_INLINE bool fenv_is_round_up() {
27#ifdef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
28 return false;
29#else
27 static volatile float x = 0x1.0p-25f;30 static volatile float x = 0x1.0p-25f;
28 return (1.0f + x != 1.0f);31 return (1.0f + x != 1.0f);
32#endif // LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
29}33}
3034
31// Quick free-standing test whether fegetround() == FE_DOWNWARD.35// Quick free-standing test whether fegetround() == FE_DOWNWARD.
...@@ -33,8 +37,12 @@ LIBC_INLINE bool fenv_is_round_up() {...@@ -33,8 +37,12 @@ LIBC_INLINE bool fenv_is_round_up() {
33// -1.0f - 2^-25 = -1.0f for FE_TONEAREST, FE_UPWARD, FE_TOWARDZERO37// -1.0f - 2^-25 = -1.0f for FE_TONEAREST, FE_UPWARD, FE_TOWARDZERO
34// = -0x1.000002f for FE_DOWNWARD.38// = -0x1.000002f for FE_DOWNWARD.
35LIBC_INLINE bool fenv_is_round_down() {39LIBC_INLINE bool fenv_is_round_down() {
40#ifdef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
41 return false;
42#else
36 static volatile float x = 0x1.0p-25f;43 static volatile float x = 0x1.0p-25f;
37 return (-1.0f - x != -1.0f);44 return (-1.0f - x != -1.0f);
45#endif // LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
38}46}
3947
40// Quick free-standing test whether fegetround() == FE_TONEAREST.48// Quick free-standing test whether fegetround() == FE_TONEAREST.
...@@ -44,9 +52,13 @@ LIBC_INLINE bool fenv_is_round_down() {...@@ -44,9 +52,13 @@ LIBC_INLINE bool fenv_is_round_down() {
44// 1.5f - 2^-24 = 1.5f for FE_TONEAREST, FE_UPWARD52// 1.5f - 2^-24 = 1.5f for FE_TONEAREST, FE_UPWARD
45// = 0x1.0ffffep-1f for FE_DOWNWARD, FE_TOWARDZERO53// = 0x1.0ffffep-1f for FE_DOWNWARD, FE_TOWARDZERO
46LIBC_INLINE bool fenv_is_round_to_nearest() {54LIBC_INLINE bool fenv_is_round_to_nearest() {
55#ifdef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
56 return true;
57#else
47 static volatile float x = 0x1.0p-24f;58 static volatile float x = 0x1.0p-24f;
48 float y = 1.5f + x;59 float y = 1.5f + x;
49 return (y == 1.5f - x);60 return (y == 1.5f - x);
61#endif // LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
50}62}
5163
52// Quick free-standing test whether fegetround() == FE_TOWARDZERO.64// Quick free-standing test whether fegetround() == FE_TOWARDZERO.
...@@ -60,13 +72,20 @@ LIBC_INLINE bool fenv_is_round_to_nearest() {...@@ -60,13 +72,20 @@ LIBC_INLINE bool fenv_is_round_to_nearest() {
60// = 2^-22 for FE_TONEAREST, FE_UPWARD72// = 2^-22 for FE_TONEAREST, FE_UPWARD
61// = 0 for FE_DOWNWARD73// = 0 for FE_DOWNWARD
62LIBC_INLINE bool fenv_is_round_to_zero() {74LIBC_INLINE bool fenv_is_round_to_zero() {
75#ifdef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
76 return false;
77#else
63 static volatile float x = 0x1.0p-24f;78 static volatile float x = 0x1.0p-24f;
64 float y = x;79 float y = x;
65 return ((0x1.000002p0f + y) + (-1.0f - y) == 0x1.0p-23f);80 return ((0x1.000002p0f + y) + (-1.0f - y) == 0x1.0p-23f);
81#endif // LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
66}82}
6783
68// Quick free standing get rounding mode based on the above observations.84// Quick free standing get rounding mode based on the above observations.
69LIBC_INLINE int quick_get_round() {85LIBC_INLINE int quick_get_round() {
86#ifdef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
87 return FE_TONEAREST;
88#else
70 static volatile float x = 0x1.0p-24f;89 static volatile float x = 0x1.0p-24f;
71 float y = x;90 float y = x;
72 float z = (0x1.000002p0f + y) + (-1.0f - y);91 float z = (0x1.000002p0f + y) + (-1.0f - y);
...@@ -76,11 +95,12 @@ LIBC_INLINE int quick_get_round() {...@@ -76,11 +95,12 @@ LIBC_INLINE int quick_get_round() {
76 if (z == 0x1.0p-23f)95 if (z == 0x1.0p-23f)
77 return FE_TOWARDZERO;96 return FE_TOWARDZERO;
78 return (2.0f + y == 2.0f) ? FE_TONEAREST : FE_UPWARD;97 return (2.0f + y == 2.0f) ? FE_TONEAREST : FE_UPWARD;
98#endif // LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
79}99}
80100
81} // namespace generic101} // namespace generic
82102
83LIBC_INLINE static constexpr bool fenv_is_round_up() {103LIBC_INLINE LIBC_CONSTEXPR_DEFAULT bool fenv_is_round_up() {
84 if (cpp::is_constant_evaluated()) {104 if (cpp::is_constant_evaluated()) {
85 return false;105 return false;
86 } else {106 } else {
...@@ -88,7 +108,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_up() {...@@ -88,7 +108,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_up() {
88 }108 }
89}109}
90110
91LIBC_INLINE static constexpr bool fenv_is_round_down() {111LIBC_INLINE LIBC_CONSTEXPR_DEFAULT bool fenv_is_round_down() {
92 if (cpp::is_constant_evaluated()) {112 if (cpp::is_constant_evaluated()) {
93 return false;113 return false;
94 } else {114 } else {
...@@ -96,7 +116,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_down() {...@@ -96,7 +116,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_down() {
96 }116 }
97}117}
98118
99LIBC_INLINE static constexpr bool fenv_is_round_to_nearest() {119LIBC_INLINE LIBC_CONSTEXPR_DEFAULT bool fenv_is_round_to_nearest() {
100 if (cpp::is_constant_evaluated()) {120 if (cpp::is_constant_evaluated()) {
101 return true;121 return true;
102 } else {122 } else {
...@@ -104,7 +124,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_to_nearest() {...@@ -104,7 +124,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_to_nearest() {
104 }124 }
105}125}
106126
107LIBC_INLINE static constexpr bool fenv_is_round_to_zero() {127LIBC_INLINE LIBC_CONSTEXPR_DEFAULT bool fenv_is_round_to_zero() {
108 if (cpp::is_constant_evaluated()) {128 if (cpp::is_constant_evaluated()) {
109 return false;129 return false;
110 } else {130 } else {
...@@ -113,7 +133,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_to_zero() {...@@ -113,7 +133,7 @@ LIBC_INLINE static constexpr bool fenv_is_round_to_zero() {
113}133}
114134
115// Quick free standing get rounding mode based on the above observations.135// Quick free standing get rounding mode based on the above observations.
116LIBC_INLINE static constexpr int quick_get_round() {136LIBC_INLINE LIBC_CONSTEXPR_DEFAULT int quick_get_round() {
117 if (cpp::is_constant_evaluated()) {137 if (cpp::is_constant_evaluated()) {
118 return FE_TONEAREST;138 return FE_TONEAREST;
119 } else {139 } else {
lib/libcxx/libc/src/__support/big_int.h+35-49
...@@ -242,10 +242,9 @@ LIBC_INLINE constexpr void quick_mul_hi(cpp::array<word, N> &dst,...@@ -242,10 +242,9 @@ LIBC_INLINE constexpr void quick_mul_hi(cpp::array<word, N> &dst,
242242
243template <typename word, size_t N>243template <typename word, size_t N>
244LIBC_INLINE constexpr bool is_negative(const cpp::array<word, N> &array) {244LIBC_INLINE constexpr bool is_negative(const cpp::array<word, N> &array) {
245 using signed_word = cpp::make_signed_t<word>;245 constexpr size_t WORD_BITS = cpp::numeric_limits<word>::digits;
246 return cpp::bit_cast<signed_word>(array.back()) < 0;246 return (array.back() >> (WORD_BITS - 1)) != 0;
247}247}
248
249// An enum for the shift function below.248// An enum for the shift function below.
250enum Direction { LEFT, RIGHT };249enum Direction { LEFT, RIGHT };
251250
...@@ -257,9 +256,11 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,...@@ -257,9 +256,11 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,
257 size_t offset) {256 size_t offset) {
258 static_assert(direction == LEFT || direction == RIGHT);257 static_assert(direction == LEFT || direction == RIGHT);
259 constexpr size_t WORD_BITS = cpp::numeric_limits<word>::digits;258 constexpr size_t WORD_BITS = cpp::numeric_limits<word>::digits;
259#if LIBC_HAS_BUILTIN_BIT_CAST
260#ifdef LIBC_TYPES_HAS_INT128260#ifdef LIBC_TYPES_HAS_INT128
261 constexpr size_t TOTAL_BITS = N * WORD_BITS;261 constexpr size_t TOTAL_BITS = N * WORD_BITS;
262 if constexpr (TOTAL_BITS == 128) {262 if constexpr (TOTAL_BITS == 128 &&
263 __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) {
263 using type = cpp::conditional_t<is_signed, __int128_t, __uint128_t>;264 using type = cpp::conditional_t<is_signed, __int128_t, __uint128_t>;
264 auto tmp = cpp::bit_cast<type>(array);265 auto tmp = cpp::bit_cast<type>(array);
265 if constexpr (direction == LEFT)266 if constexpr (direction == LEFT)
...@@ -269,6 +270,8 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,...@@ -269,6 +270,8 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,
269 return cpp::bit_cast<cpp::array<word, N>>(tmp);270 return cpp::bit_cast<cpp::array<word, N>>(tmp);
270 }271 }
271#endif272#endif
273#endif // LIBC_HAS_BUILTIN_BIT_CAST
274
272 if (LIBC_UNLIKELY(offset == 0))275 if (LIBC_UNLIKELY(offset == 0))
273 return array;276 return array;
274 const bool is_neg = is_signed && is_negative(array);277 const bool is_neg = is_signed && is_negative(array);
...@@ -336,8 +339,8 @@ private:...@@ -336,8 +339,8 @@ private:
336 "WordType must be unsigned integer.");339 "WordType must be unsigned integer.");
337340
338 struct Division {341 struct Division {
339 BigInt quotient;342 BigInt quotient{};
340 BigInt remainder;343 BigInt remainder{};
341 };344 };
342345
343public:346public:
...@@ -355,7 +358,7 @@ public:...@@ -355,7 +358,7 @@ public:
355358
356 LIBC_INLINE_VAR static constexpr size_t WORD_COUNT = Bits / WORD_SIZE;359 LIBC_INLINE_VAR static constexpr size_t WORD_COUNT = Bits / WORD_SIZE;
357360
358 cpp::array<WordType, WORD_COUNT> val{}; // zero initialized.361 cpp::array<WordType, WORD_COUNT> val;
359362
360 LIBC_INLINE constexpr BigInt() = default;363 LIBC_INLINE constexpr BigInt() = default;
361364
...@@ -363,9 +366,10 @@ public:...@@ -363,9 +366,10 @@ public:
363366
364 template <size_t OtherBits, bool OtherSigned, typename OtherWordType>367 template <size_t OtherBits, bool OtherSigned, typename OtherWordType>
365 LIBC_INLINE constexpr BigInt(368 LIBC_INLINE constexpr BigInt(
366 const BigInt<OtherBits, OtherSigned, OtherWordType> &other) {369 const BigInt<OtherBits, OtherSigned, OtherWordType> &other)
370 : val{} {
367 using BigIntOther = BigInt<OtherBits, OtherSigned, OtherWordType>;371 using BigIntOther = BigInt<OtherBits, OtherSigned, OtherWordType>;
368 const bool should_sign_extend = Signed && other.is_neg();372 [[maybe_unused]] const bool should_sign_extend = Signed && other.is_neg();
369373
370 static_assert(!(Bits == OtherBits && WORD_SIZE != BigIntOther::WORD_SIZE) &&374 static_assert(!(Bits == OtherBits && WORD_SIZE != BigIntOther::WORD_SIZE) &&
371 "This is currently untested for casting between bigints with "375 "This is currently untested for casting between bigints with "
...@@ -453,20 +457,22 @@ public:...@@ -453,20 +457,22 @@ public:
453 }457 }
454458
455 // Construct a BigInt from a C array.459 // Construct a BigInt from a C array.
456 template <size_t N> LIBC_INLINE constexpr BigInt(const WordType (&nums)[N]) {460 template <size_t N>
461 LIBC_INLINE constexpr BigInt(const WordType (&nums)[N]) : val{} {
457 static_assert(N == WORD_COUNT);462 static_assert(N == WORD_COUNT);
458 for (size_t i = 0; i < WORD_COUNT; ++i)463 for (size_t i = 0; i < WORD_COUNT; ++i)
459 val[i] = nums[i];464 val[i] = nums[i];
460 }465 }
461466
462 LIBC_INLINE constexpr explicit BigInt(467 LIBC_INLINE constexpr explicit BigInt(
463 const cpp::array<WordType, WORD_COUNT> &words) {468 const cpp::array<WordType, WORD_COUNT> &words)
469 : val{} {
464 val = words;470 val = words;
465 }471 }
466472
467 // Initialize the first word to |v| and the rest to 0.473 // Initialize the first word to |v| and the rest to 0.
468 template <typename T, typename = cpp::enable_if_t<cpp::is_integral_v<T>>>474 template <typename T, typename = cpp::enable_if_t<cpp::is_integral_v<T>>>
469 LIBC_INLINE constexpr BigInt(T v) {475 LIBC_INLINE constexpr BigInt(T v) : val{} {
470 constexpr size_t T_SIZE = sizeof(T) * CHAR_BIT;476 constexpr size_t T_SIZE = sizeof(T) * CHAR_BIT;
471 const bool is_neg = v < 0;477 const bool is_neg = v < 0;
472 for (size_t i = 0; i < WORD_COUNT; ++i) {478 for (size_t i = 0; i < WORD_COUNT; ++i) {
...@@ -488,7 +494,7 @@ public:...@@ -488,7 +494,7 @@ public:
488 LIBC_INLINE static constexpr BigInt one() { return BigInt(1); }494 LIBC_INLINE static constexpr BigInt one() { return BigInt(1); }
489 LIBC_INLINE static constexpr BigInt all_ones() { return ~zero(); }495 LIBC_INLINE static constexpr BigInt all_ones() { return ~zero(); }
490 LIBC_INLINE static constexpr BigInt min() {496 LIBC_INLINE static constexpr BigInt min() {
491 BigInt out;497 BigInt out{};
492 if constexpr (SIGNED)498 if constexpr (SIGNED)
493 out.set_msb();499 out.set_msb();
494 return out;500 return out;
...@@ -601,7 +607,7 @@ public:...@@ -601,7 +607,7 @@ public:
601 template <size_t OtherBits>607 template <size_t OtherBits>
602 LIBC_INLINE constexpr auto608 LIBC_INLINE constexpr auto
603 ful_mul(const BigInt<OtherBits, Signed, WordType> &other) const {609 ful_mul(const BigInt<OtherBits, Signed, WordType> &other) const {
604 BigInt<Bits + OtherBits, Signed, WordType> result;610 BigInt<Bits + OtherBits, Signed, WordType> result{};
605 multiword::multiply_with_carry(result.val, val, other.val);611 multiword::multiply_with_carry(result.val, val, other.val);
606 return result;612 return result;
607 }613 }
...@@ -633,7 +639,7 @@ public:...@@ -633,7 +639,7 @@ public:
633 // 256 4 16 10 3639 // 256 4 16 10 3
634 // 512 8 64 36 7640 // 512 8 64 36 7
635 LIBC_INLINE constexpr BigInt quick_mul_hi(const BigInt &other) const {641 LIBC_INLINE constexpr BigInt quick_mul_hi(const BigInt &other) const {
636 BigInt result;642 BigInt result{};
637 multiword::quick_mul_hi(result.val, val, other.val);643 multiword::quick_mul_hi(result.val, val, other.val);
638 return result;644 return result;
639 }645 }
...@@ -686,7 +692,7 @@ public:...@@ -686,7 +692,7 @@ public:
686 // And finally we perform some extra alignment steps for the remaining bits.692 // And finally we perform some extra alignment steps for the remaining bits.
687 LIBC_INLINE constexpr cpp::optional<BigInt>693 LIBC_INLINE constexpr cpp::optional<BigInt>
688 div_uint_half_times_pow_2(multiword::half_width_t<WordType> x, size_t e) {694 div_uint_half_times_pow_2(multiword::half_width_t<WordType> x, size_t e) {
689 BigInt remainder;695 BigInt remainder{};
690 if (x == 0)696 if (x == 0)
691 return cpp::nullopt;697 return cpp::nullopt;
692 if (e >= Bits) {698 if (e >= Bits) {
...@@ -694,7 +700,7 @@ public:...@@ -694,7 +700,7 @@ public:
694 *this = BigInt<Bits, false, WordType>();700 *this = BigInt<Bits, false, WordType>();
695 return remainder;701 return remainder;
696 }702 }
697 BigInt quotient;703 BigInt quotient{};
698 WordType x_word = static_cast<WordType>(x);704 WordType x_word = static_cast<WordType>(x);
699 constexpr size_t LOG2_WORD_SIZE =705 constexpr size_t LOG2_WORD_SIZE =
700 static_cast<size_t>(cpp::bit_width(WORD_SIZE) - 1);706 static_cast<size_t>(cpp::bit_width(WORD_SIZE) - 1);
...@@ -846,13 +852,13 @@ public:...@@ -846,13 +852,13 @@ public:
846#define DEFINE_BINOP(OP) \852#define DEFINE_BINOP(OP) \
847 LIBC_INLINE friend constexpr BigInt operator OP(const BigInt &lhs, \853 LIBC_INLINE friend constexpr BigInt operator OP(const BigInt &lhs, \
848 const BigInt &rhs) { \854 const BigInt &rhs) { \
849 BigInt result; \855 BigInt result{}; \
850 for (size_t i = 0; i < WORD_COUNT; ++i) \856 for (size_t i = 0; i < WORD_COUNT; ++i) \
851 result[i] = lhs[i] OP rhs[i]; \857 result[i] = lhs[i] OP rhs[i]; \
852 return result; \858 return result; \
853 } \859 } \
854 LIBC_INLINE friend constexpr BigInt operator OP##=(BigInt &lhs, \860 LIBC_INLINE friend constexpr BigInt operator OP## = \
855 const BigInt &rhs) { \861 (BigInt & lhs, const BigInt &rhs) { \
856 for (size_t i = 0; i < WORD_COUNT; ++i) \862 for (size_t i = 0; i < WORD_COUNT; ++i) \
857 lhs[i] OP## = rhs[i]; \863 lhs[i] OP## = rhs[i]; \
858 return lhs; \864 return lhs; \
...@@ -864,7 +870,7 @@ public:...@@ -864,7 +870,7 @@ public:
864#undef DEFINE_BINOP870#undef DEFINE_BINOP
865871
866 LIBC_INLINE constexpr BigInt operator~() const {872 LIBC_INLINE constexpr BigInt operator~() const {
867 BigInt result;873 BigInt result{};
868 for (size_t i = 0; i < WORD_COUNT; ++i)874 for (size_t i = 0; i < WORD_COUNT; ++i)
869 result[i] = static_cast<WordType>(~val[i]);875 result[i] = static_cast<WordType>(~val[i]);
870 return result;876 return result;
...@@ -1004,7 +1010,7 @@ private:...@@ -1004,7 +1010,7 @@ private:
1004 LIBC_INLINE constexpr static Division divide_unsigned(const BigInt &dividend,1010 LIBC_INLINE constexpr static Division divide_unsigned(const BigInt &dividend,
1005 const BigInt &divider) {1011 const BigInt &divider) {
1006 BigInt remainder = dividend;1012 BigInt remainder = dividend;
1007 BigInt quotient;1013 BigInt quotient{};
1008 if (remainder >= divider) {1014 if (remainder >= divider) {
1009 BigInt subtractor = divider;1015 BigInt subtractor = divider;
1010 int cur_bit = multiword::countl_zero(subtractor.val) -1016 int cur_bit = multiword::countl_zero(subtractor.val) -
...@@ -1181,31 +1187,6 @@ LIBC_INLINE_VAR constexpr bool is_unsigned_integral_or_big_int_v =...@@ -1181,31 +1187,6 @@ LIBC_INLINE_VAR constexpr bool is_unsigned_integral_or_big_int_v =
11811187
1182namespace cpp {1188namespace cpp {
11831189
1184// Specialization of cpp::bit_cast ('bit.h') from T to BigInt.
1185template <typename To, typename From>
1186LIBC_INLINE constexpr cpp::enable_if_t<
1187 (sizeof(To) == sizeof(From)) && cpp::is_trivially_copyable<To>::value &&
1188 cpp::is_trivially_copyable<From>::value && is_big_int<To>::value,
1189 To>
1190bit_cast(const From &from) {
1191 To out;
1192 using Storage = decltype(out.val);
1193 out.val = cpp::bit_cast<Storage>(from);
1194 return out;
1195}
1196
1197// Specialization of cpp::bit_cast ('bit.h') from BigInt to T.
1198template <typename To, size_t Bits>
1199LIBC_INLINE constexpr cpp::enable_if_t<
1200 sizeof(To) == sizeof(UInt<Bits>) &&
1201 cpp::is_trivially_constructible<To>::value &&
1202 cpp::is_trivially_copyable<To>::value &&
1203 cpp::is_trivially_copyable<UInt<Bits>>::value,
1204 To>
1205bit_cast(const UInt<Bits> &from) {
1206 return cpp::bit_cast<To>(from.val);
1207}
1208
1209// Specialization of cpp::popcount ('bit.h') for BigInt.1190// Specialization of cpp::popcount ('bit.h') for BigInt.
1210template <typename T>1191template <typename T>
1211[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, int>1192[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, int>
...@@ -1311,7 +1292,7 @@ mask_trailing_ones() {...@@ -1311,7 +1292,7 @@ mask_trailing_ones() {
1311 return T::all_ones();1292 return T::all_ones();
1312 constexpr size_t QUOTIENT = count / T::WORD_SIZE;1293 constexpr size_t QUOTIENT = count / T::WORD_SIZE;
1313 constexpr size_t REMAINDER = count % T::WORD_SIZE;1294 constexpr size_t REMAINDER = count % T::WORD_SIZE;
1314 T out; // zero initialized1295 T out{};
1315 for (size_t i = 0; i <= QUOTIENT; ++i)1296 for (size_t i = 0; i <= QUOTIENT; ++i)
1316 out[i] = i < QUOTIENT1297 out[i] = i < QUOTIENT
1317 ? cpp::numeric_limits<typename T::word_type>::max()1298 ? cpp::numeric_limits<typename T::word_type>::max()
...@@ -1327,7 +1308,7 @@ LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, T> mask_leading_ones() {...@@ -1327,7 +1308,7 @@ LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, T> mask_leading_ones() {
1327 return T::all_ones();1308 return T::all_ones();
1328 constexpr size_t QUOTIENT = (T::BITS - count - 1U) / T::WORD_SIZE;1309 constexpr size_t QUOTIENT = (T::BITS - count - 1U) / T::WORD_SIZE;
1329 constexpr size_t REMAINDER = count % T::WORD_SIZE;1310 constexpr size_t REMAINDER = count % T::WORD_SIZE;
1330 T out; // zero initialized1311 T out{};
1331 for (size_t i = QUOTIENT; i < T::WORD_COUNT; ++i)1312 for (size_t i = QUOTIENT; i < T::WORD_COUNT; ++i)
1332 out[i] = i > QUOTIENT1313 out[i] = i > QUOTIENT
1333 ? cpp::numeric_limits<typename T::word_type>::max()1314 ? cpp::numeric_limits<typename T::word_type>::max()
...@@ -1386,6 +1367,11 @@ first_trailing_one(T value) {...@@ -1386,6 +1367,11 @@ first_trailing_one(T value) {
1386 return value == 0 ? 0 : cpp::countr_zero(value) + 1;1367 return value == 0 ? 0 : cpp::countr_zero(value) + 1;
1387}1368}
13881369
1370static_assert(LIBC_NAMESPACE::cpp::is_trivially_constructible<
1371 LIBC_NAMESPACE::BigInt<128, false>>::value);
1372static_assert(LIBC_NAMESPACE::cpp::is_trivially_copyable<
1373 LIBC_NAMESPACE::BigInt<128, false>>::value);
1374
1389} // namespace LIBC_NAMESPACE_DECL1375} // namespace LIBC_NAMESPACE_DECL
13901376
1391#endif // LLVM_LIBC_SRC___SUPPORT_BIG_INT_H1377#endif // LLVM_LIBC_SRC___SUPPORT_BIG_INT_H
lib/libcxx/libc/src/__support/common.h+45-32
...@@ -22,6 +22,10 @@...@@ -22,6 +22,10 @@
22#define LLVM_LIBC_FUNCTION_ATTR22#define LLVM_LIBC_FUNCTION_ATTR
23#endif23#endif
2424
25#ifndef LLVM_LIBC_VARIABLE_ATTR
26#define LLVM_LIBC_VARIABLE_ATTR
27#endif
28
25// clang-format off29// clang-format off
26// Allow each function `func` to have extra attributes specified by defining:30// Allow each function `func` to have extra attributes specified by defining:
27// `LLVM_LIBC_FUNCTION_ATTR_func` macro, which should always start with31// `LLVM_LIBC_FUNCTION_ATTR_func` macro, which should always start with
...@@ -33,7 +37,9 @@...@@ -33,7 +37,9 @@
33// clang-format on37// clang-format on
34#define LLVM_LIBC_EMPTY38#define LLVM_LIBC_EMPTY
3539
40#define GET_NOTHING(...) 0
36#define GET_SECOND(first, second, ...) second41#define GET_SECOND(first, second, ...) second
42#define GET_FIFTH(first, second, third, fourth, fifth, ...) fifth
37#define EXPAND_THEN_SECOND(name) GET_SECOND(name, LLVM_LIBC_EMPTY)43#define EXPAND_THEN_SECOND(name) GET_SECOND(name, LLVM_LIBC_EMPTY)
3844
39#define LLVM_LIBC_ATTR(name) EXPAND_THEN_SECOND(LLVM_LIBC_FUNCTION_ATTR_##name)45#define LLVM_LIBC_ATTR(name) EXPAND_THEN_SECOND(LLVM_LIBC_FUNCTION_ATTR_##name)
...@@ -44,50 +50,57 @@...@@ -44,50 +50,57 @@
44// symbol. Moreover, a C symbol `func` in macOS is mangled as `_func`.50// symbol. Moreover, a C symbol `func` in macOS is mangled as `_func`.
45#if defined(LIBC_COPT_PUBLIC_PACKAGING) && !defined(LIBC_COMPILER_IS_MSVC)51#if defined(LIBC_COPT_PUBLIC_PACKAGING) && !defined(LIBC_COMPILER_IS_MSVC)
46#ifndef __APPLE__52#ifndef __APPLE__
47#define LLVM_LIBC_FUNCTION_IMPL(type, name, arglist) \53#define LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, c_alias) \
48 LLVM_LIBC_ATTR(name) \54 LLVM_LIBC_ATTR(name) \
49 LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name) \55 LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name) \
50 __##name##_impl__ asm(#name); \56 __##name##_impl__ asm(c_alias); \
51 decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]]; \57 decltype(LIBC_NAMESPACE::name) name [[gnu::alias(c_alias)]]; \
52 type __##name##_impl__ arglist58 type __##name##_impl__ arglist
53#else // __APPLE__59#else // __APPLE__
54#define LLVM_LIBC_FUNCTION_IMPL(type, name, arglist) \60#define LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, c_alias) \
55 LLVM_LIBC_ATTR(name) \61 LLVM_LIBC_ATTR(name) \
56 LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name) name asm("_" #name); \62 LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name) name asm( \
63 "_" c_alias); \
57 type name arglist64 type name arglist
58#endif // __APPLE__65#endif // __APPLE__
66
59#else // LIBC_COPT_PUBLIC_PACKAGING67#else // LIBC_COPT_PUBLIC_PACKAGING
60#define LLVM_LIBC_FUNCTION_IMPL(type, name, arglist) type name arglist68#define LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, c_alias) \
69 type name arglist
61#endif // LIBC_COPT_PUBLIC_PACKAGING70#endif // LIBC_COPT_PUBLIC_PACKAGING
6271
63// This extra layer of macro allows `name` to be a macro to rename a function.72#define LLVM_LIBC_FUNCTION_IMPL_3(type, name, arglist) \
64#define LLVM_LIBC_FUNCTION(type, name, arglist) \73 LLVM_LIBC_FUNCTION_IMPL_4(type, name, arglist, #name)
65 LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
6674
67namespace LIBC_NAMESPACE_DECL {75// LLVM_LIBC_FUNCTION(type, name, arglist) is equivalent to
68namespace internal {76// LLVM_LIBC_FUNCTION(type, name, arglist, #name)
69LIBC_INLINE constexpr bool same_string(char const *lhs, char const *rhs) {77#define LLVM_LIBC_FUNCTION(...) \
70 for (; *lhs || *rhs; ++lhs, ++rhs)78 GET_FIFTH(__VA_ARGS__, LLVM_LIBC_FUNCTION_IMPL_4, LLVM_LIBC_FUNCTION_IMPL_3, \
71 if (*lhs != *rhs)79 GET_NOTHING)(__VA_ARGS__)
72 return false;
73 return true;
74}
75} // namespace internal
76} // namespace LIBC_NAMESPACE_DECL
7780
78#define __LIBC_MACRO_TO_STRING(str) #str81// At the moment, [[gnu::alias()]] is not supported on MacOS, and it is needed
79#define LIBC_MACRO_TO_STRING(str) __LIBC_MACRO_TO_STRING(str)82// to cleanly export and alias the C++ symbol `LIBC_NAMESPACE::func` with the C
83// symbol `func`. So for public packaging on MacOS, we will only export the C
84// symbol. Moreover, a C symbol `func` in macOS is mangled as `_func`.
85#if defined(LIBC_COPT_PUBLIC_PACKAGING) && !defined(LIBC_COMPILER_IS_MSVC)
86#ifndef __APPLE__
87#define LLVM_LIBC_VARIABLE_IMPL(type, name) \
88 LLVM_LIBC_ATTR(name) \
89 extern LLVM_LIBC_VARIABLE_ATTR decltype(LIBC_NAMESPACE::name) \
90 __##name##_impl__ asm(#name); \
91 extern decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]]; \
92 type __##name##_impl__
93#else // __APPLE__
94#define LLVM_LIBC_VARIABLE_IMPL(type, name) \
95 LLVM_LIBC_ATTR(name) \
96 extern LLVM_LIBC_VARIABLE_ATTR decltype(LIBC_NAMESPACE::name) name asm( \
97 "_" #name); \
98 type name
99#endif // __APPLE__
100#else // LIBC_COPT_PUBLIC_PACKAGING
101#define LLVM_LIBC_VARIABLE_IMPL(type, name) type name
102#endif // LIBC_COPT_PUBLIC_PACKAGING
80103
81// LLVM_LIBC_IS_DEFINED checks whether a particular macro is defined.104#define LLVM_LIBC_VARIABLE(type, name) LLVM_LIBC_VARIABLE_IMPL(type, name)
82// Usage: constexpr bool kUseAvx = LLVM_LIBC_IS_DEFINED(__AVX__);
83//
84// This works by comparing the stringified version of the macro with and without
85// evaluation. If FOO is not undefined both stringifications yield "FOO". If FOO
86// is defined, one stringification yields "FOO" while the other yields its
87// stringified value "1".
88#define LLVM_LIBC_IS_DEFINED(macro) \
89 !LIBC_NAMESPACE::internal::same_string( \
90 LLVM_LIBC_IS_DEFINED__EVAL_AND_STRINGIZE(macro), #macro)
91#define LLVM_LIBC_IS_DEFINED__EVAL_AND_STRINGIZE(s) #s
92105
93#endif // LLVM_LIBC_SRC___SUPPORT_COMMON_H106#endif // LLVM_LIBC_SRC___SUPPORT_COMMON_H
lib/libcxx/libc/src/__support/ctype_utils.h+27-15
...@@ -37,7 +37,7 @@ namespace internal {...@@ -37,7 +37,7 @@ namespace internal {
37// EBCDIC. Technically we could use some smaller ranges, but that's even harder37// EBCDIC. Technically we could use some smaller ranges, but that's even harder
38// to read.38// to read.
3939
40LIBC_INLINE static constexpr bool islower(char ch) {40LIBC_INLINE constexpr bool islower(char ch) {
41 switch (ch) {41 switch (ch) {
42 case 'a':42 case 'a':
43 case 'b':43 case 'b':
...@@ -71,7 +71,7 @@ LIBC_INLINE static constexpr bool islower(char ch) {...@@ -71,7 +71,7 @@ LIBC_INLINE static constexpr bool islower(char ch) {
71 }71 }
72}72}
7373
74LIBC_INLINE static constexpr bool isupper(char ch) {74LIBC_INLINE constexpr bool isupper(char ch) {
75 switch (ch) {75 switch (ch) {
76 case 'A':76 case 'A':
77 case 'B':77 case 'B':
...@@ -105,7 +105,7 @@ LIBC_INLINE static constexpr bool isupper(char ch) {...@@ -105,7 +105,7 @@ LIBC_INLINE static constexpr bool isupper(char ch) {
105 }105 }
106}106}
107107
108LIBC_INLINE static constexpr bool isdigit(char ch) {108LIBC_INLINE constexpr bool isdigit(char ch) {
109 switch (ch) {109 switch (ch) {
110 case '0':110 case '0':
111 case '1':111 case '1':
...@@ -123,7 +123,7 @@ LIBC_INLINE static constexpr bool isdigit(char ch) {...@@ -123,7 +123,7 @@ LIBC_INLINE static constexpr bool isdigit(char ch) {
123 }123 }
124}124}
125125
126LIBC_INLINE static constexpr char tolower(char ch) {126LIBC_INLINE constexpr char tolower(char ch) {
127 switch (ch) {127 switch (ch) {
128 case 'A':128 case 'A':
129 return 'a';129 return 'a';
...@@ -182,7 +182,7 @@ LIBC_INLINE static constexpr char tolower(char ch) {...@@ -182,7 +182,7 @@ LIBC_INLINE static constexpr char tolower(char ch) {
182 }182 }
183}183}
184184
185LIBC_INLINE static constexpr char toupper(char ch) {185LIBC_INLINE constexpr char toupper(char ch) {
186 switch (ch) {186 switch (ch) {
187 case 'a':187 case 'a':
188 return 'A';188 return 'A';
...@@ -241,7 +241,7 @@ LIBC_INLINE static constexpr char toupper(char ch) {...@@ -241,7 +241,7 @@ LIBC_INLINE static constexpr char toupper(char ch) {
241 }241 }
242}242}
243243
244LIBC_INLINE static constexpr bool isalpha(char ch) {244LIBC_INLINE constexpr bool isalpha(char ch) {
245 switch (ch) {245 switch (ch) {
246 case 'a':246 case 'a':
247 case 'b':247 case 'b':
...@@ -301,7 +301,7 @@ LIBC_INLINE static constexpr bool isalpha(char ch) {...@@ -301,7 +301,7 @@ LIBC_INLINE static constexpr bool isalpha(char ch) {
301 }301 }
302}302}
303303
304LIBC_INLINE static constexpr bool isalnum(char ch) {304LIBC_INLINE constexpr bool isalnum(char ch) {
305 switch (ch) {305 switch (ch) {
306 case 'a':306 case 'a':
307 case 'b':307 case 'b':
...@@ -371,7 +371,8 @@ LIBC_INLINE static constexpr bool isalnum(char ch) {...@@ -371,7 +371,8 @@ LIBC_INLINE static constexpr bool isalnum(char ch) {
371 }371 }
372}372}
373373
374LIBC_INLINE static constexpr int b36_char_to_int(char ch) {374#ifndef LIBC_COPT_CTYPE_SMALLER_ASCII
375LIBC_INLINE constexpr int b36_char_to_int(char ch) {
375 switch (ch) {376 switch (ch) {
376 case '0':377 case '0':
377 return 0;378 return 0;
...@@ -475,8 +476,21 @@ LIBC_INLINE static constexpr int b36_char_to_int(char ch) {...@@ -475,8 +476,21 @@ LIBC_INLINE static constexpr int b36_char_to_int(char ch) {
475 return 0;476 return 0;
476 }477 }
477}478}
479#else // LIBC_COPT_SMALL_ASCII_CTYPE
480// This version assumes ASCII for the tolower, but generates smaller code since
481// the switch version of this function ends up with a table. This should only be
482// used when the target is known to be ASCII.
483LIBC_INLINE constexpr int b36_char_to_int(char ch) {
484 if (ch >= '0' && ch <= '9')
485 return ch - '0';
486 char ch_unsafe_lower = ch | 32;
487 if (ch_unsafe_lower >= 'a' && ch_unsafe_lower <= 'z')
488 return ch_unsafe_lower - 'a' + 10;
489 return 0;
490}
491#endif // LIBC_COPT_SMALL_ASCII_CTYPE
478492
479LIBC_INLINE static constexpr char int_to_b36_char(int num) {493LIBC_INLINE constexpr char int_to_b36_char(int num) {
480 // Can't actually use LIBC_ASSERT here because it depends on integer_to_string494 // Can't actually use LIBC_ASSERT here because it depends on integer_to_string
481 // which depends on this.495 // which depends on this.
482496
...@@ -559,7 +573,7 @@ LIBC_INLINE static constexpr char int_to_b36_char(int num) {...@@ -559,7 +573,7 @@ LIBC_INLINE static constexpr char int_to_b36_char(int num) {
559 }573 }
560}574}
561575
562LIBC_INLINE static constexpr bool isspace(char ch) {576LIBC_INLINE constexpr bool isspace(char ch) {
563 switch (ch) {577 switch (ch) {
564 case ' ':578 case ' ':
565 case '\t':579 case '\t':
...@@ -574,14 +588,12 @@ LIBC_INLINE static constexpr bool isspace(char ch) {...@@ -574,14 +588,12 @@ LIBC_INLINE static constexpr bool isspace(char ch) {
574}588}
575589
576// not yet encoding independent.590// not yet encoding independent.
577LIBC_INLINE static constexpr bool isgraph(char ch) {591LIBC_INLINE constexpr bool isgraph(char ch) { return 0x20 < ch && ch < 0x7f; }
578 return 0x20 < ch && ch < 0x7f;
579}
580592
581// An overload which provides a way to compare input with specific character593// An overload which provides a way to compare input with specific character
582// values, when input can be of a regular or a wide character type.594// values, when input can be of a regular or a wide character type.
583LIBC_INLINE static constexpr bool is_char_or_wchar(char ch, char c_value,595LIBC_INLINE constexpr bool is_char_or_wchar(char ch, char c_value,
584 [[maybe_unused]] wchar_t) {596 [[maybe_unused]] wchar_t) {
585 return (ch == c_value);597 return (ch == c_value);
586}598}
587599
lib/libcxx/libc/src/__support/high_precision_decimal.h+1-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1//===-- High Precision Decimal ----------------------------------*- C++ -*-===//1//===-- High Precision Decimal ----------------------------------*- C++ -*-===//
2//2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See httpss//llvm.org/LICENSE.txt for license information.4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
lib/libcxx/libc/src/__support/libc_assert.h+4-11
...@@ -25,8 +25,9 @@...@@ -25,8 +25,9 @@
25#include "src/__support/OSUtil/exit.h"25#include "src/__support/OSUtil/exit.h"
26#include "src/__support/OSUtil/io.h"26#include "src/__support/OSUtil/io.h"
27#include "src/__support/integer_to_string.h"27#include "src/__support/integer_to_string.h"
28#include "src/__support/macros/attributes.h" // For LIBC_INLINE28#include "src/__support/macros/attributes.h" // For LIBC_INLINE
29#include "src/__support/macros/config.h"29#include "src/__support/macros/config.h"
30#include "src/__support/macros/macro-utils.h"
30#include "src/__support/macros/optimization.h" // For LIBC_UNLIKELY31#include "src/__support/macros/optimization.h" // For LIBC_UNLIKELY
3132
32namespace LIBC_NAMESPACE_DECL {33namespace LIBC_NAMESPACE_DECL {
...@@ -65,19 +66,11 @@ LIBC_INLINE void report_assertion_failure(const char *assertion,...@@ -65,19 +66,11 @@ LIBC_INLINE void report_assertion_failure(const char *assertion,
65 } while (false)66 } while (false)
66#else67#else
6768
68// Convert __LINE__ to a string using macros. The indirection is necessary
69// because otherwise it will turn "__LINE__" into a string, not its value. The
70// value is evaluated in the indirection step.
71#define __LIBC_MACRO_TO_STR(x) #x
72#define __LIBC_MACRO_TO_STR_INDIR(y) __LIBC_MACRO_TO_STR(y)
73#define __LIBC_LINE_STR__ __LIBC_MACRO_TO_STR_INDIR(__LINE__)
74
75#define LIBC_ASSERT(COND) \69#define LIBC_ASSERT(COND) \
76 do { \70 do { \
77 if (LIBC_UNLIKELY(!(COND))) { \71 if (LIBC_UNLIKELY(!(COND))) { \
78 LIBC_NAMESPACE::write_to_stderr(__FILE__ ":" __LIBC_LINE_STR__ \72 LIBC_NAMESPACE::write_to_stderr(__FILE__ ":" LLVM_LIBC_STRINGIFY( \
79 ": Assertion failed: '" #COND \73 __LINE__) ": Assertion failed: '" #COND "' in function: '"); \
80 "' in function: '"); \
81 LIBC_NAMESPACE::write_to_stderr(__PRETTY_FUNCTION__); \74 LIBC_NAMESPACE::write_to_stderr(__PRETTY_FUNCTION__); \
82 LIBC_NAMESPACE::write_to_stderr("'\n"); \75 LIBC_NAMESPACE::write_to_stderr("'\n"); \
83 LIBC_NAMESPACE::internal::exit(0xFF); \76 LIBC_NAMESPACE::internal::exit(0xFF); \
lib/libcxx/libc/src/__support/macros/attributes.h+74
...@@ -29,6 +29,80 @@...@@ -29,6 +29,80 @@
29#define LIBC_INLINE_ASM __asm__ __volatile__29#define LIBC_INLINE_ASM __asm__ __volatile__
30#define LIBC_UNUSED __attribute__((unused))30#define LIBC_UNUSED __attribute__((unused))
3131
32#ifndef LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED
33#if (defined(LIBC_COMPILER_IS_GCC) && (LIBC_COMPILER_GCC_VER >= 900)) || \
34 (defined(LIBC_COMPILER_IS_CLANG) && LIBC_COMPILER_CLANG_VER >= 900)
35#define LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED 1
36#else
37#define LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED \
38 (__has_builtin(__builtin_is_constant_evaluated))
39#endif // (defined(LIBC_COMPILER_IS_GCC) && (LIBC_COMPILER_GCC_VER >= 900)) ||
40 // (defined(LIBC_COMPILER_IS_CLANG) && LIBC_COMPILER_CLANG
41#endif // LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED
42
43#ifndef LIBC_HAS_BUILTIN_BIT_CAST
44#if __has_builtin(__builtin_bit_cast) || defined(LIBC_COMPILER_IS_MSVC)
45#define LIBC_HAS_BUILTIN_BIT_CAST 1
46#else
47#define LIBC_HAS_BUILTIN_BIT_CAST 0
48#endif // has_builtin(__builtin_bit_cast)
49#endif // LIBC_HAS_BUILTIN_BIT_CAST
50
51#if LIBC_HAS_BUILTIN_BIT_CAST
52#define LIBC_BIT_CAST_CONSTEXPR constexpr
53#define LIBC_BIT_CAST_CONSTEXPR_VAR constexpr
54#else
55#define LIBC_BIT_CAST_CONSTEXPR
56#define LIBC_BIT_CAST_CONSTEXPR_VAR const
57#endif // LIBC_HAS_BUILTIN_BIT_CAST
58
59#ifndef LIBC_HAS_CONSTANT_EVALUATION
60#define LIBC_HAS_CONSTANT_EVALUATION \
61 (LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED && LIBC_HAS_BUILTIN_BIT_CAST)
62#endif // LIBC_HAS_CONSTANT_EVALUATION
63
64#if LIBC_HAS_CONSTANT_EVALUATION
65#define LIBC_CONSTEXPR_DEFAULT constexpr
66#define LIBC_CONSTEXPR_VAR_DEFAULT constexpr
67#else
68#define LIBC_CONSTEXPR_DEFAULT
69#define LIBC_CONSTEXPR_VAR_DEFAULT const
70#endif // LIBC_HAS_CONSTANT_EVALUATION
71
72// TODO: Remove the macro once Clang/LLVM bump their minimum compilers' version.
73// The reason for indirection is GCC is known to fail with constexpr qualified
74// functions that doesn't produce constant expression.
75// Also, there are some circular dependency in the generic functions without
76// __builtin_func for the following functions:
77// fputil::fma
78// fputil::sqrt
79#if LIBC_ENABLE_CONSTEXPR && LIBC_HAS_CONSTANT_EVALUATION
80#define LIBC_USE_CONSTEXPR
81#define LIBC_CONSTEXPR constexpr
82#define LIBC_CONSTEXPR_VAR constexpr
83#else
84#define LIBC_CONSTEXPR
85#define LIBC_CONSTEXPR_VAR const
86#endif // LIBC_USE_CONSTEXPR
87
88#ifndef LIBC_HAS_BUILTIN_IS_ASSIGNABLE
89#if (__has_builtin(__is_assignable) || \
90 (defined(LIBC_COMPILER_IS_GCC) && (LIBC_COMPILER_GCC_VER >= 800)))
91#define LIBC_HAS_BUILTIN_IS_ASSIGNABLE 1
92#else
93#define LIBC_HAS_BUILTIN_IS_ASSIGNABLE 0
94#endif
95#endif // LIBC_HAS_BUILTIN_IS_ASSIGNABLE
96
97#ifndef LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE
98#if (__has_builtin(__is_constructible) || \
99 (defined(LIBC_COMPILER_IS_GCC) && (LIBC_COMPILER_GCC_VER >= 800)))
100#define LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
101#else
102#define LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE 0
103#endif
104#endif // LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE
105
32// Uses the platform specific specialization106// Uses the platform specific specialization
33#define LIBC_THREAD_MODE_PLATFORM 0107#define LIBC_THREAD_MODE_PLATFORM 0
34108
lib/libcxx/libc/src/__support/macros/config.h+14
...@@ -48,6 +48,10 @@...@@ -48,6 +48,10 @@
4848
49#define __builtin_prefetch(X, Y, Z)49#define __builtin_prefetch(X, Y, Z)
5050
51#define LIBC_HAS_BUILTIN_IS_CONSTANT_EVALUATED 1
52#define LIBC_HAS_BUILTIN_IS_ASSIGNABLE 1
53#define LIBC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
54
51#endif // LIBC_COMPILER_IS_MSVC55#endif // LIBC_COMPILER_IS_MSVC
5256
53#ifdef __clang__57#ifdef __clang__
...@@ -66,4 +70,14 @@...@@ -66,4 +70,14 @@
66#define LIBC_NAMESPACE_DECL LIBC_NAMESPACE70#define LIBC_NAMESPACE_DECL LIBC_NAMESPACE
67#endif71#endif
6872
73// IMPORTANT (USE WITH CAUTION): This macro is intended to be used at the top of
74// the file and set to 1. It alters the signatures of some functions to have
75// constexpr qualifier and forces the use of constexpr-compatible
76// implementation, which might be a completely different code path or
77// instructions. Some of these functions exploit platform-specific non-constexpr
78// implementations to achieve certain goals, thus it is disabled by default.
79#ifndef LIBC_ENABLE_CONSTEXPR
80#define LIBC_ENABLE_CONSTEXPR 0
81#endif
82
69#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H83#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H
lib/libcxx/libc/src/__support/macros/macro-utils.h created+16
...@@ -0,0 +1,16 @@
1//===-- Macros used by other macros ----------------------------*- C++ -*-===//
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#ifndef LLVM_LIBC_SRC___SUPPORT_MACROS_MACRO_UTILS_H
10#define LLVM_LIBC_SRC___SUPPORT_MACROS_MACRO_UTILS_H
11
12// Stringify the argument after an extra pass of macro expansion.
13#define LLVM_LIBC_STRINGIFY(x) LLVM_LIBC_STRINGIFY_IMPL(x)
14#define LLVM_LIBC_STRINGIFY_IMPL(x) #x
15
16#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_MACRO_UTILS_H
lib/libcxx/libc/src/__support/macros/optimization.h+18-7
...@@ -32,8 +32,13 @@ LIBC_INLINE constexpr bool expects_bool_condition(T value, T expected) {...@@ -32,8 +32,13 @@ LIBC_INLINE constexpr bool expects_bool_condition(T value, T expected) {
32#define LIBC_LOOP_NOUNROLL _Pragma("nounroll")32#define LIBC_LOOP_NOUNROLL _Pragma("nounroll")
33#define LIBC_LOOP_UNROLL _Pragma("unroll")33#define LIBC_LOOP_UNROLL _Pragma("unroll")
34#elif defined(LIBC_COMPILER_IS_GCC)34#elif defined(LIBC_COMPILER_IS_GCC)
35#if LIBC_COMPILER_GCC_VER >= 800
35#define LIBC_LOOP_NOUNROLL _Pragma("GCC unroll 0")36#define LIBC_LOOP_NOUNROLL _Pragma("GCC unroll 0")
36#define LIBC_LOOP_UNROLL _Pragma("GCC unroll 2048")37#define LIBC_LOOP_UNROLL _Pragma("GCC unroll 2048")
38#else
39#define LIBC_LOOP_NOUNROLL
40#define LIBC_LOOP_UNROLL
41#endif
37#elif defined(LIBC_COMPILER_IS_MSVC)42#elif defined(LIBC_COMPILER_IS_MSVC)
38#define LIBC_LOOP_NOUNROLL43#define LIBC_LOOP_NOUNROLL
39#define LIBC_LOOP_UNROLL44#define LIBC_LOOP_UNROLL
...@@ -47,33 +52,39 @@ LIBC_INLINE constexpr bool expects_bool_condition(T value, T expected) {...@@ -47,33 +52,39 @@ LIBC_INLINE constexpr bool expects_bool_condition(T value, T expected) {
47#define LIBC_MATH_SMALL_TABLES 0x0252#define LIBC_MATH_SMALL_TABLES 0x02
48#define LIBC_MATH_NO_ERRNO 0x0453#define LIBC_MATH_NO_ERRNO 0x04
49#define LIBC_MATH_NO_EXCEPT 0x0854#define LIBC_MATH_NO_EXCEPT 0x08
55#define LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT 0x10
56#define LIBC_MATH_ASSUME_ROUND_NEAREST_ONLY 0x20
50#define LIBC_MATH_FAST \57#define LIBC_MATH_FAST \
51 (LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | \58 (LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | \
52 LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)59 LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT | \
53#define LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT 0x1060 LIBC_MATH_ASSUME_ROUND_NEAREST_ONLY)
5461
55#ifndef LIBC_MATH62#ifndef LIBC_MATH
56#define LIBC_MATH 063#define LIBC_MATH 0
57#endif // LIBC_MATH64#endif // LIBC_MATH
5865
59#if (LIBC_MATH & LIBC_MATH_SKIP_ACCURATE_PASS)66#if ((LIBC_MATH) & LIBC_MATH_SKIP_ACCURATE_PASS)
60#define LIBC_MATH_HAS_SKIP_ACCURATE_PASS67#define LIBC_MATH_HAS_SKIP_ACCURATE_PASS
61#endif68#endif
6269
63#if (LIBC_MATH & LIBC_MATH_SMALL_TABLES)70#if ((LIBC_MATH) & LIBC_MATH_SMALL_TABLES)
64#define LIBC_MATH_HAS_SMALL_TABLES71#define LIBC_MATH_HAS_SMALL_TABLES
65#endif72#endif
6673
67#if (LIBC_MATH & LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT)74#if ((LIBC_MATH) & LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT)
68#define LIBC_MATH_HAS_INTERMEDIATE_COMP_IN_FLOAT75#define LIBC_MATH_HAS_INTERMEDIATE_COMP_IN_FLOAT
69#endif76#endif
7077
71#if (LIBC_MATH & LIBC_MATH_NO_ERRNO)78#if ((LIBC_MATH) & LIBC_MATH_NO_ERRNO)
72#define LIBC_MATH_HAS_NO_ERRNO79#define LIBC_MATH_HAS_NO_ERRNO
73#endif80#endif
7481
75#if (LIBC_MATH & LIBC_MATH_NO_EXCEPT)82#if ((LIBC_MATH) & LIBC_MATH_NO_EXCEPT)
76#define LIBC_MATH_HAS_NO_EXCEPT83#define LIBC_MATH_HAS_NO_EXCEPT
77#endif84#endif
7885
86#if ((LIBC_MATH) & LIBC_MATH_ASSUME_ROUND_NEAREST_ONLY)
87#define LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
88#endif
89
79#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_OPTIMIZATION_H90#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_OPTIMIZATION_H
lib/libcxx/libc/src/__support/macros/properties/architectures.h+6-1
...@@ -13,11 +13,16 @@...@@ -13,11 +13,16 @@
13#define LIBC_TARGET_ARCH_IS_AMDGPU13#define LIBC_TARGET_ARCH_IS_AMDGPU
14#endif14#endif
1515
16#if defined(__SPIRV__)
17#define LIBC_TARGET_ARCH_IS_SPIRV
18#endif
19
16#if defined(__NVPTX__)20#if defined(__NVPTX__)
17#define LIBC_TARGET_ARCH_IS_NVPTX21#define LIBC_TARGET_ARCH_IS_NVPTX
18#endif22#endif
1923
20#if defined(LIBC_TARGET_ARCH_IS_NVPTX) || defined(LIBC_TARGET_ARCH_IS_AMDGPU)24#if defined(LIBC_TARGET_ARCH_IS_NVPTX) || \
25 defined(LIBC_TARGET_ARCH_IS_AMDGPU) || defined(LIBC_TARGET_ARCH_IS_SPIRV)
21#define LIBC_TARGET_ARCH_IS_GPU26#define LIBC_TARGET_ARCH_IS_GPU
22#endif27#endif
2328
lib/libcxx/libc/src/__support/macros/properties/cpu_features.h+7-2
...@@ -56,6 +56,10 @@...@@ -56,6 +56,10 @@
56#define LIBC_TARGET_CPU_HAS_AVX512BW56#define LIBC_TARGET_CPU_HAS_AVX512BW
57#endif57#endif
5858
59#if defined(__AVX512F__) || defined(__AVX2__)
60#define LIBC_TARGET_CPU_HAS_GATHER
61#endif
62
59#if defined(__ARM_FP)63#if defined(__ARM_FP)
60#if (__ARM_FP & 0x2)64#if (__ARM_FP & 0x2)
61#define LIBC_TARGET_CPU_HAS_ARM_FPU_HALF65#define LIBC_TARGET_CPU_HAS_ARM_FPU_HALF
...@@ -91,13 +95,14 @@...@@ -91,13 +95,14 @@
91#endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE95#endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE
92#endif // __riscv_flen96#endif // __riscv_flen
9397
94#if defined(__NVPTX__) || defined(__AMDGPU__)98#if defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__)
95#define LIBC_TARGET_CPU_HAS_FPU_FLOAT99#define LIBC_TARGET_CPU_HAS_FPU_FLOAT
96#define LIBC_TARGET_CPU_HAS_FPU_DOUBLE100#define LIBC_TARGET_CPU_HAS_FPU_DOUBLE
97#endif101#endif
98102
99#if defined(__ARM_FEATURE_FMA) || (defined(__AVX2__) && defined(__FMA__)) || \103#if defined(__ARM_FEATURE_FMA) || (defined(__AVX2__) && defined(__FMA__)) || \
100 defined(__NVPTX__) || defined(__AMDGPU__) || defined(__riscv_flen)104 defined(__NVPTX__) || defined(__AMDGPU__) || defined(__riscv_flen) || \
105 defined(__SPIRV__)
101#define LIBC_TARGET_CPU_HAS_FMA106#define LIBC_TARGET_CPU_HAS_FMA
102// Provide a more fine-grained control of FMA instruction for ARM targets.107// Provide a more fine-grained control of FMA instruction for ARM targets.
103#if defined(LIBC_TARGET_CPU_HAS_FPU_HALF)108#if defined(LIBC_TARGET_CPU_HAS_FPU_HALF)
lib/libcxx/libc/src/__support/macros/sanitizer.h+7-6
...@@ -26,24 +26,25 @@...@@ -26,24 +26,25 @@
26#ifdef LIBC_HAS_MEMORY_SANITIZER26#ifdef LIBC_HAS_MEMORY_SANITIZER
27// Only perform MSAN unpoison in non-constexpr context.27// Only perform MSAN unpoison in non-constexpr context.
28#include <sanitizer/msan_interface.h>28#include <sanitizer/msan_interface.h>
29#define MSAN_UNPOISON(addr, size) \29#define LIBC_MSAN_UNPOISON(addr, size) \
30 do { \30 do { \
31 if (!__builtin_is_constant_evaluated()) \31 if (!__builtin_is_constant_evaluated()) \
32 __msan_unpoison(addr, size); \32 __msan_unpoison(addr, size); \
33 } while (0)33 } while (0)
34#else34#else
35#define MSAN_UNPOISON(ptr, size)35#define LIBC_MSAN_UNPOISON(ptr, size)
36#endif36#endif
3737
38#ifdef LIBC_HAS_ADDRESS_SANITIZER38#ifdef LIBC_HAS_ADDRESS_SANITIZER
39#include <sanitizer/asan_interface.h>39#include <sanitizer/asan_interface.h>
40#define ASAN_POISON_MEMORY_REGION(addr, size) \40#define LIBC_ASAN_POISON_MEMORY_REGION(addr, size) \
41 __asan_poison_memory_region((addr), (size))41 __asan_poison_memory_region((addr), (size))
42#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \42#define LIBC_ASAN_UNPOISON_MEMORY_REGION(addr, size) \
43 __asan_unpoison_memory_region((addr), (size))43 __asan_unpoison_memory_region((addr), (size))
44#else44#else
45#define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))45#define LIBC_ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
46#define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))46#define LIBC_ASAN_UNPOISON_MEMORY_REGION(addr, size) \
47 ((void)(addr), (void)(size))
47#endif48#endif
4849
49#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_SANITIZER_H50#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_SANITIZER_H
lib/libcxx/libc/src/__support/math_extras.h+15
...@@ -80,6 +80,21 @@ template <typename T>...@@ -80,6 +80,21 @@ template <typename T>
80#endif // __builtin_sub_overflow80#endif // __builtin_sub_overflow
81}81}
8282
83template <typename T>
84[[nodiscard]] LIBC_INLINE constexpr bool mul_overflow(T a, T b, T &res) {
85#if __has_builtin(__builtin_mul_overflow)
86 return __builtin_mul_overflow(a, b, &res);
87#else
88 T max = cpp::numeric_limits<T>::max();
89 T min = cpp::numeric_limits<T>::min();
90 bool overflow = (b > 0 && (a > max / b || a < min / b)) ||
91 (b < 0 && (a < max / b || a > min / b));
92 if (!overflow)
93 res = a * b;
94 return overflow;
95#endif
96}
97
83#define RETURN_IF(TYPE, BUILTIN) \98#define RETURN_IF(TYPE, BUILTIN) \
84 if constexpr (cpp::is_same_v<T, TYPE>) \99 if constexpr (cpp::is_same_v<T, TYPE>) \
85 return BUILTIN(a, b, carry_in, &carry_out);100 return BUILTIN(a, b, carry_in, &carry_out);
lib/libcxx/libc/src/__support/str_to_float.h+14-9
...@@ -124,7 +124,7 @@ eisel_lemire(ExpandedFloat<T> init_num,...@@ -124,7 +124,7 @@ eisel_lemire(ExpandedFloat<T> init_num,
124 // Wider Approximation124 // Wider Approximation
125 UInt128 final_approx;125 UInt128 final_approx;
126 // The halfway constant is used to check if the bits that will be shifted away126 // The halfway constant is used to check if the bits that will be shifted away
127 // intially are all 1. For doubles this is 64 (bitstype size) - 52 (final127 // initially are all 1. For doubles this is 64 (bitstype size) - 52 (final
128 // mantissa size) - 3 (we shift away the last two bits separately for128 // mantissa size) - 3 (we shift away the last two bits separately for
129 // accuracy, and the most significant bit is ignored.) = 9 bits. Similarly,129 // accuracy, and the most significant bit is ignored.) = 9 bits. Similarly,
130 // it's 6 bits for floats in this case.130 // it's 6 bits for floats in this case.
...@@ -262,7 +262,7 @@ eisel_lemire<long double>(ExpandedFloat<long double> init_num,...@@ -262,7 +262,7 @@ eisel_lemire<long double>(ExpandedFloat<long double> init_num,
262 (final_approx_lower < approx_lower ? 1 : 0);262 (final_approx_lower < approx_lower ? 1 : 0);
263263
264 // The halfway constant is used to check if the bits that will be shifted away264 // The halfway constant is used to check if the bits that will be shifted away
265 // intially are all 1. For 80 bit floats this is 128 (bitstype size) - 64265 // initially are all 1. For 80 bit floats this is 128 (bitstype size) - 64
266 // (final mantissa size) - 3 (we shift away the last two bits separately for266 // (final mantissa size) - 3 (we shift away the last two bits separately for
267 // accuracy, and the most significant bit is ignored.) = 61 bits. Similarly,267 // accuracy, and the most significant bit is ignored.) = 61 bits. Similarly,
268 // it's 12 bits for 128 bit floats in this case.268 // it's 12 bits for 128 bit floats in this case.
...@@ -680,17 +680,15 @@ template <> LIBC_INLINE constexpr int32_t get_lower_bound<double>() {...@@ -680,17 +680,15 @@ template <> LIBC_INLINE constexpr int32_t get_lower_bound<double>() {
680// accuracy.680// accuracy.
681template <typename T, typename CharType>681template <typename T, typename CharType>
682LIBC_INLINE FloatConvertReturn<T> decimal_exp_to_float(682LIBC_INLINE FloatConvertReturn<T> decimal_exp_to_float(
683 ExpandedFloat<T> init_num, bool truncated, RoundDirection round,683 ExpandedFloat<T> init_num, [[maybe_unused]] bool truncated,
684 const CharType *__restrict numStart,684 RoundDirection round, const CharType *__restrict numStart,
685 const size_t num_len = cpp::numeric_limits<size_t>::max()) {685 const size_t num_len = cpp::numeric_limits<size_t>::max()) {
686 using FPBits = typename fputil::FPBits<T>;686 using FPBits = typename fputil::FPBits<T>;
687 using StorageType = typename FPBits::StorageType;
688687
689 StorageType mantissa = init_num.mantissa;
690 int32_t exp10 = init_num.exponent;688 int32_t exp10 = init_num.exponent;
691689
692 FloatConvertReturn<T> output;690 FloatConvertReturn<T> output;
693 cpp::optional<ExpandedFloat<T>> opt_output;691 [[maybe_unused]] cpp::optional<ExpandedFloat<T>> opt_output;
694692
695 // If the exponent is too large and can't be represented in this size of693 // If the exponent is too large and can't be represented in this size of
696 // float, return inf. These bounds are relatively loose, but are mostly694 // float, return inf. These bounds are relatively loose, but are mostly
...@@ -725,6 +723,8 @@ LIBC_INLINE FloatConvertReturn<T> decimal_exp_to_float(...@@ -725,6 +723,8 @@ LIBC_INLINE FloatConvertReturn<T> decimal_exp_to_float(
725723
726#ifndef LIBC_COPT_STRTOFLOAT_DISABLE_EISEL_LEMIRE724#ifndef LIBC_COPT_STRTOFLOAT_DISABLE_EISEL_LEMIRE
727 // Try Eisel-Lemire725 // Try Eisel-Lemire
726 using StorageType = typename FPBits::StorageType;
727 StorageType mantissa = init_num.mantissa;
728 opt_output = eisel_lemire<T>(init_num, round);728 opt_output = eisel_lemire<T>(init_num, round);
729 if (opt_output.has_value()) {729 if (opt_output.has_value()) {
730 if (!truncated) {730 if (!truncated) {
...@@ -1093,7 +1093,7 @@ hexadecimal_string_to_float(const CharType *__restrict src,...@@ -1093,7 +1093,7 @@ hexadecimal_string_to_float(const CharType *__restrict src,
1093}1093}
10941094
1095template <typename T, typename CharType>1095template <typename T, typename CharType>
1096LIBC_INLINE typename fputil::FPBits<T>::StorageType1096LIBC_INLINE constexpr typename fputil::FPBits<T>::StorageType
1097nan_mantissa_from_ncharseq(const CharType *str, size_t len) {1097nan_mantissa_from_ncharseq(const CharType *str, size_t len) {
1098 using FPBits = typename fputil::FPBits<T>;1098 using FPBits = typename fputil::FPBits<T>;
1099 using StorageType = typename FPBits::StorageType;1099 using StorageType = typename FPBits::StorageType;
...@@ -1129,7 +1129,9 @@ strtofloatingpoint(const CharType *__restrict src) {...@@ -1129,7 +1129,9 @@ strtofloatingpoint(const CharType *__restrict src) {
11291129
1130 size_t index = first_non_whitespace(src);1130 size_t index = first_non_whitespace(src);
1131 int sign = get_sign(src + index);1131 int sign = get_sign(src + index);
1132#ifndef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
1132 bool is_positive = (sign >= 0);1133 bool is_positive = (sign >= 0);
1134#endif
1133 index += (sign != 0);1135 index += (sign != 0);
11341136
1135 if (sign < 0) {1137 if (sign < 0) {
...@@ -1146,6 +1148,7 @@ strtofloatingpoint(const CharType *__restrict src) {...@@ -1146,6 +1148,7 @@ strtofloatingpoint(const CharType *__restrict src) {
1146 }1148 }
11471149
1148 RoundDirection round_direction = RoundDirection::Nearest;1150 RoundDirection round_direction = RoundDirection::Nearest;
1151#ifndef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
1149 switch (fputil::quick_get_round()) {1152 switch (fputil::quick_get_round()) {
1150 case FE_TONEAREST:1153 case FE_TONEAREST:
1151 round_direction = RoundDirection::Nearest;1154 round_direction = RoundDirection::Nearest;
...@@ -1160,6 +1163,7 @@ strtofloatingpoint(const CharType *__restrict src) {...@@ -1160,6 +1163,7 @@ strtofloatingpoint(const CharType *__restrict src) {
1160 round_direction = RoundDirection::Down;1163 round_direction = RoundDirection::Down;
1161 break;1164 break;
1162 }1165 }
1166#endif // LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
11631167
1164 StrToNumResult<ExpandedFloat<T>> parse_result({0, 0});1168 StrToNumResult<ExpandedFloat<T>> parse_result({0, 0});
1165 if (base == 16) {1169 if (base == 16) {
...@@ -1221,7 +1225,8 @@ strtofloatingpoint(const CharType *__restrict src) {...@@ -1221,7 +1225,8 @@ strtofloatingpoint(const CharType *__restrict src) {
1221 return {result.get_val(), static_cast<ptrdiff_t>(index), error};1225 return {result.get_val(), static_cast<ptrdiff_t>(index), error};
1222}1226}
12231227
1224template <class T> LIBC_INLINE StrToNumResult<T> strtonan(const char *arg) {1228template <class T>
1229LIBC_INLINE constexpr StrToNumResult<T> strtonan(const char *arg) {
1225 using FPBits = typename fputil::FPBits<T>;1230 using FPBits = typename fputil::FPBits<T>;
1226 using StorageType = typename FPBits::StorageType;1231 using StorageType = typename FPBits::StorageType;
12271232
lib/libcxx/libc/src/__support/str_to_integer.h+21-2
...@@ -33,7 +33,7 @@ namespace internal {...@@ -33,7 +33,7 @@ namespace internal {
33// Returns the idx to the first character in src that is not a whitespace33// Returns the idx to the first character in src that is not a whitespace
34// character (as determined by isspace())34// character (as determined by isspace())
35template <typename CharType>35template <typename CharType>
36LIBC_INLINE size_t36LIBC_INLINE constexpr size_t
37first_non_whitespace(const CharType *__restrict src,37first_non_whitespace(const CharType *__restrict src,
38 size_t src_len = cpp::numeric_limits<size_t>::max()) {38 size_t src_len = cpp::numeric_limits<size_t>::max()) {
39 size_t src_cur = 0;39 size_t src_cur = 0;
...@@ -65,6 +65,18 @@ LIBC_INLINE static bool is_hex_start(const CharType *__restrict src,...@@ -65,6 +65,18 @@ LIBC_INLINE static bool is_hex_start(const CharType *__restrict src,
65 b36_char_to_int(src[2]) < 16;65 b36_char_to_int(src[2]) < 16;
66}66}
6767
68// checks if the next 3 characters of the string pointer are the start of a
69// binary number. Does not advance the string pointer.
70template <typename CharType>
71LIBC_INLINE static bool is_binary_start(const CharType *__restrict src,
72 size_t src_len) {
73 if (src_len < 3)
74 return false;
75 return is_char_or_wchar(src[0], '0', L'0') &&
76 is_char_or_wchar(tolower(src[1]), 'b', L'b') && isalnum(src[2]) &&
77 b36_char_to_int(src[2]) < 2;
78}
79
68// Takes the address of the string pointer and parses the base from the start of80// Takes the address of the string pointer and parses the base from the start of
69// it.81// it.
70template <typename CharType>82template <typename CharType>
...@@ -75,6 +87,10 @@ LIBC_INLINE static int infer_base(const CharType *__restrict src,...@@ -75,6 +87,10 @@ LIBC_INLINE static int infer_base(const CharType *__restrict src,
75 // with values 10 through 15 respectively." (C standard 6.4.4.1)87 // with values 10 through 15 respectively." (C standard 6.4.4.1)
76 if (is_hex_start(src, src_len))88 if (is_hex_start(src, src_len))
77 return 16;89 return 16;
90 // A binary number is defined as "the prefix 0b or 0B optionally followed
91 // by a sequence of letters and digits." (C standard 7.24.1.7)
92 if (is_binary_start(src, src_len))
93 return 2;
78 // An octal number is defined as "the prefix 0 optionally followed by a94 // An octal number is defined as "the prefix 0 optionally followed by a
79 // sequence of the digits 0 through 7 only" (C standard 6.4.4.1) and so any95 // sequence of the digits 0 through 7 only" (C standard 6.4.4.1) and so any
80 // number that starts with 0, including just 0, is an octal number.96 // number that starts with 0, including just 0, is an octal number.
...@@ -94,7 +110,7 @@ LIBC_INLINE static int infer_base(const CharType *__restrict src,...@@ -94,7 +110,7 @@ LIBC_INLINE static int infer_base(const CharType *__restrict src,
94// Takes a pointer to a string and the base to convert to. This function is used110// Takes a pointer to a string and the base to convert to. This function is used
95// as the backend for all of the string to int functions.111// as the backend for all of the string to int functions.
96template <typename T, typename CharType>112template <typename T, typename CharType>
97LIBC_INLINE StrToNumResult<T>113LIBC_INLINE constexpr StrToNumResult<T>
98strtointeger(const CharType *__restrict src, int base,114strtointeger(const CharType *__restrict src, int base,
99 const size_t src_len = cpp::numeric_limits<size_t>::max()) {115 const size_t src_len = cpp::numeric_limits<size_t>::max()) {
100 using ResultType = make_integral_or_big_int_unsigned_t<T>;116 using ResultType = make_integral_or_big_int_unsigned_t<T>;
...@@ -120,6 +136,9 @@ strtointeger(const CharType *__restrict src, int base,...@@ -120,6 +136,9 @@ strtointeger(const CharType *__restrict src, int base,
120 if (base == 16 && is_hex_start(src + src_cur, src_len - src_cur))136 if (base == 16 && is_hex_start(src + src_cur, src_len - src_cur))
121 src_cur = src_cur + 2;137 src_cur = src_cur + 2;
122138
139 if (base == 2 && is_binary_start(src + src_cur, src_len - src_cur))
140 src_cur = src_cur + 2;
141
123 constexpr bool IS_UNSIGNED = cpp::is_unsigned_v<T>;142 constexpr bool IS_UNSIGNED = cpp::is_unsigned_v<T>;
124 ResultType constexpr NEGATIVE_MAX =143 ResultType constexpr NEGATIVE_MAX =
125 !IS_UNSIGNED ? static_cast<ResultType>(cpp::numeric_limits<T>::max()) + 1144 !IS_UNSIGNED ? static_cast<ResultType>(cpp::numeric_limits<T>::max()) + 1
lib/libcxx/libc/src/__support/wctype/wctype_classification_utils.h created+66
...@@ -0,0 +1,66 @@
1//===-- Utils for wctype classification functions ---------------*- C++ -*-===//
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// DO NOT EDIT MANUALLY.
9// This file is generated by libc/utils/wctype_utils scripts.
10
11#ifndef LLVM_LIBC_SRC___SUPPORT_WCTYPE_WCTYPE_CLASSIFICATION_UTILS_H
12#define LLVM_LIBC_SRC___SUPPORT_WCTYPE_WCTYPE_CLASSIFICATION_UTILS_H
13
14#include "hdr/stdint_proxy.h"
15#include "hdr/types/wchar_t.h"
16#include "src/__support/CPP/limits.h"
17#include "src/__support/libc_assert.h"
18#include "src/__support/macros/attributes.h"
19#include "src/__support/macros/config.h"
20
21namespace LIBC_NAMESPACE_DECL {
22
23// Property flags for Unicode categories
24enum PropertyFlag : uint8_t {
25 UPPER = 1 << 0,
26 LOWER = 1 << 1,
27 ALPHA = 1 << 2,
28 SPACE = 1 << 3,
29 PRINT = 1 << 4,
30 BLANK = 1 << 5,
31 CNTRL = 1 << 6,
32 PUNCT = 1 << 7,
33};
34
35static_assert(4352 <= cpp::numeric_limits<unsigned short>::max());
36static_assert(39168 <= cpp::numeric_limits<unsigned short>::max());
37
38LIBC_INLINE_VAR constexpr uint16_t LEVEL1_SIZE = 4352;
39LIBC_INLINE_VAR constexpr uint16_t LEVEL2_SIZE = 39168;
40
41// Level 1 table: indexed by (codepoint >> 8), stores level2 block offsets
42extern const uint16_t LEVEL1[LEVEL1_SIZE];
43
44// Level 2 table: blocks of 256 property flags
45extern const uint8_t LEVEL2[LEVEL2_SIZE];
46
47// Returns the Unicode property flag for a given wide character.
48LIBC_INLINE uint8_t lookup_properties(const wchar_t wc) {
49 // Out of Unicode range
50 if (static_cast<uint32_t>(wc) > 0x10FFFF) {
51 return 0;
52 }
53
54 uint16_t l1_idx = static_cast<uint16_t>(wc >> 8);
55 LIBC_ASSERT(l1_idx < LEVEL1_SIZE);
56
57 uint16_t l2_offset = LEVEL1[l1_idx];
58 uint16_t l2_idx = l2_offset + (wc & 0xFF);
59 LIBC_ASSERT(l2_idx < LEVEL2_SIZE);
60
61 return LEVEL2[l2_idx];
62}
63
64} // namespace LIBC_NAMESPACE_DECL
65
66#endif // LLVM_LIBC_SRC___SUPPORT_WCTYPE_WCTYPE_CLASSIFICATION_UTILS_H
lib/libcxx/libc/src/__support/wctype/wctype_conversion_utils.h created+34
...@@ -0,0 +1,34 @@
1//===----------------------------------------------------------------------===//
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/// \file
10/// Interface for wctype conversion functions.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIBC_SRC___SUPPORT_WCTYPE_WCTYPE_CONVERSION_UTILS_H
15#define LLVM_LIBC_SRC___SUPPORT_WCTYPE_WCTYPE_CONVERSION_UTILS_H
16
17#include "hdr/types/wchar_t.h"
18#include "hdr/types/wint_t.h"
19#include "src/__support/macros/attributes.h"
20#include "src/__support/macros/config.h"
21
22namespace LIBC_NAMESPACE_DECL {
23namespace wctype_internal {
24
25// Helper functions for non-ASCII case conversions.
26// These are implemented in wctype_conversion_utils.cpp using the generated
27// maps.
28wint_t tolower(wchar_t wch);
29wint_t toupper(wchar_t wch);
30
31} // namespace wctype_internal
32} // namespace LIBC_NAMESPACE_DECL
33
34#endif // LLVM_LIBC_SRC___SUPPORT_WCTYPE_WCTYPE_CONVERSION_UTILS_H
lib/libcxx/libc/src/__support/wctype_utils.h+351-137
...@@ -13,6 +13,18 @@...@@ -13,6 +13,18 @@
13#include "src/__support/macros/attributes.h" // LIBC_INLINE13#include "src/__support/macros/attributes.h" // LIBC_INLINE
14#include "src/__support/macros/config.h"14#include "src/__support/macros/config.h"
1515
16#define LIBC_WCTYPE_MODE_ASCII 0
17#define LIBC_WCTYPE_MODE_UTF8 1
18
19#ifndef LIBC_CONF_WCTYPE_MODE
20#define LIBC_CONF_WCTYPE_MODE LIBC_WCTYPE_MODE_ASCII
21#endif
22
23#if LIBC_CONF_WCTYPE_MODE == LIBC_WCTYPE_MODE_UTF8
24#include "src/__support/wctype/wctype_classification_utils.h"
25#include "src/__support/wctype/wctype_conversion_utils.h"
26#endif
27
16namespace LIBC_NAMESPACE_DECL {28namespace LIBC_NAMESPACE_DECL {
17namespace internal {29namespace internal {
1830
...@@ -38,8 +50,8 @@ namespace internal {...@@ -38,8 +50,8 @@ namespace internal {
38// This assumes the character ranges are contiguous, which they aren't in50// This assumes the character ranges are contiguous, which they aren't in
39// EBCDIC. Technically we could use some smaller ranges, but that's even harder51// EBCDIC. Technically we could use some smaller ranges, but that's even harder
40// to read.52// to read.
4153namespace ascii {
42LIBC_INLINE static constexpr bool islower(wchar_t wch) {54LIBC_INLINE constexpr bool islower(wchar_t wch) {
43 switch (wch) {55 switch (wch) {
44 case L'a':56 case L'a':
45 case L'b':57 case L'b':
...@@ -73,7 +85,7 @@ LIBC_INLINE static constexpr bool islower(wchar_t wch) {...@@ -73,7 +85,7 @@ LIBC_INLINE static constexpr bool islower(wchar_t wch) {
73 }85 }
74}86}
7587
76LIBC_INLINE static constexpr bool isupper(wchar_t wch) {88LIBC_INLINE constexpr bool isupper(wchar_t wch) {
77 switch (wch) {89 switch (wch) {
78 case L'A':90 case L'A':
79 case L'B':91 case L'B':
...@@ -107,7 +119,7 @@ LIBC_INLINE static constexpr bool isupper(wchar_t wch) {...@@ -107,7 +119,7 @@ LIBC_INLINE static constexpr bool isupper(wchar_t wch) {
107 }119 }
108}120}
109121
110LIBC_INLINE static constexpr bool isdigit(wchar_t wch) {122LIBC_INLINE constexpr bool isdigit(wchar_t wch) {
111 switch (wch) {123 switch (wch) {
112 case L'0':124 case L'0':
113 case L'1':125 case L'1':
...@@ -125,125 +137,169 @@ LIBC_INLINE static constexpr bool isdigit(wchar_t wch) {...@@ -125,125 +137,169 @@ LIBC_INLINE static constexpr bool isdigit(wchar_t wch) {
125 }137 }
126}138}
127139
128LIBC_INLINE static constexpr wchar_t tolower(wchar_t wch) {140LIBC_INLINE constexpr bool isalpha(wchar_t wch) {
129 switch (wch) {141 switch (wch) {
142 case L'a':
143 case L'b':
144 case L'c':
145 case L'd':
146 case L'e':
147 case L'f':
148 case L'g':
149 case L'h':
150 case L'i':
151 case L'j':
152 case L'k':
153 case L'l':
154 case L'm':
155 case L'n':
156 case L'o':
157 case L'p':
158 case L'q':
159 case L'r':
160 case L's':
161 case L't':
162 case L'u':
163 case L'v':
164 case L'w':
165 case L'x':
166 case L'y':
167 case L'z':
130 case L'A':168 case L'A':
131 return L'a';
132 case L'B':169 case L'B':
133 return L'b';
134 case L'C':170 case L'C':
135 return L'c';
136 case L'D':171 case L'D':
137 return L'd';
138 case L'E':172 case L'E':
139 return L'e';
140 case L'F':173 case L'F':
141 return L'f';
142 case L'G':174 case L'G':
143 return L'g';
144 case L'H':175 case L'H':
145 return L'h';
146 case L'I':176 case L'I':
147 return L'i';
148 case L'J':177 case L'J':
149 return L'j';
150 case L'K':178 case L'K':
151 return L'k';
152 case L'L':179 case L'L':
153 return L'l';
154 case L'M':180 case L'M':
155 return L'm';
156 case L'N':181 case L'N':
157 return L'n';
158 case L'O':182 case L'O':
159 return L'o';
160 case L'P':183 case L'P':
161 return L'p';
162 case L'Q':184 case L'Q':
163 return L'q';
164 case L'R':185 case L'R':
165 return L'r';
166 case L'S':186 case L'S':
167 return L's';
168 case L'T':187 case L'T':
169 return L't';
170 case L'U':188 case L'U':
171 return L'u';
172 case L'V':189 case L'V':
173 return L'v';
174 case L'W':190 case L'W':
175 return L'w';
176 case L'X':191 case L'X':
177 return L'x';
178 case L'Y':192 case L'Y':
179 return L'y';
180 case L'Z':193 case L'Z':
181 return L'z';194 return true;
182 default:195 default:
183 return wch;196 return false;
184 }197 }
185}198}
186199
187LIBC_INLINE static constexpr wchar_t toupper(wchar_t wch) {200LIBC_INLINE constexpr bool isalnum(wchar_t wch) {
188 switch (wch) {201 switch (wch) {
189 case L'a':202 case L'a':
190 return L'A';
191 case L'b':203 case L'b':
192 return L'B';
193 case L'c':204 case L'c':
194 return L'C';
195 case L'd':205 case L'd':
196 return L'D';
197 case L'e':206 case L'e':
198 return L'E';
199 case L'f':207 case L'f':
200 return L'F';
201 case L'g':208 case L'g':
202 return L'G';
203 case L'h':209 case L'h':
204 return L'H';
205 case L'i':210 case L'i':
206 return L'I';
207 case L'j':211 case L'j':
208 return L'J';
209 case L'k':212 case L'k':
210 return L'K';
211 case L'l':213 case L'l':
212 return L'L';
213 case L'm':214 case L'm':
214 return L'M';
215 case L'n':215 case L'n':
216 return L'N';
217 case L'o':216 case L'o':
218 return L'O';
219 case L'p':217 case L'p':
220 return L'P';
221 case L'q':218 case L'q':
222 return L'Q';
223 case L'r':219 case L'r':
224 return L'R';
225 case L's':220 case L's':
226 return L'S';
227 case L't':221 case L't':
228 return L'T';
229 case L'u':222 case L'u':
230 return L'U';
231 case L'v':223 case L'v':
232 return L'V';
233 case L'w':224 case L'w':
234 return L'W';
235 case L'x':225 case L'x':
236 return L'X';
237 case L'y':226 case L'y':
238 return L'Y';
239 case L'z':227 case L'z':
240 return L'Z';228 case L'A':
229 case L'B':
230 case L'C':
231 case L'D':
232 case L'E':
233 case L'F':
234 case L'G':
235 case L'H':
236 case L'I':
237 case L'J':
238 case L'K':
239 case L'L':
240 case L'M':
241 case L'N':
242 case L'O':
243 case L'P':
244 case L'Q':
245 case L'R':
246 case L'S':
247 case L'T':
248 case L'U':
249 case L'V':
250 case L'W':
251 case L'X':
252 case L'Y':
253 case L'Z':
254 case L'0':
255 case L'1':
256 case L'2':
257 case L'3':
258 case L'4':
259 case L'5':
260 case L'6':
261 case L'7':
262 case L'8':
263 case L'9':
264 return true;
241 default:265 default:
242 return wch;266 return false;
267 }
268}
269
270LIBC_INLINE constexpr bool isspace(wchar_t wch) {
271 switch (wch) {
272 case L' ':
273 case L'\t':
274 case L'\n':
275 case L'\v':
276 case L'\f':
277 case L'\r':
278 return true;
279 default:
280 return false;
281 }
282}
283
284LIBC_INLINE constexpr bool isblank(wchar_t wch) {
285 switch (wch) {
286 case L' ':
287 case L'\t':
288 return true;
289 default:
290 return false;
243 }291 }
244}292}
245293
246LIBC_INLINE static constexpr bool isalpha(wchar_t wch) {294LIBC_INLINE constexpr bool isgraph(wchar_t wch) {
295 return 0x20 < wch && wch < 0x7f;
296}
297
298LIBC_INLINE constexpr bool isprint(wchar_t wch) {
299 return (static_cast<unsigned>(wch) - ' ') < 95;
300}
301
302LIBC_INLINE constexpr bool isxdigit(wchar_t wch) {
247 switch (wch) {303 switch (wch) {
248 case L'a':304 case L'a':
249 case L'b':305 case L'b':
...@@ -251,129 +307,301 @@ LIBC_INLINE static constexpr bool isalpha(wchar_t wch) {...@@ -251,129 +307,301 @@ LIBC_INLINE static constexpr bool isalpha(wchar_t wch) {
251 case L'd':307 case L'd':
252 case L'e':308 case L'e':
253 case L'f':309 case L'f':
254 case L'g':
255 case L'h':
256 case L'i':
257 case L'j':
258 case L'k':
259 case L'l':
260 case L'm':
261 case L'n':
262 case L'o':
263 case L'p':
264 case L'q':
265 case L'r':
266 case L's':
267 case L't':
268 case L'u':
269 case L'v':
270 case L'w':
271 case L'x':
272 case L'y':
273 case L'z':
274 case L'A':310 case L'A':
275 case L'B':311 case L'B':
276 case L'C':312 case L'C':
277 case L'D':313 case L'D':
278 case L'E':314 case L'E':
279 case L'F':315 case L'F':
316 case L'0':
317 case L'1':
318 case L'2':
319 case L'3':
320 case L'4':
321 case L'5':
322 case L'6':
323 case L'7':
324 case L'8':
325 case L'9':
326 return true;
327 default:
328 return false;
329 }
330}
331
332LIBC_INLINE constexpr bool iscntrl(wchar_t wch) {
333 return (wch < 0x20 || wch == 0x7f);
334}
335
336LIBC_INLINE constexpr bool ispunct(wchar_t wch) {
337 return !isalnum(wch) && isgraph(wch);
338}
339
340LIBC_INLINE constexpr wchar_t tolower(wchar_t wch) {
341 switch (wch) {
342 case L'A':
343 return L'a';
344 case L'B':
345 return L'b';
346 case L'C':
347 return L'c';
348 case L'D':
349 return L'd';
350 case L'E':
351 return L'e';
352 case L'F':
353 return L'f';
280 case L'G':354 case L'G':
355 return L'g';
281 case L'H':356 case L'H':
357 return L'h';
282 case L'I':358 case L'I':
359 return L'i';
283 case L'J':360 case L'J':
361 return L'j';
284 case L'K':362 case L'K':
363 return L'k';
285 case L'L':364 case L'L':
365 return L'l';
286 case L'M':366 case L'M':
367 return L'm';
287 case L'N':368 case L'N':
369 return L'n';
288 case L'O':370 case L'O':
371 return L'o';
289 case L'P':372 case L'P':
373 return L'p';
290 case L'Q':374 case L'Q':
375 return L'q';
291 case L'R':376 case L'R':
377 return L'r';
292 case L'S':378 case L'S':
379 return L's';
293 case L'T':380 case L'T':
381 return L't';
294 case L'U':382 case L'U':
383 return L'u';
295 case L'V':384 case L'V':
385 return L'v';
296 case L'W':386 case L'W':
387 return L'w';
297 case L'X':388 case L'X':
389 return L'x';
298 case L'Y':390 case L'Y':
391 return L'y';
299 case L'Z':392 case L'Z':
300 return true;393 return L'z';
301 default:394 default:
302 return false;395 return wch;
303 }396 }
304}397}
305398
306LIBC_INLINE static constexpr bool isalnum(wchar_t wch) {399LIBC_INLINE constexpr wchar_t toupper(wchar_t wch) {
307 switch (wch) {400 switch (wch) {
308 case L'a':401 case L'a':
402 return L'A';
309 case L'b':403 case L'b':
404 return L'B';
310 case L'c':405 case L'c':
406 return L'C';
311 case L'd':407 case L'd':
408 return L'D';
312 case L'e':409 case L'e':
410 return L'E';
313 case L'f':411 case L'f':
412 return L'F';
314 case L'g':413 case L'g':
414 return L'G';
315 case L'h':415 case L'h':
416 return L'H';
316 case L'i':417 case L'i':
418 return L'I';
317 case L'j':419 case L'j':
420 return L'J';
318 case L'k':421 case L'k':
422 return L'K';
319 case L'l':423 case L'l':
424 return L'L';
320 case L'm':425 case L'm':
426 return L'M';
321 case L'n':427 case L'n':
428 return L'N';
322 case L'o':429 case L'o':
430 return L'O';
323 case L'p':431 case L'p':
432 return L'P';
324 case L'q':433 case L'q':
434 return L'Q';
325 case L'r':435 case L'r':
436 return L'R';
326 case L's':437 case L's':
438 return L'S';
327 case L't':439 case L't':
440 return L'T';
328 case L'u':441 case L'u':
442 return L'U';
329 case L'v':443 case L'v':
444 return L'V';
330 case L'w':445 case L'w':
446 return L'W';
331 case L'x':447 case L'x':
448 return L'X';
332 case L'y':449 case L'y':
450 return L'Y';
333 case L'z':451 case L'z':
334 case L'A':452 return L'Z';
335 case L'B':
336 case L'C':
337 case L'D':
338 case L'E':
339 case L'F':
340 case L'G':
341 case L'H':
342 case L'I':
343 case L'J':
344 case L'K':
345 case L'L':
346 case L'M':
347 case L'N':
348 case L'O':
349 case L'P':
350 case L'Q':
351 case L'R':
352 case L'S':
353 case L'T':
354 case L'U':
355 case L'V':
356 case L'W':
357 case L'X':
358 case L'Y':
359 case L'Z':
360 case L'0':
361 case L'1':
362 case L'2':
363 case L'3':
364 case L'4':
365 case L'5':
366 case L'6':
367 case L'7':
368 case L'8':
369 case L'9':
370 return true;
371 default:453 default:
372 return false;454 return wch;
455 }
456}
457
458} // namespace ascii
459
460LIBC_INLINE constexpr bool islower(wchar_t wch) {
461#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
462 return ascii::islower(wch);
463#else
464 if (static_cast<uint32_t>(wch) < 128) {
465 return ascii::islower(wch);
466 }
467 return lookup_properties(wch) & PropertyFlag::LOWER;
468#endif
469}
470
471LIBC_INLINE constexpr bool isupper(wchar_t wch) {
472#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
473 return ascii::isupper(wch);
474#else
475 if (static_cast<uint32_t>(wch) < 128) {
476 return ascii::isupper(wch);
477 }
478 return lookup_properties(wch) & PropertyFlag::UPPER;
479#endif
480}
481
482LIBC_INLINE constexpr bool isdigit(wchar_t wch) {
483 // In C.UT8, only ASCII digits are considered digits
484 return ascii::isdigit(wch);
485}
486
487LIBC_INLINE constexpr bool isalpha(wchar_t wch) {
488#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
489 return ascii::isalpha(wch);
490#else
491 if (static_cast<uint32_t>(wch) < 128) {
492 return ascii::isalpha(wch);
493 }
494 return lookup_properties(wch) & PropertyFlag::ALPHA;
495#endif
496}
497
498LIBC_INLINE constexpr bool isalnum(wchar_t wch) {
499#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
500 return ascii::isalnum(wch);
501#else
502 if (static_cast<uint32_t>(wch) < 128) {
503 return ascii::isalnum(wch);
504 }
505 // Only need to check ALPHA, digit cases are covered by ASCII path
506 return lookup_properties(wch) & PropertyFlag::ALPHA;
507#endif
508}
509
510LIBC_INLINE constexpr bool isspace(wchar_t wch) {
511#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
512 return ascii::isspace(wch);
513#else
514 if (static_cast<uint32_t>(wch) < 128) {
515 return ascii::isspace(wch);
516 }
517 return lookup_properties(wch) & PropertyFlag::SPACE;
518#endif
519}
520
521LIBC_INLINE constexpr bool isblank(wchar_t wch) {
522#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
523 return ascii::isblank(wch);
524#else
525 if (static_cast<uint32_t>(wch) < 128) {
526 return ascii::isblank(wch);
373 }527 }
528 return lookup_properties(wch) & PropertyFlag::BLANK;
529#endif
374}530}
375531
376LIBC_INLINE static constexpr int b36_char_to_int(wchar_t wch) {532LIBC_INLINE constexpr bool isgraph(wchar_t wch) {
533#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
534 return ascii::isgraph(wch);
535#else
536 if (static_cast<uint32_t>(wch) < 128) {
537 return ascii::isgraph(wch);
538 }
539 // print && !space
540 return (lookup_properties(wch) &
541 (PropertyFlag::PRINT | PropertyFlag::SPACE)) == PropertyFlag::PRINT;
542#endif
543}
544
545LIBC_INLINE constexpr bool isprint(wchar_t wch) {
546#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
547 return ascii::isprint(wch);
548#else
549 if (static_cast<uint32_t>(wch) < 128) {
550 return ascii::isprint(wch);
551 }
552 return lookup_properties(wch) & PropertyFlag::PRINT;
553#endif
554}
555LIBC_INLINE constexpr bool isxdigit(wchar_t wch) {
556 // Hexadecimal digits are the same in C.UTF8 as in ASCII
557 return ascii::isxdigit(wch);
558}
559
560LIBC_INLINE constexpr bool iscntrl(wchar_t wch) {
561#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
562 return ascii::iscntrl(wch);
563#else
564 if (static_cast<uint32_t>(wch) < 128) {
565 return ascii::iscntrl(wch);
566 }
567 return lookup_properties(wch) & PropertyFlag::CNTRL;
568#endif
569}
570
571LIBC_INLINE constexpr bool ispunct(wchar_t wch) {
572#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
573 return ascii::ispunct(wch);
574#else
575 if (static_cast<uint32_t>(wch) < 128) {
576 return ascii::ispunct(wch);
577 }
578 return lookup_properties(wch) & PropertyFlag::PUNCT;
579#endif
580}
581
582LIBC_INLINE constexpr wchar_t tolower(wchar_t wch) {
583#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
584 return ascii::tolower(wch);
585#else
586 if (static_cast<uint32_t>(wch) < 128) {
587 return ascii::tolower(wch);
588 }
589 return static_cast<wchar_t>(wctype_internal::tolower(wch));
590#endif
591}
592
593LIBC_INLINE constexpr wchar_t toupper(wchar_t wch) {
594#if LIBC_CONF_WCTYPE_MODE != LIBC_WCTYPE_MODE_UTF8
595 return ascii::toupper(wch);
596#else
597 if (static_cast<uint32_t>(wch) < 128) {
598 return ascii::toupper(wch);
599 }
600 return static_cast<wchar_t>(wctype_internal::toupper(wch));
601#endif
602}
603
604LIBC_INLINE constexpr int b36_char_to_int(wchar_t wch) {
377 switch (wch) {605 switch (wch) {
378 case L'0':606 case L'0':
379 return 0;607 return 0;
...@@ -561,20 +789,6 @@ LIBC_INLINE static constexpr wchar_t int_to_b36_wchar(int num) {...@@ -561,20 +789,6 @@ LIBC_INLINE static constexpr wchar_t int_to_b36_wchar(int num) {
561 }789 }
562}790}
563791
564LIBC_INLINE static constexpr bool isspace(wchar_t wch) {
565 switch (wch) {
566 case L' ':
567 case L'\t':
568 case L'\n':
569 case L'\v':
570 case L'\f':
571 case L'\r':
572 return true;
573 default:
574 return false;
575 }
576}
577
578// An overload which provides a way to compare input with specific character792// An overload which provides a way to compare input with specific character
579// values, when input can be of a regular or a wide character type.793// values, when input can be of a regular or a wide character type.
580LIBC_INLINE static constexpr bool794LIBC_INLINE static constexpr bool
lib/libcxx/src/algorithm.cpp+2
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#include <bit>10#include <bit>
1111
12_LIBCPP_BEGIN_NAMESPACE_STD12_LIBCPP_BEGIN_NAMESPACE_STD
13_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1314
14template <class Comp, class RandomAccessIterator>15template <class Comp, class RandomAccessIterator>
15void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) {16void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) {
...@@ -47,4 +48,5 @@ template void __sort<__less<double>&, double*>(double*, double*, __less<double>&...@@ -47,4 +48,5 @@ template void __sort<__less<double>&, double*>(double*, double*, __less<double>&
47template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);48template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
48// clang-format on49// clang-format on
4950
51_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
50_LIBCPP_END_NAMESPACE_STD52_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/any.cpp+4-2
...@@ -19,6 +19,7 @@ const char* bad_any_cast::what() const noexcept { return "bad any cast"; }...@@ -19,6 +19,7 @@ const char* bad_any_cast::what() const noexcept { return "bad any cast"; }
19// Preserve std::experimental::any_bad_cast for ABI compatibility19// Preserve std::experimental::any_bad_cast for ABI compatibility
20// Even though it no longer exists in a header file20// Even though it no longer exists in a header file
21_LIBCPP_BEGIN_NAMESPACE_LFTS21_LIBCPP_BEGIN_NAMESPACE_LFTS
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23class _LIBCPP_EXPORTED_FROM_ABI bad_any_cast : public bad_cast {24class _LIBCPP_EXPORTED_FROM_ABI bad_any_cast : public bad_cast {
24public:25public:
...@@ -27,6 +28,7 @@ public:...@@ -27,6 +28,7 @@ public:
2728
28const char* bad_any_cast::what() const noexcept { return "bad any cast"; }29const char* bad_any_cast::what() const noexcept { return "bad any cast"; }
2930
30#endif31_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
31
32_LIBCPP_END_NAMESPACE_LFTS32_LIBCPP_END_NAMESPACE_LFTS
33
34#endif
lib/libcxx/src/atomic.cpp+163-58
...@@ -17,7 +17,19 @@...@@ -17,7 +17,19 @@
17#include <thread>17#include <thread>
18#include <type_traits>18#include <type_traits>
1919
20#include "include/apple_availability.h"20// Determine whether to use the public os_sync API on Apple platforms based on the deployment target.
21// Otherwise we fall back to the private __ulock API.
22#if defined(__APPLE__)
23# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
24 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140400) || \
25 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
26 __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170400) || \
27 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 170400) || \
28 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
29 __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 100400)
30# define _LIBCPP_USE_OS_SYNC
31# endif
32#endif
2133
22#ifdef __linux__34#ifdef __linux__
2335
...@@ -51,6 +63,16 @@...@@ -51,6 +63,16 @@
51# include <memory>63# include <memory>
52# include <windows.h>64# include <windows.h>
5365
66#elif defined(__APPLE__)
67
68# if defined(_LIBCPP_USE_OS_SYNC)
69# include <os/os_sync_wait_on_address.h>
70# endif
71
72#elif defined(__Fuchsia__)
73
74# include <zircon/syscalls.h>
75
54#else // <- Add other operating systems here76#else // <- Add other operating systems here
5577
56// Baseline needs no new headers78// Baseline needs no new headers
...@@ -63,6 +85,7 @@ _LIBCPP_PUSH_MACROS...@@ -63,6 +85,7 @@ _LIBCPP_PUSH_MACROS
63#include <__undef_macros>85#include <__undef_macros>
6486
65_LIBCPP_BEGIN_NAMESPACE_STD87_LIBCPP_BEGIN_NAMESPACE_STD
88_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
6689
67struct NoTimeout {};90struct NoTimeout {};
6891
...@@ -90,20 +113,64 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {...@@ -90,20 +113,64 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
90 _LIBCPP_FUTEX(__ptr, FUTEX_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, 0, 0, 0);113 _LIBCPP_FUTEX(__ptr, FUTEX_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, 0, 0, 0);
91}114}
92115
93#elif defined(__APPLE__) && defined(_LIBCPP_USE_ULOCK)116#elif defined(__APPLE__)
117
118# if defined(_LIBCPP_USE_OS_SYNC)
119
120template <std::size_t _Size, class MaybeTimeout>
121static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
122 std::uint64_t __value = [__val]() -> std::uint64_t {
123 if constexpr (_Size == 4) {
124 std::uint32_t __result;
125 std::memcpy(&__result, __val, _Size);
126 return __result;
127 } else if constexpr (_Size == 8) {
128 std::uint64_t __result;
129 std::memcpy(&__result, __val, _Size);
130 return __result;
131 } else {
132 static_assert(false, "Can only wait on 8 bytes or 4 bytes value");
133 }
134 }();
135
136 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
137 os_sync_wait_on_address(const_cast<void*>(__ptr), __value, _Size, OS_SYNC_WAIT_ON_ADDRESS_NONE);
138 } else {
139 // os_sync_wait_on_address_with_timeout returns EINVAL on a 0-ns timeout, so clamp to 1ns
140 // when an already-expired deadline produced a zero-duration timeout.
141 uint64_t __timeout_ns = std::max<uint64_t>(maybe_timeout_ns, 1);
142 os_sync_wait_on_address_with_timeout(
143 const_cast<void*>(__ptr),
144 __value,
145 _Size,
146 OS_SYNC_WAIT_ON_ADDRESS_NONE,
147 OS_CLOCK_MACH_ABSOLUTE_TIME,
148 __timeout_ns);
149 }
150}
151
152template <std::size_t _Size>
153static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
154 static_assert(_Size == 8 || _Size == 4, "Can only wake up on 8 bytes or 4 bytes value");
155 if (__notify_one)
156 os_sync_wake_by_address_any(const_cast<void*>(__ptr), _Size, OS_SYNC_WAKE_BY_ADDRESS_NONE);
157 else
158 os_sync_wake_by_address_all(const_cast<void*>(__ptr), _Size, OS_SYNC_WAKE_BY_ADDRESS_NONE);
159}
160
161# else // !_LIBCPP_USE_OS_SYNC -- fall back to the private __ulock API
94162
95extern "C" int __ulock_wait(163extern "C" int __ulock_wait(
96 uint32_t operation, void* addr, uint64_t value, uint32_t timeout); /* timeout is specified in microseconds */164 uint32_t operation, void* addr, uint64_t value, uint32_t timeout); /* timeout is specified in microseconds */
97extern "C" int __ulock_wake(uint32_t operation, void* addr, uint64_t wake_value);165extern "C" int __ulock_wake(uint32_t operation, void* addr, uint64_t wake_value);
98166
99// https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/ulock.h#L82167// https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/ulock.h#L82
100# define UL_COMPARE_AND_WAIT 1168# define UL_COMPARE_AND_WAIT 1
101# define UL_COMPARE_AND_WAIT64 5169# define UL_COMPARE_AND_WAIT64 5
102# define ULF_WAKE_ALL 0x00000100170# define ULF_WAKE_ALL 0x00000100
103171
104template <std::size_t _Size, class MaybeTimeout>172template <std::size_t _Size, class MaybeTimeout>
105static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {173static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
106 static_assert(_Size == 8 || _Size == 4, "Can only wait on 8 bytes or 4 bytes value");
107 auto __timeout_us = [&] {174 auto __timeout_us = [&] {
108 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {175 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
109 return uint32_t(0);176 return uint32_t(0);
...@@ -111,17 +178,23 @@ static void __platform_wait_on_address(void const* __ptr, void const* __val, May...@@ -111,17 +178,23 @@ static void __platform_wait_on_address(void const* __ptr, void const* __val, May
111 return std::max(static_cast<uint32_t>(maybe_timeout_ns / 1000), uint32_t(1));178 return std::max(static_cast<uint32_t>(maybe_timeout_ns / 1000), uint32_t(1));
112 }179 }
113 }();180 }();
114 if constexpr (_Size == 4) {181
115 alignas(uint32_t) char buffer[_Size];182 std::uint64_t __value = [__val]() -> std::uint64_t {
116 std::memcpy(&buffer, const_cast<const void*>(__val), _Size);183 if constexpr (_Size == 4) {
117 __ulock_wait(184 std::uint32_t __result;
118 UL_COMPARE_AND_WAIT, const_cast<void*>(__ptr), *reinterpret_cast<uint32_t const*>(&buffer), __timeout_us);185 std::memcpy(&__result, __val, _Size);
119 } else {186 return __result;
120 alignas(uint64_t) char buffer[_Size];187 } else if constexpr (_Size == 8) {
121 std::memcpy(&buffer, const_cast<const void*>(__val), _Size);188 std::uint64_t __result;
122 __ulock_wait(189 std::memcpy(&__result, __val, _Size);
123 UL_COMPARE_AND_WAIT64, const_cast<void*>(__ptr), *reinterpret_cast<uint64_t const*>(&buffer), __timeout_us);190 return __result;
124 }191 } else {
192 static_assert(false, "Can only wait on 8 bytes or 4 bytes value");
193 }
194 }();
195
196 __ulock_wait(
197 _Size == 4 ? UL_COMPARE_AND_WAIT : UL_COMPARE_AND_WAIT64, const_cast<void*>(__ptr), __value, __timeout_us);
125}198}
126199
127template <std::size_t _Size>200template <std::size_t _Size>
...@@ -134,6 +207,8 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {...@@ -134,6 +207,8 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
134 __ulock_wake(UL_COMPARE_AND_WAIT64 | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<void*>(__ptr), 0);207 __ulock_wake(UL_COMPARE_AND_WAIT64 | (__notify_one ? 0 : ULF_WAKE_ALL), const_cast<void*>(__ptr), 0);
135}208}
136209
210# endif // _LIBCPP_USE_OS_SYNC
211
137#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8212#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
138/*213/*
139 * Since __cxx_contention_t is int64_t even on 32bit FreeBSD214 * Since __cxx_contention_t is int64_t even on 32bit FreeBSD
...@@ -254,6 +329,37 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {...@@ -254,6 +329,37 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
254 }329 }
255}330}
256331
332#elif defined(__Fuchsia__)
333
334template <std::size_t _Size>
335static inline zx_futex_t const* __get_zx_futex(void const* __ptr) {
336 static_assert(_Size == sizeof(zx_futex_t), "Can only wait/wake on zx_futex_t-compatible value");
337
338 // Implicitly link against the vDSO system call ABI without requiring the
339 // final link to specify -lzircon explicitly when statically linking libc++.
340# pragma comment(lib, "zircon")
341
342 return reinterpret_cast<zx_futex_t const*>(__ptr);
343}
344
345template <std::size_t _Size, class MaybeTimeout>
346static void __platform_wait_on_address(void const* __ptr, void const* __val, MaybeTimeout maybe_timeout_ns) {
347 zx_futex_t val;
348 std::memcpy(&val, __val, _Size);
349 zx_instant_mono_t deadline;
350 if constexpr (is_same_v<MaybeTimeout, NoTimeout>) {
351 deadline = ZX_TIME_INFINITE;
352 } else {
353 deadline = _zx_deadline_after(maybe_timeout_ns);
354 }
355 _zx_futex_wait(__get_zx_futex<_Size>(__ptr), val, ZX_HANDLE_INVALID, deadline);
356}
357
358template <std::size_t _Size>
359static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
360 _zx_futex_wake(__get_zx_futex<_Size>(__ptr), __notify_one ? 1 : UINT32_MAX);
361}
362
257#else // <- Add other operating systems here363#else // <- Add other operating systems here
258364
259// Baseline is just a timed backoff365// Baseline is just a timed backoff
...@@ -308,45 +414,41 @@ static constexpr size_t __contention_table_size = (1 << 8); /* < there's no magi...@@ -308,45 +414,41 @@ static constexpr size_t __contention_table_size = (1 << 8); /* < there's no magi
308414
309static constexpr hash<void const*> __contention_hasher;415static constexpr hash<void const*> __contention_hasher;
310416
311// Waiter count table for all atomics with the correct size that use itself as the wait/notify address.417// Unified contention table shared by both the native path (atomics whose size matches the platform
312418// wait size and are waited on directly) and the global path (atomics with the wrong size, which use
313struct alignas(419// the global table's atomic as the wait/notify address). The native path only reads/writes the native
314 std::hardware_constructive_interference_size) /* aim to avoid false sharing */ __contention_state_native {420// waiter count, and the global path uses the global waiter count and the platform state.
315 __cxx_atomic_contention_t __waiter_count;421//
316 constexpr __contention_state_native() : __waiter_count(0) {}422// We use a single table for both the native and non-native states to minimize the size impact, since
317};423// we would have plenty of unused padding otherwise. This technically means that if both a native and
318424// a non-native atomic fall into the same bucket and are reading/writing waiter counts on the same
319static __contention_state_native __contention_table_native[__contention_table_size];425// cache line, we would end up in a "false-sharing" situation. However, in practice, it would require
320426// both native and non-native atomics to be used concurrently, and to fall in the same bucket, which
321static __cxx_atomic_contention_t* __get_native_waiter_count(void const* p) {427// is expected to be unlikely.
322 return &__contention_table_native[__contention_hasher(p) & (__contention_table_size - 1)].__waiter_count;428struct alignas(std::hardware_destructive_interference_size) /* aim to avoid false sharing */ __contention_state {
323}429 __cxx_atomic_contention_t __waiter_count_native;
324430 __cxx_atomic_contention_t __waiter_count_global;
325// Global contention table for all atomics with the wrong size that use the global table's atomic as wait/notify
326// address.
327
328struct alignas(
329 std::hardware_constructive_interference_size) /* aim to avoid false sharing */ __contention_state_global {
330 __cxx_atomic_contention_t __waiter_count;
331 __cxx_atomic_contention_t __platform_state;431 __cxx_atomic_contention_t __platform_state;
332 constexpr __contention_state_global() : __waiter_count(0), __platform_state(0) {}432 constexpr __contention_state() : __waiter_count_native(0), __waiter_count_global(0), __platform_state(0) {}
333};433};
334434
335static __contention_state_global __contention_table_global[__contention_table_size];435static constinit __contention_state __contention_table[__contention_table_size];
336436
337static __contention_state_global* __get_global_contention_state(void const* p) {437static __contention_state* __get_contention_state(void const* p) {
338 return &__contention_table_global[__contention_hasher(p) & (__contention_table_size - 1)];438 return &__contention_table[__contention_hasher(p) & (__contention_table_size - 1)];
339}439}
340440
341/* When the incoming atomic is the wrong size for the platform wait size, need to441/* When the incoming atomic is the wrong size for the platform wait size, need to
342 launder the value sequence through an atomic from our table. */442 launder the value sequence through an atomic from our table. */
343443
344static void __atomic_notify_global_table(void const* __location) {444static void __atomic_notify_global_table(void const* __location) {
345 auto const __entry = __get_global_contention_state(__location);445 auto const __entry = __get_contention_state(__location);
346 // The value sequence laundering happens on the next line below.446 // The value sequence laundering happens on the next line below.
347 __cxx_atomic_fetch_add(&__entry->__platform_state, __cxx_contention_t(1), memory_order_seq_cst);447 __cxx_atomic_fetch_add(&__entry->__platform_state, __cxx_contention_t(1), memory_order_seq_cst);
348 __contention_notify<sizeof(__cxx_atomic_contention_t)>(448 __contention_notify<sizeof(__cxx_atomic_contention_t)>(
349 &__entry->__waiter_count, &__entry->__platform_state, false /* when laundering, we can't handle notify_one */);449 &__entry->__waiter_count_global,
450 &__entry->__platform_state,
451 false /* when laundering, we can't handle notify_one */);
350}452}
351453
352// =============================454// =============================
...@@ -355,22 +457,22 @@ static void __atomic_notify_global_table(void const* __location) {...@@ -355,22 +457,22 @@ static void __atomic_notify_global_table(void const* __location) {
355457
356// global458// global
357_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __location) noexcept {459_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __location) noexcept {
358 auto const __entry = __get_global_contention_state(__location);460 auto const __entry = __get_contention_state(__location);
359 return __cxx_atomic_load(&__entry->__platform_state, memory_order_acquire);461 return __cxx_atomic_load(&__entry->__platform_state, memory_order_acquire);
360}462}
361463
362_LIBCPP_EXPORTED_FROM_ABI void464_LIBCPP_EXPORTED_FROM_ABI void
363__atomic_wait_global_table(void const* __location, __cxx_contention_t __old_value) noexcept {465__atomic_wait_global_table(void const* __location, __cxx_contention_t __old_value) noexcept {
364 auto const __entry = __get_global_contention_state(__location);466 auto const __entry = __get_contention_state(__location);
365 __contention_wait<sizeof(__cxx_atomic_contention_t)>(467 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
366 &__entry->__waiter_count, &__entry->__platform_state, &__old_value, NoTimeout{});468 &__entry->__waiter_count_global, &__entry->__platform_state, &__old_value, NoTimeout{});
367}469}
368470
369_LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_global_table_with_timeout(471_LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_global_table_with_timeout(
370 void const* __location, __cxx_contention_t __old_value, uint64_t __timeout_ns) _NOEXCEPT {472 void const* __location, __cxx_contention_t __old_value, uint64_t __timeout_ns) _NOEXCEPT {
371 auto const __entry = __get_global_contention_state(__location);473 auto const __entry = __get_contention_state(__location);
372 __contention_wait<sizeof(__cxx_atomic_contention_t)>(474 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
373 &__entry->__waiter_count, &__entry->__platform_state, &__old_value, __timeout_ns);475 &__entry->__waiter_count_global, &__entry->__platform_state, &__old_value, __timeout_ns);
374}476}
375477
376_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_global_table(void const* __location) noexcept {478_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_global_table(void const* __location) noexcept {
...@@ -385,23 +487,25 @@ _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_global_table(void const* __lo...@@ -385,23 +487,25 @@ _LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_global_table(void const* __lo
385487
386template <std::size_t _Size>488template <std::size_t _Size>
387_LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_native(void const* __address, void const* __old_value) noexcept {489_LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_native(void const* __address, void const* __old_value) noexcept {
388 __contention_wait<_Size>(__get_native_waiter_count(__address), __address, __old_value, NoTimeout{});490 __contention_wait<_Size>(
491 &__get_contention_state(__address)->__waiter_count_native, __address, __old_value, NoTimeout{});
389}492}
390493
391template <std::size_t _Size>494template <std::size_t _Size>
392_LIBCPP_EXPORTED_FROM_ABI void495_LIBCPP_EXPORTED_FROM_ABI void
393__atomic_wait_native_with_timeout(void const* __address, void const* __old_value, uint64_t __timeout_ns) noexcept {496__atomic_wait_native_with_timeout(void const* __address, void const* __old_value, uint64_t __timeout_ns) noexcept {
394 __contention_wait<_Size>(__get_native_waiter_count(__address), __address, __old_value, __timeout_ns);497 __contention_wait<_Size>(
498 &__get_contention_state(__address)->__waiter_count_native, __address, __old_value, __timeout_ns);
395}499}
396500
397template <std::size_t _Size>501template <std::size_t _Size>
398_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_native(void const* __location) noexcept {502_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_one_native(void const* __location) noexcept {
399 __contention_notify<_Size>(__get_native_waiter_count(__location), __location, true);503 __contention_notify<_Size>(&__get_contention_state(__location)->__waiter_count_native, __location, true);
400}504}
401505
402template <std::size_t _Size>506template <std::size_t _Size>
403_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native(void const* __location) noexcept {507_LIBCPP_EXPORTED_FROM_ABI void __atomic_notify_all_native(void const* __location) noexcept {
404 __contention_notify<_Size>(__get_native_waiter_count(__location), __location, false);508 __contention_notify<_Size>(&__get_contention_state(__location)->__waiter_count_native, __location, false);
405}509}
406510
407// ==================================================511// ==================================================
...@@ -452,34 +556,34 @@ _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile* __lo...@@ -452,34 +556,34 @@ _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile* __lo
452}556}
453557
454_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile* __location) noexcept {558_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile* __location) noexcept {
455 auto const __entry = __get_global_contention_state(const_cast<void const*>(__location));559 auto const __entry = __get_contention_state(const_cast<void const*>(__location));
456 return __cxx_atomic_load(&__entry->__platform_state, memory_order_acquire);560 return __cxx_atomic_load(&__entry->__platform_state, memory_order_acquire);
457}561}
458562
459_LIBCPP_EXPORTED_FROM_ABI void563_LIBCPP_EXPORTED_FROM_ABI void
460__libcpp_atomic_wait(void const volatile* __location, __cxx_contention_t __old_value) noexcept {564__libcpp_atomic_wait(void const volatile* __location, __cxx_contention_t __old_value) noexcept {
461 auto const __entry = __get_global_contention_state(const_cast<void const*>(__location));565 auto const __entry = __get_contention_state(const_cast<void const*>(__location));
462 __contention_wait<sizeof(__cxx_atomic_contention_t)>(566 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
463 &__entry->__waiter_count, &__entry->__platform_state, &__old_value, NoTimeout{});567 &__entry->__waiter_count_global, &__entry->__platform_state, &__old_value, NoTimeout{});
464}568}
465569
466_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile* __location) noexcept {570_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile* __location) noexcept {
467 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));571 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));
468 __contention_notify<sizeof(__cxx_atomic_contention_t)>(572 __contention_notify<sizeof(__cxx_atomic_contention_t)>(
469 __get_native_waiter_count(__location_cast), __location_cast, true);573 &__get_contention_state(__location_cast)->__waiter_count_native, __location_cast, true);
470}574}
471575
472_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile* __location) noexcept {576_LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile* __location) noexcept {
473 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));577 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));
474 __contention_notify<sizeof(__cxx_atomic_contention_t)>(578 __contention_notify<sizeof(__cxx_atomic_contention_t)>(
475 __get_native_waiter_count(__location_cast), __location_cast, false);579 &__get_contention_state(__location_cast)->__waiter_count_native, __location_cast, false);
476}580}
477581
478_LIBCPP_EXPORTED_FROM_ABI void582_LIBCPP_EXPORTED_FROM_ABI void
479__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx_contention_t __old_value) noexcept {583__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx_contention_t __old_value) noexcept {
480 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));584 auto __location_cast = const_cast<const void*>(static_cast<const volatile void*>(__location));
481 __contention_wait<sizeof(__cxx_atomic_contention_t)>(585 __contention_wait<sizeof(__cxx_atomic_contention_t)>(
482 __get_native_waiter_count(__location_cast), __location_cast, &__old_value, NoTimeout{});586 &__get_contention_state(__location_cast)->__waiter_count_native, __location_cast, &__old_value, NoTimeout{});
483}587}
484588
485// this function is even unused in the old ABI589// this function is even unused in the old ABI
...@@ -490,6 +594,7 @@ __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile* __location) no...@@ -490,6 +594,7 @@ __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile* __location) no
490594
491_LIBCPP_DIAGNOSTIC_POP595_LIBCPP_DIAGNOSTIC_POP
492596
597_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
493_LIBCPP_END_NAMESPACE_STD598_LIBCPP_END_NAMESPACE_STD
494599
495_LIBCPP_POP_MACROS600_LIBCPP_POP_MACROS
lib/libcxx/src/barrier.cpp+2
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#include <thread>10#include <thread>
1111
12_LIBCPP_BEGIN_NAMESPACE_STD12_LIBCPP_BEGIN_NAMESPACE_STD
13_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1314
14class __barrier_algorithm_base {15class __barrier_algorithm_base {
15public:16public:
...@@ -69,4 +70,5 @@ __destroy_barrier_algorithm_base(_LIBCPP_NOESCAPE __barrier_algorithm_base* __ba...@@ -69,4 +70,5 @@ __destroy_barrier_algorithm_base(_LIBCPP_NOESCAPE __barrier_algorithm_base* __ba
69 delete __barrier;70 delete __barrier;
70}71}
7172
73_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
72_LIBCPP_END_NAMESPACE_STD74_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/call_once.cpp+2
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include "include/atomic_support.h"17#include "include/atomic_support.h"
1818
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
20_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2021
21// If dispatch_once_f ever handles C++ exceptions, and if one can get to it22// If dispatch_once_f ever handles C++ exceptions, and if one can get to it
22// without illegal macros (unexpected macros not beginning with _UpperCase or23// without illegal macros (unexpected macros not beginning with _UpperCase or
...@@ -68,4 +69,5 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg, void (*func)(...@@ -68,4 +69,5 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg, void (*func)(
68#endif // !_LIBCPP_HAS_THREADS69#endif // !_LIBCPP_HAS_THREADS
69}70}
7071
72_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
71_LIBCPP_END_NAMESPACE_STD73_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/charconv.cpp+3
...@@ -13,6 +13,7 @@...@@ -13,6 +13,7 @@
13#include "include/to_chars_floating_point.h"13#include "include/to_chars_floating_point.h"
1414
15_LIBCPP_BEGIN_NAMESPACE_STD15_LIBCPP_BEGIN_NAMESPACE_STD
16_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1617
17#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 1518#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
1819
...@@ -89,4 +90,6 @@ template __from_chars_result<float> __from_chars_floating_point(...@@ -89,4 +90,6 @@ template __from_chars_result<float> __from_chars_floating_point(
8990
90template __from_chars_result<double> __from_chars_floating_point(91template __from_chars_result<double> __from_chars_floating_point(
91 _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);92 _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);
93
94_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
92_LIBCPP_END_NAMESPACE_STD95_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/chrono.cpp+3-2
...@@ -20,7 +20,6 @@...@@ -20,7 +20,6 @@
20# include <__support/ibm/gettod_zos.h> // gettimeofdayMonotonic20# include <__support/ibm/gettod_zos.h> // gettimeofdayMonotonic
21#endif21#endif
2222
23#include "include/apple_availability.h"
24#include <time.h> // clock_gettime and CLOCK_{MONOTONIC,REALTIME,MONOTONIC_RAW}23#include <time.h> // clock_gettime and CLOCK_{MONOTONIC,REALTIME,MONOTONIC_RAW}
2524
26#if __has_include(<unistd.h>)25#if __has_include(<unistd.h>)
...@@ -31,7 +30,7 @@...@@ -31,7 +30,7 @@
31# include <sys/time.h> // for gettimeofday and timeval30# include <sys/time.h> // for gettimeofday and timeval
32#endif31#endif
3332
34#if defined(__LLVM_LIBC__)33#if _LIBCPP_LIBC_LLVM_LIBC
35# define _LIBCPP_HAS_TIMESPEC_GET34# define _LIBCPP_HAS_TIMESPEC_GET
36#endif35#endif
3736
...@@ -64,6 +63,7 @@...@@ -64,6 +63,7 @@
64#endif63#endif
6564
66_LIBCPP_BEGIN_NAMESPACE_STD65_LIBCPP_BEGIN_NAMESPACE_STD
66_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
6767
68namespace chrono {68namespace chrono {
6969
...@@ -262,4 +262,5 @@ steady_clock::time_point steady_clock::now() noexcept { return __libcpp_steady_c...@@ -262,4 +262,5 @@ steady_clock::time_point steady_clock::now() noexcept { return __libcpp_steady_c
262262
263} // namespace chrono263} // namespace chrono
264264
265_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
265_LIBCPP_END_NAMESPACE_STD266_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/condition_variable.cpp+2
...@@ -23,6 +23,7 @@ _LIBCPP_PUSH_MACROS...@@ -23,6 +23,7 @@ _LIBCPP_PUSH_MACROS
23#include <__undef_macros>23#include <__undef_macros>
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
26_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2627
27// ~condition_variable is defined elsewhere.28// ~condition_variable is defined elsewhere.
2829
...@@ -72,6 +73,7 @@ void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)...@@ -72,6 +73,7 @@ void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
72 __thread_local_data()->notify_all_at_thread_exit(&cond, lk.release());73 __thread_local_data()->notify_all_at_thread_exit(&cond, lk.release());
73}74}
7475
76_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
75_LIBCPP_END_NAMESPACE_STD77_LIBCPP_END_NAMESPACE_STD
7678
77_LIBCPP_POP_MACROS79_LIBCPP_POP_MACROS
lib/libcxx/src/condition_variable_destructor.cpp+2
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23#ifdef NEEDS_CONDVAR_DESTRUCTOR24#ifdef NEEDS_CONDVAR_DESTRUCTOR
2425
...@@ -37,4 +38,5 @@ public:...@@ -37,4 +38,5 @@ public:
37condition_variable::~condition_variable() { __libcpp_condvar_destroy(&__cv_); }38condition_variable::~condition_variable() { __libcpp_condvar_destroy(&__cv_); }
38#endif39#endif
3940
41_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
40_LIBCPP_END_NAMESPACE_STD42_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/error_category.cpp+2
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#include <system_error>17#include <system_error>
1818
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
20_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2021
21// class error_category22// class error_category
2223
...@@ -36,4 +37,5 @@ bool error_category::equivalent(const error_code& code, int condition) const noe...@@ -36,4 +37,5 @@ bool error_category::equivalent(const error_code& code, int condition) const noe
36 return *this == code.category() && code.value() == condition;37 return *this == code.category() && code.value() == condition;
37}38}
3839
40_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
39_LIBCPP_END_NAMESPACE_STD41_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/expected.cpp+4
...@@ -9,5 +9,9 @@...@@ -9,5 +9,9 @@
9#include <expected>9#include <expected>
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
12_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
13
12const char* bad_expected_access<void>::what() const noexcept { return "bad access to std::expected"; }14const char* bad_expected_access<void>::what() const noexcept { return "bad access to std::expected"; }
15
16_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
13_LIBCPP_END_NAMESPACE_STD17_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/experimental/chrono_exception.cpp+2
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#include <chrono>9#include <chrono>
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
12_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1213
13namespace chrono {14namespace chrono {
1415
...@@ -19,4 +20,5 @@ _LIBCPP_EXPORTED_FROM_ABI ambiguous_local_time::~ambiguous_local_time() = defaul...@@ -19,4 +20,5 @@ _LIBCPP_EXPORTED_FROM_ABI ambiguous_local_time::~ambiguous_local_time() = defaul
1920
20} // namespace chrono21} // namespace chrono
2122
23_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
22_LIBCPP_END_NAMESPACE_STD24_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/experimental/include/tzdb/tzdb_private.h+2
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include "types_private.h"16#include "types_private.h"
1717
18_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
19_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1920
20namespace chrono {21namespace chrono {
2122
...@@ -23,6 +24,7 @@ void __init_tzdb(tzdb& __tzdb, __tz::__rules_storage_type& __rules);...@@ -23,6 +24,7 @@ void __init_tzdb(tzdb& __tzdb, __tz::__rules_storage_type& __rules);
2324
24} // namespace chrono25} // namespace chrono
2526
27_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
26_LIBCPP_END_NAMESPACE_STD28_LIBCPP_END_NAMESPACE_STD
2729
28#endif // _LIBCPP_SRC_INCLUDE_TZDB_TZ_PRIVATE_H30#endif // _LIBCPP_SRC_INCLUDE_TZDB_TZ_PRIVATE_H
lib/libcxx/src/experimental/log_hardening_failure.cpp+2
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#endif // __BIONIC__15#endif // __BIONIC__
1616
17_LIBCPP_BEGIN_NAMESPACE_STD17_LIBCPP_BEGIN_NAMESPACE_STD
18_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1819
19void __log_hardening_failure(const char* message) noexcept {20void __log_hardening_failure(const char* message) noexcept {
20 // Always log the message to `stderr` in case the platform-specific system calls fail.21 // Always log the message to `stderr` in case the platform-specific system calls fail.
...@@ -28,4 +29,5 @@ void __log_hardening_failure(const char* message) noexcept {...@@ -28,4 +29,5 @@ void __log_hardening_failure(const char* message) noexcept {
28#endif29#endif
29}30}
3031
32_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
31_LIBCPP_END_NAMESPACE_STD33_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/experimental/time_zone.cpp+2-6
...@@ -55,6 +55,7 @@...@@ -55,6 +55,7 @@
55#endif55#endif
5656
57_LIBCPP_BEGIN_NAMESPACE_STD57_LIBCPP_BEGIN_NAMESPACE_STD
58_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
5859
59#ifdef PRINT60#ifdef PRINT
60template <>61template <>
...@@ -209,8 +210,6 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se...@@ -209,8 +210,6 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se
209 return chrono::seconds{0};210 return chrono::seconds{0};
210 else211 else
211 static_assert(false);212 static_assert(false);
212
213 std::__libcpp_unreachable();
214 },213 },
215 __continuation.__rules);214 __continuation.__rules);
216215
...@@ -235,8 +234,6 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se...@@ -235,8 +234,6 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se
235 return __value(__year, __month);234 return __value(__year, __month);
236 else235 else
237 static_assert(false);236 static_assert(false);
238
239 std::__libcpp_unreachable();
240 },237 },
241 __on);238 __on);
242}239}
...@@ -698,8 +695,6 @@ __get_sys_info(sys_seconds __time,...@@ -698,8 +695,6 @@ __get_sys_info(sys_seconds __time,
698 return chrono::__get_sys_info_basic(__time, __continuation_begin, __continuation, __value.__time);695 return chrono::__get_sys_info_basic(__time, __continuation_begin, __continuation, __value.__time);
699 else696 else
700 static_assert(false);697 static_assert(false);
701
702 std::__libcpp_unreachable();
703 },698 },
704 __continuation.__rules);699 __continuation.__rules);
705}700}
...@@ -1061,4 +1056,5 @@ time_zone::__get_info(local_seconds __local_time) const {...@@ -1061,4 +1056,5 @@ time_zone::__get_info(local_seconds __local_time) const {
10611056
1062} // namespace chrono1057} // namespace chrono
10631058
1059_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1064_LIBCPP_END_NAMESPACE_STD1060_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/experimental/tzdb.cpp+3-1
...@@ -46,6 +46,7 @@...@@ -46,6 +46,7 @@
46// TODO TZDB Implement the Windows mapping in tzdb::current_zone46// TODO TZDB Implement the Windows mapping in tzdb::current_zone
4747
48_LIBCPP_BEGIN_NAMESPACE_STD48_LIBCPP_BEGIN_NAMESPACE_STD
49_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4950
50namespace chrono {51namespace chrono {
5152
...@@ -53,7 +54,7 @@ _LIBCPP_DIAGNOSTIC_PUSH...@@ -53,7 +54,7 @@ _LIBCPP_DIAGNOSTIC_PUSH
53_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")54_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
54// This function is weak so it can be overriden in the tests. The55// This function is weak so it can be overriden in the tests. The
55// declaration is in the test header test/support/test_tzdb.h56// declaration is in the test header test/support/test_tzdb.h
56_LIBCPP_WEAK string_view __libcpp_tzdb_directory() {57[[gnu::weak]] string_view __libcpp_tzdb_directory() {
57#if defined(__linux__)58#if defined(__linux__)
58 return "/usr/share/zoneinfo/";59 return "/usr/share/zoneinfo/";
59#else60#else
...@@ -825,4 +826,5 @@ _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version() {...@@ -825,4 +826,5 @@ _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version() {
825826
826} // namespace chrono827} // namespace chrono
827828
829_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
828_LIBCPP_END_NAMESPACE_STD830_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/experimental/tzdb_list.cpp+2
...@@ -13,6 +13,7 @@...@@ -13,6 +13,7 @@
13#include "include/tzdb/tzdb_list_private.h"13#include "include/tzdb/tzdb_list_private.h"
1414
15_LIBCPP_BEGIN_NAMESPACE_STD15_LIBCPP_BEGIN_NAMESPACE_STD
16_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1617
17namespace chrono {18namespace chrono {
1819
...@@ -40,4 +41,5 @@ _LIBCPP_EXPORTED_FROM_ABI tzdb_list::const_iterator tzdb_list::__erase_after(con...@@ -40,4 +41,5 @@ _LIBCPP_EXPORTED_FROM_ABI tzdb_list::const_iterator tzdb_list::__erase_after(con
4041
41} // namespace chrono42} // namespace chrono
4243
44_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
43_LIBCPP_END_NAMESPACE_STD45_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/filesystem/directory_entry.cpp+2
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include "time_utils.h"16#include "time_utils.h"
1717
18_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM18_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
19_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1920
20error_code directory_entry::__do_refresh() noexcept {21error_code directory_entry::__do_refresh() noexcept {
21 __data_.__reset();22 __data_.__reset();
...@@ -70,4 +71,5 @@ error_code directory_entry::__do_refresh() noexcept {...@@ -70,4 +71,5 @@ error_code directory_entry::__do_refresh() noexcept {
70 return failure_ec;71 return failure_ec;
71}72}
7273
74_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
73_LIBCPP_END_NAMESPACE_FILESYSTEM75_LIBCPP_END_NAMESPACE_FILESYSTEM
lib/libcxx/src/filesystem/directory_iterator.cpp+2
...@@ -26,6 +26,7 @@...@@ -26,6 +26,7 @@
26#endif26#endif
2727
28_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM28_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
29_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2930
30using detail::ErrorHandler;31using detail::ErrorHandler;
3132
...@@ -320,4 +321,5 @@ bool recursive_directory_iterator::__try_recursion(error_code* ec) {...@@ -320,4 +321,5 @@ bool recursive_directory_iterator::__try_recursion(error_code* ec) {
320 return false;321 return false;
321}322}
322323
324_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
323_LIBCPP_END_NAMESPACE_FILESYSTEM325_LIBCPP_END_NAMESPACE_FILESYSTEM
lib/libcxx/src/filesystem/filesystem_clock.cpp+3-1
...@@ -32,7 +32,7 @@...@@ -32,7 +32,7 @@
32# include <sys/time.h> // for gettimeofday and timeval32# include <sys/time.h> // for gettimeofday and timeval
33#endif33#endif
3434
35#if defined(__LLVM_LIBC__)35#if _LIBCPP_LIBC_LLVM_LIBC
36# define _LIBCPP_HAS_TIMESPEC_GET36# define _LIBCPP_HAS_TIMESPEC_GET
37#endif37#endif
3838
...@@ -42,6 +42,7 @@...@@ -42,6 +42,7 @@
42#endif42#endif
4343
44_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM44_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
45_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4546
46_LIBCPP_DIAGNOSTIC_PUSH47_LIBCPP_DIAGNOSTIC_PUSH
47_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated")48_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated")
...@@ -76,4 +77,5 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept {...@@ -76,4 +77,5 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept {
76#endif77#endif
77}78}
7879
80_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
79_LIBCPP_END_NAMESPACE_FILESYSTEM81_LIBCPP_END_NAMESPACE_FILESYSTEM
lib/libcxx/src/filesystem/filesystem_error.cpp+2
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#include "format_string.h"15#include "format_string.h"
1616
17_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM17_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
18_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1819
19filesystem_error::~filesystem_error() {}20filesystem_error::~filesystem_error() {}
2021
...@@ -37,4 +38,5 @@ void filesystem_error::__create_what(int __num_paths) {...@@ -37,4 +38,5 @@ void filesystem_error::__create_what(int __num_paths) {
37 }();38 }();
38}39}
3940
41_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
40_LIBCPP_END_NAMESPACE_FILESYSTEM42_LIBCPP_END_NAMESPACE_FILESYSTEM
lib/libcxx/src/filesystem/operations.cpp+5
...@@ -69,6 +69,7 @@...@@ -69,6 +69,7 @@
69#endif69#endif
7070
71_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM71_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
72_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
7273
73using detail::capture_errno;74using detail::capture_errno;
74using detail::ErrorHandler;75using detail::ErrorHandler;
...@@ -904,6 +905,9 @@ uintmax_t remove_all_impl(int parent_directory, const path& p, error_code& ec) {...@@ -904,6 +905,9 @@ uintmax_t remove_all_impl(int parent_directory, const path& p, error_code& ec) {
904 break; // we're done iterating through the directory905 break; // we're done iterating through the directory
905 } else {906 } else {
906 count += remove_all_impl(fd, str, ec);907 count += remove_all_impl(fd, str, ec);
908 // If there's an error removing the child, return immediately to preserve the error code.
909 if (ec)
910 return count;
907 }911 }
908 }912 }
909913
...@@ -1077,4 +1081,5 @@ path __weakly_canonical(const path& p, error_code* ec) {...@@ -1077,4 +1081,5 @@ path __weakly_canonical(const path& p, error_code* ec) {
1077 return result.lexically_normal();1081 return result.lexically_normal();
1078}1082}
10791083
1084_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
1080_LIBCPP_END_NAMESPACE_FILESYSTEM1085_LIBCPP_END_NAMESPACE_FILESYSTEM
lib/libcxx/src/filesystem/path.cpp+12-11
...@@ -14,6 +14,7 @@...@@ -14,6 +14,7 @@
14#include "path_parser.h"14#include "path_parser.h"
1515
16_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM16_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
17_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1718
18using detail::ErrorHandler;19using detail::ErrorHandler;
19using parser::createView;20using parser::createView;
...@@ -139,21 +140,20 @@ string_view_t path::__extension() const { return parser::separate_filename(__fil...@@ -139,21 +140,20 @@ string_view_t path::__extension() const { return parser::separate_filename(__fil
139////////////////////////////////////////////////////////////////////////////140////////////////////////////////////////////////////////////////////////////
140// path.gen141// path.gen
141142
142enum PathPartKind : unsigned char { PK_None, PK_RootSep, PK_Filename, PK_Dot, PK_DotDot, PK_TrailingSep };143enum PathPartKind : unsigned char { PK_None, PK_RootName, PK_RootSep, PK_Filename, PK_Dot, PK_DotDot, PK_TrailingSep };
143144
144static PathPartKind ClassifyPathPart(string_view_t Part) {145static PathPartKind ClassifyPathPart(const PathParser& PP) {
146 if (PP.inRootName())
147 return PK_RootName;
148 if (PP.inRootDir())
149 return PK_RootSep;
150 string_view_t Part = *PP;
145 if (Part.empty())151 if (Part.empty())
146 return PK_TrailingSep;152 return PK_TrailingSep;
147 if (Part == PATHSTR("."))153 if (Part == PATHSTR("."))
148 return PK_Dot;154 return PK_Dot;
149 if (Part == PATHSTR(".."))155 if (Part == PATHSTR(".."))
150 return PK_DotDot;156 return PK_DotDot;
151 if (Part == PATHSTR("/"))
152 return PK_RootSep;
153#if defined(_LIBCPP_WIN32API)
154 if (Part == PATHSTR("\\"))
155 return PK_RootSep;
156#endif
157 return PK_Filename;157 return PK_Filename;
158}158}
159159
...@@ -183,13 +183,13 @@ path path::lexically_normal() const {...@@ -183,13 +183,13 @@ path path::lexically_normal() const {
183 // Build a stack containing the remaining elements of the path, popping off183 // Build a stack containing the remaining elements of the path, popping off
184 // elements which occur before a '..' entry.184 // elements which occur before a '..' entry.
185 for (auto PP = PathParser::CreateBegin(__pn_); PP; ++PP) {185 for (auto PP = PathParser::CreateBegin(__pn_); PP; ++PP) {
186 auto Part = *PP;186 PathPartKind Kind = ClassifyPathPart(PP);
187 PathPartKind Kind = ClassifyPathPart(Part);
188 switch (Kind) {187 switch (Kind) {
189 case PK_Filename:188 case PK_Filename:
189 case PK_RootName:
190 case PK_RootSep: {190 case PK_RootSep: {
191 // Add all non-dot and non-dot-dot elements to the stack of elements.191 // Add all non-dot and non-dot-dot elements to the stack of elements.
192 AddPart(Kind, Part);192 AddPart(Kind, *PP);
193 MaybeNeedTrailingSep = false;193 MaybeNeedTrailingSep = false;
194 break;194 break;
195 }195 }
...@@ -444,4 +444,5 @@ size_t __char_to_wide(const string& str, wchar_t* out, size_t outlen) {...@@ -444,4 +444,5 @@ size_t __char_to_wide(const string& str, wchar_t* out, size_t outlen) {
444}444}
445#endif445#endif
446446
447_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
447_LIBCPP_END_NAMESPACE_FILESYSTEM448_LIBCPP_END_NAMESPACE_FILESYSTEM
lib/libcxx/src/fstream.cpp+2
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
21_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2122
22#if defined(_LIBCPP_WIN32API)23#if defined(_LIBCPP_WIN32API)
2324
...@@ -34,4 +35,5 @@ _LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) no...@@ -34,4 +35,5 @@ _LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) no
3435
35#endif36#endif
3637
38_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
37_LIBCPP_END_NAMESPACE_STD39_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/functional.cpp+2
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#include <functional>9#include <functional>
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
12_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1213
13bad_function_call::~bad_function_call() noexcept {}14bad_function_call::~bad_function_call() noexcept {}
1415
...@@ -18,4 +19,5 @@ size_t __hash_memory(_LIBCPP_NOESCAPE const void* ptr, size_t size) noexcept {...@@ -18,4 +19,5 @@ size_t __hash_memory(_LIBCPP_NOESCAPE const void* ptr, size_t size) noexcept {
18 return __murmur2_or_cityhash<size_t>()(ptr, size);19 return __murmur2_or_cityhash<size_t>()(ptr, size);
19}20}
2021
22_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
21_LIBCPP_END_NAMESPACE_STD23_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/future.cpp+2
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#include <string>10#include <string>
1111
12_LIBCPP_BEGIN_NAMESPACE_STD12_LIBCPP_BEGIN_NAMESPACE_STD
13_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1314
14class _LIBCPP_HIDDEN __future_error_category : public __do_message {15class _LIBCPP_HIDDEN __future_error_category : public __do_message {
15public:16public:
...@@ -194,4 +195,5 @@ shared_future<void>& shared_future<void>::operator=(const shared_future& __rhs)...@@ -194,4 +195,5 @@ shared_future<void>& shared_future<void>::operator=(const shared_future& __rhs)
194 return *this;195 return *this;
195}196}
196197
198_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
197_LIBCPP_END_NAMESPACE_STD199_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/hash.cpp+17-334
...@@ -13,6 +13,7 @@...@@ -13,6 +13,7 @@
13_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")13_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")
1414
15_LIBCPP_BEGIN_NAMESPACE_STD15_LIBCPP_BEGIN_NAMESPACE_STD
16_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1617
17namespace {18namespace {
1819
...@@ -30,6 +31,13 @@ const unsigned indices[] = {...@@ -30,6 +31,13 @@ const unsigned indices[] = {
30 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139,31 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139,
31 143, 149, 151, 157, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 209};32 143, 149, 151, 157, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 209};
3233
34// These are the amount we increment by when checking for potential
35// primes in the loop in __next_prime.
36const uint8_t increments[] = {
37 0, 10, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2,
38 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 10,
39};
40
33} // namespace41} // namespace
3442
35// Returns: If n == 0, returns 0. Else returns the lowest prime number that43// Returns: If n == 0, returns 0. Else returns the lowest prime number that
...@@ -97,340 +105,14 @@ size_t __next_prime(size_t n) {...@@ -97,340 +105,14 @@ size_t __next_prime(size_t n) {
97 {105 {
98 size_t i = 211;106 size_t i = 211;
99 while (true) {107 while (true) {
100 std::size_t q = n / i;108 for (auto inc : increments) {
101 if (q < i)109 i += inc;
102 return n;110 std::size_t q = n / i;
103 if (n == q * i)111 if (q < i)
104 break;112 return n;
105113 if (n == q * i)
106 i += 10;114 goto next;
107 q = n / i;115 }
108 if (q < i)
109 return n;
110 if (n == q * i)
111 break;
112
113 i += 2;
114 q = n / i;
115 if (q < i)
116 return n;
117 if (n == q * i)
118 break;
119
120 i += 4;
121 q = n / i;
122 if (q < i)
123 return n;
124 if (n == q * i)
125 break;
126
127 i += 2;
128 q = n / i;
129 if (q < i)
130 return n;
131 if (n == q * i)
132 break;
133
134 i += 4;
135 q = n / i;
136 if (q < i)
137 return n;
138 if (n == q * i)
139 break;
140
141 i += 6;
142 q = n / i;
143 if (q < i)
144 return n;
145 if (n == q * i)
146 break;
147
148 i += 2;
149 q = n / i;
150 if (q < i)
151 return n;
152 if (n == q * i)
153 break;
154
155 i += 6;
156 q = n / i;
157 if (q < i)
158 return n;
159 if (n == q * i)
160 break;
161
162 i += 4;
163 q = n / i;
164 if (q < i)
165 return n;
166 if (n == q * i)
167 break;
168
169 i += 2;
170 q = n / i;
171 if (q < i)
172 return n;
173 if (n == q * i)
174 break;
175
176 i += 4;
177 q = n / i;
178 if (q < i)
179 return n;
180 if (n == q * i)
181 break;
182
183 i += 6;
184 q = n / i;
185 if (q < i)
186 return n;
187 if (n == q * i)
188 break;
189
190 i += 6;
191 q = n / i;
192 if (q < i)
193 return n;
194 if (n == q * i)
195 break;
196
197 i += 2;
198 q = n / i;
199 if (q < i)
200 return n;
201 if (n == q * i)
202 break;
203
204 i += 6;
205 q = n / i;
206 if (q < i)
207 return n;
208 if (n == q * i)
209 break;
210
211 i += 4;
212 q = n / i;
213 if (q < i)
214 return n;
215 if (n == q * i)
216 break;
217
218 i += 2;
219 q = n / i;
220 if (q < i)
221 return n;
222 if (n == q * i)
223 break;
224
225 i += 6;
226 q = n / i;
227 if (q < i)
228 return n;
229 if (n == q * i)
230 break;
231
232 i += 4;
233 q = n / i;
234 if (q < i)
235 return n;
236 if (n == q * i)
237 break;
238
239 i += 6;
240 q = n / i;
241 if (q < i)
242 return n;
243 if (n == q * i)
244 break;
245
246 i += 8;
247 q = n / i;
248 if (q < i)
249 return n;
250 if (n == q * i)
251 break;
252
253 i += 4;
254 q = n / i;
255 if (q < i)
256 return n;
257 if (n == q * i)
258 break;
259
260 i += 2;
261 q = n / i;
262 if (q < i)
263 return n;
264 if (n == q * i)
265 break;
266
267 i += 4;
268 q = n / i;
269 if (q < i)
270 return n;
271 if (n == q * i)
272 break;
273
274 i += 2;
275 q = n / i;
276 if (q < i)
277 return n;
278 if (n == q * i)
279 break;
280
281 i += 4;
282 q = n / i;
283 if (q < i)
284 return n;
285 if (n == q * i)
286 break;
287
288 i += 8;
289 q = n / i;
290 if (q < i)
291 return n;
292 if (n == q * i)
293 break;
294
295 i += 6;
296 q = n / i;
297 if (q < i)
298 return n;
299 if (n == q * i)
300 break;
301
302 i += 4;
303 q = n / i;
304 if (q < i)
305 return n;
306 if (n == q * i)
307 break;
308
309 i += 6;
310 q = n / i;
311 if (q < i)
312 return n;
313 if (n == q * i)
314 break;
315
316 i += 2;
317 q = n / i;
318 if (q < i)
319 return n;
320 if (n == q * i)
321 break;
322
323 i += 4;
324 q = n / i;
325 if (q < i)
326 return n;
327 if (n == q * i)
328 break;
329
330 i += 6;
331 q = n / i;
332 if (q < i)
333 return n;
334 if (n == q * i)
335 break;
336
337 i += 2;
338 q = n / i;
339 if (q < i)
340 return n;
341 if (n == q * i)
342 break;
343
344 i += 6;
345 q = n / i;
346 if (q < i)
347 return n;
348 if (n == q * i)
349 break;
350
351 i += 6;
352 q = n / i;
353 if (q < i)
354 return n;
355 if (n == q * i)
356 break;
357
358 i += 4;
359 q = n / i;
360 if (q < i)
361 return n;
362 if (n == q * i)
363 break;
364
365 i += 2;
366 q = n / i;
367 if (q < i)
368 return n;
369 if (n == q * i)
370 break;
371
372 i += 4;
373 q = n / i;
374 if (q < i)
375 return n;
376 if (n == q * i)
377 break;
378
379 i += 6;
380 q = n / i;
381 if (q < i)
382 return n;
383 if (n == q * i)
384 break;
385
386 i += 2;
387 q = n / i;
388 if (q < i)
389 return n;
390 if (n == q * i)
391 break;
392
393 i += 6;
394 q = n / i;
395 if (q < i)
396 return n;
397 if (n == q * i)
398 break;
399
400 i += 4;
401 q = n / i;
402 if (q < i)
403 return n;
404 if (n == q * i)
405 break;
406
407 i += 2;
408 q = n / i;
409 if (q < i)
410 return n;
411 if (n == q * i)
412 break;
413
414 i += 4;
415 q = n / i;
416 if (q < i)
417 return n;
418 if (n == q * i)
419 break;
420
421 i += 2;
422 q = n / i;
423 if (q < i)
424 return n;
425 if (n == q * i)
426 break;
427
428 i += 10;
429 q = n / i;
430 if (q < i)
431 return n;
432 if (n == q * i)
433 break;
434116
435 // This will loop i to the next "plane" of potential primes117 // This will loop i to the next "plane" of potential primes
436 i += 2;118 i += 2;
...@@ -446,4 +128,5 @@ size_t __next_prime(size_t n) {...@@ -446,4 +128,5 @@ size_t __next_prime(size_t n) {
446 }128 }
447}129}
448130
131_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
449_LIBCPP_END_NAMESPACE_STD132_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/include/apple_availability.h deleted-34
...@@ -1,34 +0,0 @@
1//===----------------------------------------------------------------------===//
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#ifndef _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H
10#define _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H
11
12#if defined(__APPLE__)
13
14# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
15# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500
16# define _LIBCPP_USE_ULOCK
17# endif
18# elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
19# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000
20# define _LIBCPP_USE_ULOCK
21# endif
22# elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
23# if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000
24# define _LIBCPP_USE_ULOCK
25# endif
26# elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
27# if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000
28# define _LIBCPP_USE_ULOCK
29# endif
30# endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__
31
32#endif // __APPLE__
33
34#endif // _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H
lib/libcxx/src/include/config_elast.h+4-1
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
21// where strerror/strerror_r can't handle out-of-range errno values.21// where strerror/strerror_r can't handle out-of-range errno values.
22#if defined(ELAST)22#if defined(ELAST)
23# define _LIBCPP_ELAST ELAST23# define _LIBCPP_ELAST ELAST
24#elif defined(__LLVM_LIBC__)24#elif _LIBCPP_LIBC_LLVM_LIBC
25// No _LIBCPP_ELAST needed for LLVM libc25// No _LIBCPP_ELAST needed for LLVM libc
26#elif _LIBCPP_LIBC_NEWLIB26#elif _LIBCPP_LIBC_NEWLIB
27# define _LIBCPP_ELAST __ELASTERROR27# define _LIBCPP_ELAST __ELASTERROR
...@@ -33,6 +33,9 @@...@@ -33,6 +33,9 @@
33// No _LIBCPP_ELAST needed on WASI33// No _LIBCPP_ELAST needed on WASI
34#elif defined(__EMSCRIPTEN__)34#elif defined(__EMSCRIPTEN__)
35// No _LIBCPP_ELAST needed on Emscripten35// No _LIBCPP_ELAST needed on Emscripten
36// zig patch: haiku support
37#elif defined(__HAIKU__)
38// No _LIBCPP_ELAST needed on Haiku
36#elif defined(__linux__) || _LIBCPP_HAS_MUSL_LIBC39#elif defined(__linux__) || _LIBCPP_HAS_MUSL_LIBC
37# define _LIBCPP_ELAST 409540# define _LIBCPP_ELAST 4095
38#elif defined(__APPLE__)41#elif defined(__APPLE__)
lib/libcxx/src/include/overridable_function.h+80-50
...@@ -11,11 +11,6 @@...@@ -11,11 +11,6 @@
11#define _LIBCPP_SRC_INCLUDE_OVERRIDABLE_FUNCTION_H11#define _LIBCPP_SRC_INCLUDE_OVERRIDABLE_FUNCTION_H
1212
13#include <__config>13#include <__config>
14#include <cstdint>
15
16#if __has_feature(ptrauth_calls)
17# include <ptrauth.h>
18#endif
1914
20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21# pragma GCC system_header16# pragma GCC system_header
...@@ -42,18 +37,19 @@...@@ -42,18 +37,19 @@
42// -------------------37// -------------------
43//38//
44// Let's say we want to check whether a weak function `f` has been overridden by the user.39// Let's say we want to check whether a weak function `f` has been overridden by the user.
45// The general mechanism works by placing `f`'s definition (in the libc++ built library)40// The general mechanism works by defining a local symbol `__impl_ref<f>::__impl_` with
46// inside a special section, which we do using the `__section__` attribute via the41// the same address as `f` as a constant expression using direct PC-relative
47// OVERRIDABLE_FUNCTION macro.42// materialization thus pointing at the symbol defined in the same TU. At runtime, it
43// compares the address of `__impl_ref<f>::__impl_` with the address of `f` loaded from
44// GOT: if `f` was overridden by the user in another TU, the addresses will be different.
48//45//
49// Then, when comes the time to check whether the function has been overridden, we take46// When pointer authentication is used, the above mechanism doesn't work (yet) so we use
50// the address of the function and we check whether it falls inside the special function47// a different strategy placing `f`'s definition (in the libc++ built library) inside
51// we created. This can be done by finding pointers to the start and the end of the section48// a special section, which we do using the `__section__` attribute via the
52// (which is done differently for ELF and Mach-O), and then checking whether `f` falls49// OVERRIDABLE_FUNCTION macro. Then, when comes the time to check whether the function has
53// within those bounds. If it falls within those bounds, then `f` is still inside the50// been overridden, we take the address of the function and we check whether it falls inside
54// special section and so it is the version we defined in the libc++ built library, i.e.51// the special section we created. This can be done by finding pointers to the start and
55// it was not overridden. Otherwise, it was overridden by the user because it falls52// the end of the section, and then checking whether `f` falls within those bounds.
56// outside of the section.
57//53//
58// Important note54// Important note
59// --------------55// --------------
...@@ -63,50 +59,80 @@...@@ -63,50 +59,80 @@
63// want to be defining special sections inside user's executables which use our headers.59// want to be defining special sections inside user's executables which use our headers.
64//60//
6561
66#if defined(_LIBCPP_OBJECT_FORMAT_MACHO)62#if defined(_LIBCPP_OBJECT_FORMAT_MACHO) || (defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__))
6763
68# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 164# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
69# define OVERRIDABLE_FUNCTION \
70 __attribute__((__section__("__TEXT,__lcxx_override,regular,pure_instructions"))) _LIBCPP_WEAK
7165
72_LIBCPP_BEGIN_NAMESPACE_STD template <typename T, T* _Func>66# if !__has_feature(ptrauth_calls)
73_LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {
74 // Declare two dummy bytes and give them these special `__asm` values. These values are
75 // defined by the linker, which means that referring to `&__lcxx_override_start` will
76 // effectively refer to the address where the section starts (and same for the end).
77 extern char __lcxx_override_start __asm("section$start$__TEXT$__lcxx_override");
78 extern char __lcxx_override_end __asm("section$end$__TEXT$__lcxx_override");
79
80 // Now get a uintptr_t out of these locations, and out of the function pointer.
81 uintptr_t __start = reinterpret_cast<uintptr_t>(&__lcxx_override_start);
82 uintptr_t __end = reinterpret_cast<uintptr_t>(&__lcxx_override_end);
83 uintptr_t __ptr = reinterpret_cast<uintptr_t>(_Func);
8467
85# if __has_feature(ptrauth_calls)68# define OVERRIDABLE_FUNCTION [[gnu::weak]]
86 // We must pass a void* to ptrauth_strip since it only accepts a pointer type. Also, in particular,
87 // we must NOT pass a function pointer, otherwise we will strip the function pointer, and then attempt
88 // to authenticate and re-sign it when casting it to a uintptr_t again, which will fail because we just
89 // stripped the function pointer. See rdar://122927845.
90 __ptr = reinterpret_cast<uintptr_t>(ptrauth_strip(reinterpret_cast<void*>(__ptr), ptrauth_key_function_pointer));
91# endif
9269
93 // Finally, the function was overridden if it falls outside of the section's bounds.70_LIBCPP_BEGIN_NAMESPACE_STD
94 return __ptr < __start || __ptr > __end;71
72namespace {
73
74// This is used to prevent TBAA from optimizing away the function pointer comparison.
75template <typename T>
76[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI T* __launder_function_pointer(T* __ptr) noexcept {
77 __asm__ volatile("" : "+r"(__ptr));
78 return __ptr;
95}79}
80
81} // namespace
82
83template <auto* _Func>
84struct __impl_ref;
85
86// __impl_ref<...>::__impl_ is expected to be defined elsewhere, so the compiler emits
87// assembly references to the mangled symbol with no definition. This template saves us
88// the trouble of providing manual declarations for overloads with some other local name
89// for each function name being overloaded (operator new, operator new[], etc.).
90template <typename _Ret, typename... _Args, _Ret (*_Func)(_Args...)>
91struct __impl_ref<_Func> {
92 [[gnu::visibility("hidden")]] static _Ret __impl_(_Args...);
93};
94
95// This takes a function type template argument first so that the second non-type template
96// argument (pointer to the public function) gets the benefit of type-aware overload
97// resolution, rather than having to use a static_cast.
98template <typename T, T* _Func>
99_LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {
100# if !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER >= 2101
101 __asm__("%cc0 = %cc1" : : "X"(__impl_ref<_Func>::__impl_), "X"(_Func));
102# else
103 __asm__("%c0 = %c1" : : "X"(__impl_ref<_Func>::__impl_), "X"(_Func));
104# endif
105 // This just has the compiler compare the two symbols. For PIC mode, this will do a
106 // direct PC-relative materialization for __impl_ref<...>::__impl_ and a GOT load for
107 // the _Func symbol. The compiler thinks __impl_ref<...>::__impl_ is defined elsewhere
108 // at link time and will be an undefined symbol. It doesn't know that the __asm__ tells
109 // the assembler to define it as a local symbol.
110 return __launder_function_pointer(_Func) != __impl_ref<_Func>::__impl_;
111}
112
96_LIBCPP_END_NAMESPACE_STD113_LIBCPP_END_NAMESPACE_STD
97114
98// The NVPTX linker cannot create '__start/__stop' sections.115# else // __has_feature(ptrauth_calls)
99#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__)
100116
101# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1117# include <cstdint>
102# define OVERRIDABLE_FUNCTION __attribute__((__section__("__lcxx_override"))) _LIBCPP_WEAK118# include <ptrauth.h>
103119
120# if defined(_LIBCPP_OBJECT_FORMAT_MACHO)
121# define OVERRIDABLE_FUNCTION [[gnu::weak, gnu::section("__TEXT,__lcxx_override,regular,pure_instructions")]]
122// Declare two dummy bytes and give them these special `__asm` values. These values are
123// defined by the linker, which means that referring to `&__lcxx_override_start` will
124// effectively refer to the address where the section starts (and same for the end).
125extern char __start___lcxx_override __asm("section$start$__TEXT$__lcxx_override");
126extern char __stop___lcxx_override __asm("section$end$__TEXT$__lcxx_override");
127# elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
104// This is very similar to what we do for Mach-O above. The ELF linker will implicitly define128// This is very similar to what we do for Mach-O above. The ELF linker will implicitly define
105// variables with those names corresponding to the start and the end of the section.129// variables with those names corresponding to the start and the end of the section.
106//130//
107// See https://stackoverflow.com/questions/16552710/how-do-you-get-the-start-and-end-addresses-of-a-custom-elf-section131// See https://stackoverflow.com/questions/16552710/how-do-you-get-the-start-and-end-addresses-of-a-custom-elf-section
132# define OVERRIDABLE_FUNCTION [[gnu::weak, gnu::section("__lcxx_override")]]
108extern char __start___lcxx_override;133extern char __start___lcxx_override;
109extern char __stop___lcxx_override;134extern char __stop___lcxx_override;
135# endif
110136
111_LIBCPP_BEGIN_NAMESPACE_STD137_LIBCPP_BEGIN_NAMESPACE_STD
112template <typename T, T* _Func>138template <typename T, T* _Func>
...@@ -115,20 +141,24 @@ _LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {...@@ -115,20 +141,24 @@ _LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {
115 uintptr_t __end = reinterpret_cast<uintptr_t>(&__stop___lcxx_override);141 uintptr_t __end = reinterpret_cast<uintptr_t>(&__stop___lcxx_override);
116 uintptr_t __ptr = reinterpret_cast<uintptr_t>(_Func);142 uintptr_t __ptr = reinterpret_cast<uintptr_t>(_Func);
117143
118# if __has_feature(ptrauth_calls)144 // We must pass a void* to ptrauth_strip since it only accepts a pointer type. Also, in particular,
119 // We must pass a void* to ptrauth_strip since it only accepts a pointer type. See full explanation above.145 // we must NOT pass a function pointer, otherwise we will strip the function pointer, and then attempt
146 // to authenticate and re-sign it when casting it to a uintptr_t again, which will fail because we just
147 // stripped the function pointer. See rdar://122927845.
120 __ptr = reinterpret_cast<uintptr_t>(ptrauth_strip(reinterpret_cast<void*>(__ptr), ptrauth_key_function_pointer));148 __ptr = reinterpret_cast<uintptr_t>(ptrauth_strip(reinterpret_cast<void*>(__ptr), ptrauth_key_function_pointer));
121# endif
122149
150 // Finally, the function was overridden if it falls outside of the section's bounds.
123 return __ptr < __start || __ptr > __end;151 return __ptr < __start || __ptr > __end;
124}152}
125_LIBCPP_END_NAMESPACE_STD153_LIBCPP_END_NAMESPACE_STD
126154
127#else155# endif // __has_feature(ptrauth_calls)
156
157#else // defined(_LIBCPP_OBJECT_FORMAT_MACHO) || (defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__))
128158
129# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 0159# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 0
130# define OVERRIDABLE_FUNCTION _LIBCPP_WEAK160# define OVERRIDABLE_FUNCTION [[gnu::weak]]
131161
132#endif162#endif // defined(_LIBCPP_OBJECT_FORMAT_MACHO) || (defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__))
133163
134#endif // _LIBCPP_SRC_INCLUDE_OVERRIDABLE_FUNCTION_H164#endif // _LIBCPP_SRC_INCLUDE_OVERRIDABLE_FUNCTION_H
lib/libcxx/src/include/refstring.h+1-1
...@@ -15,7 +15,7 @@...@@ -15,7 +15,7 @@
15#include <cstring>15#include <cstring>
16#include <stdexcept>16#include <stdexcept>
1717
18// MacOS and iOS used to ship with libstdc++, and still support old applications18// macOS and iOS used to ship with libstdc++, and still support old applications
19// linking against libstdc++. The libc++ and libstdc++ exceptions are supposed19// linking against libstdc++. The libc++ and libstdc++ exceptions are supposed
20// to be ABI compatible, such that they can be thrown from one library and caught20// to be ABI compatible, such that they can be thrown from one library and caught
21// in the other.21// in the other.
lib/libcxx/src/include/ryu/ryu.h-18
...@@ -67,24 +67,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -67,24 +67,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
6767
68// https://github.com/ulfjack/ryu/tree/59661c3/ryu68// https://github.com/ulfjack/ryu/tree/59661c3/ryu
6969
70#if !defined(_MSC_VER)
71_LIBCPP_HIDE_FROM_ABI inline unsigned char _BitScanForward64(unsigned long* __index, unsigned long long __mask) {
72 if (__mask == 0) {
73 return false;
74 }
75 *__index = __builtin_ctzll(__mask);
76 return true;
77}
78
79_LIBCPP_HIDE_FROM_ABI inline unsigned char _BitScanForward(unsigned long* __index, unsigned int __mask) {
80 if (__mask == 0) {
81 return false;
82 }
83 *__index = __builtin_ctz(__mask);
84 return true;
85}
86#endif // !_MSC_VER
87
88template <class _Floating>70template <class _Floating>
89[[nodiscard]] to_chars_result _Floating_to_chars_ryu(71[[nodiscard]] to_chars_result _Floating_to_chars_ryu(
90 char* const _First, char* const _Last, const _Floating _Value, const chars_format _Fmt) noexcept {72 char* const _First, char* const _Last, const _Floating _Value, const chars_format _Fmt) noexcept {
lib/libcxx/src/include/to_chars_floating_point.h+1-1
...@@ -38,7 +38,7 @@ namespace __itoa {...@@ -38,7 +38,7 @@ namespace __itoa {
38inline constexpr char _Charconv_digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',38inline constexpr char _Charconv_digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
39 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};39 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
40static_assert(std::size(_Charconv_digits) == 36);40static_assert(std::size(_Charconv_digits) == 36);
41} // __itoa41} // namespace __itoa
4242
43// vvvvvvvvvv DERIVED FROM corecrt_internal_fltintrn.h vvvvvvvvvv43// vvvvvvvvvv DERIVED FROM corecrt_internal_fltintrn.h vvvvvvvvvv
4444
lib/libcxx/src/ios.cpp+38-39
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#include <__config>9#include <__config>
10#include <__locale>10#include <__locale>
11#include <algorithm>11#include <algorithm>
12#include <atomic>
12#include <ios>13#include <ios>
13#include <limits>14#include <limits>
14#include <memory>15#include <memory>
...@@ -22,6 +23,7 @@ _LIBCPP_PUSH_MACROS...@@ -22,6 +23,7 @@ _LIBCPP_PUSH_MACROS
22#include <__undef_macros>23#include <__undef_macros>
2324
24_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
26_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2527
26class _LIBCPP_HIDDEN __iostream_category : public __do_message {28class _LIBCPP_HIDDEN __iostream_category : public __do_message {
27public:29public:
...@@ -102,25 +104,13 @@ void ios_base::__call_callbacks(event ev) {...@@ -102,25 +104,13 @@ void ios_base::__call_callbacks(event ev) {
102// locale104// locale
103105
104locale ios_base::imbue(const locale& newloc) {106locale ios_base::imbue(const locale& newloc) {
105 static_assert(sizeof(locale) == sizeof(__loc_), "");107 locale loc = newloc;
106 locale& loc_storage = *reinterpret_cast<locale*>(&__loc_);108 std::swap(__loc_, loc);
107 locale oldloc = loc_storage;
108 loc_storage = newloc;
109 __call_callbacks(imbue_event);109 __call_callbacks(imbue_event);
110 return oldloc;110 return loc;
111}111}
112112
113locale ios_base::getloc() const {113locale ios_base::getloc() const { return __loc_; }
114 const locale& loc_storage = *reinterpret_cast<const locale*>(&__loc_);
115 return loc_storage;
116}
117
118// xalloc
119#if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
120atomic<int> ios_base::__xindex_{0};
121#else
122int ios_base::__xindex_ = 0;
123#endif
124114
125template <typename _Tp>115template <typename _Tp>
126static size_t __ios_new_cap(size_t __req_size, size_t __current_cap) { // Precondition: __req_size > __current_cap116static size_t __ios_new_cap(size_t __req_size, size_t __current_cap) { // Precondition: __req_size > __current_cap
...@@ -131,7 +121,17 @@ static size_t __ios_new_cap(size_t __req_size, size_t __current_cap) { // Precon...@@ -131,7 +121,17 @@ static size_t __ios_new_cap(size_t __req_size, size_t __current_cap) { // Precon
131 return mx;121 return mx;
132}122}
133123
134int ios_base::xalloc() { return __xindex_++; }124int ios_base::xalloc() {
125#if _LIBCPP_HAS_THREADS
126 constinit static atomic<int> xindex = 0;
127#else
128 // If we don't have atomics, fall back to single-threaded implementation.
129 // FIXME: Should "single-threaded" be a separate option from
130 // _LIBCPP_HAS_THREADS?
131 static int xindex = 0;
132#endif // _LIBCPP_HAS_THREADS
133 return xindex++;
134}
135135
136long& ios_base::iword(int index) {136long& ios_base::iword(int index) {
137 size_t req_size = static_cast<size_t>(index) + 1;137 size_t req_size = static_cast<size_t>(index) + 1;
...@@ -180,12 +180,16 @@ void ios_base::register_callback(event_callback fn, int index) {...@@ -180,12 +180,16 @@ void ios_base::register_callback(event_callback fn, int index) {
180 if (req_size > __event_cap_) {180 if (req_size > __event_cap_) {
181 size_t newcap = __ios_new_cap<event_callback>(req_size, __event_cap_);181 size_t newcap = __ios_new_cap<event_callback>(req_size, __event_cap_);
182 event_callback* fns = static_cast<event_callback*>(realloc(__fn_, newcap * sizeof(event_callback)));182 event_callback* fns = static_cast<event_callback*>(realloc(__fn_, newcap * sizeof(event_callback)));
183 if (fns == 0)183 if (fns == 0) {
184 setstate(badbit);184 setstate(badbit);
185 return;
186 }
185 __fn_ = fns;187 __fn_ = fns;
186 int* indxs = static_cast<int*>(realloc(__index_, newcap * sizeof(int)));188 int* indxs = static_cast<int*>(realloc(__index_, newcap * sizeof(int)));
187 if (indxs == 0)189 if (indxs == 0) {
188 setstate(badbit);190 setstate(badbit);
191 return;
192 }
189 __index_ = indxs;193 __index_ = indxs;
190 __event_cap_ = newcap;194 __event_cap_ = newcap;
191 }195 }
...@@ -197,11 +201,10 @@ void ios_base::register_callback(event_callback fn, int index) {...@@ -197,11 +201,10 @@ void ios_base::register_callback(event_callback fn, int index) {
197ios_base::~ios_base() {201ios_base::~ios_base() {
198 // Avoid UB when not properly initialized. See ios_base::ios_base for202 // Avoid UB when not properly initialized. See ios_base::ios_base for
199 // more information.203 // more information.
200 if (!__loc_)204 if (!__loc_.__locale_)
201 return;205 return;
202 __call_callbacks(erase_event);206 __call_callbacks(erase_event);
203 locale& loc_storage = *reinterpret_cast<locale*>(&__loc_);207 __loc_.~locale();
204 loc_storage.~locale();
205 free(__fn_);208 free(__fn_);
206 free(__index_);209 free(__index_);
207 free(__iarray_);210 free(__iarray_);
...@@ -273,12 +276,10 @@ void ios_base::copyfmt(const ios_base& rhs) {...@@ -273,12 +276,10 @@ void ios_base::copyfmt(const ios_base& rhs) {
273 std::__throw_bad_alloc();276 std::__throw_bad_alloc();
274 }277 }
275 // Got everything we need. Copy everything but __rdstate_, __rdbuf_ and __exceptions_278 // Got everything we need. Copy everything but __rdstate_, __rdbuf_ and __exceptions_
276 __fmtflags_ = rhs.__fmtflags_;279 __fmtflags_ = rhs.__fmtflags_;
277 __precision_ = rhs.__precision_;280 __precision_ = rhs.__precision_;
278 __width_ = rhs.__width_;281 __width_ = rhs.__width_;
279 locale& lhs_loc = *reinterpret_cast<locale*>(&__loc_);282 __loc_ = rhs.__loc_;
280 const locale& rhs_loc = *reinterpret_cast<const locale*>(&rhs.__loc_);
281 lhs_loc = rhs_loc;
282 if (__event_cap_ < rhs.__event_size_) {283 if (__event_cap_ < rhs.__event_size_) {
283 free(__fn_);284 free(__fn_);
284 __fn_ = new_callbacks.release();285 __fn_ = new_callbacks.release();
...@@ -308,14 +309,13 @@ void ios_base::copyfmt(const ios_base& rhs) {...@@ -308,14 +309,13 @@ void ios_base::copyfmt(const ios_base& rhs) {
308309
309void ios_base::move(ios_base& rhs) {310void ios_base::move(ios_base& rhs) {
310 // *this is uninitialized311 // *this is uninitialized
311 __fmtflags_ = rhs.__fmtflags_;312 __fmtflags_ = rhs.__fmtflags_;
312 __precision_ = rhs.__precision_;313 __precision_ = rhs.__precision_;
313 __width_ = rhs.__width_;314 __width_ = rhs.__width_;
314 __rdstate_ = rhs.__rdstate_;315 __rdstate_ = rhs.__rdstate_;
315 __exceptions_ = rhs.__exceptions_;316 __exceptions_ = rhs.__exceptions_;
316 __rdbuf_ = 0;317 __rdbuf_ = 0;
317 locale& rhs_loc = *reinterpret_cast<locale*>(&rhs.__loc_);318 ::new (&__loc_) locale(rhs.__loc_);
318 ::new (&__loc_) locale(rhs_loc);
319 __fn_ = rhs.__fn_;319 __fn_ = rhs.__fn_;
320 rhs.__fn_ = 0;320 rhs.__fn_ = 0;
321 __index_ = rhs.__index_;321 __index_ = rhs.__index_;
...@@ -344,9 +344,7 @@ void ios_base::swap(ios_base& rhs) noexcept {...@@ -344,9 +344,7 @@ void ios_base::swap(ios_base& rhs) noexcept {
344 std::swap(__width_, rhs.__width_);344 std::swap(__width_, rhs.__width_);
345 std::swap(__rdstate_, rhs.__rdstate_);345 std::swap(__rdstate_, rhs.__rdstate_);
346 std::swap(__exceptions_, rhs.__exceptions_);346 std::swap(__exceptions_, rhs.__exceptions_);
347 locale& lhs_loc = *reinterpret_cast<locale*>(&__loc_);347 std::swap(__loc_, rhs.__loc_);
348 locale& rhs_loc = *reinterpret_cast<locale*>(&rhs.__loc_);
349 std::swap(lhs_loc, rhs_loc);
350 std::swap(__fn_, rhs.__fn_);348 std::swap(__fn_, rhs.__fn_);
351 std::swap(__index_, rhs.__index_);349 std::swap(__index_, rhs.__index_);
352 std::swap(__event_size_, rhs.__event_size_);350 std::swap(__event_size_, rhs.__event_size_);
...@@ -382,6 +380,7 @@ bool ios_base::sync_with_stdio(bool sync) {...@@ -382,6 +380,7 @@ bool ios_base::sync_with_stdio(bool sync) {
382 return r;380 return r;
383}381}
384382
383_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
385_LIBCPP_END_NAMESPACE_STD384_LIBCPP_END_NAMESPACE_STD
386385
387_LIBCPP_POP_MACROS386_LIBCPP_POP_MACROS
lib/libcxx/src/ios.instantiations.cpp+21
...@@ -15,6 +15,26 @@...@@ -15,6 +15,26 @@
15#include <streambuf>15#include <streambuf>
1616
17_LIBCPP_BEGIN_NAMESPACE_STD17_LIBCPP_BEGIN_NAMESPACE_STD
18_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
19
20#if _LIBCPP_HAS_FILESYSTEM
21// This is provided for ABI compatiblity with programs compiled against old headers.
22// TODO: Is this actually required? If so, this should be guarded with
23// `_LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 24`. Otherwise this should be removed.
24template <class _CharT, class _Traits>
25bool basic_filebuf<_CharT, _Traits>::__read_mode() {
26 if (!(__cm_ & ios_base::in)) {
27 this->setp(nullptr, nullptr);
28 if (__always_noconv_)
29 this->setg((char_type*)__extbuf_, (char_type*)__extbuf_ + __ebs_, (char_type*)__extbuf_ + __ebs_);
30 else
31 this->setg(__intbuf_, __intbuf_ + __ibs_, __intbuf_ + __ibs_);
32 __cm_ = ios_base::in;
33 return true;
34 }
35 return false;
36}
37#endif
1838
19// Original explicit instantiations provided in the library39// Original explicit instantiations provided in the library
20template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;40template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
...@@ -45,4 +65,5 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;...@@ -45,4 +65,5 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;
4565
46// Add more here if needed...66// Add more here if needed...
4767
68_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
48_LIBCPP_END_NAMESPACE_STD69_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/iostream.cpp+2
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#define ABI_NAMESPACE_STR _LIBCPP_TOSTRING(_LIBCPP_ABI_NAMESPACE)15#define ABI_NAMESPACE_STR _LIBCPP_TOSTRING(_LIBCPP_ABI_NAMESPACE)
1616
17_LIBCPP_BEGIN_NAMESPACE_STD17_LIBCPP_BEGIN_NAMESPACE_STD
18_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1819
19// This file implements the various stream objects provided inside <iostream>. We're doing some ODR violations in here,20// This file implements the various stream objects provided inside <iostream>. We're doing some ODR violations in here,
20// so this quite fragile. Specifically, the size of the stream objects (i.e. cout, cin etc.) needs to stay the same.21// so this quite fragile. Specifically, the size of the stream objects (i.e. cout, cin etc.) needs to stay the same.
...@@ -154,4 +155,5 @@ ios_base::Init::Init() {...@@ -154,4 +155,5 @@ ios_base::Init::Init() {
154155
155ios_base::Init::~Init() {}156ios_base::Init::~Init() {}
156157
158_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
157_LIBCPP_END_NAMESPACE_STD159_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/locale.cpp+22-18
...@@ -45,6 +45,7 @@ _LIBCPP_PUSH_MACROS...@@ -45,6 +45,7 @@ _LIBCPP_PUSH_MACROS
45#include <__undef_macros>45#include <__undef_macros>
4646
47_LIBCPP_BEGIN_NAMESPACE_STD47_LIBCPP_BEGIN_NAMESPACE_STD
48_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
4849
49struct __libcpp_unique_locale {50struct __libcpp_unique_locale {
50 __libcpp_unique_locale(const char* nm) : __loc_(__locale::__newlocale(_LIBCPP_ALL_MASK, nm, 0)) {}51 __libcpp_unique_locale(const char* nm) : __loc_(__locale::__newlocale(_LIBCPP_ALL_MASK, nm, 0)) {}
...@@ -158,11 +159,11 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {...@@ -158,11 +159,11 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
158 _LIBCPP_SUPPRESS_DEPRECATED_PUSH159 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
159 install(&make<codecvt<char16_t, char, mbstate_t> >(1u));160 install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
160 install(&make<codecvt<char32_t, char, mbstate_t> >(1u));161 install(&make<codecvt<char32_t, char, mbstate_t> >(1u));
161 _LIBCPP_SUPPRESS_DEPRECATED_POP
162#if _LIBCPP_HAS_CHAR8_T162#if _LIBCPP_HAS_CHAR8_T
163 install(&make<codecvt<char16_t, char8_t, mbstate_t> >(1u));163 install(&make<codecvt<char16_t, char8_t, mbstate_t> >(1u));
164 install(&make<codecvt<char32_t, char8_t, mbstate_t> >(1u));164 install(&make<codecvt<char32_t, char8_t, mbstate_t> >(1u));
165#endif165#endif
166 _LIBCPP_SUPPRESS_DEPRECATED_POP
166 install(&make<numpunct<char> >(1u));167 install(&make<numpunct<char> >(1u));
167#if _LIBCPP_HAS_WIDE_CHARACTERS168#if _LIBCPP_HAS_WIDE_CHARACTERS
168 install(&make<numpunct<wchar_t> >(1u));169 install(&make<numpunct<wchar_t> >(1u));
...@@ -228,11 +229,11 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),...@@ -228,11 +229,11 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),
228 _LIBCPP_SUPPRESS_DEPRECATED_PUSH229 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
229 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));230 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
230 install(new codecvt_byname<char32_t, char, mbstate_t>(name_));231 install(new codecvt_byname<char32_t, char, mbstate_t>(name_));
231 _LIBCPP_SUPPRESS_DEPRECATED_POP
232#if _LIBCPP_HAS_CHAR8_T232#if _LIBCPP_HAS_CHAR8_T
233 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name_));233 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name_));
234 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));234 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));
235#endif235#endif
236 _LIBCPP_SUPPRESS_DEPRECATED_POP
236 install(new numpunct_byname<char>(name_));237 install(new numpunct_byname<char>(name_));
237#if _LIBCPP_HAS_WIDE_CHARACTERS238#if _LIBCPP_HAS_WIDE_CHARACTERS
238 install(new numpunct_byname<wchar_t>(name_));239 install(new numpunct_byname<wchar_t>(name_));
...@@ -294,11 +295,11 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)...@@ -294,11 +295,11 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
294 _LIBCPP_SUPPRESS_DEPRECATED_PUSH295 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
295 install(new codecvt_byname<char16_t, char, mbstate_t>(name));296 install(new codecvt_byname<char16_t, char, mbstate_t>(name));
296 install(new codecvt_byname<char32_t, char, mbstate_t>(name));297 install(new codecvt_byname<char32_t, char, mbstate_t>(name));
297 _LIBCPP_SUPPRESS_DEPRECATED_POP
298#if _LIBCPP_HAS_CHAR8_T298#if _LIBCPP_HAS_CHAR8_T
299 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name));299 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name));
300 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name));300 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name));
301#endif301#endif
302 _LIBCPP_SUPPRESS_DEPRECATED_POP
302 }303 }
303 if (c & locale::monetary) {304 if (c & locale::monetary) {
304 install(new moneypunct_byname<char, false>(name));305 install(new moneypunct_byname<char, false>(name));
...@@ -366,11 +367,11 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)...@@ -366,11 +367,11 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
366 _LIBCPP_SUPPRESS_DEPRECATED_PUSH367 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
367 install_from<std::codecvt<char16_t, char, mbstate_t> >(one);368 install_from<std::codecvt<char16_t, char, mbstate_t> >(one);
368 install_from<std::codecvt<char32_t, char, mbstate_t> >(one);369 install_from<std::codecvt<char32_t, char, mbstate_t> >(one);
369 _LIBCPP_SUPPRESS_DEPRECATED_POP
370#if _LIBCPP_HAS_CHAR8_T370#if _LIBCPP_HAS_CHAR8_T
371 install_from<std::codecvt<char16_t, char8_t, mbstate_t> >(one);371 install_from<std::codecvt<char16_t, char8_t, mbstate_t> >(one);
372 install_from<std::codecvt<char32_t, char8_t, mbstate_t> >(one);372 install_from<std::codecvt<char32_t, char8_t, mbstate_t> >(one);
373#endif373#endif
374 _LIBCPP_SUPPRESS_DEPRECATED_POP
374#if _LIBCPP_HAS_WIDE_CHARACTERS375#if _LIBCPP_HAS_WIDE_CHARACTERS
375 install_from<std::codecvt<wchar_t, char, mbstate_t> >(one);376 install_from<std::codecvt<wchar_t, char, mbstate_t> >(one);
376#endif377#endif
...@@ -2318,7 +2319,7 @@ static codecvt_base::result utf16be_to_ucs4(...@@ -2318,7 +2319,7 @@ static codecvt_base::result utf16be_to_ucs4(
2318 frm_nxt += 2;2319 frm_nxt += 2;
2319 }2320 }
2320 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {2321 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {
2321 uint16_t c1 = static_cast<uint16_t>(frm_nxt[0] << 8 | frm_nxt[1]);2322 uint16_t c1 = static_cast<uint16_t>((frm_nxt[0] << 8) | frm_nxt[1]);
2322 if ((c1 & 0xFC00) == 0xDC00)2323 if ((c1 & 0xFC00) == 0xDC00)
2323 return codecvt_base::error;2324 return codecvt_base::error;
2324 if ((c1 & 0xFC00) != 0xD800) {2325 if ((c1 & 0xFC00) != 0xD800) {
...@@ -2329,7 +2330,7 @@ static codecvt_base::result utf16be_to_ucs4(...@@ -2329,7 +2330,7 @@ static codecvt_base::result utf16be_to_ucs4(
2329 } else {2330 } else {
2330 if (frm_end - frm_nxt < 4)2331 if (frm_end - frm_nxt < 4)
2331 return codecvt_base::partial;2332 return codecvt_base::partial;
2332 uint16_t c2 = static_cast<uint16_t>(frm_nxt[2] << 8 | frm_nxt[3]);2333 uint16_t c2 = static_cast<uint16_t>((frm_nxt[2] << 8) | frm_nxt[3]);
2333 if ((c2 & 0xFC00) != 0xDC00)2334 if ((c2 & 0xFC00) != 0xDC00)
2334 return codecvt_base::error;2335 return codecvt_base::error;
2335 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));2336 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));
...@@ -2354,7 +2355,7 @@ static int utf16be_to_ucs4_length(...@@ -2354,7 +2355,7 @@ static int utf16be_to_ucs4_length(
2354 frm_nxt += 2;2355 frm_nxt += 2;
2355 }2356 }
2356 for (size_t nchar32_t = 0; frm_nxt < frm_end - 1 && nchar32_t < mx; ++nchar32_t) {2357 for (size_t nchar32_t = 0; frm_nxt < frm_end - 1 && nchar32_t < mx; ++nchar32_t) {
2357 uint16_t c1 = static_cast<uint16_t>(frm_nxt[0] << 8 | frm_nxt[1]);2358 uint16_t c1 = static_cast<uint16_t>((frm_nxt[0] << 8) | frm_nxt[1]);
2358 if ((c1 & 0xFC00) == 0xDC00)2359 if ((c1 & 0xFC00) == 0xDC00)
2359 break;2360 break;
2360 if ((c1 & 0xFC00) != 0xD800) {2361 if ((c1 & 0xFC00) != 0xD800) {
...@@ -2364,7 +2365,7 @@ static int utf16be_to_ucs4_length(...@@ -2364,7 +2365,7 @@ static int utf16be_to_ucs4_length(
2364 } else {2365 } else {
2365 if (frm_end - frm_nxt < 4)2366 if (frm_end - frm_nxt < 4)
2366 break;2367 break;
2367 uint16_t c2 = static_cast<uint16_t>(frm_nxt[2] << 8 | frm_nxt[3]);2368 uint16_t c2 = static_cast<uint16_t>((frm_nxt[2] << 8) | frm_nxt[3]);
2368 if ((c2 & 0xFC00) != 0xDC00)2369 if ((c2 & 0xFC00) != 0xDC00)
2369 break;2370 break;
2370 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));2371 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));
...@@ -2432,7 +2433,7 @@ static codecvt_base::result utf16le_to_ucs4(...@@ -2432,7 +2433,7 @@ static codecvt_base::result utf16le_to_ucs4(
2432 frm_nxt += 2;2433 frm_nxt += 2;
2433 }2434 }
2434 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {2435 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {
2435 uint16_t c1 = static_cast<uint16_t>(frm_nxt[1] << 8 | frm_nxt[0]);2436 uint16_t c1 = static_cast<uint16_t>((frm_nxt[1] << 8) | frm_nxt[0]);
2436 if ((c1 & 0xFC00) == 0xDC00)2437 if ((c1 & 0xFC00) == 0xDC00)
2437 return codecvt_base::error;2438 return codecvt_base::error;
2438 if ((c1 & 0xFC00) != 0xD800) {2439 if ((c1 & 0xFC00) != 0xD800) {
...@@ -2443,7 +2444,7 @@ static codecvt_base::result utf16le_to_ucs4(...@@ -2443,7 +2444,7 @@ static codecvt_base::result utf16le_to_ucs4(
2443 } else {2444 } else {
2444 if (frm_end - frm_nxt < 4)2445 if (frm_end - frm_nxt < 4)
2445 return codecvt_base::partial;2446 return codecvt_base::partial;
2446 uint16_t c2 = static_cast<uint16_t>(frm_nxt[3] << 8 | frm_nxt[2]);2447 uint16_t c2 = static_cast<uint16_t>((frm_nxt[3] << 8) | frm_nxt[2]);
2447 if ((c2 & 0xFC00) != 0xDC00)2448 if ((c2 & 0xFC00) != 0xDC00)
2448 return codecvt_base::error;2449 return codecvt_base::error;
2449 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));2450 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));
...@@ -2468,7 +2469,7 @@ static int utf16le_to_ucs4_length(...@@ -2468,7 +2469,7 @@ static int utf16le_to_ucs4_length(
2468 frm_nxt += 2;2469 frm_nxt += 2;
2469 }2470 }
2470 for (size_t nchar32_t = 0; frm_nxt < frm_end - 1 && nchar32_t < mx; ++nchar32_t) {2471 for (size_t nchar32_t = 0; frm_nxt < frm_end - 1 && nchar32_t < mx; ++nchar32_t) {
2471 uint16_t c1 = static_cast<uint16_t>(frm_nxt[1] << 8 | frm_nxt[0]);2472 uint16_t c1 = static_cast<uint16_t>((frm_nxt[1] << 8) | frm_nxt[0]);
2472 if ((c1 & 0xFC00) == 0xDC00)2473 if ((c1 & 0xFC00) == 0xDC00)
2473 break;2474 break;
2474 if ((c1 & 0xFC00) != 0xD800) {2475 if ((c1 & 0xFC00) != 0xD800) {
...@@ -2478,7 +2479,7 @@ static int utf16le_to_ucs4_length(...@@ -2478,7 +2479,7 @@ static int utf16le_to_ucs4_length(
2478 } else {2479 } else {
2479 if (frm_end - frm_nxt < 4)2480 if (frm_end - frm_nxt < 4)
2480 break;2481 break;
2481 uint16_t c2 = static_cast<uint16_t>(frm_nxt[3] << 8 | frm_nxt[2]);2482 uint16_t c2 = static_cast<uint16_t>((frm_nxt[3] << 8) | frm_nxt[2]);
2482 if ((c2 & 0xFC00) != 0xDC00)2483 if ((c2 & 0xFC00) != 0xDC00)
2483 break;2484 break;
2484 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));2485 uint32_t t = static_cast<uint32_t>(((((c1 & 0x03C0) >> 6) + 1) << 16) | ((c1 & 0x003F) << 10) | (c2 & 0x03FF));
...@@ -2535,7 +2536,7 @@ static codecvt_base::result utf16be_to_ucs2(...@@ -2535,7 +2536,7 @@ static codecvt_base::result utf16be_to_ucs2(
2535 frm_nxt += 2;2536 frm_nxt += 2;
2536 }2537 }
2537 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {2538 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {
2538 uint16_t c1 = static_cast<uint16_t>(frm_nxt[0] << 8 | frm_nxt[1]);2539 uint16_t c1 = static_cast<uint16_t>((frm_nxt[0] << 8) | frm_nxt[1]);
2539 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)2540 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)
2540 return codecvt_base::error;2541 return codecvt_base::error;
2541 *to_nxt = c1;2542 *to_nxt = c1;
...@@ -2556,7 +2557,7 @@ static int utf16be_to_ucs2_length(...@@ -2556,7 +2557,7 @@ static int utf16be_to_ucs2_length(
2556 frm_nxt += 2;2557 frm_nxt += 2;
2557 }2558 }
2558 for (size_t nchar16_t = 0; frm_nxt < frm_end - 1 && nchar16_t < mx; ++nchar16_t) {2559 for (size_t nchar16_t = 0; frm_nxt < frm_end - 1 && nchar16_t < mx; ++nchar16_t) {
2559 uint16_t c1 = static_cast<uint16_t>(frm_nxt[0] << 8 | frm_nxt[1]);2560 uint16_t c1 = static_cast<uint16_t>((frm_nxt[0] << 8) | frm_nxt[1]);
2560 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)2561 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)
2561 break;2562 break;
2562 frm_nxt += 2;2563 frm_nxt += 2;
...@@ -2609,7 +2610,7 @@ static codecvt_base::result utf16le_to_ucs2(...@@ -2609,7 +2610,7 @@ static codecvt_base::result utf16le_to_ucs2(
2609 frm_nxt += 2;2610 frm_nxt += 2;
2610 }2611 }
2611 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {2612 for (; frm_nxt < frm_end - 1 && to_nxt < to_end; ++to_nxt) {
2612 uint16_t c1 = static_cast<uint16_t>(frm_nxt[1] << 8 | frm_nxt[0]);2613 uint16_t c1 = static_cast<uint16_t>((frm_nxt[1] << 8) | frm_nxt[0]);
2613 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)2614 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)
2614 return codecvt_base::error;2615 return codecvt_base::error;
2615 *to_nxt = c1;2616 *to_nxt = c1;
...@@ -2631,7 +2632,7 @@ static int utf16le_to_ucs2_length(...@@ -2631,7 +2632,7 @@ static int utf16le_to_ucs2_length(
2631 frm_nxt += 2;2632 frm_nxt += 2;
2632 }2633 }
2633 for (size_t nchar16_t = 0; frm_nxt < frm_end - 1 && nchar16_t < mx; ++nchar16_t) {2634 for (size_t nchar16_t = 0; frm_nxt < frm_end - 1 && nchar16_t < mx; ++nchar16_t) {
2634 uint16_t c1 = static_cast<uint16_t>(frm_nxt[1] << 8 | frm_nxt[0]);2635 uint16_t c1 = static_cast<uint16_t>((frm_nxt[1] << 8) | frm_nxt[0]);
2635 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)2636 if ((c1 & 0xF800) == 0xD800 || c1 > Maxcode)
2636 break;2637 break;
2637 frm_nxt += 2;2638 frm_nxt += 2;
...@@ -5651,10 +5652,13 @@ template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_...@@ -5651,10 +5652,13 @@ template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_
5651template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS5652template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
5652 codecvt_byname<char32_t, char, mbstate_t>;5653 codecvt_byname<char32_t, char, mbstate_t>;
5653#if _LIBCPP_HAS_CHAR8_T5654#if _LIBCPP_HAS_CHAR8_T
5654template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char8_t, mbstate_t>;5655template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
5655template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char8_t, mbstate_t>;5656 codecvt_byname<char16_t, char8_t, mbstate_t>;
5657template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
5658 codecvt_byname<char32_t, char8_t, mbstate_t>;
5656#endif5659#endif
56575660
5661_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
5658_LIBCPP_END_NAMESPACE_STD5662_LIBCPP_END_NAMESPACE_STD
56595663
5660_LIBCPP_POP_MACROS5664_LIBCPP_POP_MACROS
lib/libcxx/src/memory.cpp+3-2
...@@ -7,8 +7,7 @@...@@ -7,8 +7,7 @@
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include <__config>9#include <__config>
10#if !defined(_LIBCPP_OBJECT_FORMAT_COFF) && !defined(_LIBCPP_OBJECT_FORMAT_XCOFF) && \10#if !defined(_LIBCPP_OBJECT_FORMAT_COFF) && _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 5
11 _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 5
12# define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS11# define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS
13#endif12#endif
1413
...@@ -27,6 +26,7 @@...@@ -27,6 +26,7 @@
27#include "include/atomic_support.h"26#include "include/atomic_support.h"
2827
29_LIBCPP_BEGIN_NAMESPACE_STD28_LIBCPP_BEGIN_NAMESPACE_STD
29_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3030
31bad_weak_ptr::~bad_weak_ptr() noexcept {}31bad_weak_ptr::~bad_weak_ptr() noexcept {}
3232
...@@ -145,4 +145,5 @@ _LIBCPP_DIAGNOSTIC_POP...@@ -145,4 +145,5 @@ _LIBCPP_DIAGNOSTIC_POP
145145
146#endif146#endif
147147
148_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
148_LIBCPP_END_NAMESPACE_STD149_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/memory_resource.cpp+3-34
...@@ -6,20 +6,13 @@...@@ -6,20 +6,13 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include <atomic>
9#include <cstddef>10#include <cstddef>
10#include <memory>11#include <memory>
11#include <memory_resource>12#include <memory_resource>
1213
13#if _LIBCPP_HAS_ATOMIC_HEADER
14# include <atomic>
15#elif _LIBCPP_HAS_THREADS
16# include <mutex>
17# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
18# pragma comment(lib, "pthread")
19# endif
20#endif
21
22_LIBCPP_BEGIN_NAMESPACE_STD14_LIBCPP_BEGIN_NAMESPACE_STD
15_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2316
24namespace pmr {17namespace pmr {
2518
...@@ -94,7 +87,6 @@ memory_resource* null_memory_resource() noexcept { return &res_init.resources.nu...@@ -94,7 +87,6 @@ memory_resource* null_memory_resource() noexcept { return &res_init.resources.nu
94// default_memory_resource()87// default_memory_resource()
9588
96static memory_resource* __default_memory_resource(bool set = false, memory_resource* new_res = nullptr) noexcept {89static memory_resource* __default_memory_resource(bool set = false, memory_resource* new_res = nullptr) noexcept {
97#if _LIBCPP_HAS_ATOMIC_HEADER
98 static constinit atomic<memory_resource*> __res{&res_init.resources.new_delete_res};90 static constinit atomic<memory_resource*> __res{&res_init.resources.new_delete_res};
99 if (set) {91 if (set) {
100 new_res = new_res ? new_res : new_delete_resource();92 new_res = new_res ? new_res : new_delete_resource();
...@@ -103,30 +95,6 @@ static memory_resource* __default_memory_resource(bool set = false, memory_resou...@@ -103,30 +95,6 @@ static memory_resource* __default_memory_resource(bool set = false, memory_resou
103 } else {95 } else {
104 return std::atomic_load_explicit(&__res, memory_order_acquire);96 return std::atomic_load_explicit(&__res, memory_order_acquire);
105 }97 }
106#elif _LIBCPP_HAS_THREADS
107 static constinit memory_resource* res = &res_init.resources.new_delete_res;
108 static mutex res_lock;
109 if (set) {
110 new_res = new_res ? new_res : new_delete_resource();
111 lock_guard<mutex> guard(res_lock);
112 memory_resource* old_res = res;
113 res = new_res;
114 return old_res;
115 } else {
116 lock_guard<mutex> guard(res_lock);
117 return res;
118 }
119#else
120 static constinit memory_resource* res = &res_init.resources.new_delete_res;
121 if (set) {
122 new_res = new_res ? new_res : new_delete_resource();
123 memory_resource* old_res = res;
124 res = new_res;
125 return old_res;
126 } else {
127 return res;
128 }
129#endif
130}98}
13199
132memory_resource* get_default_resource() noexcept { return __default_memory_resource(); }100memory_resource* get_default_resource() noexcept { return __default_memory_resource(); }
...@@ -497,4 +465,5 @@ void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {...@@ -497,4 +465,5 @@ void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {
497465
498} // namespace pmr466} // namespace pmr
499467
468_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
500_LIBCPP_END_NAMESPACE_STD469_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/mutex.cpp+2
...@@ -23,6 +23,7 @@ _LIBCPP_PUSH_MACROS...@@ -23,6 +23,7 @@ _LIBCPP_PUSH_MACROS
23#include <__undef_macros>23#include <__undef_macros>
2424
25_LIBCPP_BEGIN_NAMESPACE_STD25_LIBCPP_BEGIN_NAMESPACE_STD
26_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2627
27// ~mutex is defined elsewhere28// ~mutex is defined elsewhere
2829
...@@ -141,6 +142,7 @@ void recursive_timed_mutex::unlock() noexcept {...@@ -141,6 +142,7 @@ void recursive_timed_mutex::unlock() noexcept {
141 }142 }
142}143}
143144
145_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
144_LIBCPP_END_NAMESPACE_STD146_LIBCPP_END_NAMESPACE_STD
145147
146_LIBCPP_POP_MACROS148_LIBCPP_POP_MACROS
lib/libcxx/src/mutex_destructor.cpp+2
...@@ -24,6 +24,7 @@...@@ -24,6 +24,7 @@
24#endif24#endif
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2728
28#ifdef NEEDS_MUTEX_DESTRUCTOR29#ifdef NEEDS_MUTEX_DESTRUCTOR
29class _LIBCPP_EXPORTED_FROM_ABI mutex {30class _LIBCPP_EXPORTED_FROM_ABI mutex {
...@@ -39,4 +40,5 @@ public:...@@ -39,4 +40,5 @@ public:
39mutex::~mutex() noexcept { __libcpp_mutex_destroy(&__m_); }40mutex::~mutex() noexcept { __libcpp_mutex_destroy(&__m_); }
40#endif // !NEEDS_MUTEX_DESTRUCTOR41#endif // !NEEDS_MUTEX_DESTRUCTOR
4142
43_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
42_LIBCPP_END_NAMESPACE_STD44_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/new.cpp+16-16
...@@ -50,7 +50,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {...@@ -50,7 +50,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {
50 return p;50 return p;
51}51}
5252
53_LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {53[[gnu::weak]] void* operator new(size_t size, const std::nothrow_t&) noexcept {
54# if !_LIBCPP_HAS_EXCEPTIONS54# if !_LIBCPP_HAS_EXCEPTIONS
55# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION55# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
56 _LIBCPP_ASSERT_SHIM(56 _LIBCPP_ASSERT_SHIM(
...@@ -76,7 +76,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {...@@ -76,7 +76,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
7676
77OVERRIDABLE_FUNCTION void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }77OVERRIDABLE_FUNCTION void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }
7878
79_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {79[[gnu::weak]] void* operator new[](size_t size, const std::nothrow_t&) noexcept {
80# if !_LIBCPP_HAS_EXCEPTIONS80# if !_LIBCPP_HAS_EXCEPTIONS
81# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION81# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
82 _LIBCPP_ASSERT_SHIM(82 _LIBCPP_ASSERT_SHIM(
...@@ -100,17 +100,17 @@ _LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {...@@ -100,17 +100,17 @@ _LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
100# endif100# endif
101}101}
102102
103_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }103[[gnu::weak]] void operator delete(void* ptr) noexcept { std::free(ptr); }
104104
105_LIBCPP_WEAK void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }105[[gnu::weak]] void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }
106106
107_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }107[[gnu::weak]] void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
108108
109_LIBCPP_WEAK void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }109[[gnu::weak]] void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
110110
111_LIBCPP_WEAK void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }111[[gnu::weak]] void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }
112112
113_LIBCPP_WEAK void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }113[[gnu::weak]] void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }
114114
115# if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION115# if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
116116
...@@ -141,7 +141,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t align...@@ -141,7 +141,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t align
141 return p;141 return p;
142}142}
143143
144_LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {144[[gnu::weak]] void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
145# if !_LIBCPP_HAS_EXCEPTIONS145# if !_LIBCPP_HAS_EXCEPTIONS
146# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION146# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
147 _LIBCPP_ASSERT_SHIM(147 _LIBCPP_ASSERT_SHIM(
...@@ -169,7 +169,7 @@ OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignmen...@@ -169,7 +169,7 @@ OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignmen
169 return ::operator new(size, alignment);169 return ::operator new(size, alignment);
170}170}
171171
172_LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {172[[gnu::weak]] void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
173# if !_LIBCPP_HAS_EXCEPTIONS173# if !_LIBCPP_HAS_EXCEPTIONS
174# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION174# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
175 _LIBCPP_ASSERT_SHIM(175 _LIBCPP_ASSERT_SHIM(
...@@ -193,25 +193,25 @@ _LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const...@@ -193,25 +193,25 @@ _LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const
193# endif193# endif
194}194}
195195
196_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }196[[gnu::weak]] void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
197197
198_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {198[[gnu::weak]] void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
199 ::operator delete(ptr, alignment);199 ::operator delete(ptr, alignment);
200}200}
201201
202_LIBCPP_WEAK void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {202[[gnu::weak]] void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {
203 ::operator delete(ptr, alignment);203 ::operator delete(ptr, alignment);
204}204}
205205
206_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment) noexcept {206[[gnu::weak]] void operator delete[](void* ptr, std::align_val_t alignment) noexcept {
207 ::operator delete(ptr, alignment);207 ::operator delete(ptr, alignment);
208}208}
209209
210_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {210[[gnu::weak]] void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
211 ::operator delete[](ptr, alignment);211 ::operator delete[](ptr, alignment);
212}212}
213213
214_LIBCPP_WEAK void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {214[[gnu::weak]] void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {
215 ::operator delete[](ptr, alignment);215 ::operator delete[](ptr, alignment);
216}216}
217217
lib/libcxx/src/optional.cpp+2
...@@ -24,6 +24,7 @@ const char* bad_optional_access::what() const noexcept { return "bad_optional_ac...@@ -24,6 +24,7 @@ const char* bad_optional_access::what() const noexcept { return "bad_optional_ac
24// Preserve std::experimental::bad_optional_access for ABI compatibility24// Preserve std::experimental::bad_optional_access for ABI compatibility
25// Even though it no longer exists in a header file25// Even though it no longer exists in a header file
26_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL26_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2728
28class _LIBCPP_EXPORTED_FROM_ABI bad_optional_access : public std::logic_error {29class _LIBCPP_EXPORTED_FROM_ABI bad_optional_access : public std::logic_error {
29public:30public:
...@@ -35,6 +36,7 @@ public:...@@ -35,6 +36,7 @@ public:
3536
36bad_optional_access::~bad_optional_access() noexcept = default;37bad_optional_access::~bad_optional_access() noexcept = default;
3738
39_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
38_LIBCPP_END_NAMESPACE_EXPERIMENTAL40_LIBCPP_END_NAMESPACE_EXPERIMENTAL
3941
40#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 742#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 7
lib/libcxx/src/ostream.cpp+2
...@@ -15,6 +15,7 @@...@@ -15,6 +15,7 @@
15#include "std_stream.h"15#include "std_stream.h"
1616
17_LIBCPP_BEGIN_NAMESPACE_STD17_LIBCPP_BEGIN_NAMESPACE_STD
18_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1819
19_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os) {20_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os) {
20 // dynamic_cast requires RTTI, this only affects users whose vendor builds21 // dynamic_cast requires RTTI, this only affects users whose vendor builds
...@@ -38,4 +39,5 @@ _LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os) {...@@ -38,4 +39,5 @@ _LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os) {
38 return nullptr;39 return nullptr;
39}40}
4041
42_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
41_LIBCPP_END_NAMESPACE_STD43_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/print.cpp+6-1
...@@ -33,6 +33,7 @@...@@ -33,6 +33,7 @@
33#endif33#endif
3434
35_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
36_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3637
37#if defined(_LIBCPP_WIN32API)38#if defined(_LIBCPP_WIN32API)
3839
...@@ -64,9 +65,13 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst...@@ -64,9 +65,13 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst
64}65}
65# endif // _LIBCPP_HAS_WIDE_CHARACTERS66# endif // _LIBCPP_HAS_WIDE_CHARACTERS
6667
67#elif defined(HAS_FILENO_AND_ISATTY) // !_LIBCPP_WIN32API68#elif defined(HAS_FILENO_AND_ISATTY) && _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 23 // !_LIBCPP_WIN32API
6869
70_LIBCPP_DIAGNOSTIC_PUSH
71_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmissing-prototypes")
69_LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream) { return isatty(fileno(__stream)); }72_LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream) { return isatty(fileno(__stream)); }
73_LIBCPP_DIAGNOSTIC_POP
70#endif74#endif
7175
76_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
72_LIBCPP_END_NAMESPACE_STD77_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/pstl/libdispatch.cpp+2
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#include <dispatch/dispatch.h>12#include <dispatch/dispatch.h>
1313
14_LIBCPP_BEGIN_NAMESPACE_STD14_LIBCPP_BEGIN_NAMESPACE_STD
15_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
15namespace __pstl::__libdispatch {16namespace __pstl::__libdispatch {
1617
17void __dispatch_apply(size_t chunk_count, void* context, void (*func)(void* context, size_t chunk)) noexcept {18void __dispatch_apply(size_t chunk_count, void* context, void (*func)(void* context, size_t chunk)) noexcept {
...@@ -29,4 +30,5 @@ __chunk_partitions __partition_chunks(ptrdiff_t element_count) noexcept {...@@ -29,4 +30,5 @@ __chunk_partitions __partition_chunks(ptrdiff_t element_count) noexcept {
29}30}
3031
31} // namespace __pstl::__libdispatch32} // namespace __pstl::__libdispatch
33_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
32_LIBCPP_END_NAMESPACE_STD34_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/random.cpp+2
...@@ -36,6 +36,7 @@...@@ -36,6 +36,7 @@
36#endif36#endif
3737
38_LIBCPP_BEGIN_NAMESPACE_STD38_LIBCPP_BEGIN_NAMESPACE_STD
39_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3940
40#if defined(_LIBCPP_USING_GETENTROPY)41#if defined(_LIBCPP_USING_GETENTROPY)
4142
...@@ -153,4 +154,5 @@ double random_device::entropy() const noexcept {...@@ -153,4 +154,5 @@ double random_device::entropy() const noexcept {
153#endif154#endif
154}155}
155156
157_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
156_LIBCPP_END_NAMESPACE_STD158_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/random_shuffle.cpp+2
...@@ -17,6 +17,7 @@...@@ -17,6 +17,7 @@
17#endif17#endif
1818
19_LIBCPP_BEGIN_NAMESPACE_STD19_LIBCPP_BEGIN_NAMESPACE_STD
20_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2021
21#if _LIBCPP_HAS_THREADS22#if _LIBCPP_HAS_THREADS
22static constinit __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;23static constinit __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
...@@ -48,4 +49,5 @@ __rs_default::result_type __rs_default::operator()() {...@@ -48,4 +49,5 @@ __rs_default::result_type __rs_default::operator()() {
4849
49__rs_default __rs_get() { return __rs_default(); }50__rs_default __rs_get() { return __rs_default(); }
5051
52_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
51_LIBCPP_END_NAMESPACE_STD53_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/regex.cpp+2
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11#include <regex>11#include <regex>
1212
13_LIBCPP_BEGIN_NAMESPACE_STD13_LIBCPP_BEGIN_NAMESPACE_STD
14_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1415
15static const char* make_error_type_string(regex_constants::error_type ecode) {16static const char* make_error_type_string(regex_constants::error_type ecode) {
16 switch (ecode) {17 switch (ecode) {
...@@ -396,4 +397,5 @@ void __match_any_but_newline<wchar_t>::__exec(__state& __s) const {...@@ -396,4 +397,5 @@ void __match_any_but_newline<wchar_t>::__exec(__state& __s) const {
396 }397 }
397}398}
398399
400_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
399_LIBCPP_END_NAMESPACE_STD401_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/ryu/d2s.cpp+2-13
...@@ -41,6 +41,7 @@...@@ -41,6 +41,7 @@
4141
42#include <__assert>42#include <__assert>
43#include <__config>43#include <__config>
44#include <bit>
44#include <charconv>45#include <charconv>
45#include <cstddef>46#include <cstddef>
4647
...@@ -478,19 +479,7 @@ struct __floating_decimal_64 {...@@ -478,19 +479,7 @@ struct __floating_decimal_64 {
478 2882303761517u, 576460752303u, 115292150460u, 23058430092u, 4611686018u, 922337203u, 184467440u,479 2882303761517u, 576460752303u, 115292150460u, 23058430092u, 4611686018u, 922337203u, 184467440u,
479 36893488u, 7378697u, 1475739u, 295147u, 59029u, 11805u, 2361u, 472u, 94u, 18u, 3u };480 36893488u, 7378697u, 1475739u, 295147u, 59029u, 11805u, 2361u, 472u, 94u, 18u, 3u };
480481
481 unsigned long _Trailing_zero_bits;482 unsigned long _Trailing_zero_bits = std::countr_zero(__v.__mantissa);
482#if _LIBCPP_HAS_BITSCAN64
483 (void) _BitScanForward64(&_Trailing_zero_bits, __v.__mantissa); // __v.__mantissa is guaranteed nonzero
484#else // ^^^ 64-bit ^^^ / vvv 32-bit vvv
485 const uint32_t _Low_mantissa = static_cast<uint32_t>(__v.__mantissa);
486 if (_Low_mantissa != 0) {
487 (void) _BitScanForward(&_Trailing_zero_bits, _Low_mantissa);
488 } else {
489 const uint32_t _High_mantissa = static_cast<uint32_t>(__v.__mantissa >> 32); // nonzero here
490 (void) _BitScanForward(&_Trailing_zero_bits, _High_mantissa);
491 _Trailing_zero_bits += 32;
492 }
493#endif // ^^^ 32-bit ^^^
494 const uint64_t _Shifted_mantissa = __v.__mantissa >> _Trailing_zero_bits;483 const uint64_t _Shifted_mantissa = __v.__mantissa >> _Trailing_zero_bits;
495 _Can_use_ryu = _Shifted_mantissa <= _Max_shifted_mantissa[_Ryu_exponent];484 _Can_use_ryu = _Shifted_mantissa <= _Max_shifted_mantissa[_Ryu_exponent];
496 }485 }
lib/libcxx/src/ryu/f2s.cpp+2-2
...@@ -41,6 +41,7 @@...@@ -41,6 +41,7 @@
4141
42#include <__assert>42#include <__assert>
43#include <__config>43#include <__config>
44#include <bit>
44#include <charconv>45#include <charconv>
45#include <cstdint>46#include <cstdint>
46#include <cstddef>47#include <cstddef>
...@@ -535,8 +536,7 @@ struct __floating_decimal_32 {...@@ -535,8 +536,7 @@ struct __floating_decimal_32 {
535 static constexpr uint32_t _Max_shifted_mantissa[11] = {536 static constexpr uint32_t _Max_shifted_mantissa[11] = {
536 16777215, 3355443, 671088, 134217, 26843, 5368, 1073, 214, 42, 8, 1 };537 16777215, 3355443, 671088, 134217, 26843, 5368, 1073, 214, 42, 8, 1 };
537538
538 unsigned long _Trailing_zero_bits;539 unsigned long _Trailing_zero_bits = std::countr_zero(__v.__mantissa); // __v.__mantissa is guaranteed nonzero
539 (void) _BitScanForward(&_Trailing_zero_bits, __v.__mantissa); // __v.__mantissa is guaranteed nonzero
540 const uint32_t _Shifted_mantissa = __v.__mantissa >> _Trailing_zero_bits;540 const uint32_t _Shifted_mantissa = __v.__mantissa >> _Trailing_zero_bits;
541 _Can_use_ryu = _Shifted_mantissa <= _Max_shifted_mantissa[_Ryu_exponent];541 _Can_use_ryu = _Shifted_mantissa <= _Max_shifted_mantissa[_Ryu_exponent];
542 }542 }
lib/libcxx/src/shared_mutex.cpp+2
...@@ -13,6 +13,7 @@...@@ -13,6 +13,7 @@
13#endif13#endif
1414
15_LIBCPP_BEGIN_NAMESPACE_STD15_LIBCPP_BEGIN_NAMESPACE_STD
16_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1617
17// Shared Mutex Base18// Shared Mutex Base
18__shared_mutex_base::__shared_mutex_base() : __state_(0) {}19__shared_mutex_base::__shared_mutex_base() : __state_(0) {}
...@@ -96,4 +97,5 @@ void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); }...@@ -96,4 +97,5 @@ void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); }
96bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }97bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }
97void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }98void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }
9899
100_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
99_LIBCPP_END_NAMESPACE_STD101_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/std_stream.h+2
...@@ -24,6 +24,7 @@ _LIBCPP_PUSH_MACROS...@@ -24,6 +24,7 @@ _LIBCPP_PUSH_MACROS
24#include <__undef_macros>24#include <__undef_macros>
2525
26_LIBCPP_BEGIN_NAMESPACE_STD26_LIBCPP_BEGIN_NAMESPACE_STD
27_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2728
28static const int __limit = 8;29static const int __limit = 8;
2930
...@@ -380,6 +381,7 @@ void __stdoutbuf<_CharT>::imbue(const locale& __loc) {...@@ -380,6 +381,7 @@ void __stdoutbuf<_CharT>::imbue(const locale& __loc) {
380 __always_noconv_ = __cv_->always_noconv();381 __always_noconv_ = __cv_->always_noconv();
381}382}
382383
384_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
383_LIBCPP_END_NAMESPACE_STD385_LIBCPP_END_NAMESPACE_STD
384386
385_LIBCPP_POP_MACROS387_LIBCPP_POP_MACROS
lib/libcxx/src/stdexcept.cpp+2
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18#endif18#endif
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
21_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2122
22void __throw_runtime_error(const char* msg) {23void __throw_runtime_error(const char* msg) {
23#if _LIBCPP_HAS_EXCEPTIONS24#if _LIBCPP_HAS_EXCEPTIONS
...@@ -27,4 +28,5 @@ void __throw_runtime_error(const char* msg) {...@@ -27,4 +28,5 @@ void __throw_runtime_error(const char* msg) {
27#endif28#endif
28}29}
2930
31_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
30_LIBCPP_END_NAMESPACE_STD32_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/string.cpp+2
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#endif19#endif
2020
21_LIBCPP_BEGIN_NAMESPACE_STD21_LIBCPP_BEGIN_NAMESPACE_STD
22_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2223
23#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 1424#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 14
2425
...@@ -367,4 +368,5 @@ wstring to_wstring(double val) { return as_string(get_swprintf(), initial_string...@@ -367,4 +368,5 @@ wstring to_wstring(double val) { return as_string(get_swprintf(), initial_string
367wstring to_wstring(long double val) { return as_string(get_swprintf(), initial_string<wstring>()(), L"%Lf", val); }368wstring to_wstring(long double val) { return as_string(get_swprintf(), initial_string<wstring>()(), L"%Lf", val); }
368#endif369#endif
369370
371_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
370_LIBCPP_END_NAMESPACE_STD372_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/strstream.cpp+2
...@@ -18,6 +18,7 @@ _LIBCPP_PUSH_MACROS...@@ -18,6 +18,7 @@ _LIBCPP_PUSH_MACROS
18#include <__undef_macros>18#include <__undef_macros>
1919
20_LIBCPP_BEGIN_NAMESPACE_STD20_LIBCPP_BEGIN_NAMESPACE_STD
21_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2122
22strstreambuf::strstreambuf(streamsize __alsize)23strstreambuf::strstreambuf(streamsize __alsize)
23 : __strmode_(__dynamic), __alsize_(__alsize), __palloc_(nullptr), __pfree_(nullptr) {}24 : __strmode_(__dynamic), __alsize_(__alsize), __palloc_(nullptr), __pfree_(nullptr) {}
...@@ -253,6 +254,7 @@ ostrstream::~ostrstream() {}...@@ -253,6 +254,7 @@ ostrstream::~ostrstream() {}
253254
254strstream::~strstream() {}255strstream::~strstream() {}
255256
257_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
256_LIBCPP_END_NAMESPACE_STD258_LIBCPP_END_NAMESPACE_STD
257259
258_LIBCPP_POP_MACROS260_LIBCPP_POP_MACROS
lib/libcxx/src/support/runtime/exception_pointer_msvc.ipp+425-34
...@@ -7,62 +7,453 @@...@@ -7,62 +7,453 @@
7//7//
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#include <exception>10_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmultichar")
11#include <stdio.h>
12#include <stdlib.h>
13
14_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCreate(void*);
15_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrDestroy(void*);
16_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopy(void*, const void*);
17_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrAssign(void*, const void*);
18_LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrCompare(const void*, const void*);
19_LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrToBool(const void*);
20_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrSwap(void*, void*);
21_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCurrentException(void*);
22[[noreturn]] _LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrRethrow(const void*);
23_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopyException(void*, const void*, const void*);
2411
25namespace std {12#include <__exception/exception_ptr.h>
13#include <__memory/shared_count.h>
14#include <cstdlib>
15#include <cstring>
2616
27exception_ptr::exception_ptr() noexcept { __ExceptionPtrCreate(this); }17#include <unknwn.h>
28exception_ptr::exception_ptr(nullptr_t) noexcept { __ExceptionPtrCreate(this); }18#include <windows.h>
19struct _ThrowInfo;
20#include <eh.h>
21#include <ehdata.h>
22#include <malloc.h> // alloca
2923
30exception_ptr::exception_ptr(const exception_ptr& __other) noexcept { __ExceptionPtrCopy(this, &__other); }24// Pre-V4 managed exception code
31exception_ptr& exception_ptr::operator=(const exception_ptr& __other) noexcept {25#define MANAGED_EXCEPTION_CODE 0XE0434F4D
32 __ExceptionPtrAssign(this, &__other);26
33 return *this;27// V4 and later managed exception code
28#define MANAGED_EXCEPTION_CODE_V4 0XE0434352
29
30extern "C" _LIBCPP_CRT_FUNC void* __cdecl __AdjustPointer(void*, const PMD&);
31extern "C" _LIBCPP_CRT_FUNC void** __cdecl __current_exception();
32
33namespace {
34
35typedef void(__stdcall* __prepare_for_throw_t)(void*);
36
37struct __winrt_exception_info {
38 void* __description;
39 void* __restricted_error_string;
40 void* __restricted_error_reference;
41 void* __capability_sid;
42 long __hr;
43 void* __restricted_info;
44 ThrowInfo* __throw_info;
45 unsigned int __size;
46 __prepare_for_throw_t __prepare_throw;
47};
48
49inline EHExceptionRecord* __get_current_exception() noexcept {
50 return *reinterpret_cast<EHExceptionRecord**>(__current_exception());
34}51}
3552
36exception_ptr& exception_ptr::operator=(nullptr_t) noexcept {53inline void __call_member_function_0(void* __this, void* __mfn) {
37 exception_ptr dummy;54 auto __fn = reinterpret_cast<void(__thiscall*)(void*)>(__mfn);
38 __ExceptionPtrAssign(this, &dummy);55 __fn(__this);
39 return *this;56}
57
58inline void __call_member_function_1(void* __this, void* __mfn, void* __arg) {
59 auto __fn = reinterpret_cast<void(__thiscall*)(void*, void*)>(__mfn);
60 __fn(__this, __arg);
61}
62
63inline void __call_member_function_2(void* __this, void* __mfn, void* __arg1, int __arg2) {
64 auto __fn = reinterpret_cast<void(__thiscall*)(void*, void*, int)>(__mfn);
65 __fn(__this, __arg1, __arg2);
40}66}
4167
42exception_ptr::~exception_ptr() noexcept { __ExceptionPtrDestroy(this); }68void __populate_cpp_exception_record(
69 _EXCEPTION_RECORD& __record, const void* const __except_obj, ThrowInfo* __throw_info) noexcept {
70 __record.ExceptionCode = EH_EXCEPTION_NUMBER;
71 __record.ExceptionFlags = EXCEPTION_NONCONTINUABLE;
72 __record.ExceptionRecord = nullptr; // No SEH to chain.
73 __record.ExceptionAddress = nullptr; // Address of exception. This will be overwritten by OS.
74 __record.NumberParameters = EH_EXCEPTION_PARAMETERS;
75 __record.ExceptionInformation[0] = EH_MAGIC_NUMBER1;
76 __record.ExceptionInformation[1] = reinterpret_cast<ULONG_PTR>(__except_obj);
77
78 if (__throw_info && (__throw_info->attributes & TI_IsWinRT)) {
79 // The pointer to the ExceptionInfo structure is stored sizeof(void*) in front of each WinRT Exception Info.
80 const auto __wei = (*static_cast<__winrt_exception_info** const*>(const_cast<void*>(__except_obj)))[-1];
81 __throw_info = __wei->__throw_info;
82 }
83
84 __record.ExceptionInformation[2] = reinterpret_cast<ULONG_PTR>(__throw_info);
85
86#if _EH_RELATIVE_TYPEINFO
87 void* __throw_image_base =
88 __throw_info ? RtlPcToFileHeader(const_cast<void*>(static_cast<const void*>(__throw_info)), &__throw_image_base)
89 : nullptr;
90 __record.ExceptionInformation[3] = reinterpret_cast<ULONG_PTR>(__throw_image_base);
91#endif // _EH_RELATIVE_TYPEINFO
92
93 // If the throw info indicates this throw is from a pure region, set the magic number to the Pure one, so only a
94 // pure-region catch will see it.
95 //
96 // Also use the Pure magic number on 64-bit platforms if we were unable to determine an image base, since that was the
97 // old way to determine a pure throw, before the TI_IsPure bit was added to the FuncInfo attributes field.
98 if (__throw_info && ((__throw_info->attributes & TI_IsPure)
99#if _EH_RELATIVE_TYPEINFO
100 || !__throw_image_base
101#endif // _EH_RELATIVE_TYPEINFO
102 ))
103 __record.ExceptionInformation[0] = EH_PURE_MAGIC_NUMBER1;
104}
105
106void __copy_exception_record(_EXCEPTION_RECORD& __dest, const _EXCEPTION_RECORD& __src) noexcept {
107 __dest.ExceptionCode = __src.ExceptionCode;
108 // We force EXCEPTION_NONCONTINUABLE because rethrow_exception is [[noreturn]].
109 __dest.ExceptionFlags = __src.ExceptionFlags | EXCEPTION_NONCONTINUABLE;
110 __dest.ExceptionRecord = nullptr; // We don't chain SEH exceptions.
111 __dest.ExceptionAddress = nullptr; // Useless field to copy. It will be overwritten by RaiseException().
112 const auto __parameters = __src.NumberParameters;
113 __dest.NumberParameters = __parameters;
114
115 // Copy the number of parameters in use.
116 constexpr auto __max_parameters = static_cast<DWORD>(EXCEPTION_MAXIMUM_PARAMETERS);
117 const auto __in_use = (__parameters < __max_parameters) ? __parameters : __max_parameters;
118 std::memcpy(__dest.ExceptionInformation, __src.ExceptionInformation, __in_use * sizeof(ULONG_PTR));
119 std::memset(&__dest.ExceptionInformation[__in_use], 0, (__max_parameters - __in_use) * sizeof(ULONG_PTR));
120}
121
122void __copy_exception_object(void* __dest, const void* __src, const CatchableType* const __type
123#if _EH_RELATIVE_TYPEINFO
124 ,
125 uintptr_t __throw_image_base
126#endif // _EH_RELATIVE_TYPEINFO
127) {
128 // Copy an object of type denoted by *_PType from __src to __dDest; throws whatever the copy ctor of the type denoted
129 // by *_PType throws.
130 if ((__type->properties & CT_IsSimpleType) || __type->copyFunction == 0) {
131 std::memcpy(__dest, __src, __type->sizeOrOffset);
132
133 if (__type->properties & CT_IsWinRTHandle) {
134 const auto __unknown = *static_cast<IUnknown* const*>(const_cast<void*>(__src));
135 if (__unknown)
136 __unknown->AddRef();
137 }
138 return;
139 }
140
141#if _EH_RELATIVE_TYPEINFO
142 const auto __copy_func = reinterpret_cast<void*>(__throw_image_base + __type->copyFunction);
143#else // _EH_RELATIVE_TYPEINFO
144 const auto __copy_func = reinterpret_cast<void*>(__type->copyFunction);
145#endif // _EH_RELATIVE_TYPEINFO
146
147 const auto __adjusted = __AdjustPointer(const_cast<void*>(__src), __type->thisDisplacement);
148 if (__type->properties & CT_HasVirtualBase)
149 __call_member_function_2(__dest, __copy_func, __adjusted, 1);
150 else
151 __call_member_function_1(__dest, __copy_func, __adjusted);
152}
153
154struct __exception_ptr_storage : public std::__shared_count {
155 _EXCEPTION_RECORD __record_;
156 explicit __exception_ptr_storage(long __refs = 0) noexcept : std::__shared_count(__refs) {}
157};
158
159template <class _StaticEx>
160struct __exception_ptr_static final : public __exception_ptr_storage {
161 _StaticEx __ex_;
162
163 __exception_ptr_static() noexcept : __exception_ptr_storage(0) {
164 __populate_cpp_exception_record(__record_, &__ex_, static_cast<ThrowInfo*>(__GetExceptionInfo(__ex_)));
165 }
166
167 void __on_zero_shared() noexcept override {}
168
169 static __exception_ptr_storage* __get() noexcept {
170 struct __container {
171 union {
172 __exception_ptr_static __instance_;
173 };
174 __container() noexcept : __instance_() {}
175 ~__container() {}
176 };
177 static __container __storage;
178 return &__storage.__instance_;
179 }
180};
181
182struct alignas(__STDCPP_DEFAULT_NEW_ALIGNMENT__) __exception_ptr_normal final : public __exception_ptr_storage {
183 explicit __exception_ptr_normal(const _EXCEPTION_RECORD& __record) noexcept : __exception_ptr_storage(0) {
184 __copy_exception_record(__record_, __record);
185 }
186
187 void __on_zero_shared() noexcept override {
188 const auto& __cpp_eh_record = reinterpret_cast<EHExceptionRecord&>(__record_);
189 if (PER_IS_MSVC_PURE_OR_NATIVE_EH(&__cpp_eh_record)) {
190 const auto* __throw_info = __cpp_eh_record.params.pThrowInfo;
191 if (__throw_info && __cpp_eh_record.params.pExceptionObject) {
192#if _EH_RELATIVE_TYPEINFO
193 const auto __throw_image_base = reinterpret_cast<uintptr_t>(__cpp_eh_record.params.pThrowImageBase);
194 const auto* __catchable_type_array = reinterpret_cast<const CatchableTypeArray*>(
195 static_cast<uintptr_t>(__throw_info->pCatchableTypeArray) + __throw_image_base);
196 const auto* __type = reinterpret_cast<CatchableType*>(
197 static_cast<uintptr_t>(__catchable_type_array->arrayOfCatchableTypes[0]) + __throw_image_base);
198#else // _EH_RELATIVE_TYPEINFO
199 const auto* __type = __throw_info->pCatchableTypeArray->arrayOfCatchableTypes[0];
200#endif // _EH_RELATIVE_TYPEINFO
201 if (__throw_info->pmfnUnwind) {
202 // The exception was a user defined type with a nontrivial destructor, call it.
203#if _EH_RELATIVE_TYPEINFO
204 __call_member_function_0(__cpp_eh_record.params.pExceptionObject,
205 reinterpret_cast<void*>(__throw_info->pmfnUnwind + __throw_image_base));
206#else // _EH_RELATIVE_TYPEINFO
207 __call_member_function_0(__cpp_eh_record.params.pExceptionObject,
208 reinterpret_cast<void*>(__throw_info->pmfnUnwind));
209#endif // _EH_RELATIVE_TYPEINFO
210 } else if (__type->properties & CT_IsWinRTHandle) {
211 const auto* __unknown = *static_cast<IUnknown* const*>(__cpp_eh_record.params.pExceptionObject);
212 if (__unknown)
213 const_cast<IUnknown*>(__unknown)->Release();
214 }
215 }
216 }
217 std::free(this);
218 }
219};
220
221static_assert(sizeof(__exception_ptr_normal) % __STDCPP_DEFAULT_NEW_ALIGNMENT__ == 0,
222 "Exception in exception_ptr would be constructed with the wrong alignment");
43223
44exception_ptr::operator bool() const noexcept { return __ExceptionPtrToBool(this); }224void __assign_seh_exception_ptr_from_record(
225 void*& __dest, const _EXCEPTION_RECORD& __record, void* const __rx_raw) noexcept {
226 if (!__rx_raw) {
227 __dest = __exception_ptr_static<std::bad_alloc>::__get();
228 return;
229 }
45230
46bool operator==(const exception_ptr& __x, const exception_ptr& __y) noexcept {231 __dest = ::new (__rx_raw) __exception_ptr_normal(__record);
47 return __ExceptionPtrCompare(&__x, &__y);
48}232}
49233
50void swap(exception_ptr& lhs, exception_ptr& rhs) noexcept { __ExceptionPtrSwap(&rhs, &lhs); }234void __assign_cpp_exception_ptr_from_record(void*& __dest, const EHExceptionRecord& __record) noexcept {
235 // Construct a reference count control block for the C++ exception recorded by __record, and bind it to __dest.
236 //
237 // * If allocating memory for the reference count control block fails, sets __dest to bad_alloc.
238 // * If copying the exception object referred to __record throws, constructs a reference count control block for that
239 // exception instead.
240 // * If copying the exception object thrown by copying the original exception object throws, sets __dest to
241 // bad_exception.
242 const auto* __throw_info = __record.params.pThrowInfo;
243#if _EH_RELATIVE_TYPEINFO
244 const auto __throw_image_base = reinterpret_cast<uintptr_t>(__record.params.pThrowImageBase);
245 const auto* __catchable_type_array = reinterpret_cast<const CatchableTypeArray*>(
246 static_cast<uintptr_t>(__throw_info->pCatchableTypeArray) + __throw_image_base);
247 const auto* __type = reinterpret_cast<CatchableType*>(
248 static_cast<uintptr_t>(__catchable_type_array->arrayOfCatchableTypes[0]) + __throw_image_base);
249#else // _EH_RELATIVE_TYPEINFO
250 const auto* __type = __throw_info->pCatchableTypeArray->arrayOfCatchableTypes[0];
251#endif // _EH_RELATIVE_TYPEINFO
252
253 const auto __except_obj_size = static_cast<size_t>(__type->sizeOrOffset);
254 const auto __alloc_size = sizeof(__exception_ptr_normal) + __except_obj_size;
255 auto* __rx_raw = std::malloc(__alloc_size);
256 if (!__rx_raw) {
257 __dest = __exception_ptr_static<std::bad_alloc>::__get();
258 return;
259 }
260
261 try {
262 __copy_exception_object(static_cast<__exception_ptr_normal*>(__rx_raw) + 1,
263 __record.params.pExceptionObject,
264 __type
265#if _EH_RELATIVE_TYPEINFO
266 ,
267 __throw_image_base
268#endif // _EH_RELATIVE_TYPEINFO
269 );
270
271 const auto* __rx = ::new (__rx_raw) __exception_ptr_normal(reinterpret_cast<const _EXCEPTION_RECORD&>(__record));
272 reinterpret_cast<EHExceptionRecord&>(const_cast<__exception_ptr_normal*>(__rx)->__record_).params.pExceptionObject =
273 static_cast<__exception_ptr_normal*>(__rx_raw) + 1;
274 __dest = const_cast<__exception_ptr_normal*>(__rx);
275 } catch (...) { // Copying the exception object threw an exception.
276 // Exception thrown by the original exception's copy ctor.
277 const auto* __inner_record_ptr = __get_current_exception();
278 if (!__inner_record_ptr) {
279 std::free(__rx_raw);
280 __dest = __exception_ptr_static<std::bad_exception>::__get();
281 return;
282 }
283 const auto& __inner_record = *__inner_record_ptr;
284 if (__inner_record.ExceptionCode == MANAGED_EXCEPTION_CODE ||
285 __inner_record.ExceptionCode == MANAGED_EXCEPTION_CODE_V4) {
286 // We don't support managed exceptions and don't want to say there's no active exception, so give up and say
287 // bad_exception.
288 std::free(__rx_raw);
289 __dest = __exception_ptr_static<std::bad_exception>::__get();
290 return;
291 }
292
293 if (!PER_IS_MSVC_PURE_OR_NATIVE_EH(&__inner_record)) { // Catching a non-C++ exception depends on /EHa.
294 __assign_seh_exception_ptr_from_record(
295 __dest, reinterpret_cast<const _EXCEPTION_RECORD&>(__inner_record), __rx_raw);
296 return;
297 }
298
299 const auto* __inner_throw = __inner_record.params.pThrowInfo;
300#if _EH_RELATIVE_TYPEINFO
301 const auto __inner_throw_image_base = reinterpret_cast<uintptr_t>(__inner_record.params.pThrowImageBase);
302 const auto* __inner_catchable_type_array = reinterpret_cast<const CatchableTypeArray*>(
303 static_cast<uintptr_t>(__inner_throw->pCatchableTypeArray) + __inner_throw_image_base);
304 const auto* __inner_type = reinterpret_cast<CatchableType*>(
305 static_cast<uintptr_t>(__inner_catchable_type_array->arrayOfCatchableTypes[0]) + __inner_throw_image_base);
306#else // _EH_RELATIVE_TYPEINFO
307 const auto* __inner_type = __inner_throw->pCatchableTypeArray->arrayOfCatchableTypes[0];
308#endif // _EH_RELATIVE_TYPEINFO
309
310 const auto __inner_except_size = static_cast<size_t>(__inner_type->sizeOrOffset);
311 const auto __inner_alloc_size = sizeof(__exception_ptr_normal) + __inner_except_size;
312 if (__inner_alloc_size > __alloc_size) {
313 std::free(__rx_raw);
314 __rx_raw = std::malloc(__inner_alloc_size);
315 if (!__rx_raw) {
316 __dest = __exception_ptr_static<std::bad_alloc>::__get();
317 return;
318 }
319 }
320
321 try {
322 __copy_exception_object(static_cast<__exception_ptr_normal*>(__rx_raw) + 1,
323 __inner_record.params.pExceptionObject,
324 __inner_type
325#if _EH_RELATIVE_TYPEINFO
326 ,
327 __inner_throw_image_base
328#endif // _EH_RELATIVE_TYPEINFO
329 );
330 } catch (...) { // Copying the exception emitted while copying the original exception also threw, give up.
331 std::free(__rx_raw);
332 __dest = __exception_ptr_static<std::bad_exception>::__get();
333 return;
334 }
335
336 // This next block must be duplicated inside the catch (even though it looks identical to the block in the try) so
337 // that __inner_record is held alive; exiting the catch will destroy it.
338 const auto* __rx =
339 ::new (__rx_raw) __exception_ptr_normal(reinterpret_cast<const _EXCEPTION_RECORD&>(__inner_record));
340 reinterpret_cast<EHExceptionRecord&>(const_cast<__exception_ptr_normal*>(__rx)->__record_).params.pExceptionObject =
341 static_cast<__exception_ptr_normal*>(__rx_raw) + 1;
342 __dest = const_cast<__exception_ptr_normal*>(__rx);
343 }
344}
345
346} // namespace
347
348namespace std {
349
350exception_ptr::~exception_ptr() noexcept {
351 if (__ptr_)
352 static_cast<__shared_count*>(__ptr_)->__release_shared();
353}
354
355exception_ptr::exception_ptr(const exception_ptr& __other) noexcept : __ptr_(__other.__ptr_) {
356 if (__ptr_)
357 static_cast<__shared_count*>(__ptr_)->__add_shared();
358}
359
360exception_ptr& exception_ptr::operator=(const exception_ptr& __other) noexcept {
361 if (__ptr_ != __other.__ptr_) {
362 if (__other.__ptr_)
363 static_cast<__shared_count*>(__other.__ptr_)->__add_shared();
364 if (__ptr_)
365 static_cast<__shared_count*>(__ptr_)->__release_shared();
366 __ptr_ = __other.__ptr_;
367 }
368 return *this;
369}
370
371exception_ptr exception_ptr::__from_native_exception_pointer(void* __p) noexcept {
372 exception_ptr __ret;
373 __ret.__ptr_ = __p;
374 if (__ret.__ptr_)
375 static_cast<__shared_count*>(__ret.__ptr_)->__add_shared();
376 return __ret;
377}
51378
52exception_ptr __copy_exception_ptr(void* __except, const void* __ptr) {379exception_ptr __copy_exception_ptr(void* __except, const void* __ptr) {
53 exception_ptr __ret = nullptr;380 exception_ptr __ret = nullptr;
54 if (__ptr)381 if (!__ptr)
55 __ExceptionPtrCopyException(&__ret, __except, __ptr);382 return __ret;
383
384 _EXCEPTION_RECORD __record;
385 __populate_cpp_exception_record(__record, __except, static_cast<ThrowInfo*>(const_cast<void*>(__ptr)));
386 __assign_cpp_exception_ptr_from_record(__ret.__ptr_, reinterpret_cast<const EHExceptionRecord&>(__record));
56 return __ret;387 return __ret;
57}388}
58389
59exception_ptr current_exception() noexcept {390exception_ptr current_exception() noexcept {
60 exception_ptr __ret;391 exception_ptr __ret;
61 __ExceptionPtrCurrentException(&__ret);392 const auto* __record = __get_current_exception();
393 if (!__record || __record->ExceptionCode == MANAGED_EXCEPTION_CODE ||
394 __record->ExceptionCode == MANAGED_EXCEPTION_CODE_V4)
395 return __ret;
396
397 if (PER_IS_MSVC_PURE_OR_NATIVE_EH(__record))
398 __assign_cpp_exception_ptr_from_record(__ret.__ptr_, *__record);
399 else
400 __assign_seh_exception_ptr_from_record(
401 __ret.__ptr_, reinterpret_cast<const _EXCEPTION_RECORD&>(*__record), std::malloc(sizeof(__exception_ptr_normal)));
62 return __ret;402 return __ret;
63}403}
64404
65[[noreturn]] void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); }405[[noreturn]] void rethrow_exception(exception_ptr __p) {
406 if (!__p)
407 throw bad_exception();
408
409 auto* __rep = static_cast<__exception_ptr_storage*>(__p.__ptr_);
410 auto __record_copy = __rep->__record_;
411 auto& __cpp_record = reinterpret_cast<EHExceptionRecord&>(__record_copy);
412 if (PER_IS_MSVC_PURE_OR_NATIVE_EH(&__cpp_record)) {
413 const auto* __throw_info = __cpp_record.params.pThrowInfo;
414 if (!__cpp_record.params.pExceptionObject || !__throw_info || !__throw_info->pCatchableTypeArray)
415 terminate();
416
417#if _EH_RELATIVE_TYPEINFO
418 const auto __throw_image_base = reinterpret_cast<uintptr_t>(__cpp_record.params.pThrowImageBase);
419 const auto* __catchable_type_array =
420 reinterpret_cast<const CatchableTypeArray*>(__throw_image_base + __throw_info->pCatchableTypeArray);
421#else // _EH_RELATIVE_TYPEINFO
422 const auto* __catchable_type_array = __throw_info->pCatchableTypeArray;
423#endif // _EH_RELATIVE_TYPEINFO
424
425 if (__catchable_type_array->nCatchableTypes <= 0)
426 terminate();
427
428#if _EH_RELATIVE_TYPEINFO
429 const auto* __type = reinterpret_cast<CatchableType*>(
430 static_cast<uintptr_t>(__catchable_type_array->arrayOfCatchableTypes[0]) + __throw_image_base);
431#else // _EH_RELATIVE_TYPEINFO
432 const auto* __type = __throw_info->pCatchableTypeArray->arrayOfCatchableTypes[0];
433#endif // _EH_RELATIVE_TYPEINFO
434
435#pragma warning(suppress : 6255)
436 void* __exception_buffer = alloca(__type->sizeOrOffset);
437 __copy_exception_object(__exception_buffer, __cpp_record.params.pExceptionObject, __type
438#if _EH_RELATIVE_TYPEINFO
439 ,
440 __throw_image_base
441#endif // _EH_RELATIVE_TYPEINFO
442 );
443
444 __cpp_record.params.pExceptionObject = __exception_buffer;
445 }
446
447 // Under MSVC C++ exception handling (/EHsc), C Win32 API functions like RaiseException
448 // are assumed not to throw synchronous C++ exceptions. As a result, stack unwinding
449 // initiated by RaiseException does not execute local destructors in this frame.
450 // We must explicitly reset __p here so that the reference count on the stored
451 // exception record is properly decremented before unwinding begins.
452 __p = nullptr;
453 RaiseException(__record_copy.ExceptionCode, __record_copy.ExceptionFlags, __record_copy.NumberParameters,
454 __record_copy.ExceptionInformation);
455 terminate();
456}
66457
67nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {}458nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {}
68459
lib/libcxx/src/support/win32/locale_win32.cpp+262
...@@ -7,6 +7,8 @@...@@ -7,6 +7,8 @@
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include <__locale_dir/support/windows.h>9#include <__locale_dir/support/windows.h>
10#include <cctype>
11#include <charconv>
10#include <clocale> // std::localeconv() & friends12#include <clocale> // std::localeconv() & friends
11#include <cstdarg> // va_start & friends13#include <cstdarg> // va_start & friends
12#include <cstddef>14#include <cstddef>
...@@ -14,8 +16,11 @@...@@ -14,8 +16,11 @@
14#include <cstdlib> // std::strtof & friends16#include <cstdlib> // std::strtof & friends
15#include <ctime> // std::strftime17#include <ctime> // std::strftime
16#include <cwchar> // wide char manipulation18#include <cwchar> // wide char manipulation
19#include <string_view>
20#include <windows.h>
1721
18_LIBCPP_BEGIN_NAMESPACE_STD22_LIBCPP_BEGIN_NAMESPACE_STD
23_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
19namespace __locale {24namespace __locale {
2025
21//26//
...@@ -34,6 +39,262 @@ __lconv_t* __localeconv(__locale_t& loc) {...@@ -34,6 +39,262 @@ __lconv_t* __localeconv(__locale_t& loc) {
34 return loc.__store_lconv(lc);39 return loc.__store_lconv(lc);
35}40}
3641
42namespace {
43const char* __codepage_name(unsigned int __codepage) {
44 switch (__codepage) {
45 case 0:
46 // If no ANSI code page is available, only Unicode can be used for the locale.
47 // In this case, the value is CP_ACP (0).
48 // Such a locale cannot be set as the system locale.
49 // Applications that do not support Unicode do not work correctly with locales
50 // marked as "Unicode only".
51 return nullptr;
52 case 037:
53 return "IBM037";
54 case 437:
55 return "IBM437";
56 case 500:
57 return "IBM500";
58 case 708:
59 return "ASMO-708";
60 case 709:
61 return "ASMO_449";
62 case 775:
63 return "IBM775";
64 case 850:
65 return "IBM850";
66 case 852:
67 return "IBM852";
68 case 855:
69 return "IBM855";
70 case 857:
71 return "IBM857";
72 case 858:
73 return "IBM00858";
74 case 860:
75 return "IBM860";
76 case 861:
77 return "IBM861";
78 case 862:
79 return "IBM862";
80 case 863:
81 return "IBM863";
82 case 864:
83 return "IBM864";
84 case 865:
85 return "IBM865";
86 case 866:
87 return "IBM866";
88 case 869:
89 return "IBM869";
90 case 870:
91 return "IBM870";
92 case 874:
93 return "windows-874";
94 case 932:
95 return "Shift_JIS";
96 case 936:
97 return "GB2312";
98 case 949:
99 return "KS_C_5601-1989";
100 case 950:
101 return "Big5";
102 case 1026:
103 return "IBM1026";
104 case 1047:
105 return "IBM1047";
106 case 1140:
107 return "IBM01140";
108 case 1141:
109 return "IBM01141";
110 case 1142:
111 return "IBM01142";
112 case 1143:
113 return "IBM01143";
114 case 1144:
115 return "IBM01144";
116 case 1145:
117 return "IBM01145";
118 case 1146:
119 return "IBM01146";
120 case 1147:
121 return "IBM01147";
122 case 1148:
123 return "IBM01148";
124 case 1149:
125 return "IBM01149";
126 case 1200:
127 return "UTF-16LE";
128 case 1201:
129 return "UTF-16BE";
130 case 1250:
131 return "windows-1250";
132 case 1251:
133 return "windows-1251";
134 case 1252:
135 return "windows-1252";
136 case 1253:
137 return "windows-1253";
138 case 1254:
139 return "windows-1254";
140 case 1255:
141 return "windows-1255";
142 case 1256:
143 return "windows-1256";
144 case 1257:
145 return "windows-1257";
146 case 1258:
147 return "windows-1258";
148 case 10000:
149 return "macintosh";
150 case 12000:
151 return "UTF-32LE";
152 case 12001:
153 return "UTF-32BE";
154 case 20127:
155 return "US-ASCII";
156 case 20273:
157 return "IBM273";
158 case 20277:
159 return "IBM277";
160 case 20278:
161 return "IBM278";
162 case 20280:
163 return "IBM280";
164 case 20284:
165 return "IBM284";
166 case 20285:
167 return "IBM285";
168 case 20290:
169 return "IBM290";
170 case 20297:
171 return "IBM297";
172 case 20420:
173 return "IBM420";
174 case 20423:
175 return "IBM423";
176 case 20424:
177 return "IBM424";
178 case 20838:
179 return "IBM-Thai";
180 case 20866:
181 return "KOI8-R";
182 case 20871:
183 return "IBM871";
184 case 20880:
185 return "IBM880";
186 case 20905:
187 return "IBM905";
188 case 20924:
189 return "IBM00924";
190 case 20932:
191 return "EUC-JP";
192 case 21866:
193 return "KOI8-U";
194 case 28591:
195 return "ISO-8859-1";
196 case 28592:
197 return "ISO-8859-2";
198 case 28593:
199 return "ISO-8859-3";
200 case 28594:
201 return "ISO-8859-4";
202 case 28595:
203 return "ISO-8859-9";
204 case 28596:
205 return "ISO-8859-10";
206 case 28597:
207 return "ISO-8859-7";
208 case 28598:
209 return "ISO-8859-8";
210 case 28599:
211 return "ISO-8859-9-Windows-Latin-5";
212 case 28603:
213 return "ISO-8859-13";
214 case 28605:
215 return "ISO-8859-15";
216 case 38598:
217 return "ISO-8859-8-I";
218 case 50220:
219 case 50221:
220 case 50222:
221 return "ISO-2022-JP";
222 case 51932:
223 return "EUC-JP";
224 case 51936:
225 return "GB2312";
226 case 51949:
227 return "EUC-KR";
228 case 52936:
229 return "HZ-GB-2312";
230 case 54936:
231 return "GB18030";
232 case 65000:
233 return "UTF-7";
234 case 65001:
235 return "UTF-8";
236 default:
237 return nullptr;
238 }
239}
240} // namespace
241
242const char* __get_locale_encoding(__locale_t loc) {
243 const char* locale_name = loc.__get_locale();
244 if (locale_name == nullptr) {
245 return __codepage_name(::GetACP());
246 }
247
248 std::string_view __sv(locale_name);
249
250 // locale :: "locale-name"
251 // | "language"[_country-region[.code-page]]
252 // | ".code-page"
253 // GetLocaleInfoEx doesn't accept anything other than BCP-47 locale names, e.g. "en_US",
254 // so do a best-attempt to derive the text encoding from the name.
255 if (__sv == "C" || __sv == "") {
256 // "A locale argument value of C specifies the minimal ANSI conforming environment for C translation."
257 // TODO: Figure out what to do for an empty string:
258 // "If locale points to an empty string, the locale is the implementation-defined native environment."
259 return __codepage_name(::GetACP());
260 } else if (auto dot = __sv.find('.'); dot != std::string_view::npos) {
261 std::string_view __code_page(locale_name + dot + 1);
262
263 // Windows allows the codepage number as part of the name,
264 // e.g. "en_US.1252" for English US, Windows-1252.
265 if (std::isdigit(__code_page[0])) {
266 unsigned int __cpage{};
267 auto __res = std::from_chars(__code_page.data(), __code_page.data() + __code_page.size(), __cpage);
268 if (__res) {
269 return __codepage_name(__cpage);
270 }
271 } else { // POSIX-style name
272 return locale_name + dot + 1;
273 }
274 }
275
276 wchar_t locale_wbuffer[LOCALE_NAME_MAX_LENGTH + 1]{};
277 wchar_t number_buffer[11]{};
278
279 bool is_ansi = ::AreFileApisANSI();
280 auto codepage = is_ansi ? CP_ACP : CP_OEMCP;
281 int ret = ::MultiByteToWideChar(
282 codepage, MB_ERR_INVALID_CHARS, locale_name, __sv.size(), locale_wbuffer, LOCALE_NAME_MAX_LENGTH);
283
284 if (ret <= 0)
285 return nullptr;
286
287 // The below function fills the string with the number in text.
288 auto lctype = is_ansi ? LOCALE_IDEFAULTANSICODEPAGE : LOCALE_IDEFAULTCODEPAGE;
289 int result = ::GetLocaleInfoEx(locale_wbuffer, lctype, number_buffer, 10);
290
291 if (result <= 0)
292 return nullptr;
293
294 unsigned int acp = std::wcstoul(number_buffer, nullptr, 10);
295 return __codepage_name(acp);
296}
297
37//298//
38// Strtonum functions299// Strtonum functions
39//300//
...@@ -182,4 +443,5 @@ int __asprintf(char** ret, __locale_t loc, const char* format, ...) {...@@ -182,4 +443,5 @@ int __asprintf(char** ret, __locale_t loc, const char* format, ...) {
182}443}
183444
184} // namespace __locale445} // namespace __locale
446_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
185_LIBCPP_END_NAMESPACE_STD447_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/support/win32/thread_win32.cpp+2
...@@ -16,6 +16,7 @@...@@ -16,6 +16,7 @@
16#include <fibersapi.h>16#include <fibersapi.h>
1717
18_LIBCPP_BEGIN_NAMESPACE_STD18_LIBCPP_BEGIN_NAMESPACE_STD
19_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1920
20static_assert(sizeof(__libcpp_mutex_t) == sizeof(SRWLOCK), "");21static_assert(sizeof(__libcpp_mutex_t) == sizeof(SRWLOCK), "");
21static_assert(alignof(__libcpp_mutex_t) == alignof(SRWLOCK), "");22static_assert(alignof(__libcpp_mutex_t) == alignof(SRWLOCK), "");
...@@ -211,4 +212,5 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void* __p) {...@@ -211,4 +212,5 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void* __p) {
211 return 0;212 return 0;
212}213}
213214
215_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
214_LIBCPP_END_NAMESPACE_STD216_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/system_error.cpp+2
...@@ -27,6 +27,7 @@...@@ -27,6 +27,7 @@
27#endif27#endif
2828
29_LIBCPP_BEGIN_NAMESPACE_STD29_LIBCPP_BEGIN_NAMESPACE_STD
30_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3031
31#if defined(_LIBCPP_WIN32API)32#if defined(_LIBCPP_WIN32API)
3233
...@@ -368,4 +369,5 @@ void __throw_system_error(int ev, const char* what_arg) {...@@ -368,4 +369,5 @@ void __throw_system_error(int ev, const char* what_arg) {
368#endif369#endif
369}370}
370371
372_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
371_LIBCPP_END_NAMESPACE_STD373_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/text_encoding.cpp created+54
...@@ -0,0 +1,54 @@
1//===----------------------------------------------------------------------===//
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#include <__config>
10#include <__locale_dir/locale_base_api.h>
11#include <__utility/scope_guard.h>
12#include <text_encoding>
13
14_LIBCPP_BEGIN_NAMESPACE_STD
15_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
16
17#if defined(__ANDROID__)
18// UTF-8 is the always the environment encoding on Android.
19std::text_encoding __get_locale_encoding([[maybe_unused]] const char* __name) { return std::text_encoding::id::UTF8; }
20#else
21static text_encoding __make_text_encoding(const char* __name) {
22 if (__name == nullptr)
23 return text_encoding{};
24
25 string_view __name_view(__name);
26 if (__name_view.size() > text_encoding::max_name_length)
27 return text_encoding{};
28
29 return text_encoding(__name_view);
30}
31
32std::text_encoding __get_locale_encoding(const char* __name) {
33 if (__name == nullptr)
34 return __make_text_encoding(__locale::__get_locale_encoding(static_cast<__locale::__locale_t>(0)));
35
36 __locale::__locale_t __l = __locale::__newlocale(_LIBCPP_CTYPE_MASK, __name, static_cast<__locale::__locale_t>(0));
37
38 __scope_guard __locale_guard([&__l] {
39 if (__l) {
40 __locale::__freelocale(__l);
41 }
42 });
43
44 if (!__l) {
45 return text_encoding{};
46 }
47
48 return __make_text_encoding(__locale::__get_locale_encoding(__l));
49}
50
51#endif // __ANDROID__
52
53_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
54_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/thread.cpp+2
...@@ -33,6 +33,7 @@...@@ -33,6 +33,7 @@
33#endif33#endif
3434
35_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
36_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
3637
37thread::~thread() {38thread::~thread() {
38 if (!__libcpp_thread_isnull(&__t_))39 if (!__libcpp_thread_isnull(&__t_))
...@@ -170,4 +171,5 @@ void __thread_struct::notify_all_at_thread_exit(condition_variable* cv, mutex* m...@@ -170,4 +171,5 @@ void __thread_struct::notify_all_at_thread_exit(condition_variable* cv, mutex* m
170171
171void __thread_struct::__make_ready_at_thread_exit(__assoc_sub_state* __s) { __p_->__make_ready_at_thread_exit(__s); }172void __thread_struct::__make_ready_at_thread_exit(__assoc_sub_state* __s) { __p_->__make_ready_at_thread_exit(__s); }
172173
174_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
173_LIBCPP_END_NAMESPACE_STD175_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/valarray.cpp+2
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#include <valarray>9#include <valarray>
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
12_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1213
13#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 914#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 9
14template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::valarray(size_t);15template _LIBCPP_EXPORTED_FROM_ABI valarray<size_t>::valarray(size_t);
...@@ -45,4 +46,5 @@ void gslice::__init(size_t __start) {...@@ -45,4 +46,5 @@ void gslice::__init(size_t __start) {
45 }46 }
46}47}
4748
49_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
48_LIBCPP_END_NAMESPACE_STD50_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/variant.cpp+2
...@@ -12,4 +12,6 @@ namespace std {...@@ -12,4 +12,6 @@ namespace std {
1212
13const char* bad_variant_access::what() const noexcept { return "bad_variant_access"; }13const char* bad_variant_access::what() const noexcept { return "bad_variant_access"; }
1414
15const char* __bad_variant_access_with_msg::what() const noexcept { return __msg_; }
16
15} // namespace std17} // namespace std
lib/libcxx/src/vector.cpp+2
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9#include <vector>9#include <vector>
1010
11_LIBCPP_BEGIN_NAMESPACE_STD11_LIBCPP_BEGIN_NAMESPACE_STD
12_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
1213
13#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 1514#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
1415
...@@ -27,4 +28,5 @@ void __vector_base_common<true>::__throw_out_of_range() const { std::__throw_out...@@ -27,4 +28,5 @@ void __vector_base_common<true>::__throw_out_of_range() const { std::__throw_out
2728
28#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 1529#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 15
2930
31_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
30_LIBCPP_END_NAMESPACE_STD32_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/verbose_abort.cpp+3-1
...@@ -22,8 +22,9 @@ extern "C" void android_set_abort_message(const char* msg);...@@ -22,8 +22,9 @@ extern "C" void android_set_abort_message(const char* msg);
22#endif22#endif
2323
24_LIBCPP_BEGIN_NAMESPACE_STD24_LIBCPP_BEGIN_NAMESPACE_STD
25_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
2526
26_LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) noexcept {27[[gnu::weak]] void __libcpp_verbose_abort(char const* format, ...) noexcept {
27 // Write message to stderr. We do this before formatting into a28 // Write message to stderr. We do this before formatting into a
28 // buffer so that we still get some information out if that fails.29 // buffer so that we still get some information out if that fails.
29 {30 {
...@@ -62,4 +63,5 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) noexcept {...@@ -62,4 +63,5 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) noexcept {
62 std::abort();63 std::abort();
63}64}
6465
66_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
65_LIBCPP_END_NAMESPACE_STD67_LIBCPP_END_NAMESPACE_STD
lib/libcxxabi/include/__cxxabi_config.h+6
...@@ -128,4 +128,10 @@...@@ -128,4 +128,10 @@
128# define _LIBCXXABI_NOEXCEPT noexcept128# define _LIBCXXABI_NOEXCEPT noexcept
129#endif129#endif
130130
131#if defined(__POINTER_FIELD_PROTECTION_ABI__)
132# define _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION [[_Clang::__no_field_protection__]]
133#else
134# define _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION
135#endif
136
131#endif // ____CXXABI_CONFIG_H137#endif // ____CXXABI_CONFIG_H
lib/libcxxabi/include/cxxabi.h+13-12
...@@ -19,8 +19,7 @@...@@ -19,8 +19,7 @@
1919
20#include <__cxxabi_config.h>20#include <__cxxabi_config.h>
2121
22#define _LIBCPPABI_VERSION 1500022#define _LIBCPPABI_VERSION 230000
23#define _LIBCXXABI_NORETURN __attribute__((noreturn))
24#define _LIBCXXABI_ALWAYS_COLD __attribute__((cold))23#define _LIBCXXABI_ALWAYS_COLD __attribute__((cold))
2524
26#ifdef __cplusplus25#ifdef __cplusplus
...@@ -31,7 +30,7 @@ class _LIBCXXABI_TYPE_VIS type_info; // forward declaration...@@ -31,7 +30,7 @@ class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
31#else30#else
32class type_info; // forward declaration31class type_info; // forward declaration
33#endif32#endif
34}33} // namespace std
3534
3635
37// runtime routines use C calling conventions, but are in __cxxabiv1 namespace36// runtime routines use C calling conventions, but are in __cxxabiv1 namespace
...@@ -56,7 +55,7 @@ __cxa_init_primary_exception(void* object, std::type_info* tinfo, void(_LIBCXXAB...@@ -56,7 +55,7 @@ __cxa_init_primary_exception(void* object, std::type_info* tinfo, void(_LIBCXXAB
56#endif55#endif
5756
58// 2.4.3 Throwing the Exception Object57// 2.4.3 Throwing the Exception Object
59extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void58[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void
60__cxa_throw(void *thrown_exception, std::type_info *tinfo,59__cxa_throw(void *thrown_exception, std::type_info *tinfo,
61#ifdef __wasm__60#ifdef __wasm__
62 void *(_LIBCXXABI_DTOR_FUNC *dest)(void *));61 void *(_LIBCXXABI_DTOR_FUNC *dest)(void *));
...@@ -80,22 +79,22 @@ extern _LIBCXXABI_FUNC_VIS std::type_info *__cxa_current_exception_type();...@@ -80,22 +79,22 @@ extern _LIBCXXABI_FUNC_VIS std::type_info *__cxa_current_exception_type();
80// GNU extension79// GNU extension
81// Calls `terminate` with the current exception being caught. This function is used by GCC when a `noexcept` function80// Calls `terminate` with the current exception being caught. This function is used by GCC when a `noexcept` function
82// throws an exception inside a try/catch block and doesn't catch it.81// throws an exception inside a try/catch block and doesn't catch it.
83extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_call_terminate(void*) _LIBCXXABI_NOEXCEPT;82[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_call_terminate(void*) _LIBCXXABI_NOEXCEPT;
8483
85// 2.5.4 Rethrowing Exceptions84// 2.5.4 Rethrowing Exceptions
86extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_rethrow();85[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_rethrow();
8786
88// 2.6 Auxiliary Runtime APIs87// 2.6 Auxiliary Runtime APIs
89extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void);88[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_bad_cast(void);
90extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void);89[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_bad_typeid(void);
91extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void90[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void
92__cxa_throw_bad_array_new_length(void);91__cxa_throw_bad_array_new_length(void);
9392
94// 3.2.6 Pure Virtual Function API93// 3.2.6 Pure Virtual Function API
95extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_pure_virtual(void);94[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_pure_virtual(void);
9695
97// 3.2.7 Deleted Virtual Function API96// 3.2.7 Deleted Virtual Function API
98extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);97[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_deleted_virtual(void);
9998
100// 3.3.2 One-time Construction API99// 3.3.2 One-time Construction API
101#if defined(_LIBCXXABI_GUARD_ABI_ARM)100#if defined(_LIBCXXABI_GUARD_ABI_ARM)
...@@ -180,7 +179,9 @@ __cxa_decrement_exception_refcount(void *primary_exception) _LIBCXXABI_NOEXCEPT;...@@ -180,7 +179,9 @@ __cxa_decrement_exception_refcount(void *primary_exception) _LIBCXXABI_NOEXCEPT;
180extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() _LIBCXXABI_NOEXCEPT;179extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() _LIBCXXABI_NOEXCEPT;
181extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() _LIBCXXABI_NOEXCEPT;180extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() _LIBCXXABI_NOEXCEPT;
182181
183#if defined(__linux__) || defined(__Fuchsia__)182// zig patch: haiku support
183// zig patch: serenity support
184#if defined(__linux__) || defined(__Fuchsia__) || defined(__HAIKU__) || defined(__serenity__)
184// Linux and Fuchsia TLS support. Not yet an official part of the Itanium ABI.185// Linux and Fuchsia TLS support. Not yet an official part of the Itanium ABI.
185// https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables186// https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables
186extern _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(void (*)(void *), void *,187extern _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(void (*)(void *), void *,
lib/libcxxabi/src/abort_message.h+1-1
...@@ -11,7 +11,7 @@...@@ -11,7 +11,7 @@
1111
12#include "cxxabi.h"12#include "cxxabi.h"
1313
14extern "C" _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void14extern "C" [[noreturn]] _LIBCXXABI_HIDDEN void
15__abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));15__abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
1616
17#ifndef _LIBCXXABI_ASSERT17#ifndef _LIBCXXABI_ASSERT
lib/libcxxabi/src/cxa_aux_runtime.cpp+3-3
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
1616
17namespace __cxxabiv1 {17namespace __cxxabiv1 {
18extern "C" {18extern "C" {
19_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void) {19[[noreturn]] _LIBCXXABI_FUNC_VIS void __cxa_bad_cast(void) {
20#ifndef _LIBCXXABI_NO_EXCEPTIONS20#ifndef _LIBCXXABI_NO_EXCEPTIONS
21 throw std::bad_cast();21 throw std::bad_cast();
22#else22#else
...@@ -24,7 +24,7 @@ _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void) {...@@ -24,7 +24,7 @@ _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void) {
24#endif24#endif
25}25}
2626
27_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {27[[noreturn]] _LIBCXXABI_FUNC_VIS void __cxa_bad_typeid(void) {
28#ifndef _LIBCXXABI_NO_EXCEPTIONS28#ifndef _LIBCXXABI_NO_EXCEPTIONS
29 throw std::bad_typeid();29 throw std::bad_typeid();
30#else30#else
...@@ -32,7 +32,7 @@ _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {...@@ -32,7 +32,7 @@ _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {
32#endif32#endif
33}33}
3434
35_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void35[[noreturn]] _LIBCXXABI_FUNC_VIS void
36__cxa_throw_bad_array_new_length(void) {36__cxa_throw_bad_array_new_length(void) {
37#ifndef _LIBCXXABI_NO_EXCEPTIONS37#ifndef _LIBCXXABI_NO_EXCEPTIONS
38 throw std::bad_array_new_length();38 throw std::bad_array_new_length();
lib/libcxxabi/src/cxa_default_handlers.cpp+4-6
...@@ -24,8 +24,7 @@...@@ -24,8 +24,7 @@
24static constinit const char* cause = "uncaught";24static constinit const char* cause = "uncaught";
2525
26# ifndef _LIBCXXABI_NO_EXCEPTIONS26# ifndef _LIBCXXABI_NO_EXCEPTIONS
27__attribute__((noreturn))27[[noreturn]] static void demangling_terminate_handler()
28static void demangling_terminate_handler()
29{28{
30 using namespace __cxxabiv1;29 using namespace __cxxabiv1;
31 __cxa_eh_globals* globals = __cxa_get_globals_fast();30 __cxa_eh_globals* globals = __cxa_get_globals_fast();
...@@ -78,15 +77,14 @@ static void demangling_terminate_handler()...@@ -78,15 +77,14 @@ static void demangling_terminate_handler()
78 }77 }
79}78}
80#else // !_LIBCXXABI_NO_EXCEPTIONS79#else // !_LIBCXXABI_NO_EXCEPTIONS
81__attribute__((noreturn))80[[noreturn]] static void demangling_terminate_handler()
82static void demangling_terminate_handler()
83{81{
82 (void)cause;
84 __abort_message("terminating");83 __abort_message("terminating");
85}84}
86#endif // !_LIBCXXABI_NO_EXCEPTIONS85#endif // !_LIBCXXABI_NO_EXCEPTIONS
8786
88__attribute__((noreturn))87[[noreturn]] static void demangling_unexpected_handler()
89static void demangling_unexpected_handler()
90{88{
91 cause = "unexpected";89 cause = "unexpected";
92 std::terminate();90 std::terminate();
lib/libcxxabi/src/cxa_exception.cpp+1-1
...@@ -140,7 +140,7 @@ exception_cleanup_func(_Unwind_Reason_Code reason, _Unwind_Exception* unwind_exc...@@ -140,7 +140,7 @@ exception_cleanup_func(_Unwind_Reason_Code reason, _Unwind_Exception* unwind_exc
140 __cxa_decrement_exception_refcount(unwind_exception + 1);140 __cxa_decrement_exception_refcount(unwind_exception + 1);
141}141}
142142
143static _LIBCXXABI_NORETURN void failed_throw(__cxa_exception* exception_header) {143[[noreturn]] static void failed_throw(__cxa_exception* exception_header) {
144// Section 2.5.3 says:144// Section 2.5.3 says:
145// * For purposes of this ABI, several things are considered exception handlers:145// * For purposes of this ABI, several things are considered exception handlers:
146// ** A terminate() call due to a throw.146// ** A terminate() call due to a throw.
lib/libcxxabi/src/cxa_guard_impl.h+1-1
...@@ -637,7 +637,7 @@ struct GlobalStatic {...@@ -637,7 +637,7 @@ struct GlobalStatic {
637 static T instance;637 static T instance;
638};638};
639template <class T>639template <class T>
640_LIBCPP_CONSTINIT T GlobalStatic<T>::instance = {};640constinit T GlobalStatic<T>::instance = {};
641641
642enum class Implementation { NoThreads, GlobalMutex, Futex };642enum class Implementation { NoThreads, GlobalMutex, Futex };
643643
lib/libcxxabi/src/cxa_handlers.cpp+2-4
...@@ -36,8 +36,7 @@ __unexpected(unexpected_handler func)...@@ -36,8 +36,7 @@ __unexpected(unexpected_handler func)
36 __abort_message("unexpected_handler unexpectedly returned");36 __abort_message("unexpected_handler unexpectedly returned");
37}37}
3838
39__attribute__((noreturn))39[[noreturn]] void
40void
41unexpected()40unexpected()
42{41{
43 __unexpected(get_unexpected());42 __unexpected(get_unexpected());
...@@ -69,8 +68,7 @@ __terminate(terminate_handler func) noexcept...@@ -69,8 +68,7 @@ __terminate(terminate_handler func) noexcept
69#endif // _LIBCXXABI_NO_EXCEPTIONS68#endif // _LIBCXXABI_NO_EXCEPTIONS
70}69}
7170
72__attribute__((noreturn))71[[noreturn]] void
73void
74terminate() noexcept72terminate() noexcept
75{73{
76#ifndef _LIBCXXABI_NO_EXCEPTIONS74#ifndef _LIBCXXABI_NO_EXCEPTIONS
lib/libcxxabi/src/cxa_handlers.h+2-2
...@@ -19,11 +19,11 @@...@@ -19,11 +19,11 @@
19namespace std19namespace std
20{20{
2121
22_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN22[[noreturn]] _LIBCXXABI_HIDDEN
23void23void
24__unexpected(unexpected_handler func);24__unexpected(unexpected_handler func);
2525
26_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN26[[noreturn]] _LIBCXXABI_HIDDEN
27void27void
28__terminate(terminate_handler func) noexcept;28__terminate(terminate_handler func) noexcept;
2929
lib/libcxxabi/src/cxa_personality.cpp+3-15
...@@ -23,7 +23,7 @@...@@ -23,7 +23,7 @@
2323
24#if __has_feature(ptrauth_calls)24#if __has_feature(ptrauth_calls)
2525
26// CXXABI depends on defintions in libunwind as pointer auth couples the26// CXXABI depends on definitions in libunwind as pointer auth couples the
27// definitions27// definitions
28# include "libunwind.h"28# include "libunwind.h"
2929
...@@ -67,15 +67,6 @@...@@ -67,15 +67,6 @@
67# pragma clang diagnostic ignored "-Wmissing-prototypes"67# pragma clang diagnostic ignored "-Wmissing-prototypes"
68#endif68#endif
6969
70// TODO: This is a temporary workaround for libc++abi to recognize that it's being
71// built against LLVM's libunwind. LLVM's libunwind started reporting _LIBUNWIND_VERSION
72// in LLVM 15 -- we can remove this workaround after shipping LLVM 17. Once we remove
73// this workaround, it won't be possible to build libc++abi against libunwind headers
74// from LLVM 14 and before anymore.
75#if defined(____LIBUNWIND_CONFIG_H__) && !defined(_LIBUNWIND_VERSION)
76# define _LIBUNWIND_VERSION
77#endif
78
79#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)70#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
80#include <windows.h>71#include <windows.h>
81#include <winnt.h>72#include <winnt.h>
...@@ -1125,9 +1116,7 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,...@@ -1125,9 +1116,7 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
11251116
1126#else1117#else
11271118
1128// zig patch: https://github.com/llvm/llvm-project/issues/1942321119extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Context*);
1129extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*,
1130 _Unwind_Context*);
11311120
1132// Helper function to unwind one frame.1121// Helper function to unwind one frame.
1133// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the1122// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the
...@@ -1283,8 +1272,7 @@ __gxx_personality_v0(_Unwind_State state,...@@ -1283,8 +1272,7 @@ __gxx_personality_v0(_Unwind_State state,
1283#endif1272#endif
12841273
12851274
1286__attribute__((noreturn))1275[[noreturn]] _LIBCXXABI_FUNC_VIS void
1287_LIBCXXABI_FUNC_VIS void
1288__cxa_call_unexpected(void* arg)1276__cxa_call_unexpected(void* arg)
1289{1277{
1290 _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(arg);1278 _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(arg);
lib/libcxxabi/src/cxa_thread_atexit.cpp+3-1
...@@ -106,7 +106,9 @@ namespace {...@@ -106,7 +106,9 @@ namespace {
106106
107#endif // HAVE___CXA_THREAD_ATEXIT_IMPL107#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
108108
109#if defined(__linux__) || defined(__Fuchsia__)109// zig patch: haiku support
110// zig patch: serenity support
111#if defined(__linux__) || defined(__Fuchsia__) || defined(__HAIKU__) || defined(__serenity__)
110extern "C" {112extern "C" {
111113
112 _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {114 _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {
lib/libcxxabi/src/cxa_vector.cpp+1-2
...@@ -116,8 +116,7 @@ namespace {...@@ -116,8 +116,7 @@ namespace {
116//116//
117117
118namespace {118namespace {
119_LIBCXXABI_NORETURN119[[noreturn]] void throw_bad_array_new_length() {
120void throw_bad_array_new_length() {
121#ifndef _LIBCXXABI_NO_EXCEPTIONS120#ifndef _LIBCXXABI_NO_EXCEPTIONS
122 throw std::bad_array_new_length();121 throw std::bad_array_new_length();
123#else122#else
lib/libcxxabi/src/cxa_virtual.cpp+2-2
...@@ -11,12 +11,12 @@...@@ -11,12 +11,12 @@
1111
12namespace __cxxabiv1 {12namespace __cxxabiv1 {
13extern "C" {13extern "C" {
14_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN14[[noreturn]] _LIBCXXABI_FUNC_VIS
15void __cxa_pure_virtual(void) {15void __cxa_pure_virtual(void) {
16 __abort_message("Pure virtual function called!");16 __abort_message("Pure virtual function called!");
17}17}
1818
19_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN19[[noreturn]] _LIBCXXABI_FUNC_VIS
20void __cxa_deleted_virtual(void) {20void __cxa_deleted_virtual(void) {
21 __abort_message("Deleted virtual function called!");21 __abort_message("Deleted virtual function called!");
22}22}
lib/libcxxabi/src/demangle/ItaniumDemangle.h+54
...@@ -1537,6 +1537,27 @@ public:...@@ -1537,6 +1537,27 @@ public:
1537 }1537 }
1538};1538};
15391539
1540class PackIndexing final : public Node {
1541 const Node *Pattern;
1542 const Node *Index;
1543
1544public:
1545 PackIndexing(const Node *Pattern_, const Node *Index_)
1546 : Node(KPackIndexing), Pattern(Pattern_), Index(Index_) {}
1547
1548 template <typename Fn> void match(Fn F) const { F(Pattern, Index); }
1549
1550 void printLeft(OutputBuffer &OB) const override {
1551 OB.printOpen('(');
1552 ParameterPackExpansion PPE(Pattern);
1553 PPE.printLeft(OB);
1554 OB.printClose(')');
1555 OB.printOpen('[');
1556 OB.printLeft(*Index);
1557 OB.printClose(']');
1558 }
1559};
1560
1540class TemplateArgs final : public Node {1561class TemplateArgs final : public Node {
1541 NodeArray Params;1562 NodeArray Params;
1542 Node *Requires;1563 Node *Requires;
...@@ -4531,6 +4552,18 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {...@@ -4531,6 +4552,18 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
4531 Result = make<ParameterPackExpansion>(Child);4552 Result = make<ParameterPackExpansion>(Child);
4532 break;4553 break;
4533 }4554 }
4555 // ::= Dy <type> <expression> # pack indexing (C++26)
4556 case 'y': {
4557 First += 2;
4558 Node *Pattern = getDerived().parseType();
4559 if (!Pattern)
4560 return nullptr;
4561 Node *Index = getDerived().parseExpr();
4562 if (!Index)
4563 return nullptr;
4564 Result = make<PackIndexing>(Pattern, Index);
4565 break;
4566 }
4534 // Exception specifier on a function type.4567 // Exception specifier on a function type.
4535 case 'o':4568 case 'o':
4536 case 'O':4569 case 'O':
...@@ -5375,6 +5408,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {...@@ -5375,6 +5408,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
5375 return nullptr;5408 return nullptr;
5376 return make<ParameterPackExpansion>(Child);5409 return make<ParameterPackExpansion>(Child);
5377 }5410 }
5411 if (consumeIf("sy")) {
5412 Node *Pattern = look() == 'T' ? getDerived().parseTemplateParam()
5413 : getDerived().parseFunctionParam();
5414 if (Pattern == nullptr)
5415 return nullptr;
5416 Node *Index = getDerived().parseExpr();
5417 if (Index == nullptr)
5418 return nullptr;
5419 return make<PackIndexing>(Pattern, Index);
5420 }
5378 if (consumeIf("sZ")) {5421 if (consumeIf("sZ")) {
5379 if (look() == 'T') {5422 if (look() == 'T') {
5380 Node *R = getDerived().parseTemplateParam();5423 Node *R = getDerived().parseTemplateParam();
...@@ -6157,8 +6200,17 @@ AbstractManglingParser<Derived, Alloc>::parseTemplateArgs(bool TagTemplates) {...@@ -6157,8 +6200,17 @@ AbstractManglingParser<Derived, Alloc>::parseTemplateArgs(bool TagTemplates) {
6157// extension ::= ___Z <encoding> _block_invoke6200// extension ::= ___Z <encoding> _block_invoke
6158// extension ::= ___Z <encoding> _block_invoke<decimal-digit>+6201// extension ::= ___Z <encoding> _block_invoke<decimal-digit>+
6159// extension ::= ___Z <encoding> _block_invoke_<decimal-digit>+6202// extension ::= ___Z <encoding> _block_invoke_<decimal-digit>+
6203// extension ::= __alloc_token__Z <encoding>
6204// extension ::= __alloc_token_<decimal-digit>+__Z <encoding>
6160template <typename Derived, typename Alloc>6205template <typename Derived, typename Alloc>
6161Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {6206Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {
6207 bool AllocToken = consumeIf("__alloc_token_");
6208 if (AllocToken) {
6209 const char *Saved = First;
6210 if (parseNumber().empty() || !consumeIf('_'))
6211 First = Saved;
6212 }
6213
6162 if (consumeIf("_Z") || consumeIf("__Z")) {6214 if (consumeIf("_Z") || consumeIf("__Z")) {
6163 Node *Encoding = getDerived().parseEncoding(ParseParams);6215 Node *Encoding = getDerived().parseEncoding(ParseParams);
6164 if (Encoding == nullptr)6216 if (Encoding == nullptr)
...@@ -6168,6 +6220,8 @@ Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {...@@ -6168,6 +6220,8 @@ Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {
6168 make<DotSuffix>(Encoding, std::string_view(First, Last - First));6220 make<DotSuffix>(Encoding, std::string_view(First, Last - First));
6169 First = Last;6221 First = Last;
6170 }6222 }
6223 if (AllocToken)
6224 Encoding = make<DotSuffix>(Encoding, ".alloc_token");
6171 if (numLeft() != 0)6225 if (numLeft() != 0)
6172 return nullptr;6226 return nullptr;
6173 return Encoding;6227 return Encoding;
lib/libcxxabi/src/demangle/ItaniumNodes.def+1-1
...@@ -100,5 +100,5 @@ NODE(ExprRequirement)...@@ -100,5 +100,5 @@ NODE(ExprRequirement)
100NODE(TypeRequirement)100NODE(TypeRequirement)
101NODE(NestedRequirement)101NODE(NestedRequirement)
102NODE(ExplicitObjectParameter)102NODE(ExplicitObjectParameter)
103103NODE(PackIndexing)
104#undef NODE104#undef NODE
lib/libcxxabi/src/demangle/Utility.h+1-1
...@@ -31,7 +31,7 @@ class Node;...@@ -31,7 +31,7 @@ class Node;
3131
32// Stream that AST nodes write their string representation into after the AST32// Stream that AST nodes write their string representation into after the AST
33// has been parsed.33// has been parsed.
34class OutputBuffer {34class DEMANGLE_ABI OutputBuffer {
35 char *Buffer = nullptr;35 char *Buffer = nullptr;
36 size_t CurrentPosition = 0;36 size_t CurrentPosition = 0;
37 size_t BufferCapacity = 0;37 size_t BufferCapacity = 0;
lib/libcxxabi/src/fallback_malloc.cpp+2-2
...@@ -35,9 +35,9 @@ namespace {...@@ -35,9 +35,9 @@ namespace {
3535
36// When POSIX threads are not available, make the mutex operations a nop36// When POSIX threads are not available, make the mutex operations a nop
37#ifndef _LIBCXXABI_HAS_NO_THREADS37#ifndef _LIBCXXABI_HAS_NO_THREADS
38static _LIBCPP_CONSTINIT std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;38static constinit std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;
39#else39#else
40static _LIBCPP_CONSTINIT void* heap_mutex = 0;40static constinit void* heap_mutex = 0;
41#endif41#endif
4242
43class mutexor {43class mutexor {
lib/libcxxabi/src/private_typeinfo.cpp+18-20
...@@ -99,28 +99,27 @@ struct derived_object_info {...@@ -99,28 +99,27 @@ struct derived_object_info {
99};99};
100100
101/// A helper function that gets (dynamic_ptr, dynamic_type, offset_to_derived) from static_ptr.101/// A helper function that gets (dynamic_ptr, dynamic_type, offset_to_derived) from static_ptr.
102void dyn_cast_get_derived_info(derived_object_info* info, const void* static_ptr)102derived_object_info dyn_cast_get_derived_info(const void* static_ptr) {
103{103 derived_object_info info;
104#if __has_feature(cxx_abi_relative_vtable)104#if __has_feature(cxx_abi_relative_vtable)
105 // The vtable address will point to the first virtual function, which is 8105 // The vtable address will point to the first virtual function, which is 8
106 // bytes after the start of the vtable (4 for the offset from top + 4 for106 // bytes after the start of the vtable (4 for the offset from top + 4 for
107 // the typeinfo component).107 // the typeinfo component).
108 const int32_t* vtable =108 const int32_t* vtable = *reinterpret_cast<const int32_t* const*>(static_ptr);
109 *reinterpret_cast<const int32_t* const*>(static_ptr);109 info.offset_to_derived = static_cast<std::ptrdiff_t>(vtable[-2]);
110 info->offset_to_derived = static_cast<std::ptrdiff_t>(vtable[-2]);110 info.dynamic_ptr = static_cast<const char*>(static_ptr) + info.offset_to_derived;
111 info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;111
112112 // The typeinfo component is now a relative offset to a proxy.
113 // The typeinfo component is now a relative offset to a proxy.113 int32_t offset_to_ti_proxy = vtable[-1];
114 int32_t offset_to_ti_proxy = vtable[-1];114 const uint8_t* ptr_to_ti_proxy = reinterpret_cast<const uint8_t*>(vtable) + offset_to_ti_proxy;
115 const uint8_t* ptr_to_ti_proxy =115 info.dynamic_type = *(reinterpret_cast<const __class_type_info* const*>(ptr_to_ti_proxy));
116 reinterpret_cast<const uint8_t*>(vtable) + offset_to_ti_proxy;
117 info->dynamic_type = *(reinterpret_cast<const __class_type_info* const*>(ptr_to_ti_proxy));
118#else116#else
119 void** vtable = strip_vtable(*static_cast<void** const*>(static_ptr));117 void** vtable = strip_vtable(*static_cast<void** const*>(static_ptr));
120 info->offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);118 info.offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
121 info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;119 info.dynamic_ptr = static_cast<const char*>(static_ptr) + info.offset_to_derived;
122 info->dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);120 info.dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
123#endif121#endif
122 return info;
124}123}
125124
126/// A helper function for __dynamic_cast that casts a base sub-object pointer125/// A helper function for __dynamic_cast that casts a base sub-object pointer
...@@ -915,8 +914,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,...@@ -915,8 +914,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
915 const __class_type_info *dst_type,914 const __class_type_info *dst_type,
916 std::ptrdiff_t src2dst_offset) {915 std::ptrdiff_t src2dst_offset) {
917 // Get (dynamic_ptr, dynamic_type) from static_ptr916 // Get (dynamic_ptr, dynamic_type) from static_ptr
918 derived_object_info derived_info;917 derived_object_info derived_info = dyn_cast_get_derived_info(static_ptr);
919 dyn_cast_get_derived_info(&derived_info, static_ptr);
920918
921 // Initialize answer to nullptr. This will be changed from the search919 // Initialize answer to nullptr. This will be changed from the search
922 // results if a non-null answer is found. Regardless, this is what will920 // results if a non-null answer is found. Regardless, this is what will
lib/libcxxabi/src/private_typeinfo.h+3-3
...@@ -145,7 +145,7 @@ public:...@@ -145,7 +145,7 @@ public:
145// Has one non-virtual public base class at offset zero145// Has one non-virtual public base class at offset zero
146class _LIBCXXABI_TYPE_VIS __si_class_type_info : public __class_type_info {146class _LIBCXXABI_TYPE_VIS __si_class_type_info : public __class_type_info {
147public:147public:
148 const __class_type_info *__base_type;148 _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION const __class_type_info* __base_type;
149149
150 _LIBCXXABI_HIDDEN virtual ~__si_class_type_info();150 _LIBCXXABI_HIDDEN virtual ~__si_class_type_info();
151151
...@@ -204,7 +204,7 @@ public:...@@ -204,7 +204,7 @@ public:
204class _LIBCXXABI_TYPE_VIS __pbase_type_info : public __shim_type_info {204class _LIBCXXABI_TYPE_VIS __pbase_type_info : public __shim_type_info {
205public:205public:
206 unsigned int __flags;206 unsigned int __flags;
207 const __shim_type_info *__pointee;207 _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION const __shim_type_info* __pointee;
208208
209 enum __masks {209 enum __masks {
210 __const_mask = 0x1,210 __const_mask = 0x1,
...@@ -245,7 +245,7 @@ public:...@@ -245,7 +245,7 @@ public:
245class _LIBCXXABI_TYPE_VIS __pointer_to_member_type_info245class _LIBCXXABI_TYPE_VIS __pointer_to_member_type_info
246 : public __pbase_type_info {246 : public __pbase_type_info {
247public:247public:
248 const __class_type_info *__context;248 _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION const __class_type_info* __context;
249249
250 _LIBCXXABI_HIDDEN virtual ~__pointer_to_member_type_info();250 _LIBCXXABI_HIDDEN virtual ~__pointer_to_member_type_info();
251 _LIBCXXABI_HIDDEN virtual bool can_catch(const __shim_type_info *,251 _LIBCXXABI_HIDDEN virtual bool can_catch(const __shim_type_info *,
lib/libcxxabi/src/stdlib_new_delete.cpp+16-20
...@@ -20,10 +20,6 @@...@@ -20,10 +20,6 @@
20# error The _THROW_BAD_ALLOC macro should be already defined by libc++20# error The _THROW_BAD_ALLOC macro should be already defined by libc++
21#endif21#endif
2222
23#ifndef _LIBCPP_WEAK
24# error The _LIBCPP_WEAK macro should be already defined by libc++
25#endif
26
27#if defined(_LIBCXXABI_NO_EXCEPTIONS) != !_LIBCPP_HAS_EXCEPTIONS23#if defined(_LIBCXXABI_NO_EXCEPTIONS) != !_LIBCPP_HAS_EXCEPTIONS
28# error libc++ and libc++abi seem to disagree on whether exceptions are enabled24# error libc++ and libc++abi seem to disagree on whether exceptions are enabled
29#endif25#endif
...@@ -70,7 +66,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {...@@ -70,7 +66,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {
70 return p;66 return p;
71}67}
7268
73_LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {69[[gnu::weak]] void* operator new(size_t size, const std::nothrow_t&) noexcept {
74#if !_LIBCPP_HAS_EXCEPTIONS70#if !_LIBCPP_HAS_EXCEPTIONS
75# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION71# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
76 _LIBCPP_ASSERT_SHIM(72 _LIBCPP_ASSERT_SHIM(
...@@ -96,7 +92,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {...@@ -96,7 +92,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
9692
97OVERRIDABLE_FUNCTION void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }93OVERRIDABLE_FUNCTION void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }
9894
99_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {95[[gnu::weak]] void* operator new[](size_t size, const std::nothrow_t&) noexcept {
100#if !_LIBCPP_HAS_EXCEPTIONS96#if !_LIBCPP_HAS_EXCEPTIONS
101# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION97# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
102 _LIBCPP_ASSERT_SHIM(98 _LIBCPP_ASSERT_SHIM(
...@@ -120,17 +116,17 @@ _LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {...@@ -120,17 +116,17 @@ _LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
120#endif116#endif
121}117}
122118
123_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }119[[gnu::weak]] void operator delete(void* ptr) noexcept { std::free(ptr); }
124120
125_LIBCPP_WEAK void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }121[[gnu::weak]] void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }
126122
127_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }123[[gnu::weak]] void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
128124
129_LIBCPP_WEAK void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }125[[gnu::weak]] void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
130126
131_LIBCPP_WEAK void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }127[[gnu::weak]] void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }
132128
133_LIBCPP_WEAK void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }129[[gnu::weak]] void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }
134130
135#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION131#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
136132
...@@ -161,7 +157,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t align...@@ -161,7 +157,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t align
161 return p;157 return p;
162}158}
163159
164_LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {160[[gnu::weak]] void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
165# if !_LIBCPP_HAS_EXCEPTIONS161# if !_LIBCPP_HAS_EXCEPTIONS
166# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION162# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
167 _LIBCPP_ASSERT_SHIM(163 _LIBCPP_ASSERT_SHIM(
...@@ -189,7 +185,7 @@ OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignmen...@@ -189,7 +185,7 @@ OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignmen
189 return ::operator new(size, alignment);185 return ::operator new(size, alignment);
190}186}
191187
192_LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {188[[gnu::weak]] void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
193# if !_LIBCPP_HAS_EXCEPTIONS189# if !_LIBCPP_HAS_EXCEPTIONS
194# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION190# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
195 _LIBCPP_ASSERT_SHIM(191 _LIBCPP_ASSERT_SHIM(
...@@ -213,25 +209,25 @@ _LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const...@@ -213,25 +209,25 @@ _LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const
213# endif209# endif
214}210}
215211
216_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }212[[gnu::weak]] void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
217213
218_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {214[[gnu::weak]] void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
219 ::operator delete(ptr, alignment);215 ::operator delete(ptr, alignment);
220}216}
221217
222_LIBCPP_WEAK void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {218[[gnu::weak]] void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {
223 ::operator delete(ptr, alignment);219 ::operator delete(ptr, alignment);
224}220}
225221
226_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment) noexcept {222[[gnu::weak]] void operator delete[](void* ptr, std::align_val_t alignment) noexcept {
227 ::operator delete(ptr, alignment);223 ::operator delete(ptr, alignment);
228}224}
229225
230_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {226[[gnu::weak]] void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
231 ::operator delete[](ptr, alignment);227 ::operator delete[](ptr, alignment);
232}228}
233229
234_LIBCPP_WEAK void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {230[[gnu::weak]] void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {
235 ::operator delete[](ptr, alignment);231 ::operator delete[](ptr, alignment);
236}232}
237233
lib/libtsan/interception/interception.h+10
...@@ -362,6 +362,16 @@ const interpose_substitution substitution_##func_name[] \...@@ -362,6 +362,16 @@ const interpose_substitution substitution_##func_name[] \
362// so we use casts via uintptr_t (the local __sanitizer::uptr equivalent).362// so we use casts via uintptr_t (the local __sanitizer::uptr equivalent).
363namespace __interception {363namespace __interception {
364364
365// Dynamic library loading helpers (dlopen/LoadLibrary, dlsym/GetProcAddress).
366// Implemented in interception_linux.cpp on non-Windows targets and
367// interception_win.cpp on Windows.
368bool DynamicLoaderAvailable();
369void* OpenLibrary(const char* name);
370void* LookupSymbol(void* handle, const char* symbol);
371void* LookupSymbolDefault(const char* symbol);
372void* LookupSymbolNext(const char* symbol);
373void* LookupSymbolNextVersioned(const char* symbol, const char* version);
374
365#if defined(__ELF__) && !SANITIZER_FUCHSIA375#if defined(__ELF__) && !SANITIZER_FUCHSIA
366// The use of interceptors makes many sanitizers unusable for static linking.376// The use of interceptors makes many sanitizers unusable for static linking.
367// Define a function, if called, will cause a linker error (undefined _DYNAMIC).377// Define a function, if called, will cause a linker error (undefined _DYNAMIC).
lib/libtsan/interception/interception_linux.cpp+58-5
...@@ -9,15 +9,68 @@...@@ -9,15 +9,68 @@
9// This file is a part of AddressSanitizer, an address sanity checker.9// This file is a part of AddressSanitizer, an address sanity checker.
10//10//
11// Linux-specific interception methods.11// Linux-specific interception methods.
12//
13// POSIX dynamic-library helpers (dlopen / dlsym) live here for every
14// non-Windows interception target (Linux, *BSD, Darwin, AIX, Fuchsia, ...).
15// macOS/AIX/Fuchsia compile this TU for RTInterception but do not use the
16// Linux-specific InterceptFunction helpers below.
12//===----------------------------------------------------------------------===//17//===----------------------------------------------------------------------===//
1318
14#include "interception.h"19#include "interception.h"
1520
21#if !SANITIZER_WINDOWS
22
23# include <dlfcn.h>
24
25# pragma weak dlopen
26# pragma weak dlsym
27#if SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD
28# pragma weak dlvsym
29#endif
30
31namespace __interception {
32
33bool DynamicLoaderAvailable() { return dlopen != nullptr && dlsym != nullptr; }
34
35void* OpenLibrary(const char* name) {
36 if (!DynamicLoaderAvailable())
37 return nullptr;
38 return dlopen(name, RTLD_LAZY | RTLD_LOCAL);
39}
40
41void* LookupSymbol(void* handle, const char* symbol) {
42 if (!DynamicLoaderAvailable())
43 return nullptr;
44 return dlsym(handle, symbol);
45}
46
47void* LookupSymbolDefault(const char* symbol) {
48 if (!DynamicLoaderAvailable())
49 return nullptr;
50 return dlsym(RTLD_DEFAULT, symbol);
51}
52
53void* LookupSymbolNext(const char* symbol) {
54 if (!DynamicLoaderAvailable())
55 return nullptr;
56 return dlsym(RTLD_NEXT, symbol);
57}
58
59#if SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD
60void* LookupSymbolNextVersioned(const char* symbol, const char* version) {
61 if (!DynamicLoaderAvailable() || dlvsym == nullptr)
62 return nullptr;
63 return dlvsym(RTLD_NEXT, symbol, version);
64}
65#endif // SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD
66
67} // namespace __interception
68
69#endif // !SANITIZER_WINDOWS
70
16#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \71#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
17 SANITIZER_SOLARIS || SANITIZER_HAIKU72 SANITIZER_SOLARIS || SANITIZER_HAIKU
1873
19#include <dlfcn.h> // for dlsym() and dlvsym()
20
21namespace __interception {74namespace __interception {
2275
23#if SANITIZER_NETBSD76#if SANITIZER_NETBSD
...@@ -39,14 +92,14 @@ static void *GetFuncAddr(const char *name, uptr trampoline) {...@@ -39,14 +92,14 @@ static void *GetFuncAddr(const char *name, uptr trampoline) {
39 if (StrCmp(name, "sigaction"))92 if (StrCmp(name, "sigaction"))
40 name = "__sigaction14";93 name = "__sigaction14";
41#endif94#endif
42 void *addr = dlsym(RTLD_NEXT, name);95 void* addr = LookupSymbolNext(name);
43 if (!addr) {96 if (!addr) {
44 // If the lookup using RTLD_NEXT failed, the sanitizer runtime library is97 // If the lookup using RTLD_NEXT failed, the sanitizer runtime library is
45 // later in the library search order than the DSO that we are trying to98 // later in the library search order than the DSO that we are trying to
46 // intercept, which means that we cannot intercept this function. We still99 // intercept, which means that we cannot intercept this function. We still
47 // want the address of the real definition, though, so look it up using100 // want the address of the real definition, though, so look it up using
48 // RTLD_DEFAULT.101 // RTLD_DEFAULT.
49 addr = dlsym(RTLD_DEFAULT, name);102 addr = LookupSymbolDefault(name);
50103
51 // In case `name' is not loaded, dlsym ends up finding the actual wrapper.104 // In case `name' is not loaded, dlsym ends up finding the actual wrapper.
52 // We don't want to intercept the wrapper and have it point to itself.105 // We don't want to intercept the wrapper and have it point to itself.
...@@ -66,7 +119,7 @@ bool InterceptFunction(const char *name, uptr *ptr_to_real, uptr func,...@@ -66,7 +119,7 @@ bool InterceptFunction(const char *name, uptr *ptr_to_real, uptr func,
66// dlvsym is a GNU extension supported by some other platforms.119// dlvsym is a GNU extension supported by some other platforms.
67#if SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD120#if SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD
68static void *GetFuncAddr(const char *name, const char *ver) {121static void *GetFuncAddr(const char *name, const char *ver) {
69 return dlvsym(RTLD_NEXT, name, ver);122 return LookupSymbolNextVersioned(name, ver);
70}123}
71124
72bool InterceptFunction(const char *name, const char *ver, uptr *ptr_to_real,125bool InterceptFunction(const char *name, const char *ver, uptr *ptr_to_real,
lib/libtsan/interception/interception_win.cpp+25
...@@ -134,6 +134,30 @@...@@ -134,6 +134,30 @@
134134
135namespace __interception {135namespace __interception {
136136
137bool DynamicLoaderAvailable() { return true; }
138
139void* OpenLibrary(const char* name) {
140 if (!name)
141 return reinterpret_cast<void*>(GetModuleHandleA(nullptr));
142 return reinterpret_cast<void*>(LoadLibraryA(name));
143}
144
145void* LookupSymbol(void* handle, const char* symbol) {
146 if (!handle)
147 return nullptr;
148 return reinterpret_cast<void*>(reinterpret_cast<__sanitizer::uptr>(
149 GetProcAddress(reinterpret_cast<HMODULE>(handle), symbol)));
150}
151
152void* LookupSymbolDefault(const char* symbol) {
153 return LookupSymbol(reinterpret_cast<void*>(GetModuleHandleA(nullptr)),
154 symbol);
155}
156
157void* LookupSymbolNext(const char*) { return nullptr; }
158
159void* LookupSymbolNextVersioned(const char*, const char*) { return nullptr; }
160
137static const int kAddressLength = FIRST_32_SECOND_64(4, 8);161static const int kAddressLength = FIRST_32_SECOND_64(4, 8);
138static const int kJumpInstructionLength = 5;162static const int kJumpInstructionLength = 5;
139static const int kShortJumpInstructionLength = 2;163static const int kShortJumpInstructionLength = 2;
...@@ -655,6 +679,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {...@@ -655,6 +679,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
655 return 2;679 return 2;
656680
657 case 0x3980: // 80 39 XX : cmp BYTE PTR [rcx], XX681 case 0x3980: // 80 39 XX : cmp BYTE PTR [rcx], XX
682 case 0x3a80: // 80 3A XX : cmp BYTE PTR [rdx], XX
658 case 0x4D8B: // 8B 4D XX : mov XX(%ebp), ecx683 case 0x4D8B: // 8B 4D XX : mov XX(%ebp), ecx
659 case 0x558B: // 8B 55 XX : mov XX(%ebp), edx684 case 0x558B: // 8B 55 XX : mov XX(%ebp), edx
660 case 0x758B: // 8B 75 XX : mov XX(%ebp), esp685 case 0x758B: // 8B 75 XX : mov XX(%ebp), esp
lib/libtsan/sanitizer_common/sanitizer_allocator.cpp+3-2
...@@ -109,14 +109,15 @@ void *InternalReallocArray(void *addr, uptr count, uptr size,...@@ -109,14 +109,15 @@ void *InternalReallocArray(void *addr, uptr count, uptr size,
109 return InternalRealloc(addr, count * size, cache);109 return InternalRealloc(addr, count * size, cache);
110}110}
111111
112void *InternalCalloc(uptr count, uptr size, InternalAllocatorCache *cache) {112void* InternalCalloc(uptr count, uptr size, InternalAllocatorCache* cache,
113 uptr alignment) {
113 if (UNLIKELY(CheckForCallocOverflow(count, size))) {114 if (UNLIKELY(CheckForCallocOverflow(count, size))) {
114 Report("FATAL: %s: calloc parameters overflow: count * size (%zd * %zd) "115 Report("FATAL: %s: calloc parameters overflow: count * size (%zd * %zd) "
115 "cannot be represented in type size_t\n", SanitizerToolName, count,116 "cannot be represented in type size_t\n", SanitizerToolName, count,
116 size);117 size);
117 Die();118 Die();
118 }119 }
119 void *p = InternalAlloc(count * size, cache);120 void* p = InternalAlloc(count * size, cache, alignment);
120 if (LIKELY(p))121 if (LIKELY(p))
121 internal_memset(p, 0, count * size);122 internal_memset(p, 0, count * size);
122 return p;123 return p;
lib/libtsan/sanitizer_common/sanitizer_allocator.h-6
...@@ -47,12 +47,6 @@ void PrintHintAllocatorCannotReturnNull();...@@ -47,12 +47,6 @@ void PrintHintAllocatorCannotReturnNull();
47// Callback type for iterating over chunks.47// Callback type for iterating over chunks.
48typedef void (*ForEachChunkCallback)(uptr chunk, void *arg);48typedef void (*ForEachChunkCallback)(uptr chunk, void *arg);
4949
50inline u32 Rand(u32 *state) { // ANSI C linear congruential PRNG.
51 return (*state = *state * 1103515245 + 12345) >> 16;
52}
53
54inline u32 RandN(u32 *state, u32 n) { return Rand(state) % n; } // [0, n)
55
56template<typename T>50template<typename T>
57inline void RandomShuffle(T *a, u32 n, u32 *rand_state) {51inline void RandomShuffle(T *a, u32 n, u32 *rand_state) {
58 if (n <= 1) return;52 if (n <= 1) return;
lib/libtsan/sanitizer_common/sanitizer_allocator_dlsym.h+5-5
...@@ -40,8 +40,8 @@ struct DlSymAllocator {...@@ -40,8 +40,8 @@ struct DlSymAllocator {
40 return ptr;40 return ptr;
41 }41 }
4242
43 static void *Callocate(usize nmemb, usize size) {43 static void* Callocate(usize nmemb, usize size, uptr align = kWordSize) {
44 void *ptr = InternalCalloc(nmemb, size);44 void* ptr = InternalCalloc(nmemb, size, nullptr, align);
45 CHECK(internal_allocator()->FromPrimary(ptr));45 CHECK(internal_allocator()->FromPrimary(ptr));
46 Details::OnAllocate(ptr, GetSize(ptr));46 Details::OnAllocate(ptr, GetSize(ptr));
47 return ptr;47 return ptr;
...@@ -53,9 +53,9 @@ struct DlSymAllocator {...@@ -53,9 +53,9 @@ struct DlSymAllocator {
53 InternalFree(ptr);53 InternalFree(ptr);
54 }54 }
5555
56 static void *Realloc(void *ptr, uptr new_size) {56 static void* Realloc(void* ptr, uptr new_size, uptr align = kWordSize) {
57 if (!ptr)57 if (!ptr)
58 return Allocate(new_size);58 return Allocate(new_size, align);
59 CHECK(internal_allocator()->FromPrimary(ptr));59 CHECK(internal_allocator()->FromPrimary(ptr));
60 if (!new_size) {60 if (!new_size) {
61 Free(ptr);61 Free(ptr);
...@@ -63,7 +63,7 @@ struct DlSymAllocator {...@@ -63,7 +63,7 @@ struct DlSymAllocator {
63 }63 }
64 uptr size = GetSize(ptr);64 uptr size = GetSize(ptr);
65 uptr memcpy_size = Min(new_size, size);65 uptr memcpy_size = Min(new_size, size);
66 void *new_ptr = Allocate(new_size);66 void* new_ptr = Allocate(new_size, align);
67 if (new_ptr)67 if (new_ptr)
68 internal_memcpy(new_ptr, ptr, memcpy_size);68 internal_memcpy(new_ptr, ptr, memcpy_size);
69 Free(ptr);69 Free(ptr);
lib/libtsan/sanitizer_common/sanitizer_allocator_internal.h+3-2
...@@ -45,8 +45,9 @@ void *InternalRealloc(void *p, uptr size,...@@ -45,8 +45,9 @@ void *InternalRealloc(void *p, uptr size,
45 InternalAllocatorCache *cache = nullptr);45 InternalAllocatorCache *cache = nullptr);
46void *InternalReallocArray(void *p, uptr count, uptr size,46void *InternalReallocArray(void *p, uptr count, uptr size,
47 InternalAllocatorCache *cache = nullptr);47 InternalAllocatorCache *cache = nullptr);
48void *InternalCalloc(uptr count, uptr size,48void* InternalCalloc(uptr count, uptr size,
49 InternalAllocatorCache *cache = nullptr);49 InternalAllocatorCache* cache = nullptr,
50 uptr alignment = 0);
50void InternalFree(void *p, InternalAllocatorCache *cache = nullptr);51void InternalFree(void *p, InternalAllocatorCache *cache = nullptr);
51void InternalAllocatorLock();52void InternalAllocatorLock();
52void InternalAllocatorUnlock();53void InternalAllocatorUnlock();
lib/libtsan/sanitizer_common/sanitizer_asm.h+4-2
...@@ -61,6 +61,8 @@...@@ -61,6 +61,8 @@
61# define ASM_TAIL_CALL jg61# define ASM_TAIL_CALL jg
62#elif defined(__riscv)62#elif defined(__riscv)
63# define ASM_TAIL_CALL tail63# define ASM_TAIL_CALL tail
64#elif defined(__hexagon__)
65# define ASM_TAIL_CALL jump
64#endif66#endif
6567
66// Currently, almost all of the shared libraries rely on the value of68// Currently, almost all of the shared libraries rely on the value of
...@@ -103,8 +105,8 @@...@@ -103,8 +105,8 @@
103# define ASM_SIZE(symbol) .size symbol, .-symbol105# define ASM_SIZE(symbol) .size symbol, .-symbol
104# define ASM_SYMBOL(symbol) symbol106# define ASM_SYMBOL(symbol) symbol
105# define ASM_SYMBOL_INTERCEPTOR(symbol) symbol107# define ASM_SYMBOL_INTERCEPTOR(symbol) symbol
106# if defined(__i386__) || defined(__powerpc__) || defined(__s390__) || \108# if defined(__i386__) || defined(__powerpc__) || defined(__s390__) || \
107 defined(__sparc__)109 defined(__sparc__) || defined(__alpha__)
108// For details, see interception.h110// For details, see interception.h
109# define ASM_WRAPPER_NAME(symbol) __interceptor_##symbol111# define ASM_WRAPPER_NAME(symbol) __interceptor_##symbol
110# define ASM_TRAMPOLINE_ALIAS(symbol, name) \112# define ASM_TRAMPOLINE_ALIAS(symbol, name) \
lib/libtsan/sanitizer_common/sanitizer_common.h+19-4
...@@ -387,8 +387,8 @@ void ReportDeadlySignal(const SignalContext &sig, u32 tid,...@@ -387,8 +387,8 @@ void ReportDeadlySignal(const SignalContext &sig, u32 tid,
387 const void *unwind_context);387 const void *unwind_context);
388388
389// Alternative signal stack (POSIX-only).389// Alternative signal stack (POSIX-only).
390void SetAlternateSignalStack();390void* SetAlternateSignalStack();
391void UnsetAlternateSignalStack();391void UnsetAlternateSignalStack(void* altstack_base);
392392
393bool IsSignalHandlerFromSanitizer(int signum);393bool IsSignalHandlerFromSanitizer(int signum);
394bool SetSignalHandlerFromSanitizer(int signum, bool new_state);394bool SetSignalHandlerFromSanitizer(int signum, bool new_state);
...@@ -906,7 +906,14 @@ class LoadedModule {...@@ -906,7 +906,14 @@ class LoadedModule {
906class ListOfModules {906class ListOfModules {
907 public:907 public:
908 ListOfModules() : initialized(false) {}908 ListOfModules() : initialized(false) {}
909 ~ListOfModules() { clear(); }909 ~ListOfModules() {
910 clear();
911 if (initialized)
912 modules_.Destroy();
913 }
914 ListOfModules(const ListOfModules&) = delete;
915 ListOfModules& operator=(const ListOfModules&) = delete;
916
910 void init();917 void init();
911 void fallbackInit(); // Uses fallback init if available, otherwise clears918 void fallbackInit(); // Uses fallback init if available, otherwise clears
912 const LoadedModule *begin() const { return modules_.begin(); }919 const LoadedModule *begin() const { return modules_.begin(); }
...@@ -1085,7 +1092,9 @@ struct StackDepotStats {...@@ -1085,7 +1092,9 @@ struct StackDepotStats {
1085// indicate that sanitizer allocator should not attempt to release memory to OS.1092// indicate that sanitizer allocator should not attempt to release memory to OS.
1086const s32 kReleaseToOSIntervalNever = -1;1093const s32 kReleaseToOSIntervalNever = -1;
10871094
1088void CheckNoDeepBind(const char *filename, int flag);1095// Platform hook invoked before dlopen. Performs platform-specific dlopen flag
1096// checks (e.g. RTLD_DEEPBIND on Linux).
1097void OnDlOpen(const char* filename, int flag);
10891098
1090// Returns the requested amount of random data (up to 256 bytes) that can then1099// Returns the requested amount of random data (up to 256 bytes) that can then
1091// be used to seed a PRNG. Defaults to blocking like the underlying syscall.1100// be used to seed a PRNG. Defaults to blocking like the underlying syscall.
...@@ -1100,6 +1109,12 @@ inline u32 GetNumberOfCPUsCached() {...@@ -1100,6 +1109,12 @@ inline u32 GetNumberOfCPUsCached() {
1100 return NumberOfCPUsCached;1109 return NumberOfCPUsCached;
1101}1110}
11021111
1112inline u32 Rand(u32* state) { // ANSI C linear congruential PRNG.
1113 return (*state = *state * 1103515245 + 12345) >> 16;
1114}
1115
1116inline u32 RandN(u32* state, u32 n) { return Rand(state) % n; } // [0, n)
1117
1103} // namespace __sanitizer1118} // namespace __sanitizer
11041119
1105inline void *operator new(__sanitizer::usize size,1120inline void *operator new(__sanitizer::usize size,
lib/libtsan/sanitizer_common/sanitizer_common_interceptors.inc+65-2
...@@ -277,8 +277,11 @@ extern const short *_tolower_tab_;...@@ -277,8 +277,11 @@ extern const short *_tolower_tab_;
277 common_flags()->strict_string_checks ? (internal_strlen(s)) + 1 : (n) )277 common_flags()->strict_string_checks ? (internal_strlen(s)) + 1 : (n) )
278278
279#ifndef COMMON_INTERCEPTOR_DLOPEN279#ifndef COMMON_INTERCEPTOR_DLOPEN
280#define COMMON_INTERCEPTOR_DLOPEN(filename, flag) \280# define COMMON_INTERCEPTOR_DLOPEN(filename, flag) \
281 ({ CheckNoDeepBind(filename, flag); REAL(dlopen)(filename, flag); })281 ({ \
282 OnDlOpen(filename, flag); \
283 REAL(dlopen)(filename, flag); \
284 })
282#endif285#endif
283286
284#ifndef COMMON_INTERCEPTOR_GET_TLS_RANGE287#ifndef COMMON_INTERCEPTOR_GET_TLS_RANGE
...@@ -1023,6 +1026,25 @@ INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {...@@ -1023,6 +1026,25 @@ INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
1023#define INIT_READ1026#define INIT_READ
1024#endif1027#endif
10251028
1029#if SANITIZER_INTERCEPT___READ_CHK
1030INTERCEPTOR(SSIZE_T, __read_chk, int fd, void* ptr, SIZE_T count,
1031 SIZE_T buflen) {
1032 void* ctx;
1033 COMMON_INTERCEPTOR_ENTER(ctx, __read_chk, fd, ptr, count, buflen);
1034 COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
1035 SSIZE_T res =
1036 COMMON_INTERCEPTOR_BLOCK_REAL(__read_chk)(fd, ptr, count, buflen);
1037 if (res > 0)
1038 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
1039 if (res >= 0 && fd >= 0)
1040 COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
1041 return res;
1042}
1043# define INIT___READ_CHK COMMON_INTERCEPT_FUNCTION(__read_chk)
1044#else
1045# define INIT___READ_CHK
1046#endif
1047
1026#if SANITIZER_INTERCEPT_FREAD1048#if SANITIZER_INTERCEPT_FREAD
1027INTERCEPTOR(SIZE_T, fread, void *ptr, SIZE_T size, SIZE_T nmemb, void *file) {1049INTERCEPTOR(SIZE_T, fread, void *ptr, SIZE_T size, SIZE_T nmemb, void *file) {
1028 // libc file streams can call user-supplied functions, see fopencookie.1050 // libc file streams can call user-supplied functions, see fopencookie.
...@@ -1058,6 +1080,25 @@ INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) {...@@ -1058,6 +1080,25 @@ INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) {
1058#define INIT_PREAD1080#define INIT_PREAD
1059#endif1081#endif
10601082
1083#if SANITIZER_INTERCEPT___PREAD_CHK
1084INTERCEPTOR(SSIZE_T, __pread_chk, int fd, void* ptr, SIZE_T count, OFF_T offset,
1085 SIZE_T buflen) {
1086 void* ctx;
1087 COMMON_INTERCEPTOR_ENTER(ctx, __pread_chk, fd, ptr, count, offset, buflen);
1088 COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
1089 SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL(__pread_chk)(fd, ptr, count,
1090 offset, buflen);
1091 if (res > 0)
1092 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
1093 if (res >= 0 && fd >= 0)
1094 COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
1095 return res;
1096}
1097# define INIT___PREAD_CHK COMMON_INTERCEPT_FUNCTION(__pread_chk)
1098#else
1099# define INIT___PREAD_CHK
1100#endif
1101
1061#if SANITIZER_INTERCEPT_PREAD641102#if SANITIZER_INTERCEPT_PREAD64
1062INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {1103INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {
1063 void *ctx;1104 void *ctx;
...@@ -1076,6 +1117,25 @@ INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {...@@ -1076,6 +1117,25 @@ INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {
1076#define INIT_PREAD641117#define INIT_PREAD64
1077#endif1118#endif
10781119
1120#if SANITIZER_INTERCEPT___PREAD64_CHK
1121INTERCEPTOR(SSIZE_T, __pread64_chk, int fd, void* ptr, SIZE_T count,
1122 OFF64_T offset, SIZE_T buflen) {
1123 void* ctx;
1124 COMMON_INTERCEPTOR_ENTER(ctx, __pread64_chk, fd, ptr, count, offset, buflen);
1125 COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
1126 SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL(__pread64_chk)(fd, ptr, count,
1127 offset, buflen);
1128 if (res > 0)
1129 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
1130 if (res >= 0 && fd >= 0)
1131 COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
1132 return res;
1133}
1134# define INIT___PREAD64_CHK COMMON_INTERCEPT_FUNCTION(__pread64_chk)
1135#else
1136# define INIT___PREAD64_CHK
1137#endif
1138
1079#if SANITIZER_INTERCEPT_READV1139#if SANITIZER_INTERCEPT_READV
1080INTERCEPTOR_WITH_SUFFIX(SSIZE_T, readv, int fd, __sanitizer_iovec *iov,1140INTERCEPTOR_WITH_SUFFIX(SSIZE_T, readv, int fd, __sanitizer_iovec *iov,
1081 int iovcnt) {1141 int iovcnt) {
...@@ -10428,9 +10488,12 @@ static void InitializeCommonInterceptors() {...@@ -10428,9 +10488,12 @@ static void InitializeCommonInterceptors() {
10428 INIT_MEMRCHR;10488 INIT_MEMRCHR;
10429 INIT_MEMMEM;10489 INIT_MEMMEM;
10430 INIT_READ;10490 INIT_READ;
10491 INIT___READ_CHK;
10431 INIT_FREAD;10492 INIT_FREAD;
10432 INIT_PREAD;10493 INIT_PREAD;
10494 INIT___PREAD_CHK;
10433 INIT_PREAD64;10495 INIT_PREAD64;
10496 INIT___PREAD64_CHK;
10434 INIT_READV;10497 INIT_READV;
10435 INIT_PREADV;10498 INIT_PREADV;
10436 INIT_PREADV64;10499 INIT_PREADV64;
lib/libtsan/sanitizer_common/sanitizer_common_interface.inc-1
...@@ -10,7 +10,6 @@...@@ -10,7 +10,6 @@
10INTERFACE_FUNCTION(__sanitizer_acquire_crash_state)10INTERFACE_FUNCTION(__sanitizer_acquire_crash_state)
11INTERFACE_FUNCTION(__sanitizer_annotate_contiguous_container)11INTERFACE_FUNCTION(__sanitizer_annotate_contiguous_container)
12INTERFACE_FUNCTION(__sanitizer_annotate_double_ended_contiguous_container)12INTERFACE_FUNCTION(__sanitizer_annotate_double_ended_contiguous_container)
13INTERFACE_FUNCTION(__sanitizer_copy_contiguous_container_annotations)
14INTERFACE_FUNCTION(__sanitizer_contiguous_container_find_bad_address)13INTERFACE_FUNCTION(__sanitizer_contiguous_container_find_bad_address)
15INTERFACE_FUNCTION(14INTERFACE_FUNCTION(
16 __sanitizer_double_ended_contiguous_container_find_bad_address)15 __sanitizer_double_ended_contiguous_container_find_bad_address)
lib/libtsan/sanitizer_common/sanitizer_dense_map.h+57-95
...@@ -44,10 +44,10 @@ class DenseMapBase {...@@ -44,10 +44,10 @@ class DenseMapBase {
44 }44 }
4545
46 void clear() {46 void clear() {
47 if (getNumEntries() == 0 && getNumTombstones() == 0)47 if (getNumEntries() == 0)
48 return;48 return;
4949
50 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();50 const KeyT EmptyKey = getEmptyKey();
51 if (__sanitizer::is_trivially_destructible<ValueT>::value) {51 if (__sanitizer::is_trivially_destructible<ValueT>::value) {
52 // Use a simpler loop when values don't need destruction.52 // Use a simpler loop when values don't need destruction.
53 for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P)53 for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P)
...@@ -56,17 +56,14 @@ class DenseMapBase {...@@ -56,17 +56,14 @@ class DenseMapBase {
56 unsigned NumEntries = getNumEntries();56 unsigned NumEntries = getNumEntries();
57 for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {57 for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
58 if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey)) {58 if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey)) {
59 if (!KeyInfoT::isEqual(P->getFirst(), TombstoneKey)) {59 P->getSecond().~ValueT();
60 P->getSecond().~ValueT();60 --NumEntries;
61 --NumEntries;
62 }
63 P->getFirst() = EmptyKey;61 P->getFirst() = EmptyKey;
64 }62 }
65 }63 }
66 CHECK_EQ(NumEntries, 0);64 CHECK_EQ(NumEntries, 0);
67 }65 }
68 setNumEntries(0);66 setNumEntries(0);
69 setNumTombstones(0);
70 }67 }
7168
72 /// Return true if the specified key is in the map, false otherwise.69 /// Return true if the specified key is in the map, false otherwise.
...@@ -171,20 +168,13 @@ class DenseMapBase {...@@ -171,20 +168,13 @@ class DenseMapBase {
171 if (!TheBucket)168 if (!TheBucket)
172 return false; // not in map.169 return false; // not in map.
173170
174 TheBucket->getSecond().~ValueT();171 eraseFromFilledBucket(TheBucket);
175 TheBucket->getFirst() = getTombstoneKey();
176 decrementNumEntries();
177 incrementNumTombstones();
178 return true;172 return true;
179 }173 }
180174
181 void erase(value_type *I) {175 void erase(value_type *I) {
182 CHECK_NE(I, nullptr);176 CHECK_NE(I, nullptr);
183 BucketT *TheBucket = &*I;177 eraseFromFilledBucket(I);
184 TheBucket->getSecond().~ValueT();
185 TheBucket->getFirst() = getTombstoneKey();
186 decrementNumEntries();
187 incrementNumTombstones();
188 }178 }
189179
190 value_type &FindAndConstruct(const KeyT &Key) {180 value_type &FindAndConstruct(const KeyT &Key) {
...@@ -214,11 +204,10 @@ class DenseMapBase {...@@ -214,11 +204,10 @@ class DenseMapBase {
214 /// Function can return fast to stop the process.204 /// Function can return fast to stop the process.
215 template <class Fn>205 template <class Fn>
216 void forEach(Fn fn) {206 void forEach(Fn fn) {
217 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();207 const KeyT EmptyKey = getEmptyKey();
218 for (auto *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {208 for (auto *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
219 const KeyT K = P->getFirst();209 const KeyT K = P->getFirst();
220 if (!KeyInfoT::isEqual(K, EmptyKey) &&210 if (!KeyInfoT::isEqual(K, EmptyKey)) {
221 !KeyInfoT::isEqual(K, TombstoneKey)) {
222 if (!fn(*P))211 if (!fn(*P))
223 return;212 return;
224 }213 }
...@@ -238,10 +227,9 @@ class DenseMapBase {...@@ -238,10 +227,9 @@ class DenseMapBase {
238 if (getNumBuckets() == 0) // Nothing to do.227 if (getNumBuckets() == 0) // Nothing to do.
239 return;228 return;
240229
241 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();230 const KeyT EmptyKey = getEmptyKey();
242 for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {231 for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
243 if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey) &&232 if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey))
244 !KeyInfoT::isEqual(P->getFirst(), TombstoneKey))
245 P->getSecond().~ValueT();233 P->getSecond().~ValueT();
246 P->getFirst().~KeyT();234 P->getFirst().~KeyT();
247 }235 }
...@@ -249,7 +237,6 @@ class DenseMapBase {...@@ -249,7 +237,6 @@ class DenseMapBase {
249237
250 void initEmpty() {238 void initEmpty() {
251 setNumEntries(0);239 setNumEntries(0);
252 setNumTombstones(0);
253240
254 CHECK_EQ((getNumBuckets() & (getNumBuckets() - 1)), 0);241 CHECK_EQ((getNumBuckets() & (getNumBuckets() - 1)), 0);
255 const KeyT EmptyKey = getEmptyKey();242 const KeyT EmptyKey = getEmptyKey();
...@@ -273,10 +260,8 @@ class DenseMapBase {...@@ -273,10 +260,8 @@ class DenseMapBase {
273260
274 // Insert all the old elements.261 // Insert all the old elements.
275 const KeyT EmptyKey = getEmptyKey();262 const KeyT EmptyKey = getEmptyKey();
276 const KeyT TombstoneKey = getTombstoneKey();
277 for (BucketT *B = OldBucketsBegin, *E = OldBucketsEnd; B != E; ++B) {263 for (BucketT *B = OldBucketsBegin, *E = OldBucketsEnd; B != E; ++B) {
278 if (!KeyInfoT::isEqual(B->getFirst(), EmptyKey) &&264 if (!KeyInfoT::isEqual(B->getFirst(), EmptyKey)) {
279 !KeyInfoT::isEqual(B->getFirst(), TombstoneKey)) {
280 // Insert the key/value into the new table.265 // Insert the key/value into the new table.
281 BucketT *DestBucket;266 BucketT *DestBucket;
282 bool FoundVal = LookupBucketFor(B->getFirst(), DestBucket);267 bool FoundVal = LookupBucketFor(B->getFirst(), DestBucket);
...@@ -301,7 +286,6 @@ class DenseMapBase {...@@ -301,7 +286,6 @@ class DenseMapBase {
301 CHECK_EQ(getNumBuckets(), other.getNumBuckets());286 CHECK_EQ(getNumBuckets(), other.getNumBuckets());
302287
303 setNumEntries(other.getNumEntries());288 setNumEntries(other.getNumEntries());
304 setNumTombstones(other.getNumTombstones());
305289
306 if (__sanitizer::is_trivially_copyable<KeyT>::value &&290 if (__sanitizer::is_trivially_copyable<KeyT>::value &&
307 __sanitizer::is_trivially_copyable<ValueT>::value)291 __sanitizer::is_trivially_copyable<ValueT>::value)
...@@ -311,8 +295,7 @@ class DenseMapBase {...@@ -311,8 +295,7 @@ class DenseMapBase {
311 for (uptr i = 0; i < getNumBuckets(); ++i) {295 for (uptr i = 0; i < getNumBuckets(); ++i) {
312 ::new (&getBuckets()[i].getFirst())296 ::new (&getBuckets()[i].getFirst())
313 KeyT(other.getBuckets()[i].getFirst());297 KeyT(other.getBuckets()[i].getFirst());
314 if (!KeyInfoT::isEqual(getBuckets()[i].getFirst(), getEmptyKey()) &&298 if (!KeyInfoT::isEqual(getBuckets()[i].getFirst(), getEmptyKey()))
315 !KeyInfoT::isEqual(getBuckets()[i].getFirst(), getTombstoneKey()))
316 ::new (&getBuckets()[i].getSecond())299 ::new (&getBuckets()[i].getSecond())
317 ValueT(other.getBuckets()[i].getSecond());300 ValueT(other.getBuckets()[i].getSecond());
318 }301 }
...@@ -329,9 +312,40 @@ class DenseMapBase {...@@ -329,9 +312,40 @@ class DenseMapBase {
329312
330 static const KeyT getEmptyKey() { return KeyInfoT::getEmptyKey(); }313 static const KeyT getEmptyKey() { return KeyInfoT::getEmptyKey(); }
331314
332 static const KeyT getTombstoneKey() { return KeyInfoT::getTombstoneKey(); }
333
334 private:315 private:
316 /// Erase the entry at \p TheBucket and close the resulting hole via Knuth
317 /// TAOCP 6.4 Algorithm R: walk forward over the cluster, shifting back any
318 /// entry whose linear-probe chain from its home bucket passes through the
319 /// hole, until an empty bucket terminates the cluster.
320 void eraseFromFilledBucket(BucketT* TheBucket) {
321 TheBucket->getSecond().~ValueT();
322 decrementNumEntries();
323
324 BucketT* BucketsPtr = getBuckets();
325 const unsigned NumBuckets = getNumBuckets();
326 const unsigned Mask = NumBuckets - 1;
327 const KeyT EmptyKey = getEmptyKey();
328 unsigned I = static_cast<unsigned>(TheBucket - BucketsPtr);
329 unsigned J = I;
330 while (true) {
331 J = (J + 1) & Mask;
332 BucketT& BJ = BucketsPtr[J];
333 if (KeyInfoT::isEqual(BJ.getFirst(), EmptyKey))
334 break;
335 unsigned Ideal = getHashValue(BJ.getFirst()) & Mask;
336 // If the hole (I) lies on the linear-probe chain from the home bucket
337 // (Ideal) to J, shift J into the hole and make J the new hole.
338 if (((I - Ideal) & Mask) < ((J - Ideal) & Mask)) {
339 BucketT& BI = BucketsPtr[I];
340 BI.getFirst() = __sanitizer::move(BJ.getFirst());
341 ::new (&BI.getSecond()) ValueT(__sanitizer::move(BJ.getSecond()));
342 BJ.getSecond().~ValueT();
343 I = J;
344 }
345 }
346 BucketsPtr[I].getFirst() = EmptyKey;
347 }
348
335 unsigned getNumEntries() const {349 unsigned getNumEntries() const {
336 return static_cast<const DerivedT *>(this)->getNumEntries();350 return static_cast<const DerivedT *>(this)->getNumEntries();
337 }351 }
...@@ -344,18 +358,6 @@ class DenseMapBase {...@@ -344,18 +358,6 @@ class DenseMapBase {
344358
345 void decrementNumEntries() { setNumEntries(getNumEntries() - 1); }359 void decrementNumEntries() { setNumEntries(getNumEntries() - 1); }
346360
347 unsigned getNumTombstones() const {
348 return static_cast<const DerivedT *>(this)->getNumTombstones();
349 }
350
351 void setNumTombstones(unsigned Num) {
352 static_cast<DerivedT *>(this)->setNumTombstones(Num);
353 }
354
355 void incrementNumTombstones() { setNumTombstones(getNumTombstones() + 1); }
356
357 void decrementNumTombstones() { setNumTombstones(getNumTombstones() - 1); }
358
359 const BucketT *getBuckets() const {361 const BucketT *getBuckets() const {
360 return static_cast<const DerivedT *>(this)->getBuckets();362 return static_cast<const DerivedT *>(this)->getBuckets();
361 }363 }
...@@ -398,25 +400,16 @@ class DenseMapBase {...@@ -398,25 +400,16 @@ class DenseMapBase {
398 template <typename LookupKeyT>400 template <typename LookupKeyT>
399 BucketT *InsertIntoBucketImpl(const KeyT &Key, const LookupKeyT &Lookup,401 BucketT *InsertIntoBucketImpl(const KeyT &Key, const LookupKeyT &Lookup,
400 BucketT *TheBucket) {402 BucketT *TheBucket) {
401 // If the load of the hash table is more than 3/4, or if fewer than 1/8 of403 // Grow the table if the load factor would exceed 3/4 after insertion.
402 // the buckets are empty (meaning that many are filled with tombstones),404 // Linear probing with gap-closing deletion (Knuth Algorithm R) keeps every
403 // grow the table.405 // chain compact and bounded by the table's empty-bucket count, so no
404 //406 // tombstone-driven resize is needed.
405 // The later case is tricky. For example, if we had one empty bucket with
406 // tons of tombstones, failing lookups (e.g. for insertion) would have to
407 // probe almost the entire table until it found the empty bucket. If the
408 // table completely filled with tombstones, no lookup would ever succeed,
409 // causing infinite loops in lookup.
410 unsigned NewNumEntries = getNumEntries() + 1;407 unsigned NewNumEntries = getNumEntries() + 1;
411 unsigned NumBuckets = getNumBuckets();408 unsigned NumBuckets = getNumBuckets();
412 if (UNLIKELY(NewNumEntries * 4 >= NumBuckets * 3)) {409 if (UNLIKELY(NewNumEntries * 4 >= NumBuckets * 3)) {
413 this->grow(NumBuckets * 2);410 this->grow(NumBuckets * 2);
414 LookupBucketFor(Lookup, TheBucket);411 LookupBucketFor(Lookup, TheBucket);
415 NumBuckets = getNumBuckets();412 NumBuckets = getNumBuckets();
416 } else if (UNLIKELY(NumBuckets - (NewNumEntries + getNumTombstones()) <=
417 NumBuckets / 8)) {
418 this->grow(NumBuckets);
419 LookupBucketFor(Lookup, TheBucket);
420 }413 }
421 CHECK(TheBucket);414 CHECK(TheBucket);
422415
...@@ -424,11 +417,6 @@ class DenseMapBase {...@@ -424,11 +417,6 @@ class DenseMapBase {
424 // so that when growing buckets we have self-consistent entry count.417 // so that when growing buckets we have self-consistent entry count.
425 incrementNumEntries();418 incrementNumEntries();
426419
427 // If we are writing over a tombstone, remember this.
428 const KeyT EmptyKey = getEmptyKey();
429 if (!KeyInfoT::isEqual(TheBucket->getFirst(), EmptyKey))
430 decrementNumTombstones();
431
432 return TheBucket;420 return TheBucket;
433 }421 }
434422
...@@ -441,7 +429,6 @@ class DenseMapBase {...@@ -441,7 +429,6 @@ class DenseMapBase {
441429
442 const KeyT EmptyKey = getEmptyKey();430 const KeyT EmptyKey = getEmptyKey();
443 unsigned BucketNo = getHashValue(Val) & (NumBuckets - 1);431 unsigned BucketNo = getHashValue(Val) & (NumBuckets - 1);
444 unsigned ProbeAmt = 1;
445 while (true) {432 while (true) {
446 BucketT *Bucket = BucketsPtr + BucketNo;433 BucketT *Bucket = BucketsPtr + BucketNo;
447 if (LIKELY(KeyInfoT::isEqual(Val, Bucket->getFirst())))434 if (LIKELY(KeyInfoT::isEqual(Val, Bucket->getFirst())))
...@@ -449,10 +436,8 @@ class DenseMapBase {...@@ -449,10 +436,8 @@ class DenseMapBase {
449 if (LIKELY(KeyInfoT::isEqual(Bucket->getFirst(), EmptyKey)))436 if (LIKELY(KeyInfoT::isEqual(Bucket->getFirst(), EmptyKey)))
450 return nullptr;437 return nullptr;
451438
452 // Otherwise, it's a hash collision or a tombstone, continue quadratic439 // Hash collision: continue linear probing.
453 // probing.440 BucketNo = (BucketNo + 1) & (NumBuckets - 1);
454 BucketNo += ProbeAmt++;
455 BucketNo &= NumBuckets - 1;
456 }441 }
457 }442 }
458443
...@@ -463,8 +448,8 @@ class DenseMapBase {...@@ -463,8 +448,8 @@ class DenseMapBase {
463448
464 /// LookupBucketFor - Lookup the appropriate bucket for Val, returning it in449 /// LookupBucketFor - Lookup the appropriate bucket for Val, returning it in
465 /// FoundBucket. If the bucket contains the key and a value, this returns450 /// FoundBucket. If the bucket contains the key and a value, this returns
466 /// true, otherwise it returns a bucket with an empty marker or tombstone and451 /// true, otherwise it returns a bucket with an empty marker and returns
467 /// returns false.452 /// false.
468 template <typename LookupKeyT>453 template <typename LookupKeyT>
469 bool LookupBucketFor(const LookupKeyT &Val,454 bool LookupBucketFor(const LookupKeyT &Val,
470 const BucketT *&FoundBucket) const {455 const BucketT *&FoundBucket) const {
...@@ -476,15 +461,10 @@ class DenseMapBase {...@@ -476,15 +461,10 @@ class DenseMapBase {
476 return false;461 return false;
477 }462 }
478463
479 // FoundTombstone - Keep track of whether we find a tombstone while probing.
480 const BucketT *FoundTombstone = nullptr;
481 const KeyT EmptyKey = getEmptyKey();464 const KeyT EmptyKey = getEmptyKey();
482 const KeyT TombstoneKey = getTombstoneKey();
483 CHECK(!KeyInfoT::isEqual(Val, EmptyKey));465 CHECK(!KeyInfoT::isEqual(Val, EmptyKey));
484 CHECK(!KeyInfoT::isEqual(Val, TombstoneKey));
485466
486 unsigned BucketNo = getHashValue(Val) & (NumBuckets - 1);467 unsigned BucketNo = getHashValue(Val) & (NumBuckets - 1);
487 unsigned ProbeAmt = 1;
488 while (true) {468 while (true) {
489 const BucketT *ThisBucket = BucketsPtr + BucketNo;469 const BucketT *ThisBucket = BucketsPtr + BucketNo;
490 // Found Val's bucket? If so, return it.470 // Found Val's bucket? If so, return it.
...@@ -494,24 +474,14 @@ class DenseMapBase {...@@ -494,24 +474,14 @@ class DenseMapBase {
494 }474 }
495475
496 // If we found an empty bucket, the key doesn't exist in the set.476 // If we found an empty bucket, the key doesn't exist in the set.
497 // Insert it and return the default value.477 // Return it as the insertion point.
498 if (LIKELY(KeyInfoT::isEqual(ThisBucket->getFirst(), EmptyKey))) {478 if (LIKELY(KeyInfoT::isEqual(ThisBucket->getFirst(), EmptyKey))) {
499 // If we've already seen a tombstone while probing, fill it in instead479 FoundBucket = ThisBucket;
500 // of the empty bucket we eventually probed to.
501 FoundBucket = FoundTombstone ? FoundTombstone : ThisBucket;
502 return false;480 return false;
503 }481 }
504482
505 // If this is a tombstone, remember it. If Val ends up not in the map, we483 // Hash collision: continue linear probing.
506 // prefer to return it than something that would require more probing.484 BucketNo = (BucketNo + 1) & (NumBuckets - 1);
507 if (KeyInfoT::isEqual(ThisBucket->getFirst(), TombstoneKey) &&
508 !FoundTombstone)
509 FoundTombstone = ThisBucket; // Remember the first tombstone found.
510
511 // Otherwise, it's a hash collision or a tombstone, continue quadratic
512 // probing.
513 BucketNo += ProbeAmt++;
514 BucketNo &= (NumBuckets - 1);
515 }485 }
516 }486 }
517487
...@@ -587,7 +557,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,...@@ -587,7 +557,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
587557
588 BucketT *Buckets = nullptr;558 BucketT *Buckets = nullptr;
589 unsigned NumEntries = 0;559 unsigned NumEntries = 0;
590 unsigned NumTombstones = 0;
591 unsigned NumBuckets = 0;560 unsigned NumBuckets = 0;
592561
593 public:562 public:
...@@ -614,7 +583,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,...@@ -614,7 +583,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
614 void swap(DenseMap &RHS) {583 void swap(DenseMap &RHS) {
615 Swap(Buckets, RHS.Buckets);584 Swap(Buckets, RHS.Buckets);
616 Swap(NumEntries, RHS.NumEntries);585 Swap(NumEntries, RHS.NumEntries);
617 Swap(NumTombstones, RHS.NumTombstones);
618 Swap(NumBuckets, RHS.NumBuckets);586 Swap(NumBuckets, RHS.NumBuckets);
619 }587 }
620588
...@@ -639,7 +607,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,...@@ -639,7 +607,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
639 this->BaseT::copyFrom(other);607 this->BaseT::copyFrom(other);
640 } else {608 } else {
641 NumEntries = 0;609 NumEntries = 0;
642 NumTombstones = 0;
643 }610 }
644 }611 }
645612
...@@ -649,7 +616,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,...@@ -649,7 +616,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
649 this->BaseT::initEmpty();616 this->BaseT::initEmpty();
650 } else {617 } else {
651 NumEntries = 0;618 NumEntries = 0;
652 NumTombstones = 0;
653 }619 }
654 }620 }
655621
...@@ -675,10 +641,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,...@@ -675,10 +641,6 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
675641
676 void setNumEntries(unsigned Num) { NumEntries = Num; }642 void setNumEntries(unsigned Num) { NumEntries = Num; }
677643
678 unsigned getNumTombstones() const { return NumTombstones; }
679
680 void setNumTombstones(unsigned Num) { NumTombstones = Num; }
681
682 BucketT *getBuckets() const { return Buckets; }644 BucketT *getBuckets() const { return Buckets; }
683645
684 unsigned getNumBuckets() const { return NumBuckets; }646 unsigned getNumBuckets() const { return NumBuckets; }
lib/libtsan/sanitizer_common/sanitizer_dense_map_info.h-25
...@@ -62,7 +62,6 @@ struct DenseMapPair {...@@ -62,7 +62,6 @@ struct DenseMapPair {
62template <typename T>62template <typename T>
63struct DenseMapInfo {63struct DenseMapInfo {
64 // static T getEmptyKey();64 // static T getEmptyKey();
65 // static T getTombstoneKey();
66 // static unsigned getHashValue(const T &Val);65 // static unsigned getHashValue(const T &Val);
67 // static bool isEqual(const T &LHS, const T &RHS);66 // static bool isEqual(const T &LHS, const T &RHS);
68};67};
...@@ -86,12 +85,6 @@ struct DenseMapInfo<T *> {...@@ -86,12 +85,6 @@ struct DenseMapInfo<T *> {
86 return reinterpret_cast<T *>(Val);85 return reinterpret_cast<T *>(Val);
87 }86 }
8887
89 static constexpr T *getTombstoneKey() {
90 uptr Val = static_cast<uptr>(-2);
91 Val <<= Log2MaxAlign;
92 return reinterpret_cast<T *>(Val);
93 }
94
95 static constexpr unsigned getHashValue(const T *PtrVal) {88 static constexpr unsigned getHashValue(const T *PtrVal) {
96 return (unsigned((uptr)PtrVal) >> 4) ^ (unsigned((uptr)PtrVal) >> 9);89 return (unsigned((uptr)PtrVal) >> 4) ^ (unsigned((uptr)PtrVal) >> 9);
97 }90 }
...@@ -105,7 +98,6 @@ struct DenseMapInfo<T *> {...@@ -105,7 +98,6 @@ struct DenseMapInfo<T *> {
105template <>98template <>
106struct DenseMapInfo<char> {99struct DenseMapInfo<char> {
107 static constexpr char getEmptyKey() { return ~0; }100 static constexpr char getEmptyKey() { return ~0; }
108 static constexpr char getTombstoneKey() { return ~0 - 1; }
109 static constexpr unsigned getHashValue(const char &Val) { return Val * 37U; }101 static constexpr unsigned getHashValue(const char &Val) { return Val * 37U; }
110102
111 static constexpr bool isEqual(const char &LHS, const char &RHS) {103 static constexpr bool isEqual(const char &LHS, const char &RHS) {
...@@ -117,7 +109,6 @@ struct DenseMapInfo<char> {...@@ -117,7 +109,6 @@ struct DenseMapInfo<char> {
117template <>109template <>
118struct DenseMapInfo<unsigned char> {110struct DenseMapInfo<unsigned char> {
119 static constexpr unsigned char getEmptyKey() { return ~0; }111 static constexpr unsigned char getEmptyKey() { return ~0; }
120 static constexpr unsigned char getTombstoneKey() { return ~0 - 1; }
121 static constexpr unsigned getHashValue(const unsigned char &Val) {112 static constexpr unsigned getHashValue(const unsigned char &Val) {
122 return Val * 37U;113 return Val * 37U;
123 }114 }
...@@ -132,7 +123,6 @@ struct DenseMapInfo<unsigned char> {...@@ -132,7 +123,6 @@ struct DenseMapInfo<unsigned char> {
132template <>123template <>
133struct DenseMapInfo<unsigned short> {124struct DenseMapInfo<unsigned short> {
134 static constexpr unsigned short getEmptyKey() { return 0xFFFF; }125 static constexpr unsigned short getEmptyKey() { return 0xFFFF; }
135 static constexpr unsigned short getTombstoneKey() { return 0xFFFF - 1; }
136 static constexpr unsigned getHashValue(const unsigned short &Val) {126 static constexpr unsigned getHashValue(const unsigned short &Val) {
137 return Val * 37U;127 return Val * 37U;
138 }128 }
...@@ -147,7 +137,6 @@ struct DenseMapInfo<unsigned short> {...@@ -147,7 +137,6 @@ struct DenseMapInfo<unsigned short> {
147template <>137template <>
148struct DenseMapInfo<unsigned> {138struct DenseMapInfo<unsigned> {
149 static constexpr unsigned getEmptyKey() { return ~0U; }139 static constexpr unsigned getEmptyKey() { return ~0U; }
150 static constexpr unsigned getTombstoneKey() { return ~0U - 1; }
151 static constexpr unsigned getHashValue(const unsigned &Val) {140 static constexpr unsigned getHashValue(const unsigned &Val) {
152 return Val * 37U;141 return Val * 37U;
153 }142 }
...@@ -161,7 +150,6 @@ struct DenseMapInfo<unsigned> {...@@ -161,7 +150,6 @@ struct DenseMapInfo<unsigned> {
161template <>150template <>
162struct DenseMapInfo<unsigned long> {151struct DenseMapInfo<unsigned long> {
163 static constexpr unsigned long getEmptyKey() { return ~0UL; }152 static constexpr unsigned long getEmptyKey() { return ~0UL; }
164 static constexpr unsigned long getTombstoneKey() { return ~0UL - 1L; }
165153
166 static constexpr unsigned getHashValue(const unsigned long &Val) {154 static constexpr unsigned getHashValue(const unsigned long &Val) {
167 return (unsigned)(Val * 37UL);155 return (unsigned)(Val * 37UL);
...@@ -177,7 +165,6 @@ struct DenseMapInfo<unsigned long> {...@@ -177,7 +165,6 @@ struct DenseMapInfo<unsigned long> {
177template <>165template <>
178struct DenseMapInfo<unsigned long long> {166struct DenseMapInfo<unsigned long long> {
179 static constexpr unsigned long long getEmptyKey() { return ~0ULL; }167 static constexpr unsigned long long getEmptyKey() { return ~0ULL; }
180 static constexpr unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; }
181168
182 static constexpr unsigned getHashValue(const unsigned long long &Val) {169 static constexpr unsigned getHashValue(const unsigned long long &Val) {
183 return (unsigned)(Val * 37ULL);170 return (unsigned)(Val * 37ULL);
...@@ -193,7 +180,6 @@ struct DenseMapInfo<unsigned long long> {...@@ -193,7 +180,6 @@ struct DenseMapInfo<unsigned long long> {
193template <>180template <>
194struct DenseMapInfo<short> {181struct DenseMapInfo<short> {
195 static constexpr short getEmptyKey() { return 0x7FFF; }182 static constexpr short getEmptyKey() { return 0x7FFF; }
196 static constexpr short getTombstoneKey() { return -0x7FFF - 1; }
197 static constexpr unsigned getHashValue(const short &Val) { return Val * 37U; }183 static constexpr unsigned getHashValue(const short &Val) { return Val * 37U; }
198 static constexpr bool isEqual(const short &LHS, const short &RHS) {184 static constexpr bool isEqual(const short &LHS, const short &RHS) {
199 return LHS == RHS;185 return LHS == RHS;
...@@ -204,7 +190,6 @@ struct DenseMapInfo<short> {...@@ -204,7 +190,6 @@ struct DenseMapInfo<short> {
204template <>190template <>
205struct DenseMapInfo<int> {191struct DenseMapInfo<int> {
206 static constexpr int getEmptyKey() { return 0x7fffffff; }192 static constexpr int getEmptyKey() { return 0x7fffffff; }
207 static constexpr int getTombstoneKey() { return -0x7fffffff - 1; }
208 static constexpr unsigned getHashValue(const int &Val) {193 static constexpr unsigned getHashValue(const int &Val) {
209 return (unsigned)(Val * 37U);194 return (unsigned)(Val * 37U);
210 }195 }
...@@ -221,8 +206,6 @@ struct DenseMapInfo<long> {...@@ -221,8 +206,6 @@ struct DenseMapInfo<long> {
221 return (1UL << (sizeof(long) * 8 - 1)) - 1UL;206 return (1UL << (sizeof(long) * 8 - 1)) - 1UL;
222 }207 }
223208
224 static constexpr long getTombstoneKey() { return getEmptyKey() - 1L; }
225
226 static constexpr unsigned getHashValue(const long &Val) {209 static constexpr unsigned getHashValue(const long &Val) {
227 return (unsigned)(Val * 37UL);210 return (unsigned)(Val * 37UL);
228 }211 }
...@@ -236,9 +219,6 @@ struct DenseMapInfo<long> {...@@ -236,9 +219,6 @@ struct DenseMapInfo<long> {
236template <>219template <>
237struct DenseMapInfo<long long> {220struct DenseMapInfo<long long> {
238 static constexpr long long getEmptyKey() { return 0x7fffffffffffffffLL; }221 static constexpr long long getEmptyKey() { return 0x7fffffffffffffffLL; }
239 static constexpr long long getTombstoneKey() {
240 return -0x7fffffffffffffffLL - 1;
241 }
242222
243 static constexpr unsigned getHashValue(const long long &Val) {223 static constexpr unsigned getHashValue(const long long &Val) {
244 return (unsigned)(Val * 37ULL);224 return (unsigned)(Val * 37ULL);
...@@ -261,11 +241,6 @@ struct DenseMapInfo<detail::DenseMapPair<T, U>> {...@@ -261,11 +241,6 @@ struct DenseMapInfo<detail::DenseMapPair<T, U>> {
261 SecondInfo::getEmptyKey());241 SecondInfo::getEmptyKey());
262 }242 }
263243
264 static constexpr Pair getTombstoneKey() {
265 return detail::DenseMapPair<T, U>(FirstInfo::getTombstoneKey(),
266 SecondInfo::getTombstoneKey());
267 }
268
269 static constexpr unsigned getHashValue(const Pair &PairVal) {244 static constexpr unsigned getHashValue(const Pair &PairVal) {
270 return detail::combineHashValue(FirstInfo::getHashValue(PairVal.first),245 return detail::combineHashValue(FirstInfo::getHashValue(PairVal.first),
271 SecondInfo::getHashValue(PairVal.second));246 SecondInfo::getHashValue(PairVal.second));
lib/libtsan/sanitizer_common/sanitizer_errno.h+2
...@@ -31,6 +31,8 @@...@@ -31,6 +31,8 @@
31# define __errno_location _errno31# define __errno_location _errno
32#elif SANITIZER_HAIKU32#elif SANITIZER_HAIKU
33# define __errno_location _errnop33# define __errno_location _errnop
34#elif SANITIZER_AIX
35# define __errno_location _Errno
34#endif36#endif
3537
36extern "C" int *__errno_location();38extern "C" int *__errno_location();
lib/libtsan/sanitizer_common/sanitizer_flag_parser.h+2-2
...@@ -189,8 +189,8 @@ class FlagParser {...@@ -189,8 +189,8 @@ class FlagParser {
189};189};
190190
191template <typename T>191template <typename T>
192static void RegisterFlag(FlagParser *parser, const char *name, const char *desc,192void RegisterFlag(FlagParser* parser, const char* name, const char* desc,
193 T *var) {193 T* var) {
194 FlagHandler<T> *fh = new (GetGlobalLowLevelAllocator()) FlagHandler<T>(var);194 FlagHandler<T> *fh = new (GetGlobalLowLevelAllocator()) FlagHandler<T>(var);
195 parser->RegisterHandler(name, fh, desc);195 parser->RegisterHandler(name, fh, desc);
196}196}
lib/libtsan/sanitizer_common/sanitizer_fuchsia.cpp+2-2
...@@ -93,8 +93,8 @@ void CheckMPROTECT() {}...@@ -93,8 +93,8 @@ void CheckMPROTECT() {}
93void PlatformPrepareForSandboxing(void *args) {}93void PlatformPrepareForSandboxing(void *args) {}
94void DisableCoreDumperIfNecessary() {}94void DisableCoreDumperIfNecessary() {}
95void InstallDeadlySignalHandlers(SignalHandlerType handler) {}95void InstallDeadlySignalHandlers(SignalHandlerType handler) {}
96void SetAlternateSignalStack() {}96void* SetAlternateSignalStack() { return nullptr; }
97void UnsetAlternateSignalStack() {}97void UnsetAlternateSignalStack(void* altstack_base) {}
9898
99bool SignalContext::IsStackOverflow() const { return false; }99bool SignalContext::IsStackOverflow() const { return false; }
100void SignalContext::DumpAllRegisters(void *context) { UNIMPLEMENTED(); }100void SignalContext::DumpAllRegisters(void *context) { UNIMPLEMENTED(); }
lib/libtsan/sanitizer_common/sanitizer_haiku.cpp+4
...@@ -128,6 +128,10 @@ uptr internal_close(fd_t fd) {...@@ -128,6 +128,10 @@ uptr internal_close(fd_t fd) {
128 RETURN_AND_SET_ERRNO(_kern_close(fd));128 RETURN_AND_SET_ERRNO(_kern_close(fd));
129}129}
130130
131uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {
132 return -1; // Not supported.
133}
134
131uptr internal_open(const char *filename, int flags) {135uptr internal_open(const char *filename, int flags) {
132 CHECK(&_kern_open);136 CHECK(&_kern_open);
133 RETURN_AND_SET_ERRNO(_kern_open(-1, filename, flags, 0));137 RETURN_AND_SET_ERRNO(_kern_open(-1, filename, flags, 0));
lib/libtsan/sanitizer_common/sanitizer_interface_internal.h-5
...@@ -76,11 +76,6 @@ void __sanitizer_annotate_double_ended_contiguous_container(...@@ -76,11 +76,6 @@ void __sanitizer_annotate_double_ended_contiguous_container(
76 const void *old_container_beg, const void *old_container_end,76 const void *old_container_beg, const void *old_container_end,
77 const void *new_container_beg, const void *new_container_end);77 const void *new_container_beg, const void *new_container_end);
78SANITIZER_INTERFACE_ATTRIBUTE78SANITIZER_INTERFACE_ATTRIBUTE
79void __sanitizer_copy_contiguous_container_annotations(const void *src_begin,
80 const void *src_end,
81 const void *dst_begin,
82 const void *dst_end);
83SANITIZER_INTERFACE_ATTRIBUTE
84int __sanitizer_verify_contiguous_container(const void *beg, const void *mid,79int __sanitizer_verify_contiguous_container(const void *beg, const void *mid,
85 const void *end);80 const void *end);
86SANITIZER_INTERFACE_ATTRIBUTE81SANITIZER_INTERFACE_ATTRIBUTE
lib/libtsan/sanitizer_common/sanitizer_internal_defs.h+16-12
...@@ -29,20 +29,24 @@...@@ -29,20 +29,24 @@
2929
30// Only use SANITIZER_*ATTRIBUTE* before the function return type!30// Only use SANITIZER_*ATTRIBUTE* before the function return type!
31#if SANITIZER_WINDOWS31#if SANITIZER_WINDOWS
32#if SANITIZER_IMPORT_INTERFACE32# if SANITIZER_IMPORT_INTERFACE
33# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllimport)33# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllimport)
34#else34# else
35# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport)35# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport)
36#endif36# endif
37# define SANITIZER_WEAK_ATTRIBUTE37# define SANITIZER_WEAK_ATTRIBUTE
38# define SANITIZER_WEAK_IMPORT
39#elif SANITIZER_GO
40# define SANITIZER_INTERFACE_ATTRIBUTE
41# define SANITIZER_WEAK_ATTRIBUTE
42# define SANITIZER_WEAK_IMPORT38# define SANITIZER_WEAK_IMPORT
43#else39#else
44# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))40# if SANITIZER_GO
45# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))41# define SANITIZER_INTERFACE_ATTRIBUTE
42# define SANITIZER_WEAK_ATTRIBUTE
43# elif SANITIZER_AMDGPU || SANITIZER_NVPTX
44# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("hidden")))
45# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
46# else
47# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))
48# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
49# endif // SANITIZER_GO
46# if SANITIZER_APPLE50# if SANITIZER_APPLE
47# define SANITIZER_WEAK_IMPORT extern "C" __attribute((weak_import))51# define SANITIZER_WEAK_IMPORT extern "C" __attribute((weak_import))
48# else52# else
lib/libtsan/sanitizer_common/sanitizer_linux.cpp+81-12
...@@ -90,10 +90,18 @@...@@ -90,10 +90,18 @@
90extern "C" SANITIZER_WEAK_ATTRIBUTE const char *strerrorname_np(int);90extern "C" SANITIZER_WEAK_ATTRIBUTE const char *strerrorname_np(int);
91# endif91# endif
9292
93# if SANITIZER_LINUX && defined(__loongarch__)93# if SANITIZER_LINUX && \
94 (defined(__loongarch__) || defined(__hexagon__) || defined(__alpha__))
94# include <sys/sysmacros.h>95# include <sys/sysmacros.h>
95# endif96# endif
9697
98// Hexagon uses statx() instead of stat64(). glibc provides struct statx
99// through <sys/stat.h>, but musl does not — pull it from <linux/stat.h>.
100// On this musl/hexagon combination the two headers coexist without conflict.
101# if SANITIZER_LINUX && defined(__hexagon__)
102# include <linux/stat.h>
103# endif
104
97# if SANITIZER_LINUX && defined(__powerpc64__)105# if SANITIZER_LINUX && defined(__powerpc64__)
98# include <asm/ptrace.h>106# include <asm/ptrace.h>
99# endif107# endif
...@@ -254,6 +262,8 @@ ScopedBlockSignals::~ScopedBlockSignals() { SetSigProcMask(&saved_, nullptr); }...@@ -254,6 +262,8 @@ ScopedBlockSignals::~ScopedBlockSignals() { SetSigProcMask(&saved_, nullptr); }
254# include "sanitizer_syscall_linux_hexagon.inc"262# include "sanitizer_syscall_linux_hexagon.inc"
255# elif SANITIZER_LINUX && SANITIZER_LOONGARCH64263# elif SANITIZER_LINUX && SANITIZER_LOONGARCH64
256# include "sanitizer_syscall_linux_loongarch64.inc"264# include "sanitizer_syscall_linux_loongarch64.inc"
265# elif SANITIZER_LINUX && SANITIZER_ALPHA
266# include "sanitizer_syscall_linux_alpha.inc"
257# else267# else
258# include "sanitizer_syscall_generic.inc"268# include "sanitizer_syscall_generic.inc"
259# endif269# endif
...@@ -296,11 +306,13 @@ int internal_madvise(uptr addr, uptr length, int advice) {...@@ -296,11 +306,13 @@ int internal_madvise(uptr addr, uptr length, int advice) {
296 return internal_syscall(SYSCALL(madvise), addr, length, advice);306 return internal_syscall(SYSCALL(madvise), addr, length, advice);
297}307}
298308
299# if SANITIZER_FREEBSD
300uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {309uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {
310# if SANITIZER_FREEBSD || (SANITIZER_LINUX && defined(__NR_close_range))
301 return internal_syscall(SYSCALL(close_range), lowfd, highfd, flags);311 return internal_syscall(SYSCALL(close_range), lowfd, highfd, flags);
302}
303# endif312# endif
313 return -1; // Not supported.
314}
315
304uptr internal_close(fd_t fd) { return internal_syscall(SYSCALL(close), fd); }316uptr internal_close(fd_t fd) { return internal_syscall(SYSCALL(close), fd); }
305317
306uptr internal_open(const char *filename, int flags) {318uptr internal_open(const char *filename, int flags) {
...@@ -341,7 +353,8 @@ uptr internal_ftruncate(fd_t fd, uptr size) {...@@ -341,7 +353,8 @@ uptr internal_ftruncate(fd_t fd, uptr size) {
341 return res;353 return res;
342}354}
343355
344# if !SANITIZER_LINUX_USES_64BIT_SYSCALLS && SANITIZER_LINUX356# if !SANITIZER_LINUX_USES_64BIT_SYSCALLS && SANITIZER_LINUX && \
357 !defined(__hexagon__)
345static void stat64_to_stat(struct stat64 *in, struct stat *out) {358static void stat64_to_stat(struct stat64 *in, struct stat *out) {
346 internal_memset(out, 0, sizeof(*out));359 internal_memset(out, 0, sizeof(*out));
347 out->st_dev = in->st_dev;360 out->st_dev = in->st_dev;
...@@ -360,7 +373,8 @@ static void stat64_to_stat(struct stat64 *in, struct stat *out) {...@@ -360,7 +373,8 @@ static void stat64_to_stat(struct stat64 *in, struct stat *out) {
360}373}
361# endif374# endif
362375
363# if SANITIZER_LINUX && defined(__loongarch__)376# if SANITIZER_LINUX && \
377 (defined(__loongarch__) || defined(__hexagon__) || defined(__alpha__))
364static void statx_to_stat(struct statx *in, struct stat *out) {378static void statx_to_stat(struct statx *in, struct stat *out) {
365 internal_memset(out, 0, sizeof(*out));379 internal_memset(out, 0, sizeof(*out));
366 out->st_dev = makedev(in->stx_dev_major, in->stx_dev_minor);380 out->st_dev = makedev(in->stx_dev_major, in->stx_dev_minor);
...@@ -440,7 +454,7 @@ uptr internal_stat(const char *path, void *buf) {...@@ -440,7 +454,7 @@ uptr internal_stat(const char *path, void *buf) {
440# if SANITIZER_FREEBSD454# if SANITIZER_FREEBSD
441 return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0);455 return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0);
442# elif SANITIZER_LINUX456# elif SANITIZER_LINUX
443# if defined(__loongarch__)457# if defined(__loongarch__) || defined(__hexagon__) || defined(__alpha__)
444 struct statx bufx;458 struct statx bufx;
445 int res = internal_syscall(SYSCALL(statx), AT_FDCWD, (uptr)path,459 int res = internal_syscall(SYSCALL(statx), AT_FDCWD, (uptr)path,
446 AT_NO_AUTOMOUNT, STATX_BASIC_STATS, (uptr)&bufx);460 AT_NO_AUTOMOUNT, STATX_BASIC_STATS, (uptr)&bufx);
...@@ -478,7 +492,7 @@ uptr internal_lstat(const char *path, void *buf) {...@@ -478,7 +492,7 @@ uptr internal_lstat(const char *path, void *buf) {
478 return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf,492 return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf,
479 AT_SYMLINK_NOFOLLOW);493 AT_SYMLINK_NOFOLLOW);
480# elif SANITIZER_LINUX494# elif SANITIZER_LINUX
481# if defined(__loongarch__)495# if defined(__loongarch__) || defined(__hexagon__) || defined(__alpha__)
482 struct statx bufx;496 struct statx bufx;
483 int res = internal_syscall(SYSCALL(statx), AT_FDCWD, (uptr)path,497 int res = internal_syscall(SYSCALL(statx), AT_FDCWD, (uptr)path,
484 AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT,498 AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT,
...@@ -526,7 +540,7 @@ uptr internal_fstat(fd_t fd, void *buf) {...@@ -526,7 +540,7 @@ uptr internal_fstat(fd_t fd, void *buf) {
526 int res = internal_syscall(SYSCALL(fstat64), fd, &kbuf);540 int res = internal_syscall(SYSCALL(fstat64), fd, &kbuf);
527 kernel_stat_to_stat(&kbuf, (struct stat *)buf);541 kernel_stat_to_stat(&kbuf, (struct stat *)buf);
528 return res;542 return res;
529# elif SANITIZER_LINUX && defined(__loongarch__)543# elif SANITIZER_LINUX && (defined(__loongarch__) || defined(__alpha__))
530 struct statx bufx;544 struct statx bufx;
531 int res = internal_syscall(SYSCALL(statx), fd, "", AT_EMPTY_PATH,545 int res = internal_syscall(SYSCALL(statx), fd, "", AT_EMPTY_PATH,
532 STATX_BASIC_STATS, (uptr)&bufx);546 STATX_BASIC_STATS, (uptr)&bufx);
...@@ -535,6 +549,13 @@ uptr internal_fstat(fd_t fd, void *buf) {...@@ -535,6 +549,13 @@ uptr internal_fstat(fd_t fd, void *buf) {
535# else549# else
536 return internal_syscall(SYSCALL(fstat), fd, (uptr)buf);550 return internal_syscall(SYSCALL(fstat), fd, (uptr)buf);
537# endif551# endif
552# elif SANITIZER_LINUX && defined(__hexagon__)
553 // Hexagon musl lacks struct stat64; use statx() instead.
554 struct statx bufx;
555 int res = internal_syscall(SYSCALL(statx), fd, "", AT_EMPTY_PATH,
556 STATX_BASIC_STATS, (uptr)&bufx);
557 statx_to_stat(&bufx, (struct stat*)buf);
558 return res;
538# else559# else
539 struct stat64 buf64;560 struct stat64 buf64;
540 int res = internal_syscall(SYSCALL(fstat64), fd, &buf64);561 int res = internal_syscall(SYSCALL(fstat64), fd, &buf64);
...@@ -1003,7 +1024,7 @@ int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {...@@ -1003,7 +1024,7 @@ int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {
1003 // rt_sigaction, so we need to do the same (we'll need to reimplement the1024 // rt_sigaction, so we need to do the same (we'll need to reimplement the
1004 // restorers; for x86_64 the restorer address can be obtained from1025 // restorers; for x86_64 the restorer address can be obtained from
1005 // oldact->sa_restorer upon a call to sigaction(xxx, NULL, oldact).1026 // oldact->sa_restorer upon a call to sigaction(xxx, NULL, oldact).
1006# if !SANITIZER_ANDROID || !SANITIZER_MIPS321027# if (!SANITIZER_ANDROID || !SANITIZER_MIPS32) && !defined(__alpha__)
1007 k_act.sa_restorer = u_act->sa_restorer;1028 k_act.sa_restorer = u_act->sa_restorer;
1008# endif1029# endif
1009 }1030 }
...@@ -1019,7 +1040,7 @@ int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {...@@ -1019,7 +1040,7 @@ int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {
1019 internal_memcpy(&u_oldact->sa_mask, &k_oldact.sa_mask,1040 internal_memcpy(&u_oldact->sa_mask, &k_oldact.sa_mask,
1020 sizeof(__sanitizer_kernel_sigset_t));1041 sizeof(__sanitizer_kernel_sigset_t));
1021 u_oldact->sa_flags = k_oldact.sa_flags;1042 u_oldact->sa_flags = k_oldact.sa_flags;
1022# if !SANITIZER_ANDROID || !SANITIZER_MIPS321043# if (!SANITIZER_ANDROID || !SANITIZER_MIPS32) && !defined(__alpha__)
1023 u_oldact->sa_restorer = k_oldact.sa_restorer;1044 u_oldact->sa_restorer = k_oldact.sa_restorer;
1024# endif1045# endif
1025 }1046 }
...@@ -1228,6 +1249,16 @@ uptr GetMaxVirtualAddress() {...@@ -1228,6 +1249,16 @@ uptr GetMaxVirtualAddress() {
1228 // loongarch64 also has multiple address space layouts: default is 47-bit.1249 // loongarch64 also has multiple address space layouts: default is 47-bit.
1229 // RISC-V 64 also has multiple address space layouts: 39, 48 and 57-bit.1250 // RISC-V 64 also has multiple address space layouts: 39, 48 and 57-bit.
1230 return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;1251 return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;
1252# elif SANITIZER_ALPHA
1253 // Linux/Alpha uses a 42-bit user VAS (TASK_SIZE = 0x40000000000). With
1254 // fixed shadow offset 0x10000000000 (1 TiB) the layout is:
1255 // LowMem: [0x000000000000, 0x00ffffffffff] (1 TiB)
1256 // LowShadow: [0x010000000000, 0x011fffffffff] (128 GiB)
1257 // ShadowGap: [0x012000000000, 0x012fffffffff]
1258 // HighShadow:[0x013000000000, 0x017fffffffff] (256 GiB)
1259 // HighMem: [0x018000000000, 0x03ffffffffff] (2.5 TiB, stack near top)
1260 // Capping at TASK_SIZE - 1 avoids treating kernel addresses as HighMem.
1261 return (1ULL << 42) - 1; // TASK_SIZE - 1
1231# elif SANITIZER_MIPS641262# elif SANITIZER_MIPS64
1232 return (1ULL << 40) - 1; // 0x000000ffffffffffUL;1263 return (1ULL << 40) - 1; // 0x000000ffffffffffUL;
1233# elif defined(__s390x__)1264# elif defined(__s390x__)
...@@ -1894,6 +1925,39 @@ uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,...@@ -1894,6 +1925,39 @@ uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
1894 : "memory");1925 : "memory");
1895 return res;1926 return res;
1896}1927}
1928# elif defined(__hexagon__)
1929uptr internal_clone(int (*fn)(void*), void* child_stack, int flags, void* arg,
1930 int* parent_tidptr, void* newtls, int* child_tidptr) {
1931 if (!fn || !child_stack)
1932 return -EINVAL;
1933 child_stack = (char*)child_stack - 2 * sizeof(unsigned int);
1934 ((unsigned int*)child_stack)[0] = (uptr)fn;
1935 ((unsigned int*)child_stack)[1] = (uptr)arg;
1936
1937 // Hexagon clone syscall uses the generic argument order (no
1938 // CONFIG_CLONE_BACKWARDS): flags, stack, ptid, ctid, tls.
1939 register int r0 __asm__("r0") = flags;
1940 register void* r1 __asm__("r1") = child_stack;
1941 register int* r2 __asm__("r2") = parent_tidptr;
1942 register int* r3 __asm__("r3") = child_tidptr;
1943 register void* r4 __asm__("r4") = newtls;
1944 register int r6 __asm__("r6") = __NR_clone;
1945
1946 __asm__ __volatile__(
1947 "trap0(#1)\n" /* syscall */
1948 "{ p0 = cmp.eq(r0, #0)\n" /* child? */
1949 " if (!p0.new) jump:nt 1f }\n"
1950 "r1 = memw(r29 + #0)\n" /* r1 = fn */
1951 "r0 = memw(r29 + #4)\n" /* r0 = arg */
1952 "callr r1\n" /* fn(arg) */
1953 "r6 = #%7\n" /* __NR_exit */
1954 "trap0(#1)\n"
1955 "1:\n"
1956 : "=r"(r0)
1957 : "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r6), "i"(__NR_exit)
1958 : "memory", "p0", "r1", "lr");
1959 return (uptr)r0;
1960}
1897# endif1961# endif
1898# endif // SANITIZER_LINUX1962# endif // SANITIZER_LINUX
18991963
...@@ -2427,7 +2491,7 @@ static void DumpSingleReg(ucontext_t *ctx, int RegNum) {...@@ -2427,7 +2491,7 @@ static void DumpSingleReg(ucontext_t *ctx, int RegNum) {
2427# if SANITIZER_LINUX2491# if SANITIZER_LINUX
2428 ctx->uc_mcontext.gregs[RegNum]2492 ctx->uc_mcontext.gregs[RegNum]
2429# elif SANITIZER_NETBSD2493# elif SANITIZER_NETBSD
2430 ctx->uc_mcontext.__gregs[RegNum]2494 (unsigned long long)ctx->uc_mcontext.__gregs[RegNum]
2431# endif2495# endif
2432 );2496 );
2433# elif defined(__i386__)2497# elif defined(__i386__)
...@@ -2729,6 +2793,11 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {...@@ -2729,6 +2793,11 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
2729 *pc = ucontext->uc_mcontext.__pc;2793 *pc = ucontext->uc_mcontext.__pc;
2730 *bp = ucontext->uc_mcontext.__gregs[22];2794 *bp = ucontext->uc_mcontext.__gregs[22];
2731 *sp = ucontext->uc_mcontext.__gregs[3];2795 *sp = ucontext->uc_mcontext.__gregs[3];
2796# elif defined(__alpha__)
2797 ucontext_t* ucontext = (ucontext_t*)context;
2798 *pc = ucontext->uc_mcontext.sc_pc;
2799 *bp = ucontext->uc_mcontext.sc_regs[15]; // $fp / $s6
2800 *sp = ucontext->uc_mcontext.sc_regs[30]; // $sp
2732# else2801# else
2733# error "Unsupported arch"2802# error "Unsupported arch"
2734# endif2803# endif
...@@ -2819,7 +2888,7 @@ void CheckMPROTECT() {...@@ -2819,7 +2888,7 @@ void CheckMPROTECT() {
2819# endif2888# endif
2820}2889}
28212890
2822void CheckNoDeepBind(const char *filename, int flag) {2891void OnDlOpen(const char* filename, int flag) {
2823# ifdef RTLD_DEEPBIND2892# ifdef RTLD_DEEPBIND
2824 if (flag & RTLD_DEEPBIND) {2893 if (flag & RTLD_DEEPBIND) {
2825 Report(2894 Report(
lib/libtsan/sanitizer_common/sanitizer_linux.h+2-1
...@@ -86,7 +86,8 @@ int internal_sigaction_norestorer(int signum, const void *act, void *oldact);...@@ -86,7 +86,8 @@ int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
86void internal_sigdelset(__sanitizer_sigset_t *set, int signum);86void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
87# if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) || \87# if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) || \
88 defined(__powerpc64__) || defined(__s390__) || defined(__i386__) || \88 defined(__powerpc64__) || defined(__s390__) || defined(__i386__) || \
89 defined(__arm__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH6489 defined(__arm__) || defined(__hexagon__) || SANITIZER_RISCV64 || \
90 SANITIZER_LOONGARCH64
90uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,91uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
91 int *parent_tidptr, void *newtls, int *child_tidptr);92 int *parent_tidptr, void *newtls, int *child_tidptr);
92# endif93# endif
lib/libtsan/sanitizer_common/sanitizer_linux_libcdep.cpp+6-2
...@@ -284,6 +284,10 @@ static uptr ThreadDescriptorSizeFallback() {...@@ -284,6 +284,10 @@ static uptr ThreadDescriptorSizeFallback() {
284# if defined(__powerpc64__)284# if defined(__powerpc64__)
285 return 1776; // from glibc.ppc64le 2.20-8.fc21285 return 1776; // from glibc.ppc64le 2.20-8.fc21
286# endif286# endif
287
288# if defined(__alpha__)
289 return 1824; // from glibc 2.43
290# endif
287}291}
288# endif // SANITIZER_GLIBC && !SANITIZER_GO292# endif // SANITIZER_GLIBC && !SANITIZER_GO
289293
...@@ -494,10 +498,10 @@ __attribute__((unused)) static void GetStaticTlsBoundary(uptr *addr, uptr *size,...@@ -494,10 +498,10 @@ __attribute__((unused)) static void GetStaticTlsBoundary(uptr *addr, uptr *size,
494 // loader places static TLS blocks this way not to waste space.498 // loader places static TLS blocks this way not to waste space.
495 uptr l = one;499 uptr l = one;
496 *align = ranges[l].align;500 *align = ranges[l].align;
497 while (l != 0 && ranges[l].begin < ranges[l - 1].end + ranges[l].align)501 while (l != 0 && ranges[l].begin <= ranges[l - 1].end + ranges[l].align)
498 *align = Max(*align, ranges[--l].align);502 *align = Max(*align, ranges[--l].align);
499 uptr r = one + 1;503 uptr r = one + 1;
500 while (r != len && ranges[r].begin < ranges[r - 1].end + ranges[r].align)504 while (r != len && ranges[r].begin <= ranges[r - 1].end + ranges[r].align)
501 *align = Max(*align, ranges[r++].align);505 *align = Max(*align, ranges[r++].align);
502 *addr = ranges[l].begin;506 *addr = ranges[l].begin;
503 *size = ranges[r - 1].end - ranges[l].begin;507 *size = ranges[r - 1].end - ranges[l].begin;
lib/libtsan/sanitizer_common/sanitizer_lzw.h+1-3
...@@ -26,9 +26,7 @@ ItOut LzwEncode(ItIn begin, ItIn end, ItOut out) {...@@ -26,9 +26,7 @@ ItOut LzwEncode(ItIn begin, ItIn end, ItOut out) {
2626
27 // Sentinel value for substrings of len 1.27 // Sentinel value for substrings of len 1.
28 static constexpr LzwCodeType kNoPrefix =28 static constexpr LzwCodeType kNoPrefix =
29 Min(DenseMapInfo<Substring>::getEmptyKey().first,29 DenseMapInfo<Substring>::getEmptyKey().first - 1;
30 DenseMapInfo<Substring>::getTombstoneKey().first) -
31 1;
32 DenseMap<Substring, LzwCodeType> prefix_to_code;30 DenseMap<Substring, LzwCodeType> prefix_to_code;
33 {31 {
34 // Add all substring of len 1 as initial dictionary.32 // Add all substring of len 1 as initial dictionary.
lib/libtsan/sanitizer_common/sanitizer_mac.cpp+30-2
...@@ -170,6 +170,10 @@ uptr internal_close(fd_t fd) {...@@ -170,6 +170,10 @@ uptr internal_close(fd_t fd) {
170 return close(fd);170 return close(fd);
171}171}
172172
173uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {
174 return -1; // Not supported.
175}
176
173uptr internal_open(const char *filename, int flags) {177uptr internal_open(const char *filename, int flags) {
174 return open(filename, flags);178 return open(filename, flags);
175}179}
...@@ -609,7 +613,13 @@ static uptr ApproximateOSVersionViaKernelVersion(VersStr vers) {...@@ -609,7 +613,13 @@ static uptr ApproximateOSVersionViaKernelVersion(VersStr vers) {
609 u16 os_major = kernel_major - offset;613 u16 os_major = kernel_major - offset;
610614
611 const char *format = "%d.0";615 const char *format = "%d.0";
612 if (TARGET_OS_OSX) {616 if (kernel_major >= 27) {
617 // with kernel major 27 <=> OSes 27.0, OS versions are aligned with kernel
618 os_major = kernel_major;
619 } else if (kernel_major >= 25) {
620 // with kernel_major 25 <=> OSes 26.0, OS versions are aligned
621 os_major = kernel_major + 1;
622 } else if (TARGET_OS_OSX) {
613 if (os_major >= 16) { // macOS 11+623 if (os_major >= 16) { // macOS 11+
614 os_major -= 5;624 os_major -= 5;
615 } else { // macOS 10.15 and below625 } else { // macOS 10.15 and below
...@@ -666,6 +676,24 @@ static void MapToMacos(u16 *major, u16 *minor) {...@@ -666,6 +676,24 @@ static void MapToMacos(u16 *major, u16 *minor) {
666 if (TARGET_OS_OSX)676 if (TARGET_OS_OSX)
667 return;677 return;
668678
679 // All supported platforms (including DriverKit) have
680 // aligned version numbers in macOS 27+
681 if (*major >= 27)
682 return;
683
684# if TARGET_OS_DRIVERKIT
685 // Driverkit 25.0+ aligns with macOS 26+
686 if (*major >= 25) {
687 *major += 1;
688 return;
689 }
690# else
691 // macOS 26 and later have aligned version strings.
692 if (*major >= 26)
693 return;
694# endif
695
696 // Below are mappings for pre-macOS-25-aligned releases
669 if (TARGET_OS_IOS || TARGET_OS_TV)697 if (TARGET_OS_IOS || TARGET_OS_TV)
670 *major += 2;698 *major += 2;
671 else if (TARGET_OS_WATCH)699 else if (TARGET_OS_WATCH)
...@@ -1529,7 +1557,7 @@ void DumpProcessMap() {...@@ -1529,7 +1557,7 @@ void DumpProcessMap() {
1529 Printf("End of module map.\n");1557 Printf("End of module map.\n");
1530}1558}
15311559
1532void CheckNoDeepBind(const char *filename, int flag) {1560void OnDlOpen(const char* filename, int flag) {
1533 // Do nothing.1561 // Do nothing.
1534}1562}
15351563
lib/libtsan/sanitizer_common/sanitizer_netbsd.cpp+4
...@@ -126,6 +126,10 @@ uptr internal_close(fd_t fd) {...@@ -126,6 +126,10 @@ uptr internal_close(fd_t fd) {
126 return _sys_close(fd);126 return _sys_close(fd);
127}127}
128128
129uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {
130 return -1; // Not supported.
131}
132
129uptr internal_open(const char *filename, int flags) {133uptr internal_open(const char *filename, int flags) {
130 CHECK(&_sys_open);134 CHECK(&_sys_open);
131 return _sys_open(filename, flags);135 return _sys_open(filename, flags);
lib/libtsan/sanitizer_common/sanitizer_platform.h+33-2
...@@ -15,7 +15,8 @@...@@ -15,7 +15,8 @@
15#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \15#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
16 !defined(__APPLE__) && !defined(_WIN32) && !defined(__Fuchsia__) && \16 !defined(__APPLE__) && !defined(_WIN32) && !defined(__Fuchsia__) && \
17 !(defined(__sun__) && defined(__svr4__)) && !defined(__HAIKU__) && \17 !(defined(__sun__) && defined(__svr4__)) && !defined(__HAIKU__) && \
18 !defined(__wasi__)18 !defined(__wasi__) && !defined(__NVPTX__) && !defined(__AMDGPU__) && \
19 !defined(__SPIRV__) && !defined(_AIX)
19# error "This operating system is not supported"20# error "This operating system is not supported"
20#endif21#endif
2122
...@@ -32,6 +33,12 @@...@@ -32,6 +33,12 @@
32# define SANITIZER_LINUX 033# define SANITIZER_LINUX 0
33#endif34#endif
3435
36#if defined(_AIX)
37# define SANITIZER_AIX 1
38#else
39# define SANITIZER_AIX 0
40#endif
41
35#if defined(__GLIBC__)42#if defined(__GLIBC__)
36# define SANITIZER_GLIBC 143# define SANITIZER_GLIBC 1
37#else44#else
...@@ -151,7 +158,7 @@...@@ -151,7 +158,7 @@
151158
152#define SANITIZER_POSIX \159#define SANITIZER_POSIX \
153 (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_APPLE || \160 (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_APPLE || \
154 SANITIZER_NETBSD || SANITIZER_SOLARIS || SANITIZER_HAIKU)161 SANITIZER_NETBSD || SANITIZER_SOLARIS || SANITIZER_HAIKU || SANITIZER_AIX)
155162
156#if __LP64__ || defined(_WIN64)163#if __LP64__ || defined(_WIN64)
157# define SANITIZER_WORDSIZE 64164# define SANITIZER_WORDSIZE 64
...@@ -302,6 +309,30 @@...@@ -302,6 +309,30 @@
302# define SANITIZER_LOONGARCH64 0309# define SANITIZER_LOONGARCH64 0
303#endif310#endif
304311
312#if defined(__alpha__)
313# define SANITIZER_ALPHA 1
314#else
315# define SANITIZER_ALPHA 0
316#endif
317
318#if defined(__AMDGPU__)
319# define SANITIZER_AMDGPU 1
320#else
321# define SANITIZER_AMDGPU 0
322#endif
323
324#if defined(__NVPTX__)
325# define SANITIZER_NVPTX 1
326#else
327# define SANITIZER_NVPTX 0
328#endif
329
330#if defined(__SPIRV__)
331# define SANITIZER_SPIRV 1
332#else
333# define SANITIZER_SPIRV 0
334#endif
335
305// By default we allow to use SizeClassAllocator64 on 64-bit platform.336// By default we allow to use SizeClassAllocator64 on 64-bit platform.
306// But in some cases SizeClassAllocator64 does not work well and we need to337// But in some cases SizeClassAllocator64 does not work well and we need to
307// fallback to SizeClassAllocator32.338// fallback to SizeClassAllocator32.
lib/libtsan/sanitizer_common/sanitizer_platform_interceptors.h+6-1
...@@ -201,6 +201,9 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,...@@ -201,6 +201,9 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
201201
202#define SANITIZER_INTERCEPT_READ SI_POSIX202#define SANITIZER_INTERCEPT_READ SI_POSIX
203#define SANITIZER_INTERCEPT_PREAD SI_POSIX203#define SANITIZER_INTERCEPT_PREAD SI_POSIX
204#define SANITIZER_INTERCEPT___READ_CHK SI_GLIBC
205#define SANITIZER_INTERCEPT___PREAD_CHK SI_GLIBC
206#define SANITIZER_INTERCEPT___PREAD64_CHK SI_GLIBC
204#define SANITIZER_INTERCEPT_WRITE SI_POSIX207#define SANITIZER_INTERCEPT_WRITE SI_POSIX
205#define SANITIZER_INTERCEPT_PWRITE SI_POSIX208#define SANITIZER_INTERCEPT_PWRITE SI_POSIX
206209
...@@ -393,6 +396,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,...@@ -393,6 +396,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
393#define SANITIZER_INTERCEPT_SHMCTL \396#define SANITIZER_INTERCEPT_SHMCTL \
394 (((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && SANITIZER_WORDSIZE == 64) || \397 (((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && SANITIZER_WORDSIZE == 64) || \
395 SI_NETBSD || SI_SOLARIS)398 SI_NETBSD || SI_SOLARIS)
399// shmat calls REAL(shmctl), so it requires shmctl interception.
400#define SANITIZER_INTERCEPT_SHMAT SANITIZER_INTERCEPT_SHMCTL
396#define SANITIZER_INTERCEPT_RANDOM_R SI_GLIBC401#define SANITIZER_INTERCEPT_RANDOM_R SI_GLIBC
397#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX402#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX
398#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED \403#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED \
...@@ -545,7 +550,7 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,...@@ -545,7 +550,7 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
545#define SANITIZER_INTERCEPT___LIBC_MEMALIGN SI_GLIBC550#define SANITIZER_INTERCEPT___LIBC_MEMALIGN SI_GLIBC
546#define SANITIZER_INTERCEPT_PVALLOC (SI_GLIBC || SI_ANDROID)551#define SANITIZER_INTERCEPT_PVALLOC (SI_GLIBC || SI_ANDROID)
547#define SANITIZER_INTERCEPT_CFREE (SI_GLIBC && !SANITIZER_RISCV64)552#define SANITIZER_INTERCEPT_CFREE (SI_GLIBC && !SANITIZER_RISCV64)
548#define SANITIZER_INTERCEPT_REALLOCARRAY SI_POSIX553#define SANITIZER_INTERCEPT_REALLOCARRAY (SI_POSIX || SI_FUCHSIA)
549#define SANITIZER_INTERCEPT_ALIGNED_ALLOC \554#define SANITIZER_INTERCEPT_ALIGNED_ALLOC \
550 (!SI_MAC || SI_MAC_SDK_10_15_AVAILABLE)555 (!SI_MAC || SI_MAC_SDK_10_15_AVAILABLE)
551#define SANITIZER_INTERCEPT_MALLOC_USABLE_SIZE (!SI_MAC && !SI_NETBSD)556#define SANITIZER_INTERCEPT_MALLOC_USABLE_SIZE (!SI_MAC && !SI_NETBSD)
lib/libtsan/sanitizer_common/sanitizer_platform_limits_linux.cpp+1-1
...@@ -60,7 +60,7 @@ using namespace __sanitizer;...@@ -60,7 +60,7 @@ using namespace __sanitizer;
60# if !defined(__powerpc64__) && !defined(__x86_64__) && \60# if !defined(__powerpc64__) && !defined(__x86_64__) && \
61 !defined(__aarch64__) && !defined(__mips__) && !defined(__s390__) && \61 !defined(__aarch64__) && !defined(__mips__) && !defined(__s390__) && \
62 !defined(__sparc__) && !defined(__riscv) && !defined(__hexagon__) && \62 !defined(__sparc__) && !defined(__riscv) && !defined(__hexagon__) && \
63 !defined(__loongarch__)63 !defined(__loongarch__) && !defined(__alpha__)
64COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat));64COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat));
65#endif65#endif
6666
lib/libtsan/sanitizer_common/sanitizer_platform_limits_posix.cpp+57-25
...@@ -24,7 +24,7 @@...@@ -24,7 +24,7 @@
24// Must go after undef _FILE_OFFSET_BITS.24// Must go after undef _FILE_OFFSET_BITS.
25#include "sanitizer_platform.h"25#include "sanitizer_platform.h"
2626
27#if SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU27#if SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU || SANITIZER_AIX
28// Must go after undef _FILE_OFFSET_BITS.28// Must go after undef _FILE_OFFSET_BITS.
29#include "sanitizer_glibc_version.h"29#include "sanitizer_glibc_version.h"
3030
...@@ -61,11 +61,11 @@...@@ -61,11 +61,11 @@
61#endif61#endif
6262
63#if !SANITIZER_ANDROID63#if !SANITIZER_ANDROID
64#if !SANITIZER_HAIKU64# if !SANITIZER_HAIKU && !SANITIZER_AIX
65#include <sys/mount.h>65# include <sys/mount.h>
66#endif66# endif
67#include <sys/timeb.h>67# include <sys/timeb.h>
68#include <utmpx.h>68# include <utmpx.h>
69#endif69#endif
7070
71#if SANITIZER_LINUX71#if SANITIZER_LINUX
...@@ -113,11 +113,15 @@ typedef struct user_fpregs elf_fpregset_t;...@@ -113,11 +113,15 @@ typedef struct user_fpregs elf_fpregset_t;
113#endif113#endif
114114
115#if !SANITIZER_ANDROID115#if !SANITIZER_ANDROID
116#include <ifaddrs.h>116# if !SANITIZER_AIX
117#if !SANITIZER_HAIKU117# include <ifaddrs.h>
118#include <sys/ucontext.h>118# else
119#include <wordexp.h>119# include <netinet/in.h>
120#endif120# endif
121# if !SANITIZER_HAIKU
122# include <sys/ucontext.h>
123# include <wordexp.h>
124# endif
121#endif125#endif
122126
123#if SANITIZER_LINUX127#if SANITIZER_LINUX
...@@ -182,6 +186,17 @@ typedef struct user_fpregs elf_fpregset_t;...@@ -182,6 +186,17 @@ typedef struct user_fpregs elf_fpregset_t;
182#include <sys/ioctl.h>186#include <sys/ioctl.h>
183#endif187#endif
184188
189# if SANITIZER_AIX
190# include <netinet/ip_mroute.h>
191# include <stropts.h>
192# include <sys/ioctl.h>
193# include <sys/statfs.h>
194# include <unistd.h>
195# if HAVE_RPC_XDR_H
196# include <tirpc/rpc/xdr.h>
197# endif
198# endif
199
185// Include these after system headers to avoid name clashes and ambiguities.200// Include these after system headers to avoid name clashes and ambiguities.
186# include "sanitizer_common.h"201# include "sanitizer_common.h"
187# include "sanitizer_internal_defs.h"202# include "sanitizer_internal_defs.h"
...@@ -293,7 +308,7 @@ namespace __sanitizer {...@@ -293,7 +308,7 @@ namespace __sanitizer {
293#define SIZEOF_STRUCT_USTAT 32308#define SIZEOF_STRUCT_USTAT 32
294# elif defined(__arm__) || defined(__i386__) || defined(__mips__) || \309# elif defined(__arm__) || defined(__i386__) || defined(__mips__) || \
295 defined(__powerpc__) || defined(__s390__) || defined(__sparc__) || \310 defined(__powerpc__) || defined(__s390__) || defined(__sparc__) || \
296 defined(__hexagon__)311 defined(__hexagon__) || defined(__alpha__)
297# define SIZEOF_STRUCT_USTAT 20312# define SIZEOF_STRUCT_USTAT 20
298# elif defined(__loongarch__)313# elif defined(__loongarch__)
299 // Not used. The minimum Glibc version available for LoongArch is 2.36314 // Not used. The minimum Glibc version available for LoongArch is 2.36
...@@ -305,9 +320,12 @@ namespace __sanitizer {...@@ -305,9 +320,12 @@ namespace __sanitizer {
305 unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;320 unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
306 unsigned struct_rlimit64_sz = sizeof(struct rlimit64);321 unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
307 unsigned struct_statvfs64_sz = sizeof(struct statvfs64);322 unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
308#endif // SANITIZER_GLIBC323# elif SANITIZER_MUSL
324 // On musl, rlimit64 is an alias for rlimit.
325 unsigned struct_rlimit64_sz = sizeof(struct rlimit);
326# endif // SANITIZER_GLIBC
309327
310#if SANITIZER_LINUX && !SANITIZER_ANDROID328# if SANITIZER_LINUX && !SANITIZER_ANDROID
311 unsigned struct_timex_sz = sizeof(struct timex);329 unsigned struct_timex_sz = sizeof(struct timex);
312 unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds);330 unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds);
313 unsigned struct_mq_attr_sz = sizeof(struct mq_attr);331 unsigned struct_mq_attr_sz = sizeof(struct mq_attr);
...@@ -556,13 +574,13 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -556,13 +574,13 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
556 const unsigned IOCTL_NOT_PRESENT = 0;574 const unsigned IOCTL_NOT_PRESENT = 0;
557575
558 unsigned IOCTL_FIONBIO = FIONBIO;576 unsigned IOCTL_FIONBIO = FIONBIO;
559#if !SANITIZER_HAIKU577# if !SANITIZER_HAIKU
560 unsigned IOCTL_FIOASYNC = FIOASYNC;578 unsigned IOCTL_FIOASYNC = FIOASYNC;
561 unsigned IOCTL_FIOCLEX = FIOCLEX;579 unsigned IOCTL_FIOCLEX = FIOCLEX;
562 unsigned IOCTL_FIOGETOWN = FIOGETOWN;580 unsigned IOCTL_FIOGETOWN = FIOGETOWN;
563 unsigned IOCTL_FIONCLEX = FIONCLEX;581 unsigned IOCTL_FIONCLEX = FIONCLEX;
564 unsigned IOCTL_FIOSETOWN = FIOSETOWN;582 unsigned IOCTL_FIOSETOWN = FIOSETOWN;
565#endif583# endif
566 unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI;584 unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI;
567 unsigned IOCTL_SIOCATMARK = SIOCATMARK;585 unsigned IOCTL_SIOCATMARK = SIOCATMARK;
568 unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI;586 unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI;
...@@ -584,14 +602,14 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -584,14 +602,14 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
584 unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK;602 unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK;
585 unsigned IOCTL_SIOCSPGRP = SIOCSPGRP;603 unsigned IOCTL_SIOCSPGRP = SIOCSPGRP;
586604
587#if !SANITIZER_HAIKU605# if !SANITIZER_HAIKU
588 unsigned IOCTL_TIOCCONS = TIOCCONS;606 unsigned IOCTL_TIOCCONS = TIOCCONS;
589 unsigned IOCTL_TIOCGETD = TIOCGETD;607 unsigned IOCTL_TIOCGETD = TIOCGETD;
590 unsigned IOCTL_TIOCNOTTY = TIOCNOTTY;608 unsigned IOCTL_TIOCNOTTY = TIOCNOTTY;
591 unsigned IOCTL_TIOCPKT = TIOCPKT;609 unsigned IOCTL_TIOCPKT = TIOCPKT;
592 unsigned IOCTL_TIOCSETD = TIOCSETD;610 unsigned IOCTL_TIOCSETD = TIOCSETD;
593 unsigned IOCTL_TIOCSTI = TIOCSTI;611 unsigned IOCTL_TIOCSTI = TIOCSTI;
594#endif612# endif
595613
596 unsigned IOCTL_TIOCEXCL = TIOCEXCL;614 unsigned IOCTL_TIOCEXCL = TIOCEXCL;
597 unsigned IOCTL_TIOCGPGRP = TIOCGPGRP;615 unsigned IOCTL_TIOCGPGRP = TIOCGPGRP;
...@@ -602,10 +620,12 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);...@@ -602,10 +620,12 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
602 unsigned IOCTL_TIOCMSET = TIOCMSET;620 unsigned IOCTL_TIOCMSET = TIOCMSET;
603 unsigned IOCTL_TIOCNXCL = TIOCNXCL;621 unsigned IOCTL_TIOCNXCL = TIOCNXCL;
604 unsigned IOCTL_TIOCOUTQ = TIOCOUTQ;622 unsigned IOCTL_TIOCOUTQ = TIOCOUTQ;
623# if !SANITIZER_AIX
605 unsigned IOCTL_TIOCSCTTY = TIOCSCTTY;624 unsigned IOCTL_TIOCSCTTY = TIOCSCTTY;
625# endif
606 unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;626 unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;
607 unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;627 unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;
608#if SANITIZER_LINUX && !SANITIZER_ANDROID628# if SANITIZER_LINUX && !SANITIZER_ANDROID
609 unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;629 unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;
610 unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT;630 unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT;
611#endif631#endif
...@@ -1067,6 +1087,9 @@ CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);...@@ -1067,6 +1087,9 @@ CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
1067CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen);1087CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen);
1068CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname);1088CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname);
1069CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr);1089CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr);
1090# if SANITIZER_AIX
1091CHECK_SIZE_AND_OFFSET(addrinfo, ai_eflags);
1092# endif
10701093
1071CHECK_TYPE_SIZE(hostent);1094CHECK_TYPE_SIZE(hostent);
1072CHECK_SIZE_AND_OFFSET(hostent, h_name);1095CHECK_SIZE_AND_OFFSET(hostent, h_name);
...@@ -1113,11 +1136,13 @@ COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));...@@ -1113,11 +1136,13 @@ COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
1113CHECK_SIZE_AND_OFFSET(dirent, d_ino);1136CHECK_SIZE_AND_OFFSET(dirent, d_ino);
1114#if SANITIZER_APPLE1137#if SANITIZER_APPLE
1115CHECK_SIZE_AND_OFFSET(dirent, d_seekoff);1138CHECK_SIZE_AND_OFFSET(dirent, d_seekoff);
1116#elif SANITIZER_FREEBSD || SANITIZER_HAIKU1139# elif SANITIZER_AIX
1140CHECK_SIZE_AND_OFFSET(dirent, d_offset);
1141# elif SANITIZER_FREEBSD || SANITIZER_HAIKU
1117// There is no 'd_off' field on FreeBSD.1142// There is no 'd_off' field on FreeBSD.
1118#else1143# else
1119CHECK_SIZE_AND_OFFSET(dirent, d_off);1144CHECK_SIZE_AND_OFFSET(dirent, d_off);
1120#endif1145# endif
1121CHECK_SIZE_AND_OFFSET(dirent, d_reclen);1146CHECK_SIZE_AND_OFFSET(dirent, d_reclen);
11221147
1123#if SANITIZER_GLIBC1148#if SANITIZER_GLIBC
...@@ -1151,7 +1176,8 @@ CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_mask);...@@ -1151,7 +1176,8 @@ CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_mask);
1151// didn't exist.1176// didn't exist.
1152CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_flags);1177CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_flags);
1153#endif1178#endif
1154#if SANITIZER_LINUX && (!SANITIZER_ANDROID || !SANITIZER_MIPS32)1179# if SANITIZER_LINUX && (!SANITIZER_ANDROID || !SANITIZER_MIPS32) && \
1180 !defined(__alpha__)
1155CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_restorer);1181CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_restorer);
1156#endif1182#endif
11571183
...@@ -1192,6 +1218,10 @@ CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc);...@@ -1192,6 +1218,10 @@ CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc);
1192CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv);1218CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv);
1193CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs);1219CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs);
1194#endif1220#endif
1221# if SANITIZER_AIX
1222CHECK_SIZE_AND_OFFSET(wordexp_t, we_sflags);
1223CHECK_SIZE_AND_OFFSET(wordexp_t, we_soffs);
1224# endif
11951225
1196CHECK_TYPE_SIZE(tm);1226CHECK_TYPE_SIZE(tm);
1197CHECK_SIZE_AND_OFFSET(tm, tm_sec);1227CHECK_SIZE_AND_OFFSET(tm, tm_sec);
...@@ -1203,10 +1233,12 @@ CHECK_SIZE_AND_OFFSET(tm, tm_year);...@@ -1203,10 +1233,12 @@ CHECK_SIZE_AND_OFFSET(tm, tm_year);
1203CHECK_SIZE_AND_OFFSET(tm, tm_wday);1233CHECK_SIZE_AND_OFFSET(tm, tm_wday);
1204CHECK_SIZE_AND_OFFSET(tm, tm_yday);1234CHECK_SIZE_AND_OFFSET(tm, tm_yday);
1205CHECK_SIZE_AND_OFFSET(tm, tm_isdst);1235CHECK_SIZE_AND_OFFSET(tm, tm_isdst);
1236# if !SANITIZER_AIX
1206CHECK_SIZE_AND_OFFSET(tm, tm_gmtoff);1237CHECK_SIZE_AND_OFFSET(tm, tm_gmtoff);
1207CHECK_SIZE_AND_OFFSET(tm, tm_zone);1238CHECK_SIZE_AND_OFFSET(tm, tm_zone);
1239# endif
12081240
1209#if SANITIZER_LINUX1241# if SANITIZER_LINUX
1210CHECK_TYPE_SIZE(mntent);1242CHECK_TYPE_SIZE(mntent);
1211CHECK_SIZE_AND_OFFSET(mntent, mnt_fsname);1243CHECK_SIZE_AND_OFFSET(mntent, mnt_fsname);
1212CHECK_SIZE_AND_OFFSET(mntent, mnt_dir);1244CHECK_SIZE_AND_OFFSET(mntent, mnt_dir);
...@@ -1256,7 +1288,7 @@ CHECK_TYPE_SIZE(clock_t);...@@ -1256,7 +1288,7 @@ CHECK_TYPE_SIZE(clock_t);
1256CHECK_TYPE_SIZE(clockid_t);1288CHECK_TYPE_SIZE(clockid_t);
1257#endif1289#endif
12581290
1259#if !SANITIZER_ANDROID && !SANITIZER_HAIKU1291# if !SANITIZER_ANDROID && !SANITIZER_HAIKU && !SANITIZER_AIX
1260CHECK_TYPE_SIZE(ifaddrs);1292CHECK_TYPE_SIZE(ifaddrs);
1261CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next);1293CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next);
1262CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name);1294CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name);
lib/libtsan/sanitizer_common/sanitizer_platform_limits_posix.h+69-13
...@@ -14,7 +14,7 @@...@@ -14,7 +14,7 @@
14#ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H14#ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
15#define SANITIZER_PLATFORM_LIMITS_POSIX_H15#define SANITIZER_PLATFORM_LIMITS_POSIX_H
1616
17#if SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU17#if SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU || SANITIZER_AIX
1818
19# include "sanitizer_internal_defs.h"19# include "sanitizer_internal_defs.h"
20# include "sanitizer_mallinfo.h"20# include "sanitizer_mallinfo.h"
...@@ -29,7 +29,7 @@...@@ -29,7 +29,7 @@
29# define SANITIZER_HAS_STAT64 029# define SANITIZER_HAS_STAT64 0
30# define SANITIZER_HAS_STATFS64 030# define SANITIZER_HAS_STATFS64 0
31# endif31# endif
32# elif SANITIZER_GLIBC || SANITIZER_ANDROID32# elif SANITIZER_GLIBC || SANITIZER_ANDROID || SANITIZER_AIX
33# define SANITIZER_HAS_STAT64 133# define SANITIZER_HAS_STAT64 1
34# define SANITIZER_HAS_STATFS64 134# define SANITIZER_HAS_STATFS64 1
35# elif SANITIZER_HAIKU35# elif SANITIZER_HAIKU
...@@ -103,9 +103,15 @@ const unsigned struct_kernel_stat64_sz = 104;...@@ -103,9 +103,15 @@ const unsigned struct_kernel_stat64_sz = 104;
103const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID103const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
104 ? FIRST_32_SECOND_64(104, 128)104 ? FIRST_32_SECOND_64(104, 128)
105# if defined(_ABIN32) && _MIPS_SIM == _ABIN32105# if defined(_ABIN32) && _MIPS_SIM == _ABIN32
106# if defined(_TIME_BITS) && _TIME_BITS == 64
107 : FIRST_32_SECOND_64(112, 216);
108# else
106 : FIRST_32_SECOND_64(176, 216);109 : FIRST_32_SECOND_64(176, 216);
110# endif
107# elif SANITIZER_MUSL111# elif SANITIZER_MUSL
108 : FIRST_32_SECOND_64(160, 208);112 : FIRST_32_SECOND_64(160, 208);
113# elif defined(_TIME_BITS) && _TIME_BITS == 64
114 : FIRST_32_SECOND_64(112, 216);
109# else115# else
110 : FIRST_32_SECOND_64(160, 216);116 : FIRST_32_SECOND_64(160, 216);
111# endif117# endif
...@@ -133,6 +139,9 @@ const unsigned struct_kernel_stat64_sz = 0;...@@ -133,6 +139,9 @@ const unsigned struct_kernel_stat64_sz = 0;
133# elif defined(__loongarch__)139# elif defined(__loongarch__)
134const unsigned struct_kernel_stat_sz = 128;140const unsigned struct_kernel_stat_sz = 128;
135const unsigned struct_kernel_stat64_sz = 0;141const unsigned struct_kernel_stat64_sz = 0;
142# elif defined(__alpha__)
143const unsigned struct_kernel_stat_sz = 80;
144const unsigned struct_kernel_stat64_sz = 136;
136# endif145# endif
137struct __sanitizer_perf_event_attr {146struct __sanitizer_perf_event_attr {
138 unsigned type;147 unsigned type;
...@@ -323,7 +332,7 @@ struct __sanitizer_iovec {...@@ -323,7 +332,7 @@ struct __sanitizer_iovec {
323 usize iov_len;332 usize iov_len;
324};333};
325334
326# if !SANITIZER_ANDROID335# if !SANITIZER_ANDROID && !SANITIZER_AIX
327struct __sanitizer_ifaddrs {336struct __sanitizer_ifaddrs {
328 struct __sanitizer_ifaddrs *ifa_next;337 struct __sanitizer_ifaddrs *ifa_next;
329 char *ifa_name;338 char *ifa_name;
...@@ -337,7 +346,7 @@ struct __sanitizer_ifaddrs {...@@ -337,7 +346,7 @@ struct __sanitizer_ifaddrs {
337 void *ifa_dstaddr; // (struct sockaddr *)346 void *ifa_dstaddr; // (struct sockaddr *)
338 void *ifa_data;347 void *ifa_data;
339};348};
340# endif // !SANITIZER_ANDROID349# endif // !SANITIZER_ANDROID && !SANITIZER_AIX
341350
342# if SANITIZER_APPLE351# if SANITIZER_APPLE
343typedef unsigned long __sanitizer_pthread_key_t;352typedef unsigned long __sanitizer_pthread_key_t;
...@@ -345,7 +354,7 @@ typedef unsigned long __sanitizer_pthread_key_t;...@@ -345,7 +354,7 @@ typedef unsigned long __sanitizer_pthread_key_t;
345typedef unsigned __sanitizer_pthread_key_t;354typedef unsigned __sanitizer_pthread_key_t;
346# endif355# endif
347356
348# if SANITIZER_LINUX && !SANITIZER_ANDROID357# if (SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_AIX
349358
350struct __sanitizer_XDR {359struct __sanitizer_XDR {
351 int x_op;360 int x_op;
...@@ -440,12 +449,14 @@ struct __sanitizer_tm {...@@ -440,12 +449,14 @@ struct __sanitizer_tm {
440 int tm_wday;449 int tm_wday;
441 int tm_yday;450 int tm_yday;
442 int tm_isdst;451 int tm_isdst;
443# if SANITIZER_HAIKU452# if !SANITIZER_AIX
453# if SANITIZER_HAIKU
444 int tm_gmtoff;454 int tm_gmtoff;
445# else455# else
446 long int tm_gmtoff;456 long int tm_gmtoff;
447# endif457# endif
448 const char *tm_zone;458 const char *tm_zone;
459# endif
449};460};
450461
451# if SANITIZER_LINUX462# if SANITIZER_LINUX
...@@ -513,11 +524,19 @@ struct __sanitizer_msghdr {...@@ -513,11 +524,19 @@ struct __sanitizer_msghdr {
513 struct __sanitizer_iovec *msg_iov;524 struct __sanitizer_iovec *msg_iov;
514 uptr msg_iovlen;525 uptr msg_iovlen;
515 void *msg_control;526 void *msg_control;
527# if !SANITIZER_AIX
516 uptr msg_controllen;528 uptr msg_controllen;
529# else
530 unsigned msg_controllen;
531# endif
517 int msg_flags;532 int msg_flags;
518};533};
519struct __sanitizer_cmsghdr {534struct __sanitizer_cmsghdr {
535# if !SANITIZER_AIX
520 uptr cmsg_len;536 uptr cmsg_len;
537# else
538 unsigned cmsg_len;
539# endif
521 int cmsg_level;540 int cmsg_level;
522 int cmsg_type;541 int cmsg_type;
523};542};
...@@ -554,10 +573,23 @@ struct __sanitizer_dirent {...@@ -554,10 +573,23 @@ struct __sanitizer_dirent {
554 unsigned short d_reclen;573 unsigned short d_reclen;
555 // more fields that we don't care about574 // more fields that we don't care about
556};575};
576# elif defined(__alpha__)
577struct __sanitizer_dirent {
578 unsigned int d_ino; // ino_t is 32-bit on Alpha
579 int __pad; // explicit padding before d_off
580 unsigned long d_off;
581 unsigned short d_reclen;
582 // more fields that we don't care about
583};
557# else584# else
558struct __sanitizer_dirent {585struct __sanitizer_dirent {
586# if SANITIZER_AIX
587 uptr d_offset;
588 uptr d_ino;
589# else
559 uptr d_ino;590 uptr d_ino;
560 uptr d_off;591 uptr d_off;
592# endif
561 unsigned short d_reclen;593 unsigned short d_reclen;
562 // more fields that we don't care about594 // more fields that we don't care about
563};595};
...@@ -573,7 +605,7 @@ struct __sanitizer_dirent64 {...@@ -573,7 +605,7 @@ struct __sanitizer_dirent64 {
573extern unsigned struct_sock_fprog_sz;605extern unsigned struct_sock_fprog_sz;
574# endif606# endif
575607
576# if SANITIZER_HAIKU608# if SANITIZER_HAIKU || SANITIZER_AIX
577typedef int __sanitizer_clock_t;609typedef int __sanitizer_clock_t;
578# elif defined(__x86_64__) && !defined(_LP64)610# elif defined(__x86_64__) && !defined(_LP64)
579typedef long long __sanitizer_clock_t;611typedef long long __sanitizer_clock_t;
...@@ -581,8 +613,10 @@ typedef long long __sanitizer_clock_t;...@@ -581,8 +613,10 @@ typedef long long __sanitizer_clock_t;
581typedef long __sanitizer_clock_t;613typedef long __sanitizer_clock_t;
582# endif614# endif
583615
584# if SANITIZER_LINUX || SANITIZER_HAIKU616# if SANITIZER_LINUX || SANITIZER_HAIKU || SANITIZER_AIX
585typedef int __sanitizer_clockid_t;617typedef int __sanitizer_clockid_t;
618# endif
619# if SANITIZER_LINUX || SANITIZER_HAIKU
586typedef unsigned long long __sanitizer_eventfd_t;620typedef unsigned long long __sanitizer_eventfd_t;
587# endif621# endif
588622
...@@ -637,6 +671,14 @@ struct __sanitizer_sigset_t {...@@ -637,6 +671,14 @@ struct __sanitizer_sigset_t {
637 // The size is determined by looking at sizeof of real sigset_t on linux.671 // The size is determined by looking at sizeof of real sigset_t on linux.
638 uptr val[128 / sizeof(uptr)];672 uptr val[128 / sizeof(uptr)];
639};673};
674# elif SANITIZER_AIX
675struct __sanitizer_sigset_t {
676# if SANITIZER_WORDSIZE == 64
677 uptr val[4];
678# else
679 uptr val[2];
680# endif
681};
640# endif682# endif
641683
642struct __sanitizer_siginfo_pad {684struct __sanitizer_siginfo_pad {
...@@ -741,7 +783,7 @@ struct __sanitizer_sigaction {...@@ -741,7 +783,7 @@ struct __sanitizer_sigaction {
741# endif783# endif
742# endif784# endif
743# endif785# endif
744# if SANITIZER_LINUX || SANITIZER_HAIKU786# if (SANITIZER_LINUX || SANITIZER_HAIKU) && !defined(__alpha__)
745 void (*sa_restorer)();787 void (*sa_restorer)();
746# endif788# endif
747# if defined(__mips__) && (SANITIZER_WORDSIZE == 32) && !SANITIZER_MUSL789# if defined(__mips__) && (SANITIZER_WORDSIZE == 32) && !SANITIZER_MUSL
...@@ -828,8 +870,12 @@ struct __sanitizer_addrinfo {...@@ -828,8 +870,12 @@ struct __sanitizer_addrinfo {
828 int ai_family;870 int ai_family;
829 int ai_socktype;871 int ai_socktype;
830 int ai_protocol;872 int ai_protocol;
831# if SANITIZER_ANDROID || SANITIZER_APPLE || SANITIZER_HAIKU873# if SANITIZER_ANDROID || SANITIZER_APPLE || SANITIZER_HAIKU || SANITIZER_AIX
874# if SANITIZER_AIX // AIX ai_addrlen type is size_t
875 uptr ai_addrlen;
876# else
832 unsigned ai_addrlen;877 unsigned ai_addrlen;
878# endif
833 char *ai_canonname;879 char *ai_canonname;
834 void *ai_addr;880 void *ai_addr;
835# else // LINUX881# else // LINUX
...@@ -838,6 +884,9 @@ struct __sanitizer_addrinfo {...@@ -838,6 +884,9 @@ struct __sanitizer_addrinfo {
838 char *ai_canonname;884 char *ai_canonname;
839# endif885# endif
840 struct __sanitizer_addrinfo *ai_next;886 struct __sanitizer_addrinfo *ai_next;
887# if SANITIZER_AIX
888 int ai_eflags;
889# endif
841};890};
842891
843struct __sanitizer_hostent {892struct __sanitizer_hostent {
...@@ -854,7 +903,7 @@ struct __sanitizer_pollfd {...@@ -854,7 +903,7 @@ struct __sanitizer_pollfd {
854 short revents;903 short revents;
855};904};
856905
857# if SANITIZER_ANDROID || SANITIZER_APPLE906# if SANITIZER_ANDROID || SANITIZER_APPLE || SANITIZER_AIX
858typedef unsigned __sanitizer_nfds_t;907typedef unsigned __sanitizer_nfds_t;
859# else908# else
860typedef unsigned long __sanitizer_nfds_t;909typedef unsigned long __sanitizer_nfds_t;
...@@ -892,6 +941,10 @@ struct __sanitizer_wordexp_t {...@@ -892,6 +941,10 @@ struct __sanitizer_wordexp_t {
892 uptr we_wordc;941 uptr we_wordc;
893 char **we_wordv;942 char **we_wordv;
894 uptr we_offs;943 uptr we_offs;
944# if SANITIZER_AIX
945 int we_sflags;
946 uptr we_soffs;
947# endif
895};948};
896949
897# if SANITIZER_LINUX && !SANITIZER_ANDROID950# if SANITIZER_LINUX && !SANITIZER_ANDROID
...@@ -1023,7 +1076,7 @@ struct __sanitizer_cookie_io_functions_t {...@@ -1023,7 +1076,7 @@ struct __sanitizer_cookie_io_functions_t {
1023# define IOC_NRBITS 81076# define IOC_NRBITS 8
1024# define IOC_TYPEBITS 81077# define IOC_TYPEBITS 8
1025# if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) || \1078# if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) || \
1026 defined(__sparc__)1079 defined(__sparc__) || defined(__alpha__)
1027# define IOC_SIZEBITS 131080# define IOC_SIZEBITS 13
1028# define IOC_DIRBITS 31081# define IOC_DIRBITS 3
1029# define IOC_NONE 1U1082# define IOC_NONE 1U
...@@ -1193,7 +1246,9 @@ extern unsigned IOCTL_TIOCMGET;...@@ -1193,7 +1246,9 @@ extern unsigned IOCTL_TIOCMGET;
1193extern unsigned IOCTL_TIOCMSET;1246extern unsigned IOCTL_TIOCMSET;
1194extern unsigned IOCTL_TIOCNXCL;1247extern unsigned IOCTL_TIOCNXCL;
1195extern unsigned IOCTL_TIOCOUTQ;1248extern unsigned IOCTL_TIOCOUTQ;
1249# if !SANITIZER_AIX
1196extern unsigned IOCTL_TIOCSCTTY;1250extern unsigned IOCTL_TIOCSCTTY;
1251# endif
1197extern unsigned IOCTL_TIOCSPGRP;1252extern unsigned IOCTL_TIOCSPGRP;
1198extern unsigned IOCTL_TIOCSWINSZ;1253extern unsigned IOCTL_TIOCSWINSZ;
1199# if SANITIZER_LINUX && !SANITIZER_ANDROID1254# if SANITIZER_LINUX && !SANITIZER_ANDROID
...@@ -1593,6 +1648,7 @@ extern const int si_SEGV_ACCERR;...@@ -1593,6 +1648,7 @@ extern const int si_SEGV_ACCERR;
1593typedef void *__sanitizer_timer_t;1648typedef void *__sanitizer_timer_t;
1594# endif1649# endif
15951650
1596#endif // SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU1651#endif // SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU ||
1652 // SANITIZER_AIX
15971653
1598#endif1654#endif
lib/libtsan/sanitizer_common/sanitizer_platform_limits_solaris.cpp+1
...@@ -51,6 +51,7 @@...@@ -51,6 +51,7 @@
51#include <sys/timeb.h>51#include <sys/timeb.h>
52#include <sys/times.h>52#include <sys/times.h>
53#include <sys/types.h>53#include <sys/types.h>
54#include <sys/ucontext.h>
54#include <sys/utsname.h>55#include <sys/utsname.h>
55#include <termios.h>56#include <termios.h>
56#include <time.h>57#include <time.h>
lib/libtsan/sanitizer_common/sanitizer_posix.cpp+9-7
...@@ -27,12 +27,13 @@...@@ -27,12 +27,13 @@
27#include <signal.h>27#include <signal.h>
28#include <sys/mman.h>28#include <sys/mman.h>
2929
30#if SANITIZER_FREEBSD30# if SANITIZER_FREEBSD || SANITIZER_AIX
31// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before31// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before
32// that, it was never implemented. So just define it to zero.32// that, it was never implemented. So just define it to zero.
33#undef MAP_NORESERVE33// Similarly, AIX does not define MAP_NORESERVE.
34#define MAP_NORESERVE 034# undef MAP_NORESERVE
35#endif35# define MAP_NORESERVE 0
36# endif
3637
37namespace __sanitizer {38namespace __sanitizer {
3839
...@@ -357,9 +358,10 @@ int GetNamedMappingFd(const char *name, uptr size, int *flags) {...@@ -357,9 +358,10 @@ int GetNamedMappingFd(const char *name, uptr size, int *flags) {
357 if (!common_flags()->decorate_proc_maps || !name)358 if (!common_flags()->decorate_proc_maps || !name)
358 return -1;359 return -1;
359 char shmname[200];360 char shmname[200];
360 CHECK(internal_strlen(name) < sizeof(shmname) - 10);361 int len =
361 internal_snprintf(shmname, sizeof(shmname), "/dev/shm/%zu [%s]",362 internal_snprintf(shmname, sizeof(shmname), "/dev/shm/%zu.%llu [%s]",
362 internal_getpid(), name);363 internal_getpid(), GetTid(), name);
364 CHECK_LT(len, sizeof(shmname));
363 int o_cloexec = 0;365 int o_cloexec = 0;
364#if defined(O_CLOEXEC)366#if defined(O_CLOEXEC)
365 o_cloexec = O_CLOEXEC;367 o_cloexec = O_CLOEXEC;
lib/libtsan/sanitizer_common/sanitizer_posix.h+2-2
...@@ -28,9 +28,9 @@ namespace __sanitizer {...@@ -28,9 +28,9 @@ namespace __sanitizer {
28// Don't use directly, use __sanitizer::OpenFile() instead.28// Don't use directly, use __sanitizer::OpenFile() instead.
29uptr internal_open(const char *filename, int flags);29uptr internal_open(const char *filename, int flags);
30uptr internal_open(const char *filename, int flags, u32 mode);30uptr internal_open(const char *filename, int flags, u32 mode);
31# if SANITIZER_FREEBSD31// Closes all file descriptors from lowfd to highfd (inclusive).
32// Returns 0 on success or non-zero if not supported on this platform.
32uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags);33uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags);
33# endif
34uptr internal_close(fd_t fd);34uptr internal_close(fd_t fd);
3535
36uptr internal_read(fd_t fd, void *buf, uptr count);36uptr internal_read(fd_t fd, void *buf, uptr count);
lib/libtsan/sanitizer_common/sanitizer_posix_libcdep.cpp+12-9
...@@ -188,12 +188,13 @@ static uptr GetAltStackSize() {...@@ -188,12 +188,13 @@ static uptr GetAltStackSize() {
188 return SIGSTKSZ * 4;188 return SIGSTKSZ * 4;
189}189}
190190
191void SetAlternateSignalStack() {191void* SetAlternateSignalStack() {
192 stack_t altstack, oldstack;192 stack_t altstack, oldstack;
193 CHECK_EQ(0, sigaltstack(nullptr, &oldstack));193 CHECK_EQ(0, sigaltstack(nullptr, &oldstack));
194 // If the alternate stack is already in place, do nothing.194 // If the alternate stack is already in place, do nothing.
195 // Android always sets an alternate stack, but it's too small for us.195 // Android always sets an alternate stack, but it's too small for us.
196 if (!SANITIZER_ANDROID && !(oldstack.ss_flags & SS_DISABLE)) return;196 if (!SANITIZER_ANDROID && !(oldstack.ss_flags & SS_DISABLE))
197 return nullptr;
197 // TODO(glider): the mapped stack should have the MAP_STACK flag in the198 // TODO(glider): the mapped stack should have the MAP_STACK flag in the
198 // future. It is not required by man 2 sigaltstack now (they're using199 // future. It is not required by man 2 sigaltstack now (they're using
199 // malloc()).200 // malloc()).
...@@ -201,15 +202,18 @@ void SetAlternateSignalStack() {...@@ -201,15 +202,18 @@ void SetAlternateSignalStack() {
201 altstack.ss_sp = (char *)MmapOrDie(altstack.ss_size, __func__);202 altstack.ss_sp = (char *)MmapOrDie(altstack.ss_size, __func__);
202 altstack.ss_flags = 0;203 altstack.ss_flags = 0;
203 CHECK_EQ(0, sigaltstack(&altstack, nullptr));204 CHECK_EQ(0, sigaltstack(&altstack, nullptr));
205 return altstack.ss_sp;
204}206}
205207
206void UnsetAlternateSignalStack() {208void UnsetAlternateSignalStack(void* altstack_base) {
207 stack_t altstack, oldstack;209 stack_t altstack, oldstack;
208 altstack.ss_sp = nullptr;210 altstack.ss_sp = nullptr;
209 altstack.ss_flags = SS_DISABLE;211 altstack.ss_flags = SS_DISABLE;
210 altstack.ss_size = GetAltStackSize(); // Some sane value required on Darwin.212 altstack.ss_size = GetAltStackSize(); // Some sane value required on Darwin.
211 CHECK_EQ(0, sigaltstack(&altstack, &oldstack));213 CHECK_EQ(0, sigaltstack(&altstack, &oldstack));
212 UnmapOrDie(oldstack.ss_sp, oldstack.ss_size);214 if (altstack_base && altstack_base == oldstack.ss_sp) {
215 UnmapOrDie(oldstack.ss_sp, oldstack.ss_size);
216 }
213}217}
214218
215bool IsSignalHandlerFromSanitizer(int signum) {219bool IsSignalHandlerFromSanitizer(int signum) {
...@@ -562,11 +566,10 @@ pid_t StartSubprocess(const char *program, const char *const argv[],...@@ -562,11 +566,10 @@ pid_t StartSubprocess(const char *program, const char *const argv[],
562 internal_close(stderr_fd);566 internal_close(stderr_fd);
563 }567 }
564568
565# if SANITIZER_FREEBSD569 // Close all fds except stdin/stdout/stderr before exec.
566 internal_close_range(3, ~static_cast<fd_t>(0), 0);570 // Fallback to the loop if close_range is not supported.
567# else571 if (internal_close_range(3, ~static_cast<fd_t>(0), 0) != 0)
568 for (int fd = sysconf(_SC_OPEN_MAX); fd > 2; fd--) internal_close(fd);572 for (int fd = sysconf(_SC_OPEN_MAX); fd > 2; fd--) internal_close(fd);
569# endif
570573
571 internal_execve(program, const_cast<char **>(&argv[0]),574 internal_execve(program, const_cast<char **>(&argv[0]),
572 const_cast<char *const *>(envp));575 const_cast<char *const *>(envp));
lib/libtsan/sanitizer_common/sanitizer_redefine_builtins.h+17-5
...@@ -17,11 +17,23 @@...@@ -17,11 +17,23 @@
17// The asm hack only works with GCC and Clang.17// The asm hack only works with GCC and Clang.
18# if !defined(_WIN32) && !defined(_AIX) && !defined(__APPLE__)18# if !defined(_WIN32) && !defined(_AIX) && !defined(__APPLE__)
1919
20asm(R"(20# if defined(__hexagon__)
21 .set memcpy, __sanitizer_internal_memcpy21
22 .set memmove, __sanitizer_internal_memmove22# define SANITIZER_REDEFINE_BUILTIN_ASM(name) \
23 .set memset, __sanitizer_internal_memset23 asm(".set " #name ", __sanitizer_internal_" #name)
24 )");24
25# else
26
27# define SANITIZER_REDEFINE_BUILTIN_ASM(name) \
28 asm(#name " = __sanitizer_internal_" #name)
29
30# endif
31
32SANITIZER_REDEFINE_BUILTIN_ASM(memcpy);
33SANITIZER_REDEFINE_BUILTIN_ASM(memmove);
34SANITIZER_REDEFINE_BUILTIN_ASM(memset);
35
36# undef SANITIZER_REDEFINE_BUILTIN_ASM
2537
26# if defined(__cplusplus) && \38# if defined(__cplusplus) && \
27 !defined(SANITIZER_COMMON_REDEFINE_BUILTINS_IN_STD)39 !defined(SANITIZER_COMMON_REDEFINE_BUILTINS_IN_STD)
lib/libtsan/sanitizer_common/sanitizer_solaris.cpp+4
...@@ -102,6 +102,10 @@ uptr internal_open(const char *filename, int flags, u32 mode) {...@@ -102,6 +102,10 @@ uptr internal_open(const char *filename, int flags, u32 mode) {
102 return _REAL64(open)(filename, flags, mode);102 return _REAL64(open)(filename, flags, mode);
103}103}
104104
105uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {
106 return -1; // Not supported.
107}
108
105DECLARE__REAL_AND_INTERNAL(uptr, read, fd_t fd, void *buf, uptr count) {109DECLARE__REAL_AND_INTERNAL(uptr, read, fd_t fd, void *buf, uptr count) {
106 return _REAL(read)(fd, buf, count);110 return _REAL(read)(fd, buf, count);
107}111}
lib/libtsan/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp+11-3
...@@ -16,7 +16,8 @@...@@ -16,7 +16,8 @@
16#if SANITIZER_LINUX && \16#if SANITIZER_LINUX && \
17 (defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) || \17 (defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) || \
18 defined(__powerpc64__) || defined(__s390__) || defined(__i386__) || \18 defined(__powerpc64__) || defined(__s390__) || defined(__i386__) || \
19 defined(__arm__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64)19 defined(__arm__) || defined(__hexagon__) || SANITIZER_RISCV64 || \
20 SANITIZER_LOONGARCH64)
2021
21#include "sanitizer_stoptheworld.h"22#include "sanitizer_stoptheworld.h"
2223
...@@ -32,8 +33,8 @@...@@ -32,8 +33,8 @@
32#include <sys/uio.h> // for iovec33#include <sys/uio.h> // for iovec
33#include <elf.h> // for NT_PRSTATUS34#include <elf.h> // for NT_PRSTATUS
34#if (defined(__aarch64__) || defined(__powerpc64__) || \35#if (defined(__aarch64__) || defined(__powerpc64__) || \
35 SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \36 defined(__hexagon__) || SANITIZER_RISCV64 || \
36 !SANITIZER_ANDROID37 SANITIZER_LOONGARCH64) && !SANITIZER_ANDROID
37// GLIBC 2.20+ sys/user does not include asm/ptrace.h38// GLIBC 2.20+ sys/user does not include asm/ptrace.h
38# include <asm/ptrace.h>39# include <asm/ptrace.h>
39#endif40#endif
...@@ -613,6 +614,13 @@ typedef _user_regs_struct regs_struct;...@@ -613,6 +614,13 @@ typedef _user_regs_struct regs_struct;
613static constexpr uptr kExtraRegs[] = {0};614static constexpr uptr kExtraRegs[] = {0};
614#define ARCH_IOVEC_FOR_GETREGSET615#define ARCH_IOVEC_FOR_GETREGSET
615616
617#elif defined(__hexagon__)
618#include <asm/user.h>
619typedef struct user_regs_struct regs_struct;
620#define REG_SP r29
621static constexpr uptr kExtraRegs[] = {0};
622#define ARCH_IOVEC_FOR_GETREGSET
623
616#else624#else
617#error "Unsupported architecture"625#error "Unsupported architecture"
618#endif // SANITIZER_ANDROID && defined(__arm__)626#endif // SANITIZER_ANDROID && defined(__arm__)
lib/libtsan/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp+7-7
...@@ -475,6 +475,13 @@ static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {...@@ -475,6 +475,13 @@ static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {
475 return new (*allocator) Addr2LinePool(found_path, allocator);475 return new (*allocator) Addr2LinePool(found_path, allocator);
476 }476 }
477 }477 }
478
479# if SANITIZER_APPLE
480 Report(
481 "WARN: No external symbolizers found. Symbols may be missing or "
482 "unreliable.\n");
483 Report("HINT: Is PATH set? Does sandbox allow file-read of /usr/bin/atos?\n");
484# endif
478 return nullptr;485 return nullptr;
479# endif // SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH486# endif // SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH
480}487}
...@@ -509,13 +516,6 @@ static void ChooseSymbolizerTools(IntrusiveList<SymbolizerTool> *list,...@@ -509,13 +516,6 @@ static void ChooseSymbolizerTools(IntrusiveList<SymbolizerTool> *list,
509 }516 }
510517
511# if SANITIZER_APPLE518# if SANITIZER_APPLE
512 if (list->empty()) {
513 Report(
514 "WARN: No external symbolizers found. Symbols may be missing or "
515 "unreliable.\n");
516 Report(
517 "HINT: Is PATH set? Does sandbox allow file-read of /usr/bin/atos?\n");
518 }
519 VReport(2, "Using dladdr symbolizer.\n");519 VReport(2, "Using dladdr symbolizer.\n");
520 list->push_back(new (*allocator) DlAddrSymbolizer());520 list->push_back(new (*allocator) DlAddrSymbolizer());
521# endif // SANITIZER_APPLE521# endif // SANITIZER_APPLE
lib/libtsan/sanitizer_common/sanitizer_symbolizer_report.cpp+7-6
...@@ -184,7 +184,7 @@ static void MaybeReportNonExecRegion(uptr pc) {...@@ -184,7 +184,7 @@ static void MaybeReportNonExecRegion(uptr pc) {
184 MemoryMappedSegment segment;184 MemoryMappedSegment segment;
185 while (proc_maps.Next(&segment)) {185 while (proc_maps.Next(&segment)) {
186 if (pc >= segment.start && pc < segment.end && !segment.IsExecutable())186 if (pc >= segment.start && pc < segment.end && !segment.IsExecutable())
187 Report("Hint: PC is at a non-executable region. Maybe a wild jump?\n");187 Report("HINT: PC is at a non-executable region. Maybe a wild jump?\n");
188 }188 }
189#endif189#endif
190}190}
...@@ -254,7 +254,7 @@ static void ReportDeadlySignalImpl(const SignalContext &sig, u32 tid,...@@ -254,7 +254,7 @@ static void ReportDeadlySignalImpl(const SignalContext &sig, u32 tid,
254 (void *)sig.bp, (void *)sig.sp, tid);254 (void *)sig.bp, (void *)sig.sp, tid);
255 Printf("%s", d.Default());255 Printf("%s", d.Default());
256 if (sig.pc < GetPageSizeCached())256 if (sig.pc < GetPageSizeCached())
257 Report("Hint: pc points to the zero page.\n");257 Report("HINT: pc points to the zero page.\n");
258 if (sig.is_memory_access) {258 if (sig.is_memory_access) {
259 const char *access_type =259 const char *access_type =
260 sig.write_flag == SignalContext::Write260 sig.write_flag == SignalContext::Write
...@@ -262,11 +262,12 @@ static void ReportDeadlySignalImpl(const SignalContext &sig, u32 tid,...@@ -262,11 +262,12 @@ static void ReportDeadlySignalImpl(const SignalContext &sig, u32 tid,
262 : (sig.write_flag == SignalContext::Read ? "READ" : "UNKNOWN");262 : (sig.write_flag == SignalContext::Read ? "READ" : "UNKNOWN");
263 Report("The signal is caused by a %s memory access.\n", access_type);263 Report("The signal is caused by a %s memory access.\n", access_type);
264 if (!sig.is_true_faulting_addr)264 if (!sig.is_true_faulting_addr)
265 Report("Hint: this fault was caused by a dereference of a high value "265 Report(
266 "address (see register values below). Disassemble the provided "266 "HINT: this fault was caused by a dereference of a high value "
267 "pc to learn which register was used.\n");267 "address (see register values below). Disassemble the provided "
268 "pc to learn which register was used.\n");
268 else if (sig.addr < GetPageSizeCached())269 else if (sig.addr < GetPageSizeCached())
269 Report("Hint: address points to the zero page.\n");270 Report("HINT: address points to the zero page.\n");
270 }271 }
271 MaybeReportNonExecRegion(sig.pc);272 MaybeReportNonExecRegion(sig.pc);
272 InternalMmapVector<BufferedStackTrace> stack_buffer(1);273 InternalMmapVector<BufferedStackTrace> stack_buffer(1);
lib/libtsan/sanitizer_common/sanitizer_unwind_win.cpp+43-6
...@@ -43,10 +43,47 @@ void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) {...@@ -43,10 +43,47 @@ void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) {
43 trace_buffer[0] = pc;43 trace_buffer[0] = pc;
44}44}
4545
46#ifdef __clang__46PVOID CALLBACK FallbackFunctionTableAccess(HANDLE hProcess,
47#pragma clang diagnostic push47 DWORD64 dwAddrBase) {
48#pragma clang diagnostic ignored "-Wframe-larger-than="48 // First try DbgHelp's function.
49#endif49 if (PVOID pResult =
50 __sanitizer::SymFunctionTableAccess64(hProcess, dwAddrBase)) {
51 return pResult;
52 }
53
54 // Fall back to RtlLookupFunctionEntry for dynamic code.
55 // Function registered with RtlAddFunctionTable is not necessarily registered
56 // with DbgHelp, so this is required to cover some edge cases (e.g. JIT
57 // compilers can use Rtl* functions).
58# if SANITIZER_WINDOWS64
59 DWORD64 dw64ImageBase = 0;
60 return RtlLookupFunctionEntry(dwAddrBase, &dw64ImageBase, nullptr);
61# else
62 return nullptr;
63# endif
64}
65
66DWORD64 CALLBACK FallbackGetModuleBase(HANDLE hProcess, DWORD64 dwAddr) {
67 if (DWORD64 dwResult = __sanitizer::SymGetModuleBase64(hProcess, dwAddr)) {
68 return dwResult;
69 }
70
71 // Both GetModuleBase and FunctionTableAccess must provide this fallback,
72 // otherwise dynamic functions won't be properly unwound.
73# if SANITIZER_WINDOWS64
74 DWORD64 dw64ImageBase = 0;
75 if (RtlLookupFunctionEntry(dwAddr, &dw64ImageBase, nullptr)) {
76 return dw64ImageBase;
77 }
78# endif
79
80 return 0;
81}
82
83# ifdef __clang__
84# pragma clang diagnostic push
85# pragma clang diagnostic ignored "-Wframe-larger-than="
86# endif
50void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {87void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
51 CHECK(context);88 CHECK(context);
52 CHECK_GE(max_depth, 2);89 CHECK_GE(max_depth, 2);
...@@ -91,8 +128,8 @@ void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {...@@ -91,8 +128,8 @@ void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
91 stack_frame.AddrFrame.Mode = AddrModeFlat;128 stack_frame.AddrFrame.Mode = AddrModeFlat;
92 stack_frame.AddrStack.Mode = AddrModeFlat;129 stack_frame.AddrStack.Mode = AddrModeFlat;
93 while (StackWalk64(machine_type, GetCurrentProcess(), GetCurrentThread(),130 while (StackWalk64(machine_type, GetCurrentProcess(), GetCurrentThread(),
94 &stack_frame, &ctx, NULL, SymFunctionTableAccess64,131 &stack_frame, &ctx, NULL, FallbackFunctionTableAccess,
95 SymGetModuleBase64, NULL) &&132 FallbackGetModuleBase, NULL) &&
96 size < Min(max_depth, kStackTraceMax)) {133 size < Min(max_depth, kStackTraceMax)) {
97 trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset;134 trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset;
98 }135 }
lib/libtsan/sanitizer_common/sanitizer_win.cpp+4-3
...@@ -913,11 +913,12 @@ void ReportFile::Write(const char *buffer, uptr length) {...@@ -913,11 +913,12 @@ void ReportFile::Write(const char *buffer, uptr length) {
913 }913 }
914}914}
915915
916void SetAlternateSignalStack() {916void* SetAlternateSignalStack() {
917 // FIXME: Decide what to do on Windows.917 // FIXME: Decide what to do on Windows.
918 return nullptr;
918}919}
919920
920void UnsetAlternateSignalStack() {921void UnsetAlternateSignalStack(void* altstack_base) {
921 // FIXME: Decide what to do on Windows.922 // FIXME: Decide what to do on Windows.
922}923}
923924
...@@ -1222,7 +1223,7 @@ int WaitForProcess(pid_t pid) { return -1; }...@@ -1222,7 +1223,7 @@ int WaitForProcess(pid_t pid) { return -1; }
1222// FIXME implement on this platform.1223// FIXME implement on this platform.
1223void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}1224void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}
12241225
1225void CheckNoDeepBind(const char *filename, int flag) {1226void OnDlOpen(const char* filename, int flag) {
1226 // Do nothing.1227 // Do nothing.
1227}1228}
12281229
lib/libtsan/tsan_adaptive_delay.cpp created+433
...@@ -0,0 +1,433 @@
1//===-- tsan_adaptive_delay.h -----------------------------------*- C++ -*-===//
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// This file is a part of ThreadSanitizer (TSan), a race detector.
10//
11//===----------------------------------------------------------------------===//
12
13#include "tsan_adaptive_delay.h"
14
15#include "interception/interception.h"
16#include "sanitizer_common/sanitizer_allocator_internal.h"
17#include "sanitizer_common/sanitizer_common.h"
18#include "sanitizer_common/sanitizer_errno_codes.h"
19#include "tsan_interface.h"
20#include "tsan_rtl.h"
21
22namespace __tsan {
23
24namespace {
25
26// =============================================================================
27// DelaySpec: Represents a delay configuration parsed from flag strings
28// =============================================================================
29//
30// Delay can be specified as:
31// - "spin=N" : Spin for up to N cycles (very short delays)
32// - "yield" : Call sched_yield() once
33// - "sleep_us=N" : Sleep for up to N microseconds
34
35enum class DelayType { Spin, Yield, SleepUs };
36
37struct DelaySpec {
38 DelayType type;
39 int value; // spin cycles or sleep_us value; ignored for yield
40
41 // Both estimates below are used internally as a very rough estimate for
42 // delay overhead calculation, to cap the overall delay to the
43 // adaptive_delay_aggressiveness option. They're not intended to be 100%
44 // accurate on any or all architectures/operating systems, or for use in any
45 // other contexts.
46 //
47 // Estimated nanoseconds per spin cycle (volatile loop iteration).
48 static constexpr u64 kNsPerSpinCycle = 1;
49 // Estimated nanoseconds for a yield (context switch overhead)
50 static constexpr u64 kNsPerYield = 500;
51
52 static DelaySpec Parse(const char* str) {
53 DelaySpec spec;
54 if (internal_strncmp(str, "spin=", 5) == 0) {
55 spec.type = DelayType::Spin;
56 spec.value = internal_atoll(str + 5);
57 if (spec.value <= 0 || spec.value > 10000) {
58 Printf(
59 "FATAL: Invalid TSAN_OPTIONS spin value '%s'; value must be "
60 "between 1 and 10000\n",
61 str);
62 Die();
63 }
64 } else if (internal_strcmp(str, "yield") == 0) {
65 spec.type = DelayType::Yield;
66 spec.value = 0;
67 } else if (internal_strncmp(str, "sleep_us=", 9) == 0) {
68 spec.type = DelayType::SleepUs;
69 spec.value = internal_atoll(str + 9);
70 if (spec.value <= 0) {
71 Printf(
72 "FATAL: Invalid TSAN_OPTIONS sleep_us value '%s'; value must be a "
73 "positive integer\n",
74 str);
75 Die();
76 }
77 } else {
78 Printf("FATAL: Unrecognized delay spec '%s', check TSAN_OPTIONS\n", str);
79 Die();
80 }
81 return spec;
82 }
83
84 const char* TypeName() const {
85 switch (type) {
86 case DelayType::Spin:
87 return "spin";
88 case DelayType::Yield:
89 return "yield";
90 case DelayType::SleepUs:
91 return "sleep_us";
92 }
93 return "unknown";
94 }
95};
96
97} // namespace
98
99// =============================================================================
100// AdaptiveDelayImpl: Time-budget aware delay injection for race exposure
101// =============================================================================
102//
103// This implementation injects delays to expose data races while maintaining a
104// configurable overhead target. It uses several strategies:
105//
106// 1. Time-Budget Controller: Tracks cumulative delays vs wall-clock time
107// and adjusts delay probability to maintain target overhead.
108//
109// 2. Tiered Delays: Different delay strategies for different op types:
110// - Relaxed atomics: Very rare sampling, tiny spin delays
111// - Sync atomics (acq/rel/seq_cst): Moderate sampling, small usleep
112// - Mutex/CV ops: Higher sampling, larger delays
113// - Thread create/join: Always delay (rare but high value)
114//
115// 3. Address-based Sampling: Exponential backoff per address to avoid
116// repeatedly delaying hot atomics.
117
118struct AdaptiveDelayImpl {
119 ALWAYS_INLINE static AdaptiveDelayState* TLS() {
120 return &cur_thread()->adaptive_delay_state;
121 }
122 ALWAYS_INLINE static unsigned int* GetRandomSeed() {
123 return &TLS()->tls_random_seed_;
124 }
125 ALWAYS_INLINE static void SetRandomSeed(unsigned int seed) {
126 TLS()->tls_random_seed_ = seed;
127 }
128
129 // The public facing option is adaptive_delay_aggressiveness, which is an
130 // opaque value for the user to tune the amount of delay injected into the
131 // program. Internally, the implementation maps the aggressiveness to a target
132 // percent delay for the overall program runtime. It's not easy to implement
133 // a true wall clock delay target (e.g., 25% program wall time slowdown)
134 // because 1) spin loops and yield are hard to calculate actual wall time
135 // slowness and 2) usleep(N) is often slower than advertised. Thus, we keep
136 // the user facing parameter opaque to not under deliver on a promise of
137 // percent wall time slowdown.
138 struct TimeBudget {
139 int target_overhead_pct_;
140 Percent target_low_;
141 Percent target_high_;
142
143 void Init(int target_pct) {
144 target_overhead_pct_ = target_pct;
145 target_low_ = Percent::FromPct(
146 target_overhead_pct_ >= 5 ? target_overhead_pct_ - 5 : 0);
147 target_high_ = Percent::FromPct(target_overhead_pct_ + 5);
148 }
149
150 static constexpr u64 BucketDurationNs = 30'000'000'000ULL;
151
152 void RecordDelay(u64 delay_ns) {
153 u64 now = NanoTime();
154 u64 elapsed_ns = now - TLS()->bucket_start_ns_;
155
156 if (elapsed_ns >= BucketDurationNs) {
157 // Shift: old bucket is discarded, new becomes old, start fresh new
158 TLS()->delay_buckets_ns_[0] = TLS()->delay_buckets_ns_[1];
159 TLS()->delay_buckets_ns_[1] = 0;
160 TLS()->bucket_start_ns_ = now;
161 TLS()->bucket0_window_ns = BucketDurationNs;
162 }
163
164 TLS()->delay_buckets_ns_[1] += delay_ns;
165 }
166
167 Percent GetOverheadPercent() {
168 u64 now = NanoTime();
169 u64 elapsed_ns = now - TLS()->bucket_start_ns_;
170
171 // Need at least 1ms to calculate
172 if (elapsed_ns < 1'000'000ULL)
173 return Percent::FromPct(0);
174
175 if (elapsed_ns > BucketDurationNs * 2) {
176 // Both buckets are stale
177 return Percent::FromPct(0);
178 } else if (elapsed_ns > BucketDurationNs) {
179 // bucket[0] is stale, use only bucket[1] (current bucket)
180 u64 total_delay_ns = TLS()->delay_buckets_ns_[1];
181 return Percent::FromRatio(total_delay_ns, elapsed_ns);
182 } else {
183 u64 total_delay_ns =
184 TLS()->delay_buckets_ns_[0] + TLS()->delay_buckets_ns_[1];
185 u64 window_ns = TLS()->bucket0_window_ns + elapsed_ns;
186 return Percent::FromRatio(total_delay_ns, window_ns);
187 }
188 }
189
190 bool ShouldDelay() {
191 Percent ratio = GetOverheadPercent();
192
193 if (ratio < target_low_)
194 return true;
195 if (ratio > target_high_)
196 return false;
197
198 // Linear interpolation: at target_low -> 100%, at target_high -> 0%
199 Percent prob = (target_high_ - ratio) / (target_high_ - target_low_);
200 return prob.RandomCheck(GetRandomSeed());
201 }
202 };
203
204 // Address Sampler with Exponential Backoff
205 struct AddressSampler {
206 static constexpr u64 TABLE_SIZE = 2048;
207 struct Entry {
208 atomic_uintptr_t addr_;
209 atomic_uint32_t count_;
210 };
211 Entry table_[TABLE_SIZE];
212 static constexpr u32 ExponentialBackoffCap = 64;
213
214 void Init() {
215 for (u64 i = 0; i < TABLE_SIZE; ++i) {
216 atomic_store(&table_[i].addr_, 0, memory_order_relaxed);
217 atomic_store(&table_[i].count_, 0, memory_order_relaxed);
218 }
219 }
220
221 static ALWAYS_INLINE u64 splitmix64(u64 x) {
222 x = (x ^ (x >> 30)) * 0xBF58476D1CE4E5B9ULL;
223 x = (x ^ (x >> 27)) * 0x94D049BB133111EBULL;
224 x = x ^ (x >> 31);
225 return x;
226 }
227
228 // Uses exponential backoff: delay on 1st, 2nd, 4th, 8th, 16th, ...
229 bool ShouldDelayAddr(uptr addr) {
230 u64 idx = splitmix64(addr >> 3) & (TABLE_SIZE - 1);
231 Entry& e = table_[idx];
232
233 // This function is not thread safe.
234 // If two threads access the same hashed entry in parallel,
235 // worst case, we may end up returning true too often. This is
236 // acceptable...instead of full locking.
237
238 uptr stored_addr = atomic_load(&e.addr_, memory_order_relaxed);
239 if (stored_addr != addr) {
240 // Hash Collision - reset
241 atomic_store(&e.addr_, addr, memory_order_relaxed);
242 atomic_store(&e.count_, 1, memory_order_relaxed);
243 return true;
244 }
245
246 u32 count = atomic_fetch_add(&e.count_, 1, memory_order_relaxed) + 1;
247
248 if ((count & (count - 1)) == 0 && count <= ExponentialBackoffCap)
249 return true;
250 return false;
251 }
252 };
253
254 TimeBudget budget_;
255 AddressSampler sampler_;
256
257 int relaxed_sample_rate_;
258 int sync_atomic_sample_rate_;
259 int mutex_sample_rate_;
260 DelaySpec atomic_delay_;
261 DelaySpec sync_delay_;
262
263 void Init() { InitTls(); }
264
265 void InitTls() {
266 TLS()->bucket_start_ns_ = NanoTime();
267 TLS()->delay_buckets_ns_[0] = 0;
268 TLS()->delay_buckets_ns_[1] = 0;
269 TLS()->bucket0_window_ns = 0;
270
271 SetRandomSeed(NanoTime());
272 TLS()->tls_initialized_ = true;
273 }
274
275 bool IsTlsInitialized() const { return TLS()->tls_initialized_; }
276
277 AdaptiveDelayImpl() {
278 relaxed_sample_rate_ = flags()->adaptive_delay_relaxed_sample_rate;
279 sync_atomic_sample_rate_ = flags()->adaptive_delay_sync_atomic_sample_rate;
280 mutex_sample_rate_ = flags()->adaptive_delay_mutex_sample_rate;
281 atomic_delay_ = DelaySpec::Parse(flags()->adaptive_delay_max_atomic);
282 sync_delay_ = DelaySpec::Parse(flags()->adaptive_delay_max_sync);
283
284 int delay_aggressiveness = flags()->adaptive_delay_aggressiveness;
285 if (delay_aggressiveness < 1)
286 delay_aggressiveness = 1;
287
288 budget_.Init(delay_aggressiveness);
289 sampler_.Init();
290
291 VPrintf(1, "INFO: ThreadSanitizer AdaptiveDelay initialized\n");
292 VPrintf(1, " Delay aggressiveness: %d\n", delay_aggressiveness);
293 VPrintf(1, " Relaxed atomic sample rate: 1/%d\n", relaxed_sample_rate_);
294 VPrintf(1, " Sync atomic sample rate: 1/%d\n", sync_atomic_sample_rate_);
295 VPrintf(1, " Mutex sample rate: 1/%d\n", mutex_sample_rate_);
296 VPrintf(1, " Atomic delay: %s=%d\n", atomic_delay_.TypeName(),
297 atomic_delay_.value);
298 VPrintf(1, " Sync delay: %s=%d\n", sync_delay_.TypeName(),
299 sync_delay_.value);
300 }
301
302 void DoSpinDelay(int iters) {
303 volatile int v = 0;
304 for (int i = 0; i < iters; ++i) v = i;
305 (void)v;
306 budget_.RecordDelay(iters * DelaySpec::kNsPerSpinCycle);
307 }
308
309 void DoYieldDelay() {
310 internal_sched_yield();
311 budget_.RecordDelay(DelaySpec::kNsPerYield);
312 }
313
314 void DoSleepUsDelay(int max_us) {
315 // Use two Rand() calls to get full 32-bit range for larger sleep values
316 u32 rnd = ((u32)Rand(GetRandomSeed()) << 16) | Rand(GetRandomSeed());
317 int delay_us = 1 + (rnd % max_us);
318 internal_usleep(delay_us);
319 budget_.RecordDelay(delay_us * 1000ULL);
320 }
321
322 void ExecuteDelay(const DelaySpec& spec) {
323 switch (spec.type) {
324 case DelayType::Spin: {
325 int iters = 1 + (Rand(GetRandomSeed()) % spec.value);
326 DoSpinDelay(iters);
327 break;
328 }
329 case DelayType::Yield:
330 DoYieldDelay();
331 break;
332 case DelayType::SleepUs:
333 DoSleepUsDelay(spec.value);
334 break;
335 }
336 }
337
338 void AtomicRelaxedOpDelay() {
339 if ((Rand(GetRandomSeed()) % relaxed_sample_rate_) != 0)
340 return;
341 if (!budget_.ShouldDelay())
342 return;
343
344 int iters = 10 + (Rand(GetRandomSeed()) % 10);
345 DoSpinDelay(iters);
346 }
347
348 void AtomicSyncOpDelay(uptr* addr) {
349 if ((Rand(GetRandomSeed()) % sync_atomic_sample_rate_) != 0)
350 return;
351 if (!budget_.ShouldDelay())
352 return;
353
354 if (addr && !sampler_.ShouldDelayAddr(*addr))
355 return;
356
357 ExecuteDelay(atomic_delay_);
358 }
359
360 void AtomicOpFence(int mo) {
361 CHECK(IsTlsInitialized());
362
363 if (mo < mo_acquire)
364 AtomicRelaxedOpDelay();
365 else
366 AtomicSyncOpDelay(nullptr);
367 }
368
369 void AtomicOpAddr(uptr addr, int mo) {
370 CHECK(IsTlsInitialized());
371
372 if (mo < mo_acquire)
373 AtomicRelaxedOpDelay();
374 else
375 AtomicSyncOpDelay(&addr);
376 }
377
378 void UnsampledDelay() {
379 CHECK(IsTlsInitialized());
380
381 if (!budget_.ShouldDelay())
382 return;
383
384 ExecuteDelay(sync_delay_);
385 }
386
387 void SyncOp() {
388 CHECK(IsTlsInitialized());
389
390 if ((Rand(GetRandomSeed()) % mutex_sample_rate_) != 0)
391 return;
392 if (!budget_.ShouldDelay())
393 return;
394
395 ExecuteDelay(sync_delay_);
396 }
397
398 void BeforeChildThreadRuns() {
399 InitTls();
400 UnsampledDelay();
401 }
402
403 void AfterThreadCreation() { UnsampledDelay(); }
404};
405
406AdaptiveDelayImpl& GetImpl() {
407 static AdaptiveDelayImpl impl;
408 return impl;
409}
410
411bool AdaptiveDelay::is_adaptive_delay_enabled;
412
413void AdaptiveDelay::InitImpl() {
414 AdaptiveDelay::is_adaptive_delay_enabled = flags()->enable_adaptive_delay;
415 if (!AdaptiveDelay::is_adaptive_delay_enabled)
416 return;
417
418 GetImpl().Init();
419}
420
421void AdaptiveDelay::SyncOpImpl() { GetImpl().SyncOp(); }
422void AdaptiveDelay::AtomicOpFenceImpl(int mo) { GetImpl().AtomicOpFence(mo); }
423void AdaptiveDelay::AtomicOpAddrImpl(__sanitizer::uptr addr, int mo) {
424 GetImpl().AtomicOpAddr(addr, mo);
425}
426void AdaptiveDelay::AfterThreadCreationImpl() {
427 GetImpl().AfterThreadCreation();
428}
429void AdaptiveDelay::BeforeChildThreadRunsImpl() {
430 GetImpl().BeforeChildThreadRuns();
431}
432
433} // namespace __tsan
lib/libtsan/tsan_adaptive_delay.h created+173
...@@ -0,0 +1,173 @@
1//===-- tsan_adaptive_delay.h -----------------------------------*- C++ -*-===//
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// This file is a part of ThreadSanitizer (TSan), a race detector.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef TSAN_ADAPTIVE_DELAY_H
14#define TSAN_ADAPTIVE_DELAY_H
15
16#include "sanitizer_common/sanitizer_common.h"
17#include "sanitizer_common/sanitizer_internal_defs.h"
18
19namespace __tsan {
20
21// AdaptiveDelay injects delays at synchronization points, atomic operations,
22// and thread lifecycle events to increase the likelihood of exposing data
23// races. The delay injection is controlled by an approximate time budget to
24// maintain a configurable overhead target.
25//
26// SyncOp() delays non-atomic synchronization points (those with clear
27// happens-before relationships):
28// - Acquire operations like locking a mutex delays before the mutex is locked.
29// - Release operations like unlocking a mutex delays after the mutex is
30// unlocked
31// These are more likely to expose interesting (rare) thread interleavings.
32// For example, delaying a thread that unlocks a mutex from running to allow
33// newly woken thread to execute before the unlocking thread would normally
34// execute.
35//
36// TODO:
37// - Move the adaptive delay implementation into sanitizer_common so that
38// ASAN can also leverage it in pthread_* interceptors
39// - Integrate into other interceptors like libdispatch.
40struct AdaptiveDelay {
41 ALWAYS_INLINE static void Init() { InitImpl(); }
42
43 ALWAYS_INLINE static void SyncOp() {
44 if (!is_adaptive_delay_enabled)
45 return;
46 SyncOpImpl();
47 }
48
49 ALWAYS_INLINE static void AtomicOpFence(int mo) {
50 if (!is_adaptive_delay_enabled)
51 return;
52 AtomicOpFenceImpl(mo);
53 }
54
55 ALWAYS_INLINE static void AtomicOpAddr(__sanitizer::uptr addr, int mo) {
56 if (!is_adaptive_delay_enabled)
57 return;
58 AtomicOpAddrImpl(addr, mo);
59 }
60
61 ALWAYS_INLINE static void AfterThreadCreation() {
62 if (!is_adaptive_delay_enabled)
63 return;
64 AfterThreadCreationImpl();
65 }
66
67 ALWAYS_INLINE static void BeforeChildThreadRuns() {
68 if (!is_adaptive_delay_enabled)
69 return;
70 BeforeChildThreadRunsImpl();
71 }
72
73 private:
74 static void InitImpl();
75
76 static void SyncOpImpl();
77
78 static void AtomicOpFenceImpl(int mo);
79 static void AtomicOpAddrImpl(__sanitizer::uptr addr, int mo);
80
81 static void AfterThreadCreationImpl();
82 static void BeforeChildThreadRunsImpl();
83
84 static bool is_adaptive_delay_enabled;
85};
86
87// The runtime defines cur_thread() to retrieve TLS thread state, and it
88// takes care of platform specific implementation details. The AdaptiveDelay
89// implementation stores per-thread data in this struct, which is embedded
90// in cur_thread().
91struct AdaptiveDelayState {
92 // For the adaptive delay implementation
93 // Sliding window delay tracking: 2 buckets of 30 seconds each
94 u64 delay_buckets_ns_[2]; // [0] = older 30s, [1] = newer 30s
95 u64 bucket_start_ns_; // When current bucket (index 1) started
96 u64 bucket0_window_ns; // 0ns before the first bucket has rolled, and set to
97 // the bucket window time after This handles the case
98 // where, before the program has ran one bucket window
99 // duration, we should not include the previous bucket
100 // duration in the overhead percent calculation.
101 unsigned int tls_random_seed_;
102 bool tls_initialized_;
103};
104
105// Fixed-point arithmetic type that mimics floating point operations
106class Percent {
107 using u32 = __sanitizer::u32;
108 using u64 = __sanitizer::u64;
109
110 u32 bp_{}; // basis points (0-10000 represents 0.0-1.0)
111 bool is_valid_{};
112
113 static constexpr u32 kBasisPointsPerUnit = 10000;
114
115 Percent(u32 bp, bool is_valid) : bp_(bp), is_valid_(is_valid) {}
116
117 public:
118 Percent() = default;
119 Percent(const Percent&) = default;
120 Percent& operator=(const Percent&) = default;
121 Percent(Percent&&) = default;
122 Percent& operator=(Percent&&) = default;
123
124 static Percent FromPct(u32 pct) { return Percent{pct * 100, true}; }
125 static Percent FromRatio(u64 numerator, u64 denominator) {
126 if (denominator == 0)
127 return Percent{0, false};
128 // Avoid overflow: scale down if needed
129 if (numerator > UINT64_MAX / kBasisPointsPerUnit) {
130 return Percent{(u32)((numerator / denominator) * kBasisPointsPerUnit),
131 true};
132 }
133 return Percent{(u32)((numerator * kBasisPointsPerUnit) / denominator),
134 true};
135 }
136
137 bool IsValid() const { return is_valid_; }
138
139 // Returns true with probability equal to the percentage.
140 bool RandomCheck(u32* seed) const {
141 return (Rand(seed) % kBasisPointsPerUnit) < bp_;
142 }
143
144 int GetPct() const { return bp_ / 100; }
145 int GetBasisPoints() const { return bp_; }
146
147 bool operator==(const Percent& other) const { return bp_ == other.bp_; }
148 bool operator!=(const Percent& other) const { return bp_ != other.bp_; }
149 bool operator<(const Percent& other) const { return bp_ < other.bp_; }
150 bool operator>(const Percent& other) const { return bp_ > other.bp_; }
151 bool operator<=(const Percent& other) const { return bp_ <= other.bp_; }
152 bool operator>=(const Percent& other) const { return bp_ >= other.bp_; }
153
154 Percent operator-(const Percent& other) const {
155 if (!is_valid_ || !other.is_valid_)
156 return Percent{0, false};
157 if (bp_ < other.bp_)
158 return Percent{0, false};
159 return Percent{bp_ - other.bp_, true};
160 }
161
162 Percent operator/(const Percent& other) const {
163 if (!is_valid_ || !other.is_valid_)
164 return Percent{0, false};
165 if (other.bp_ == 0)
166 return Percent{0, false};
167 return Percent{(bp_ * kBasisPointsPerUnit) / other.bp_, true};
168 }
169};
170
171} // namespace __tsan
172
173#endif // TSAN_ADAPTIVE_DELAY_H
lib/libtsan/tsan_flags.cpp+1-1
...@@ -37,7 +37,7 @@ inline bool FlagHandler<LockDuringWriteSetting>::Parse(const char *value) {...@@ -37,7 +37,7 @@ inline bool FlagHandler<LockDuringWriteSetting>::Parse(const char *value) {
37 *t_ = kNoLockDuringWritesAllProcesses;37 *t_ = kNoLockDuringWritesAllProcesses;
38 return true;38 return true;
39 }39 }
40 Printf("ERROR: Invalid value for signal handler option: '%s'\n", value);40 Printf("ERROR: Invalid value for lock_during_write option: '%s'\n", value);
41 return false;41 return false;
42}42}
4343
lib/libtsan/tsan_flags.inc+27
...@@ -92,3 +92,30 @@ TSAN_FLAG(LockDuringWriteSetting, lock_during_write, kLockDuringAllWrites,...@@ -92,3 +92,30 @@ TSAN_FLAG(LockDuringWriteSetting, lock_during_write, kLockDuringAllWrites,
92 "\"disable_for_all_processes\" - don't lock during all writes in "92 "\"disable_for_all_processes\" - don't lock during all writes in "
93 "the current process and it's children processes.")93 "the current process and it's children processes.")
94#endif94#endif
95
96TSAN_FLAG(bool, enable_adaptive_delay, false,
97 "Enable adaptive delay injection to expose data races. When "
98 "enabled, delays are strategically injected at synchronization "
99 "points, atomic operations, and thread lifecycle events to increase "
100 "the likelihood of exposing races while maintaining a configurable "
101 "overhead budget.")
102
103TSAN_FLAG(
104 int, adaptive_delay_aggressiveness, 25,
105 "Controls delay injection intensity for race detection. Higher values "
106 "inject more delays to expose races. Suggested values: 10 (minimal delay), "
107 "50 (moderate delay), 200 (aggressive). "
108 "This is a tuning parameter; actual overhead varies by workload and "
109 "platform.")
110TSAN_FLAG(int, adaptive_delay_relaxed_sample_rate, 10000,
111 "Sample 1 in N relaxed atomic operations for delay")
112TSAN_FLAG(int, adaptive_delay_sync_atomic_sample_rate, 100,
113 "Sample 1 in N acquire/release/seq_cst atomic operations for delay")
114TSAN_FLAG(int, adaptive_delay_mutex_sample_rate, 10,
115 "Sample 1 in N mutex/cv operations for delay")
116TSAN_FLAG(const char*, adaptive_delay_max_atomic, "sleep_us=50",
117 "Delay for atomic operations: 'spin=N' (max N spins), 'yield', or "
118 "'sleep_us=N' (max N>0 us sleep)")
119TSAN_FLAG(const char*, adaptive_delay_max_sync, "sleep_us=500",
120 "Delay for sync operations: 'spin=N' (max N spins), 'yield', or "
121 "'sleep_us=N' (max N>0 us sleep)")
lib/libtsan/tsan_interceptors_posix.cpp+24-2
...@@ -34,6 +34,7 @@...@@ -34,6 +34,7 @@
34#if SANITIZER_APPLE && !SANITIZER_GO34#if SANITIZER_APPLE && !SANITIZER_GO
35# include "tsan_flags.h"35# include "tsan_flags.h"
36#endif36#endif
37#include "tsan_adaptive_delay.h"
37#include "tsan_interceptors.h"38#include "tsan_interceptors.h"
38#include "tsan_interface.h"39#include "tsan_interface.h"
39#include "tsan_mman.h"40#include "tsan_mman.h"
...@@ -1065,6 +1066,9 @@ extern "C" void *__tsan_thread_start_func(void *arg) {...@@ -1065,6 +1066,9 @@ extern "C" void *__tsan_thread_start_func(void *arg) {
1065 ThreadStart(thr, p->tid, GetTid(), ThreadType::Regular);1066 ThreadStart(thr, p->tid, GetTid(), ThreadType::Regular);
1066 p->started.Post();1067 p->started.Post();
1067 }1068 }
1069
1070 AdaptiveDelay::BeforeChildThreadRuns();
1071
1068 void *res = callback(param);1072 void *res = callback(param);
1069 // Prevent the callback from being tail called,1073 // Prevent the callback from being tail called,
1070 // it mixes up stack traces.1074 // it mixes up stack traces.
...@@ -1128,6 +1132,7 @@ TSAN_INTERCEPTOR(int, pthread_create,...@@ -1128,6 +1132,7 @@ TSAN_INTERCEPTOR(int, pthread_create,
1128 }1132 }
1129 if (attr == &myattr)1133 if (attr == &myattr)
1130 pthread_attr_destroy(&myattr);1134 pthread_attr_destroy(&myattr);
1135 AdaptiveDelay::AfterThreadCreation();
1131 return res;1136 return res;
1132}1137}
11331138
...@@ -1423,6 +1428,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_destroy, void *m) {...@@ -1423,6 +1428,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_destroy, void *m) {
1423TSAN_INTERCEPTOR(int, pthread_mutex_lock, void *m) {1428TSAN_INTERCEPTOR(int, pthread_mutex_lock, void *m) {
1424 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_lock, m);1429 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_lock, m);
1425 MutexPreLock(thr, pc, (uptr)m);1430 MutexPreLock(thr, pc, (uptr)m);
1431 AdaptiveDelay::SyncOp();
1426 int res = BLOCK_REAL(pthread_mutex_lock)(m);1432 int res = BLOCK_REAL(pthread_mutex_lock)(m);
1427 if (res == errno_EOWNERDEAD)1433 if (res == errno_EOWNERDEAD)
1428 MutexRepair(thr, pc, (uptr)m);1434 MutexRepair(thr, pc, (uptr)m);
...@@ -1435,6 +1441,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_lock, void *m) {...@@ -1435,6 +1441,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_lock, void *m) {
14351441
1436TSAN_INTERCEPTOR(int, pthread_mutex_trylock, void *m) {1442TSAN_INTERCEPTOR(int, pthread_mutex_trylock, void *m) {
1437 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_trylock, m);1443 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_trylock, m);
1444 AdaptiveDelay::SyncOp();
1438 int res = REAL(pthread_mutex_trylock)(m);1445 int res = REAL(pthread_mutex_trylock)(m);
1439 if (res == errno_EOWNERDEAD)1446 if (res == errno_EOWNERDEAD)
1440 MutexRepair(thr, pc, (uptr)m);1447 MutexRepair(thr, pc, (uptr)m);
...@@ -1446,6 +1453,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_trylock, void *m) {...@@ -1446,6 +1453,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_trylock, void *m) {
1446#if !SANITIZER_APPLE1453#if !SANITIZER_APPLE
1447TSAN_INTERCEPTOR(int, pthread_mutex_timedlock, void *m, void *abstime) {1454TSAN_INTERCEPTOR(int, pthread_mutex_timedlock, void *m, void *abstime) {
1448 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_timedlock, m, abstime);1455 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_timedlock, m, abstime);
1456 AdaptiveDelay::SyncOp();
1449 int res = REAL(pthread_mutex_timedlock)(m, abstime);1457 int res = REAL(pthread_mutex_timedlock)(m, abstime);
1450 if (res == 0) {1458 if (res == 0) {
1451 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);1459 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);
...@@ -1458,6 +1466,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_unlock, void *m) {...@@ -1458,6 +1466,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_unlock, void *m) {
1458 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_unlock, m);1466 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_unlock, m);
1459 MutexUnlock(thr, pc, (uptr)m);1467 MutexUnlock(thr, pc, (uptr)m);
1460 int res = REAL(pthread_mutex_unlock)(m);1468 int res = REAL(pthread_mutex_unlock)(m);
1469 AdaptiveDelay::SyncOp();
1461 if (res == errno_EINVAL)1470 if (res == errno_EINVAL)
1462 MutexInvalidAccess(thr, pc, (uptr)m);1471 MutexInvalidAccess(thr, pc, (uptr)m);
1463 return res;1472 return res;
...@@ -1468,6 +1477,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_clocklock, void *m,...@@ -1468,6 +1477,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_clocklock, void *m,
1468 __sanitizer_clockid_t clock, void *abstime) {1477 __sanitizer_clockid_t clock, void *abstime) {
1469 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_clocklock, m, clock, abstime);1478 SCOPED_TSAN_INTERCEPTOR(pthread_mutex_clocklock, m, clock, abstime);
1470 MutexPreLock(thr, pc, (uptr)m);1479 MutexPreLock(thr, pc, (uptr)m);
1480 AdaptiveDelay::SyncOp();
1471 int res = BLOCK_REAL(pthread_mutex_clocklock)(m, clock, abstime);1481 int res = BLOCK_REAL(pthread_mutex_clocklock)(m, clock, abstime);
1472 if (res == errno_EOWNERDEAD)1482 if (res == errno_EOWNERDEAD)
1473 MutexRepair(thr, pc, (uptr)m);1483 MutexRepair(thr, pc, (uptr)m);
...@@ -1486,6 +1496,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_clocklock, void *m,...@@ -1486,6 +1496,7 @@ TSAN_INTERCEPTOR(int, pthread_mutex_clocklock, void *m,
1486TSAN_INTERCEPTOR(int, __pthread_mutex_lock, void *m) {1496TSAN_INTERCEPTOR(int, __pthread_mutex_lock, void *m) {
1487 SCOPED_TSAN_INTERCEPTOR(__pthread_mutex_lock, m);1497 SCOPED_TSAN_INTERCEPTOR(__pthread_mutex_lock, m);
1488 MutexPreLock(thr, pc, (uptr)m);1498 MutexPreLock(thr, pc, (uptr)m);
1499 AdaptiveDelay::SyncOp();
1489 int res = BLOCK_REAL(__pthread_mutex_lock)(m);1500 int res = BLOCK_REAL(__pthread_mutex_lock)(m);
1490 if (res == errno_EOWNERDEAD)1501 if (res == errno_EOWNERDEAD)
1491 MutexRepair(thr, pc, (uptr)m);1502 MutexRepair(thr, pc, (uptr)m);
...@@ -1500,6 +1511,7 @@ TSAN_INTERCEPTOR(int, __pthread_mutex_unlock, void *m) {...@@ -1500,6 +1511,7 @@ TSAN_INTERCEPTOR(int, __pthread_mutex_unlock, void *m) {
1500 SCOPED_TSAN_INTERCEPTOR(__pthread_mutex_unlock, m);1511 SCOPED_TSAN_INTERCEPTOR(__pthread_mutex_unlock, m);
1501 MutexUnlock(thr, pc, (uptr)m);1512 MutexUnlock(thr, pc, (uptr)m);
1502 int res = REAL(__pthread_mutex_unlock)(m);1513 int res = REAL(__pthread_mutex_unlock)(m);
1514 AdaptiveDelay::SyncOp();
1503 if (res == errno_EINVAL)1515 if (res == errno_EINVAL)
1504 MutexInvalidAccess(thr, pc, (uptr)m);1516 MutexInvalidAccess(thr, pc, (uptr)m);
1505 return res;1517 return res;
...@@ -1529,6 +1541,7 @@ TSAN_INTERCEPTOR(int, pthread_spin_destroy, void *m) {...@@ -1529,6 +1541,7 @@ TSAN_INTERCEPTOR(int, pthread_spin_destroy, void *m) {
1529TSAN_INTERCEPTOR(int, pthread_spin_lock, void *m) {1541TSAN_INTERCEPTOR(int, pthread_spin_lock, void *m) {
1530 SCOPED_TSAN_INTERCEPTOR(pthread_spin_lock, m);1542 SCOPED_TSAN_INTERCEPTOR(pthread_spin_lock, m);
1531 MutexPreLock(thr, pc, (uptr)m);1543 MutexPreLock(thr, pc, (uptr)m);
1544 AdaptiveDelay::SyncOp();
1532 int res = BLOCK_REAL(pthread_spin_lock)(m);1545 int res = BLOCK_REAL(pthread_spin_lock)(m);
1533 if (res == 0) {1546 if (res == 0) {
1534 MutexPostLock(thr, pc, (uptr)m);1547 MutexPostLock(thr, pc, (uptr)m);
...@@ -1538,6 +1551,7 @@ TSAN_INTERCEPTOR(int, pthread_spin_lock, void *m) {...@@ -1538,6 +1551,7 @@ TSAN_INTERCEPTOR(int, pthread_spin_lock, void *m) {
15381551
1539TSAN_INTERCEPTOR(int, pthread_spin_trylock, void *m) {1552TSAN_INTERCEPTOR(int, pthread_spin_trylock, void *m) {
1540 SCOPED_TSAN_INTERCEPTOR(pthread_spin_trylock, m);1553 SCOPED_TSAN_INTERCEPTOR(pthread_spin_trylock, m);
1554 AdaptiveDelay::SyncOp();
1541 int res = REAL(pthread_spin_trylock)(m);1555 int res = REAL(pthread_spin_trylock)(m);
1542 if (res == 0) {1556 if (res == 0) {
1543 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);1557 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);
...@@ -1549,6 +1563,7 @@ TSAN_INTERCEPTOR(int, pthread_spin_unlock, void *m) {...@@ -1549,6 +1563,7 @@ TSAN_INTERCEPTOR(int, pthread_spin_unlock, void *m) {
1549 SCOPED_TSAN_INTERCEPTOR(pthread_spin_unlock, m);1563 SCOPED_TSAN_INTERCEPTOR(pthread_spin_unlock, m);
1550 MutexUnlock(thr, pc, (uptr)m);1564 MutexUnlock(thr, pc, (uptr)m);
1551 int res = REAL(pthread_spin_unlock)(m);1565 int res = REAL(pthread_spin_unlock)(m);
1566 AdaptiveDelay::SyncOp();
1552 return res;1567 return res;
1553}1568}
1554#endif1569#endif
...@@ -1574,6 +1589,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_destroy, void *m) {...@@ -1574,6 +1589,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_destroy, void *m) {
1574TSAN_INTERCEPTOR(int, pthread_rwlock_rdlock, void *m) {1589TSAN_INTERCEPTOR(int, pthread_rwlock_rdlock, void *m) {
1575 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_rdlock, m);1590 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_rdlock, m);
1576 MutexPreReadLock(thr, pc, (uptr)m);1591 MutexPreReadLock(thr, pc, (uptr)m);
1592 AdaptiveDelay::SyncOp();
1577 int res = REAL(pthread_rwlock_rdlock)(m);1593 int res = REAL(pthread_rwlock_rdlock)(m);
1578 if (res == 0) {1594 if (res == 0) {
1579 MutexPostReadLock(thr, pc, (uptr)m);1595 MutexPostReadLock(thr, pc, (uptr)m);
...@@ -1583,6 +1599,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_rdlock, void *m) {...@@ -1583,6 +1599,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_rdlock, void *m) {
15831599
1584TSAN_INTERCEPTOR(int, pthread_rwlock_tryrdlock, void *m) {1600TSAN_INTERCEPTOR(int, pthread_rwlock_tryrdlock, void *m) {
1585 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_tryrdlock, m);1601 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_tryrdlock, m);
1602 AdaptiveDelay::SyncOp();
1586 int res = REAL(pthread_rwlock_tryrdlock)(m);1603 int res = REAL(pthread_rwlock_tryrdlock)(m);
1587 if (res == 0) {1604 if (res == 0) {
1588 MutexPostReadLock(thr, pc, (uptr)m, MutexFlagTryLock);1605 MutexPostReadLock(thr, pc, (uptr)m, MutexFlagTryLock);
...@@ -1593,6 +1610,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_tryrdlock, void *m) {...@@ -1593,6 +1610,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_tryrdlock, void *m) {
1593#if !SANITIZER_APPLE1610#if !SANITIZER_APPLE
1594TSAN_INTERCEPTOR(int, pthread_rwlock_timedrdlock, void *m, void *abstime) {1611TSAN_INTERCEPTOR(int, pthread_rwlock_timedrdlock, void *m, void *abstime) {
1595 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_timedrdlock, m, abstime);1612 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_timedrdlock, m, abstime);
1613 AdaptiveDelay::SyncOp();
1596 int res = REAL(pthread_rwlock_timedrdlock)(m, abstime);1614 int res = REAL(pthread_rwlock_timedrdlock)(m, abstime);
1597 if (res == 0) {1615 if (res == 0) {
1598 MutexPostReadLock(thr, pc, (uptr)m);1616 MutexPostReadLock(thr, pc, (uptr)m);
...@@ -1604,6 +1622,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_timedrdlock, void *m, void *abstime) {...@@ -1604,6 +1622,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_timedrdlock, void *m, void *abstime) {
1604TSAN_INTERCEPTOR(int, pthread_rwlock_wrlock, void *m) {1622TSAN_INTERCEPTOR(int, pthread_rwlock_wrlock, void *m) {
1605 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_wrlock, m);1623 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_wrlock, m);
1606 MutexPreLock(thr, pc, (uptr)m);1624 MutexPreLock(thr, pc, (uptr)m);
1625 AdaptiveDelay::SyncOp();
1607 int res = BLOCK_REAL(pthread_rwlock_wrlock)(m);1626 int res = BLOCK_REAL(pthread_rwlock_wrlock)(m);
1608 if (res == 0) {1627 if (res == 0) {
1609 MutexPostLock(thr, pc, (uptr)m);1628 MutexPostLock(thr, pc, (uptr)m);
...@@ -1613,6 +1632,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_wrlock, void *m) {...@@ -1613,6 +1632,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_wrlock, void *m) {
16131632
1614TSAN_INTERCEPTOR(int, pthread_rwlock_trywrlock, void *m) {1633TSAN_INTERCEPTOR(int, pthread_rwlock_trywrlock, void *m) {
1615 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_trywrlock, m);1634 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_trywrlock, m);
1635 AdaptiveDelay::SyncOp();
1616 int res = REAL(pthread_rwlock_trywrlock)(m);1636 int res = REAL(pthread_rwlock_trywrlock)(m);
1617 if (res == 0) {1637 if (res == 0) {
1618 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);1638 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);
...@@ -1623,6 +1643,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_trywrlock, void *m) {...@@ -1623,6 +1643,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_trywrlock, void *m) {
1623#if !SANITIZER_APPLE1643#if !SANITIZER_APPLE
1624TSAN_INTERCEPTOR(int, pthread_rwlock_timedwrlock, void *m, void *abstime) {1644TSAN_INTERCEPTOR(int, pthread_rwlock_timedwrlock, void *m, void *abstime) {
1625 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_timedwrlock, m, abstime);1645 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_timedwrlock, m, abstime);
1646 AdaptiveDelay::SyncOp();
1626 int res = REAL(pthread_rwlock_timedwrlock)(m, abstime);1647 int res = REAL(pthread_rwlock_timedwrlock)(m, abstime);
1627 if (res == 0) {1648 if (res == 0) {
1628 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);1649 MutexPostLock(thr, pc, (uptr)m, MutexFlagTryLock);
...@@ -1635,6 +1656,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_unlock, void *m) {...@@ -1635,6 +1656,7 @@ TSAN_INTERCEPTOR(int, pthread_rwlock_unlock, void *m) {
1635 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_unlock, m);1656 SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_unlock, m);
1636 MutexReadOrWriteUnlock(thr, pc, (uptr)m);1657 MutexReadOrWriteUnlock(thr, pc, (uptr)m);
1637 int res = REAL(pthread_rwlock_unlock)(m);1658 int res = REAL(pthread_rwlock_unlock)(m);
1659 AdaptiveDelay::SyncOp();
1638 return res;1660 return res;
1639}1661}
16401662
...@@ -2574,9 +2596,9 @@ static void HandleRecvmsg(ThreadState *thr, uptr pc,...@@ -2574,9 +2596,9 @@ static void HandleRecvmsg(ThreadState *thr, uptr pc,
25742596
2575#define COMMON_INTERCEPTOR_DLOPEN(filename, flag) \2597#define COMMON_INTERCEPTOR_DLOPEN(filename, flag) \
2576 ({ \2598 ({ \
2577 CheckNoDeepBind(filename, flag); \2599 OnDlOpen(filename, flag); \
2578 ThreadIgnoreBegin(thr, 0); \2600 ThreadIgnoreBegin(thr, 0); \
2579 void *res = REAL(dlopen)(filename, flag); \2601 void* res = REAL(dlopen)(filename, flag); \
2580 ThreadIgnoreEnd(thr); \2602 ThreadIgnoreEnd(thr); \
2581 res; \2603 res; \
2582 })2604 })
lib/libtsan/tsan_interface_ann.cpp+9-5
...@@ -9,17 +9,19 @@...@@ -9,17 +9,19 @@
9// This file is a part of ThreadSanitizer (TSan), a race detector.9// This file is a part of ThreadSanitizer (TSan), a race detector.
10//10//
11//===----------------------------------------------------------------------===//11//===----------------------------------------------------------------------===//
12#include "sanitizer_common/sanitizer_libc.h"12#include "tsan_interface_ann.h"
13
13#include "sanitizer_common/sanitizer_internal_defs.h"14#include "sanitizer_common/sanitizer_internal_defs.h"
15#include "sanitizer_common/sanitizer_libc.h"
14#include "sanitizer_common/sanitizer_placement_new.h"16#include "sanitizer_common/sanitizer_placement_new.h"
15#include "sanitizer_common/sanitizer_stacktrace.h"17#include "sanitizer_common/sanitizer_stacktrace.h"
16#include "sanitizer_common/sanitizer_vector.h"18#include "sanitizer_common/sanitizer_vector.h"
17#include "tsan_interface_ann.h"19#include "tsan_adaptive_delay.h"
18#include "tsan_report.h"
19#include "tsan_rtl.h"
20#include "tsan_mman.h"
21#include "tsan_flags.h"20#include "tsan_flags.h"
21#include "tsan_mman.h"
22#include "tsan_platform.h"22#include "tsan_platform.h"
23#include "tsan_report.h"
24#include "tsan_rtl.h"
2325
24#define CALLERPC ((uptr)__builtin_return_address(0))26#define CALLERPC ((uptr)__builtin_return_address(0))
2527
...@@ -370,6 +372,7 @@ void __tsan_mutex_pre_lock(void *m, unsigned flagz) {...@@ -370,6 +372,7 @@ void __tsan_mutex_pre_lock(void *m, unsigned flagz) {
370 }372 }
371 ThreadIgnoreBegin(thr, 0);373 ThreadIgnoreBegin(thr, 0);
372 ThreadIgnoreSyncBegin(thr, 0);374 ThreadIgnoreSyncBegin(thr, 0);
375 AdaptiveDelay::SyncOp();
373}376}
374377
375INTERFACE_ATTRIBUTE378INTERFACE_ATTRIBUTE
...@@ -402,6 +405,7 @@ int __tsan_mutex_pre_unlock(void *m, unsigned flagz) {...@@ -402,6 +405,7 @@ int __tsan_mutex_pre_unlock(void *m, unsigned flagz) {
402405
403INTERFACE_ATTRIBUTE406INTERFACE_ATTRIBUTE
404void __tsan_mutex_post_unlock(void *m, unsigned flagz) {407void __tsan_mutex_post_unlock(void *m, unsigned flagz) {
408 AdaptiveDelay::SyncOp();
405 SCOPED_ANNOTATION(__tsan_mutex_post_unlock);409 SCOPED_ANNOTATION(__tsan_mutex_post_unlock);
406 ThreadIgnoreSyncEnd(thr);410 ThreadIgnoreSyncEnd(thr);
407 ThreadIgnoreEnd(thr);411 ThreadIgnoreEnd(thr);
lib/libtsan/tsan_interface_atomic.cpp+12
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
21#include "sanitizer_common/sanitizer_mutex.h"21#include "sanitizer_common/sanitizer_mutex.h"
22#include "sanitizer_common/sanitizer_placement_new.h"22#include "sanitizer_common/sanitizer_placement_new.h"
23#include "sanitizer_common/sanitizer_stacktrace.h"23#include "sanitizer_common/sanitizer_stacktrace.h"
24#include "tsan_adaptive_delay.h"
24#include "tsan_flags.h"25#include "tsan_flags.h"
25#include "tsan_interface.h"26#include "tsan_interface.h"
26#include "tsan_rtl.h"27#include "tsan_rtl.h"
...@@ -520,8 +521,19 @@ static morder to_morder(int mo) {...@@ -520,8 +521,19 @@ static morder to_morder(int mo) {
520 return res;521 return res;
521}522}
522523
524template <class... Types>
525ALWAYS_INLINE auto AtomicDelayImpl(morder mo, Types... args) {
526 AdaptiveDelay::AtomicOpFence(mo);
527}
528
529template <class AddrType, class... Types>
530ALWAYS_INLINE auto AtomicDelayImpl(morder mo, AddrType addr, Types... args) {
531 AdaptiveDelay::AtomicOpAddr((uptr)addr, (int)mo);
532}
533
523template <class Op, class... Types>534template <class Op, class... Types>
524ALWAYS_INLINE auto AtomicImpl(morder mo, Types... args) {535ALWAYS_INLINE auto AtomicImpl(morder mo, Types... args) {
536 AtomicDelayImpl(mo, args...);
525 ThreadState *const thr = cur_thread();537 ThreadState *const thr = cur_thread();
526 ProcessPendingSignals(thr);538 ProcessPendingSignals(thr);
527 if (UNLIKELY(thr->ignore_sync || thr->ignore_interceptors))539 if (UNLIKELY(thr->ignore_sync || thr->ignore_interceptors))
lib/libtsan/tsan_platform.h+10-7
...@@ -404,7 +404,7 @@ struct MappingRiscv64_39 {...@@ -404,7 +404,7 @@ struct MappingRiscv64_39 {
404 static const uptr kHeapMemBeg = 0x2c00000000ull;404 static const uptr kHeapMemBeg = 0x2c00000000ull;
405 static const uptr kHeapMemEnd = 0x2c00000000ull;405 static const uptr kHeapMemEnd = 0x2c00000000ull;
406 static const uptr kHiAppMemBeg = 0x3c00000000ull;406 static const uptr kHiAppMemBeg = 0x3c00000000ull;
407 static const uptr kHiAppMemEnd = 0x3fffffffffull;407 static const uptr kHiAppMemEnd = 0x4000000000ull;
408 static const uptr kShadowMsk = 0x3800000000ull;408 static const uptr kShadowMsk = 0x3800000000ull;
409 static const uptr kShadowXor = 0x0800000000ull;409 static const uptr kShadowXor = 0x0800000000ull;
410 static const uptr kShadowAdd = 0x0000000000ull;410 static const uptr kShadowAdd = 0x0000000000ull;
...@@ -434,7 +434,7 @@ struct MappingRiscv64_48 {...@@ -434,7 +434,7 @@ struct MappingRiscv64_48 {
434 static const uptr kHeapMemBeg = 0x5a0000000000ull;434 static const uptr kHeapMemBeg = 0x5a0000000000ull;
435 static const uptr kHeapMemEnd = 0x5a0000000000ull;435 static const uptr kHeapMemEnd = 0x5a0000000000ull;
436 static const uptr kHiAppMemBeg = 0x7a0000000000ull;436 static const uptr kHiAppMemBeg = 0x7a0000000000ull;
437 static const uptr kHiAppMemEnd = 0x7fffffffffffull;437 static const uptr kHiAppMemEnd = 0x800000000000ull;
438 static const uptr kShadowMsk = 0x700000000000ull;438 static const uptr kShadowMsk = 0x700000000000ull;
439 static const uptr kShadowXor = 0x100000000000ull;439 static const uptr kShadowXor = 0x100000000000ull;
440 static const uptr kShadowAdd = 0x000000000000ull;440 static const uptr kShadowAdd = 0x000000000000ull;
...@@ -738,13 +738,16 @@ struct MappingGoRiscv64_48 {...@@ -738,13 +738,16 @@ struct MappingGoRiscv64_48 {
738Go on linux/s390x738Go on linux/s390x
7390000 0000 1000 - 1000 0000 0000: executable and heap - 16 TiB7390000 0000 1000 - 1000 0000 0000: executable and heap - 16 TiB
7401000 0000 0000 - 4000 0000 0000: -7401000 0000 0000 - 4000 0000 0000: -
7414000 0000 0000 - 6000 0000 0000: shadow - 64TiB (4 * app)7414000 0000 0000 - 6000 0000 0000: shadow - 32 TiB (2 * app)
7426000 0000 0000 - 9000 0000 0000: -7426000 0000 0000 - 7000 0000 0000: -
7439000 0000 0000 - 9800 0000 0000: metainfo - 8TiB (0.5 * app)7437000 0000 0000 - 7800 0000 0000: metainfo - 8 TiB (0.5 * app)
7447800 0000 0000 - 8000 0000 0000: -
744*/745*/
745struct MappingGoS390x {746struct MappingGoS390x {
746 static const uptr kMetaShadowBeg = 0x900000000000ull;747 // Keep the mapping below 2^47 for QEMU linux-user on x86-64 hosts with
747 static const uptr kMetaShadowEnd = 0x980000000000ull;748 // four-level page tables.
749 static const uptr kMetaShadowBeg = 0x700000000000ull;
750 static const uptr kMetaShadowEnd = 0x780000000000ull;
748 static const uptr kShadowBeg = 0x400000000000ull;751 static const uptr kShadowBeg = 0x400000000000ull;
749 static const uptr kShadowEnd = 0x600000000000ull;752 static const uptr kShadowEnd = 0x600000000000ull;
750 static const uptr kLoAppMemBeg = 0x000000001000ull;753 static const uptr kLoAppMemBeg = 0x000000001000ull;
lib/libtsan/tsan_platform_linux.cpp+12
...@@ -27,6 +27,18 @@...@@ -27,6 +27,18 @@
27#include "tsan_platform.h"27#include "tsan_platform.h"
28#include "tsan_rtl.h"28#include "tsan_rtl.h"
2929
30#if SANITIZER_NETBSD
31# // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
32# define _RTLD_SOURCE
33# include <sys/types.h>
34# include <machine/mcontext.h>
35# undef _RTLD_SOURCE
36# include <sys/param.h>
37# if __NetBSD_Version__ >= 1099001200
38# include <machine/lwp_private.h>
39# endif
40#endif
41
30#include <fcntl.h>42#include <fcntl.h>
31#include <pthread.h>43#include <pthread.h>
32#include <signal.h>44#include <signal.h>
lib/libtsan/tsan_report.cpp+3-2
...@@ -317,8 +317,9 @@ void PrintReport(const ReportDesc *rep) {...@@ -317,8 +317,9 @@ void PrintReport(const ReportDesc *rep) {
317 } else {317 } else {
318 PrintStack(rep->stacks[i]);318 PrintStack(rep->stacks[i]);
319 if (i == 0)319 if (i == 0)
320 Printf(" Hint: use TSAN_OPTIONS=second_deadlock_stack=1 "320 Printf(
321 "to get more informative warning message\n\n");321 " HINT: use TSAN_OPTIONS=second_deadlock_stack=1 "
322 "to get more informative warning message\n\n");
322 }323 }
323 }324 }
324 } else {325 } else {
lib/libtsan/tsan_rtl.cpp+5
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
21#include "sanitizer_common/sanitizer_placement_new.h"21#include "sanitizer_common/sanitizer_placement_new.h"
22#include "sanitizer_common/sanitizer_stackdepot.h"22#include "sanitizer_common/sanitizer_stackdepot.h"
23#include "sanitizer_common/sanitizer_symbolizer.h"23#include "sanitizer_common/sanitizer_symbolizer.h"
24#include "tsan_adaptive_delay.h"
24#include "tsan_defs.h"25#include "tsan_defs.h"
25#include "tsan_interface.h"26#include "tsan_interface.h"
26#include "tsan_mman.h"27#include "tsan_mman.h"
...@@ -775,6 +776,10 @@ void Initialize(ThreadState *thr) {...@@ -775,6 +776,10 @@ void Initialize(ThreadState *thr) {
775 while (__tsan_resumed == 0) {}776 while (__tsan_resumed == 0) {}
776 }777 }
777778
779#if !SANITIZER_GO
780 AdaptiveDelay::Init();
781#endif
782
778 OnInitialize();783 OnInitialize();
779}784}
780785
lib/libtsan/tsan_rtl.h+3
...@@ -34,6 +34,7 @@...@@ -34,6 +34,7 @@
34#include "sanitizer_common/sanitizer_suppressions.h"34#include "sanitizer_common/sanitizer_suppressions.h"
35#include "sanitizer_common/sanitizer_thread_registry.h"35#include "sanitizer_common/sanitizer_thread_registry.h"
36#include "sanitizer_common/sanitizer_vector.h"36#include "sanitizer_common/sanitizer_vector.h"
37#include "tsan_adaptive_delay.h"
37#include "tsan_defs.h"38#include "tsan_defs.h"
38#include "tsan_flags.h"39#include "tsan_flags.h"
39#include "tsan_ignoreset.h"40#include "tsan_ignoreset.h"
...@@ -240,6 +241,8 @@ struct alignas(SANITIZER_CACHE_LINE_SIZE) ThreadState {...@@ -240,6 +241,8 @@ struct alignas(SANITIZER_CACHE_LINE_SIZE) ThreadState {
240 bool in_internal_write_call;241 bool in_internal_write_call;
241#endif242#endif
242243
244 AdaptiveDelayState adaptive_delay_state;
245
243 explicit ThreadState(Tid tid);246 explicit ThreadState(Tid tid);
244};247};
245248
lib/libtsan/ubsan/ubsan_flags.h+4
...@@ -41,6 +41,10 @@ extern "C" {...@@ -41,6 +41,10 @@ extern "C" {
41// override the default flag values.41// override the default flag values.
42SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE42SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
43const char *__ubsan_default_options();43const char *__ubsan_default_options();
44// Users may provide their own implementation of __ubsan_default_suppressions to
45// override the default suppression values.
46SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *
47__ubsan_default_suppressions();
44} // extern "C"48} // extern "C"
4549
46#endif // UBSAN_FLAGS_H50#endif // UBSAN_FLAGS_H
lib/libunwind/include/__libunwind_config.h+1-1
...@@ -9,7 +9,7 @@...@@ -9,7 +9,7 @@
9#ifndef ____LIBUNWIND_CONFIG_H__9#ifndef ____LIBUNWIND_CONFIG_H__
10#define ____LIBUNWIND_CONFIG_H__10#define ____LIBUNWIND_CONFIG_H__
1111
12#define _LIBUNWIND_VERSION 1500012#define _LIBUNWIND_VERSION 230000
1313
14#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \14#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
15 !defined(__ARM_DWARF_EH__) && !defined(__SEH__)15 !defined(__ARM_DWARF_EH__) && !defined(__SEH__)
lib/libunwind/include/libunwind.h+1-1
...@@ -122,7 +122,7 @@...@@ -122,7 +122,7 @@
122 __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer, 1, \122 __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer, 1, \
123 __ptrauth_unwind_cie_info_personality_disc)123 __ptrauth_unwind_cie_info_personality_disc)
124124
125 // ptrauth_string_discriminator("personality") == 0x7EAD)125 // ptrauth_string_discriminator("personality") == 0x7EAD
126 #define __ptrauth_unwind_pauthtest_personality_disc 0x7EAD126 #define __ptrauth_unwind_pauthtest_personality_disc 0x7EAD
127127
128#else128#else
lib/libunwind/include/mach-o/compact_unwind_encoding.h+1-1
...@@ -443,7 +443,7 @@ struct unwind_info_section_header_lsda_index_entry...@@ -443,7 +443,7 @@ struct unwind_info_section_header_lsda_index_entry
443443
444struct unwind_info_regular_second_level_entry444struct unwind_info_regular_second_level_entry
445{445{
446 uint32_t functionOffset;446 uint32_t functionOffset;
447 compact_unwind_encoding_t encoding;447 compact_unwind_encoding_t encoding;
448};448};
449449
lib/libunwind/include/unwind_itanium.h+1-1
...@@ -32,7 +32,7 @@ struct _Unwind_Exception {...@@ -32,7 +32,7 @@ struct _Unwind_Exception {
32 // The implementation of _Unwind_Exception uses an attribute mode on the32 // The implementation of _Unwind_Exception uses an attribute mode on the
33 // above fields which has the side effect of causing this whole struct to33 // above fields which has the side effect of causing this whole struct to
34 // round up to 32 bytes in size (48 with SEH). To be more explicit, we add34 // round up to 32 bytes in size (48 with SEH). To be more explicit, we add
35 // pad fields added for binary compatibility.35 // pad fields for binary compatibility.
36 uint32_t reserved[3];36 uint32_t reserved[3];
37#endif37#endif
38 // The Itanium ABI requires that _Unwind_Exception objects are "double-word38 // The Itanium ABI requires that _Unwind_Exception objects are "double-word
lib/libunwind/src/AddressSpace.hpp-1
...@@ -666,7 +666,6 @@ inline bool LocalAddressSpace::findUnwindSections(...@@ -666,7 +666,6 @@ inline bool LocalAddressSpace::findUnwindSections(
666 return true;666 return true;
667 }667 }
668#endif668#endif
669 // zig patch: https://github.com/llvm/llvm-project/issues/194228
670 dl_iterate_cb_data cb_data = {this, &info, static_cast<pint_t>(targetAddr)};669 dl_iterate_cb_data cb_data = {this, &info, static_cast<pint_t>(targetAddr)};
671 int found = dl_iterate_phdr(findUnwindSectionsByPhdr, &cb_data);670 int found = dl_iterate_phdr(findUnwindSectionsByPhdr, &cb_data);
672 return static_cast<bool>(found);671 return static_cast<bool>(found);
lib/libunwind/src/CompactUnwinder.hpp+5-4
...@@ -12,6 +12,7 @@...@@ -12,6 +12,7 @@
12#ifndef __COMPACT_UNWINDER_HPP__12#ifndef __COMPACT_UNWINDER_HPP__
13#define __COMPACT_UNWINDER_HPP__13#define __COMPACT_UNWINDER_HPP__
1414
15#include <inttypes.h>
15#include <stdint.h>16#include <stdint.h>
16#include <stdlib.h>17#include <stdlib.h>
1718
...@@ -335,8 +336,8 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame(...@@ -335,8 +336,8 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame(
335 default:336 default:
336 (void)functionStart;337 (void)functionStart;
337 _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "338 _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "
338 "function starting at 0x%llX",339 "function starting at 0x%" PRIu64 "X",
339 compactEncoding, functionStart);340 compactEncoding, functionStart);
340 _LIBUNWIND_ABORT("invalid compact unwind encoding");341 _LIBUNWIND_ABORT("invalid compact unwind encoding");
341 }342 }
342 savedRegisters += 8;343 savedRegisters += 8;
...@@ -454,8 +455,8 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless(...@@ -454,8 +455,8 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless(
454 break;455 break;
455 default:456 default:
456 _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "457 _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
457 "function starting at 0x%llX",458 "function starting at 0x%" PRIu64 "X",
458 encoding, functionStart);459 encoding, functionStart);
459 _LIBUNWIND_ABORT("invalid compact unwind encoding");460 _LIBUNWIND_ABORT("invalid compact unwind encoding");
460 }461 }
461 savedRegisters += 8;462 savedRegisters += 8;
lib/libunwind/src/DwarfInstructions.hpp+17-26
...@@ -76,10 +76,14 @@ private:...@@ -76,10 +76,14 @@ private:
76 __builtin_unreachable();76 __builtin_unreachable();
77 }77 }
78#if defined(_LIBUNWIND_TARGET_AARCH64)78#if defined(_LIBUNWIND_TARGET_AARCH64)
79 static bool isReturnAddressSigned(A &addressSpace, R registers, pint_t cfa,79 enum RASignStatus {
80 PrologInfo &prolog);80 RANotSigned = 0,
81 static bool isReturnAddressSignedWithPC(A &addressSpace, R registers,81 RASigned = 1,
82 pint_t cfa, PrologInfo &prolog);82 RASignedWithPC = 2,
83 };
84 static RASignStatus getReturnAddressSignStatus(A &addressSpace, R registers,
85 pint_t cfa,
86 PrologInfo &prolog);
83#endif87#endif
84};88};
8589
...@@ -177,7 +181,8 @@ v128 DwarfInstructions<A, R>::getSavedVectorRegister(...@@ -177,7 +181,8 @@ v128 DwarfInstructions<A, R>::getSavedVectorRegister(
177}181}
178#if defined(_LIBUNWIND_TARGET_AARCH64)182#if defined(_LIBUNWIND_TARGET_AARCH64)
179template <typename A, typename R>183template <typename A, typename R>
180bool DwarfInstructions<A, R>::isReturnAddressSigned(A &addressSpace,184typename DwarfInstructions<A, R>::RASignStatus
185DwarfInstructions<A, R>::getReturnAddressSignStatus(A &addressSpace,
181 R registers, pint_t cfa,186 R registers, pint_t cfa,
182 PrologInfo &prolog) {187 PrologInfo &prolog) {
183 pint_t raSignState;188 pint_t raSignState;
...@@ -187,24 +192,9 @@ bool DwarfInstructions<A, R>::isReturnAddressSigned(A &addressSpace,...@@ -187,24 +192,9 @@ bool DwarfInstructions<A, R>::isReturnAddressSigned(A &addressSpace,
187 else192 else
188 raSignState = getSavedRegister(addressSpace, registers, cfa, regloc);193 raSignState = getSavedRegister(addressSpace, registers, cfa, regloc);
189194
190 // Only bit[0] is meaningful.195 // bits[1:0] describe how RA is signed.
191 return raSignState & 0x01;196 assert((raSignState & 0x3) != 3 && "unexpected RA sign state");
192}197 return static_cast<RASignStatus>(raSignState & 0x3);
193
194template <typename A, typename R>
195bool DwarfInstructions<A, R>::isReturnAddressSignedWithPC(A &addressSpace,
196 R registers,
197 pint_t cfa,
198 PrologInfo &prolog) {
199 pint_t raSignState;
200 auto regloc = prolog.savedRegisters[UNW_AARCH64_RA_SIGN_STATE];
201 if (regloc.location == CFI_Parser<A>::kRegisterUnused)
202 raSignState = static_cast<pint_t>(regloc.value);
203 else
204 raSignState = getSavedRegister(addressSpace, registers, cfa, regloc);
205
206 // Only bit[1] is meaningful.
207 return raSignState & 0x02;
208}198}
209#endif199#endif
210200
...@@ -317,8 +307,9 @@ int DwarfInstructions<A, R>::stepWithDwarf(...@@ -317,8 +307,9 @@ int DwarfInstructions<A, R>::stepWithDwarf(
317 // return address needs to be authenticated before the return address is307 // return address needs to be authenticated before the return address is
318 // restored. autia1716 is used instead of autia as autia1716 assembles308 // restored. autia1716 is used instead of autia as autia1716 assembles
319 // to a NOP on pre-v8.3a architectures.309 // to a NOP on pre-v8.3a architectures.
320 if ((R::getArch() == REGISTERS_ARM64) &&310 RASignStatus RAState =
321 isReturnAddressSigned(addressSpace, registers, cfa, prolog) &&311 getReturnAddressSignStatus(addressSpace, registers, cfa, prolog);
312 if ((R::getArch() == REGISTERS_ARM64) && RAState != RANotSigned &&
322 returnAddress != 0) {313 returnAddress != 0) {
323#if !defined(_LIBUNWIND_IS_NATIVE_ONLY)314#if !defined(_LIBUNWIND_IS_NATIVE_ONLY)
324 return UNW_ECROSSRASIGNING;315 return UNW_ECROSSRASIGNING;
...@@ -329,7 +320,7 @@ int DwarfInstructions<A, R>::stepWithDwarf(...@@ -329,7 +320,7 @@ int DwarfInstructions<A, R>::stepWithDwarf(
329 // We use the hint versions of the authentication instructions below to320 // We use the hint versions of the authentication instructions below to
330 // ensure they're assembled by the compiler even for targets with no321 // ensure they're assembled by the compiler even for targets with no
331 // FEAT_PAuth/FEAT_PAuth_LR support.322 // FEAT_PAuth/FEAT_PAuth_LR support.
332 if (isReturnAddressSignedWithPC(addressSpace, registers, cfa, prolog)) {323 if (RAState == RASignedWithPC) {
333 register unsigned long long x15 __asm("x15") =324 register unsigned long long x15 __asm("x15") =
334 prolog.ptrAuthDiversifier;325 prolog.ptrAuthDiversifier;
335 if (cieInfo.addressesSignedWithBKey) {326 if (cieInfo.addressesSignedWithBKey) {
lib/libunwind/src/DwarfParser.hpp-1
...@@ -473,7 +473,6 @@ bool CFI_Parser<A>::parseFDEInstructions(...@@ -473,7 +473,6 @@ bool CFI_Parser<A>::parseFDEInstructions(
473 pint_t pcoffset;473 pint_t pcoffset;
474 };474 };
475475
476 // zig patch: https://github.com/llvm/llvm-project/issues/194228
477 ParseInfo parseInfoArray[] = {476 ParseInfo parseInfoArray[] = {
478 {cieInfo.cieInstructions, cieInfo.cieStart + cieInfo.cieLength,477 {cieInfo.cieInstructions, cieInfo.cieStart + cieInfo.cieLength,
479 (pint_t)(-1)},478 (pint_t)(-1)},
lib/libunwind/src/FrameHeaderCache.hpp+1-1
...@@ -24,7 +24,7 @@...@@ -24,7 +24,7 @@
24#define _LIBUNWIND_FRAMEHEADERCACHE_TRACE(msg, ...)24#define _LIBUNWIND_FRAMEHEADERCACHE_TRACE(msg, ...)
25#endif25#endif
2626
27// This cache should only be be used from within a dl_iterate_phdr callback.27// This cache should only be used from within a dl_iterate_phdr callback.
28// dl_iterate_phdr does the necessary synchronization to prevent problems28// dl_iterate_phdr does the necessary synchronization to prevent problems
29// with concurrent access via the libc load lock. Adding synchronization29// with concurrent access via the libc load lock. Adding synchronization
30// for other uses is possible, but not currently done.30// for other uses is possible, but not currently done.
lib/libunwind/src/Registers.hpp+17-6
...@@ -20,6 +20,9 @@...@@ -20,6 +20,9 @@
20#include "libunwind_ext.h"20#include "libunwind_ext.h"
21#include "shadow_stack_unwind.h"21#include "shadow_stack_unwind.h"
2222
23#if defined(__APPLE__)
24#include <sys/sysctl.h>
25#endif
23#if defined(_LIBUNWIND_HAVE_GETAUXVAL) || defined(_LIBUNWIND_HAVE_ELF_AUX_INFO)26#if defined(_LIBUNWIND_HAVE_GETAUXVAL) || defined(_LIBUNWIND_HAVE_ELF_AUX_INFO)
24#include <sys/auxv.h>27#include <sys/auxv.h>
25#endif28#endif
...@@ -1892,7 +1895,7 @@ public:...@@ -1892,7 +1895,7 @@ public:
1892 uint64_t value = _registers.__pc;1895 uint64_t value = _registers.__pc;
1893#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)1896#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
1894 // Note the value of the PC was signed to its address in the register state1897 // Note the value of the PC was signed to its address in the register state
1895 // but everyone else expects it to be sign by the SP, so convert on return.1898 // but everyone else expects it to be signed by the SP, so convert on return.
1896 value = (uint64_t)ptrauth_auth_and_resign((void *)_registers.__pc,1899 value = (uint64_t)ptrauth_auth_and_resign((void *)_registers.__pc,
1897 ptrauth_key_return_address,1900 ptrauth_key_return_address,
1898 &_registers.__pc,1901 &_registers.__pc,
...@@ -1940,7 +1943,15 @@ private:...@@ -1940,7 +1943,15 @@ private:
1940 _LIBUNWIND_ABORT("SME ZA disable failed");1943 _LIBUNWIND_ABORT("SME ZA disable failed");
1941 }1944 }
19421945
1943#if defined(_LIBUNWIND_HAVE_GETAUXVAL)1946#if defined(__APPLE__)
1947 static bool checkHasSME() {
1948 int has_sme = 0;
1949 size_t size = sizeof(has_sme);
1950 if (sysctlbyname("hw.optional.arm.FEAT_SME", &has_sme, &size, NULL, 0))
1951 return false;
1952 return has_sme != 0;
1953 }
1954#elif defined(_LIBUNWIND_HAVE_GETAUXVAL)
1944 static bool checkHasSME() {1955 static bool checkHasSME() {
1945 constexpr int hwcap2_sme = (1 << 23);1956 constexpr int hwcap2_sme = (1 << 23);
1946 unsigned long hwcap2 = getauxval(AT_HWCAP2);1957 unsigned long hwcap2 = getauxval(AT_HWCAP2);
...@@ -3724,21 +3735,21 @@ inline void Registers_sparc::setRegister(int regNum, uint32_t value) {...@@ -3724,21 +3735,21 @@ inline void Registers_sparc::setRegister(int regNum, uint32_t value) {
3724inline bool Registers_sparc::validFloatRegister(int) const { return false; }3735inline bool Registers_sparc::validFloatRegister(int) const { return false; }
37253736
3726inline double Registers_sparc::getFloatRegister(int) const {3737inline double Registers_sparc::getFloatRegister(int) const {
3727 _LIBUNWIND_ABORT("no Sparc float registers");3738 _LIBUNWIND_ABORT("no sparc float registers");
3728}3739}
37293740
3730inline void Registers_sparc::setFloatRegister(int, double) {3741inline void Registers_sparc::setFloatRegister(int, double) {
3731 _LIBUNWIND_ABORT("no Sparc float registers");3742 _LIBUNWIND_ABORT("no sparc float registers");
3732}3743}
37333744
3734inline bool Registers_sparc::validVectorRegister(int) const { return false; }3745inline bool Registers_sparc::validVectorRegister(int) const { return false; }
37353746
3736inline v128 Registers_sparc::getVectorRegister(int) const {3747inline v128 Registers_sparc::getVectorRegister(int) const {
3737 _LIBUNWIND_ABORT("no Sparc vector registers");3748 _LIBUNWIND_ABORT("no sparc vector registers");
3738}3749}
37393750
3740inline void Registers_sparc::setVectorRegister(int, v128) {3751inline void Registers_sparc::setVectorRegister(int, v128) {
3741 _LIBUNWIND_ABORT("no Sparc vector registers");3752 _LIBUNWIND_ABORT("no sparc vector registers");
3742}3753}
37433754
3744inline const char *Registers_sparc::getRegisterName(int regNum) {3755inline const char *Registers_sparc::getRegisterName(int regNum) {
lib/libunwind/src/Unwind-wasm.c+20-3
...@@ -54,7 +54,7 @@ _Unwind_Reason_Code _Unwind_CallPersonality(void *exception_ptr) {...@@ -54,7 +54,7 @@ _Unwind_Reason_Code _Unwind_CallPersonality(void *exception_ptr) {
54 __wasm_lpad_context.selector = 0;54 __wasm_lpad_context.selector = 0;
5555
56 // Call personality function. Wasm does not have two-phase unwinding, so we56 // Call personality function. Wasm does not have two-phase unwinding, so we
57 // only do the cleanup phase.57 // only do the search phase.
58 return __gxx_personality_wasm0(58 return __gxx_personality_wasm0(
59 1, _UA_SEARCH_PHASE, exception_object->exception_class, exception_object,59 1, _UA_SEARCH_PHASE, exception_object->exception_class, exception_object,
60 (struct _Unwind_Context *)&__wasm_lpad_context);60 (struct _Unwind_Context *)&__wasm_lpad_context);
...@@ -69,6 +69,21 @@ _Unwind_RaiseException(_Unwind_Exception *exception_object) {...@@ -69,6 +69,21 @@ _Unwind_RaiseException(_Unwind_Exception *exception_object) {
69 __builtin_wasm_throw(0, exception_object);69 __builtin_wasm_throw(0, exception_object);
70}70}
7171
72// Define the `__cpp_exception` symbol which `__builtin_wasm_throw` above will
73// reference. This is defined here in `libunwind` as the single canonical
74// definition for this API and it's required for users to ensure that there's
75// only one copy of `libunwind` within a wasm module to ensure this is only
76// defined once and exactly once.
77__asm__(".globl __cpp_exception\n"
78#if defined(__wasm32__)
79 ".tagtype __cpp_exception i32\n"
80#elif defined(__wasm64__)
81 ".tagtype __cpp_exception i64\n"
82#else
83#error "Unsupported Wasm architecture"
84#endif
85 "__cpp_exception:\n");
86
72/// Called by __cxa_end_catch.87/// Called by __cxa_end_catch.
73_LIBUNWIND_EXPORT void88_LIBUNWIND_EXPORT void
74_Unwind_DeleteException(_Unwind_Exception *exception_object) {89_Unwind_DeleteException(_Unwind_Exception *exception_object) {
...@@ -102,7 +117,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {...@@ -102,7 +117,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
102}117}
103118
104/// Not used in Wasm.119/// Not used in Wasm.
105_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {}120_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
121 uintptr_t value) {}
106122
107/// Called by personality handler to get LSDA for current frame.123/// Called by personality handler to get LSDA for current frame.
108_LIBUNWIND_EXPORT uintptr_t124_LIBUNWIND_EXPORT uintptr_t
...@@ -114,7 +130,8 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {...@@ -114,7 +130,8 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
114}130}
115131
116/// Not used in Wasm.132/// Not used in Wasm.
117_LIBUNWIND_EXPORT uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *) {133_LIBUNWIND_EXPORT uintptr_t
134_Unwind_GetRegionStart(struct _Unwind_Context *context) {
118 return 0;135 return 0;
119}136}
120137
lib/libunwind/src/UnwindCursor.hpp+119-7
...@@ -963,7 +963,7 @@ template <typename A, typename R> bool UnwindCursor<A, R>::isSignalFrame() {...@@ -963,7 +963,7 @@ template <typename A, typename R> bool UnwindCursor<A, R>::isSignalFrame() {
963/// UnwindCursor contains all state (including all register values) during963/// UnwindCursor contains all state (including all register values) during
964/// an unwind. This is normally stack allocated inside a unw_cursor_t.964/// an unwind. This is normally stack allocated inside a unw_cursor_t.
965template <typename A, typename R>965template <typename A, typename R>
966class UnwindCursor : public AbstractUnwindCursor{966class UnwindCursor : public AbstractUnwindCursor {
967 typedef typename A::pint_t pint_t;967 typedef typename A::pint_t pint_t;
968public:968public:
969 UnwindCursor(unw_context_t *context, A &as);969 UnwindCursor(unw_context_t *context, A &as);
...@@ -1363,6 +1363,10 @@ private:...@@ -1363,6 +1363,10 @@ private:
1363 reinterpret_cast<tbtable *>(_info.unwind_info),1363 reinterpret_cast<tbtable *>(_info.unwind_info),
1364 _registers, _isSignalFrame);1364 _registers, _isSignalFrame);
1365 }1365 }
1366 bool isKnownVapiNotActive() const { return _isKnownVapiNotActive; }
1367 void setIsKnownVapiNotActive(bool val) { _isKnownVapiNotActive = val; }
1368 static pint_t getVAPILR();
1369
1366#endif // defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)1370#endif // defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
13671371
1368 A &_addressSpace;1372 A &_addressSpace;
...@@ -1377,13 +1381,23 @@ private:...@@ -1377,13 +1381,23 @@ private:
1377#ifdef _LIBUNWIND_TRACE_RET_INJECT1381#ifdef _LIBUNWIND_TRACE_RET_INJECT
1378 uint32_t _walkedFrames;1382 uint32_t _walkedFrames;
1379#endif1383#endif
1384#if defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
1385 // TODO: this will need to be recorded in the unw_context_t by unw_getcontext
1386 // to support cases where the cursor is retrieved prior to invocation of the
1387 // Virtual API.
1388 bool _isKnownVapiNotActive;
1389#endif
1380};1390};
13811391
1382
1383template <typename A, typename R>1392template <typename A, typename R>
1384UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)1393UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
1385 : _addressSpace(as), _registers(context), _unwindInfoMissing(false),1394 : _addressSpace(as), _registers(context), _unwindInfoMissing(false),
1386 _isSignalFrame(false) {1395 _isSignalFrame(false)
1396#if defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
1397 ,
1398 _isKnownVapiNotActive(false)
1399#endif
1400{
1387 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),1401 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),
1388 "UnwindCursor<> does not fit in unw_cursor_t");1402 "UnwindCursor<> does not fit in unw_cursor_t");
1389 static_assert((alignof(UnwindCursor<A, R>) <= alignof(unw_cursor_t)),1403 static_assert((alignof(UnwindCursor<A, R>) <= alignof(unw_cursor_t)),
...@@ -1393,13 +1407,17 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)...@@ -1393,13 +1407,17 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
13931407
1394template <typename A, typename R>1408template <typename A, typename R>
1395UnwindCursor<A, R>::UnwindCursor(A &as, void *)1409UnwindCursor<A, R>::UnwindCursor(A &as, void *)
1396 : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false) {1410 : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false)
1411#if defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
1412 ,
1413 _isKnownVapiNotActive(false)
1414#endif
1415{
1397 memset(static_cast<void *>(&_info), 0, sizeof(_info));1416 memset(static_cast<void *>(&_info), 0, sizeof(_info));
1398 // FIXME1417 // FIXME
1399 // fill in _registers from thread arg1418 // fill in _registers from thread arg
1400}1419}
14011420
1402
1403template <typename A, typename R>1421template <typename A, typename R>
1404bool UnwindCursor<A, R>::validReg(int regNum) {1422bool UnwindCursor<A, R>::validReg(int regNum) {
1405 return _registers.validRegister(regNum);1423 return _registers.validRegister(regNum);
...@@ -1469,6 +1487,30 @@ template <typename A, typename R> void UnwindCursor<A, R>::jumpto() {...@@ -1469,6 +1487,30 @@ template <typename A, typename R> void UnwindCursor<A, R>::jumpto() {
1469 static constexpr size_t _EXTRA_LIBUNWIND_FRAMES_WALKED = 5 - 1;1487 static constexpr size_t _EXTRA_LIBUNWIND_FRAMES_WALKED = 5 - 1;
1470 _registers.returnto(_walkedFrames + _EXTRA_LIBUNWIND_FRAMES_WALKED);1488 _registers.returnto(_walkedFrames + _EXTRA_LIBUNWIND_FRAMES_WALKED);
1471#else1489#else
1490#if defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
1491 if (isKnownVapiNotActive()) {
1492 // If the current frame is known VAPI not active, execute the VAPI return
1493 // glue to clear the VAPI control block. The VAPI return glue is used by
1494 // AIX longjmp based on the VAPI active status recorded by setjmp in the
1495 // jmp_buf, which means that the VAPI return glue can be called solely on
1496 // the basis of the VAPI active status of the target context.
1497
1498 // VAPI return glue address is the VAPI glue address - 4.
1499#ifdef __64BIT__
1500 constexpr pint_t VAPIReturnGlue = 0x8e40 - 4;
1501#else
1502 constexpr pint_t VAPIReturnGlue = 0x8c40 - 4;
1503#endif
1504
1505 _LIBUNWIND_TRACE_UNWINDING("VAPI: executing return glue %p\n",
1506 reinterpret_cast<void *>(VAPIReturnGlue));
1507 register auto *registers __asm__("r30") = &_registers;
1508 __asm__ __volatile__("bla %[retglue]"
1509 : "+r"(registers)
1510 : [retglue] "i"(VAPIReturnGlue));
1511 registers->jumpto();
1512 }
1513#endif // defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
1472 _registers.jumpto();1514 _registers.jumpto();
1473#endif1515#endif
1474}1516}
...@@ -2037,7 +2079,7 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(...@@ -2037,7 +2079,7 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(
2037 if (personalityIndex != 0) {2079 if (personalityIndex != 0) {
2038 --personalityIndex; // change 1-based to zero-based index2080 --personalityIndex; // change 1-based to zero-based index
2039 if (personalityIndex >= sectionHeader.personalityArrayCount()) {2081 if (personalityIndex >= sectionHeader.personalityArrayCount()) {
2040 _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "2082 _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "
2041 "but personality table has only %d entries",2083 "but personality table has only %d entries",
2042 encoding, personalityIndex,2084 encoding, personalityIndex,
2043 sectionHeader.personalityArrayCount());2085 sectionHeader.personalityArrayCount());
...@@ -2459,6 +2501,45 @@ bool UnwindCursor<A, R>::getInfoFromTBTable(pint_t pc, R &registers) {...@@ -2459,6 +2501,45 @@ bool UnwindCursor<A, R>::getInfoFromTBTable(pint_t pc, R &registers) {
2459 return true;2501 return true;
2460}2502}
24612503
2504// VAPI glue addresses
2505constexpr uintptr_t vapi_glue_addr_ext_32 = 0x8b80;
2506constexpr uintptr_t vapi_addr_64 = 0x8e00;
2507constexpr size_t vapi_size_64 = 0x0200;
2508constexpr uintptr_t vapi_glue_addr_begin =
2509 vapi_glue_addr_ext_32; // Start address in 32-bit
2510constexpr uintptr_t vapi_glue_addr_end =
2511 vapi_addr_64 + vapi_size_64; // End address in 64-bit
2512
2513#ifdef __64BIT__
2514constexpr size_t VAPI_CB_SIZE = 256;
2515constexpr ptrdiff_t TLS_POINTER_OFFSET = 30 * 1024;
2516constexpr size_t TLSCB_BASE_SIZE = 256;
2517
2518static __inline__ __attribute__((__always_inline__)) char *tptr(void) {
2519 char *result;
2520 __asm__("mr %0, 13" : "=r"(result));
2521 return result;
2522}
2523#else // 32-bit
2524constexpr size_t VAPI_CB_SIZE = 128;
2525constexpr ptrdiff_t TLS_POINTER_OFFSET = 31 * 1024;
2526constexpr size_t TLSCB_BASE_SIZE = 128;
2527
2528static __inline__ __attribute__((__always_inline__)) char *tptr(void) {
2529 char *result;
2530 __asm__("mfspr %0, 259" : "=r"(result));
2531 return result;
2532}
2533#endif
2534
2535constexpr ptrdiff_t VAPI_CB_OFFSET =
2536 TLS_POINTER_OFFSET + VAPI_CB_SIZE + TLSCB_BASE_SIZE;
2537
2538template <typename A, typename R>
2539typename UnwindCursor<A, R>::pint_t UnwindCursor<A, R>::getVAPILR() {
2540 return *reinterpret_cast<pint_t *>(tptr() - VAPI_CB_OFFSET + 8);
2541}
2542
2462// Step back up the stack following the frame back link.2543// Step back up the stack following the frame back link.
2463template <typename A, typename R>2544template <typename A, typename R>
2464int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,2545int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
...@@ -2511,6 +2592,16 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,...@@ -2511,6 +2592,16 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
2511 _LIBUNWIND_TRACE_UNWINDING("Possible signal handler frame: lastStack=%p",2592 _LIBUNWIND_TRACE_UNWINDING("Possible signal handler frame: lastStack=%p",
2512 reinterpret_cast<void *>(lastStack));2593 reinterpret_cast<void *>(lastStack));
25132594
2595 pint_t returnAddressInStack = reinterpret_cast<pint_t *>(lastStack)[2];
2596 if (vapi_glue_addr_begin <= returnAddressInStack &&
2597 returnAddressInStack < vapi_glue_addr_end) {
2598 _LIBUNWIND_TRACE_UNWINDING(
2599 "The return address in stack %p is within the range of VAPI address;"
2600 " set isKnownVapiNotActive to true\n",
2601 reinterpret_cast<void *>(returnAddressInStack));
2602 setIsKnownVapiNotActive(true);
2603 }
2604
2514 sigcontext *sigContext = reinterpret_cast<sigcontext *>(2605 sigcontext *sigContext = reinterpret_cast<sigcontext *>(
2515 reinterpret_cast<char *>(lastStack) + STKMINALIGN);2606 reinterpret_cast<char *>(lastStack) + STKMINALIGN);
2516 returnAddress = sigContext->sc_jmpbuf.jmp_context.iar;2607 returnAddress = sigContext->sc_jmpbuf.jmp_context.iar;
...@@ -2579,6 +2670,17 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,...@@ -2579,6 +2670,17 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
2579 } else {2670 } else {
2580 // Otherwise, use the LR value in the stack link area.2671 // Otherwise, use the LR value in the stack link area.
2581 returnAddress = reinterpret_cast<pint_t *>(lastStack)[2];2672 returnAddress = reinterpret_cast<pint_t *>(lastStack)[2];
2673
2674 if (vapi_glue_addr_begin <= returnAddress &&
2675 returnAddress < vapi_glue_addr_end) {
2676 _LIBUNWIND_TRACE_UNWINDING(
2677 "The return address=%p is within the range of VAPI address;",
2678 reinterpret_cast<void *>(returnAddress));
2679 setIsKnownVapiNotActive(true);
2680 returnAddress = getVAPILR();
2681 _LIBUNWIND_TRACE_UNWINDING("return address=%p from VAPI\n",
2682 reinterpret_cast<void *>(returnAddress));
2683 }
2582 }2684 }
25832685
2584 // Reset LR in the current context.2686 // Reset LR in the current context.
...@@ -2709,6 +2811,16 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,...@@ -2709,6 +2811,16 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
2709 // Return address is the address after call site instruction.2811 // Return address is the address after call site instruction.
2710 pint_t nextReturnAddress = reinterpret_cast<pint_t *>(nextStack)[2];2812 pint_t nextReturnAddress = reinterpret_cast<pint_t *>(nextStack)[2];
27112813
2814 if (vapi_glue_addr_begin <= nextReturnAddress &&
2815 nextReturnAddress < vapi_glue_addr_end) {
2816 _LIBUNWIND_TRACE_UNWINDING(
2817 "The next return address=%p is within the range of VAPI address;",
2818 reinterpret_cast<void *>(nextReturnAddress));
2819 nextReturnAddress = getVAPILR();
2820 _LIBUNWIND_TRACE_UNWINDING("the next return address=%p from VAPI\n",
2821 reinterpret_cast<void *>(nextReturnAddress));
2822 }
2823
2712 if (nextReturnAddress > 0x01 && nextReturnAddress < 0x10000) {2824 if (nextReturnAddress > 0x01 && nextReturnAddress < 0x10000) {
2713 _LIBUNWIND_TRACE_UNWINDING("The next is a signal handler frame: "2825 _LIBUNWIND_TRACE_UNWINDING("The next is a signal handler frame: "
2714 "nextStack=%p, next return address=%p\n",2826 "nextStack=%p, next return address=%p\n",
...@@ -3256,7 +3368,7 @@ int UnwindCursor<A, R>::stepThroughSigReturn() {...@@ -3256,7 +3368,7 @@ int UnwindCursor<A, R>::stepThroughSigReturn() {
32563368
3257template <typename A, typename R> int UnwindCursor<A, R>::step(bool stage2) {3369template <typename A, typename R> int UnwindCursor<A, R>::step(bool stage2) {
3258 (void)stage2;3370 (void)stage2;
3259 // Bottom of stack is defined is when unwind info cannot be found.3371 // Bottom of stack is defined when unwind info cannot be found.
3260 if (_unwindInfoMissing)3372 if (_unwindInfoMissing)
3261 return UNW_STEP_END;3373 return UNW_STEP_END;
32623374
lib/libunwind/src/UnwindLevel1-gcc-ext.c+1-1
...@@ -284,7 +284,7 @@ _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) {...@@ -284,7 +284,7 @@ _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) {
284// before 10.6 used keymgr to track known FDEs, but these functions284// before 10.6 used keymgr to track known FDEs, but these functions
285// never got updated to use keymgr.285// never got updated to use keymgr.
286// For now, we implement these as do-nothing functions to keep any existing286// For now, we implement these as do-nothing functions to keep any existing
287// applications working. We also add the not in 10.6 symbol so that nwe287// applications working. We also add the not in 10.6 symbol so that new
288// application won't be able to use them.288// application won't be able to use them.
289289
290#if defined(_LIBUNWIND_SUPPORT_FRAME_APIS)290#if defined(_LIBUNWIND_SUPPORT_FRAME_APIS)
lib/libunwind/src/UnwindLevel1.c+1-1
...@@ -14,7 +14,7 @@...@@ -14,7 +14,7 @@
14// ARM EHABI does not specify _Unwind_{Get,Set}{GR,IP}(). Thus, we are14// ARM EHABI does not specify _Unwind_{Get,Set}{GR,IP}(). Thus, we are
15// defining inline functions to delegate the function calls to15// defining inline functions to delegate the function calls to
16// _Unwind_VRS_{Get,Set}(). However, some applications might declare the16// _Unwind_VRS_{Get,Set}(). However, some applications might declare the
17// function protetype directly (instead of including <unwind.h>), thus we need17// function prototype directly (instead of including <unwind.h>), thus we need
18// to export these functions from libunwind.so as well.18// to export these functions from libunwind.so as well.
19#define _LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE 119#define _LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE 1
2020
lib/libunwind/src/UnwindRegistersRestore.S+18-1
...@@ -678,9 +678,15 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)...@@ -678,9 +678,15 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
678 ldp x18,x19, [x0, #0x090]678 ldp x18,x19, [x0, #0x090]
679 ldp x20,x21, [x0, #0x0A0]679 ldp x20,x21, [x0, #0x0A0]
680 ldp x22,x23, [x0, #0x0B0]680 ldp x22,x23, [x0, #0x0B0]
681#if defined(__LFI__)
682 ldr x24, [x0, #0x0C0]
683 // Skip reloading x25-x28; reserved by LFI ABI.
684 ldr x29, [x0, #0x0E8]
685#else
681 ldp x24,x25, [x0, #0x0C0]686 ldp x24,x25, [x0, #0x0C0]
682 ldp x26,x27, [x0, #0x0D0]687 ldp x26,x27, [x0, #0x0D0]
683 ldp x28,x29, [x0, #0x0E0]688 ldp x28,x29, [x0, #0x0E0]
689#endif
684690
685#if defined(__ARM_FP) && __ARM_FP != 0691#if defined(__ARM_FP) && __ARM_FP != 0
686 ldp d0, d1, [x0, #0x110]692 ldp d0, d1, [x0, #0x110]
...@@ -941,11 +947,22 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind14Registers_or1k6jumptoEv)...@@ -941,11 +947,22 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind14Registers_or1k6jumptoEv)
941947
942#elif defined(__hexagon__)948#elif defined(__hexagon__)
943# On entry:949# On entry:
944# thread_state pointer is in r2950# thread_state pointer is in r0
945DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind17Registers_hexagon6jumptoEv)951DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind17Registers_hexagon6jumptoEv)
946#952#
947# void libunwind::Registers_hexagon::jumpto()953# void libunwind::Registers_hexagon::jumpto()
948#954#
955# The context layout is hexagon_thread_state_t: unsigned int __r[35]
956# __r[0..31] = r0..r31, __r[32] = predicates, __r[33] = PC.
957# Offsets: __r[n] is at byte offset n*4. r0 is the context pointer, so
958# it is restored last; r31 is loaded with the saved PC as the jumpr target.
959 r2 = memw(r0+#8)
960 r3 = memw(r0+#12)
961 r4 = memw(r0+#16)
962 r5 = memw(r0+#20)
963 r6 = memw(r0+#24)
964 r7 = memw(r0+#28)
965
949 r8 = memw(r0+#32)966 r8 = memw(r0+#32)
950 r9 = memw(r0+#36)967 r9 = memw(r0+#36)
951 r10 = memw(r0+#40)968 r10 = memw(r0+#40)
lib/libunwind/src/UnwindRegistersSave.S+28-3
...@@ -794,13 +794,20 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -794,13 +794,20 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
794 stp x18,x19, [x0, #0x090]794 stp x18,x19, [x0, #0x090]
795 stp x20,x21, [x0, #0x0A0]795 stp x20,x21, [x0, #0x0A0]
796 stp x22,x23, [x0, #0x0B0]796 stp x22,x23, [x0, #0x0B0]
797#if defined(__LFI__)
798 str x24, [x0, #0x0C0]
799 // Skip spilling x25-x28; reserved by LFI ABI.
800 str x29, [x0, #0x0E8]
801#else
797 stp x24,x25, [x0, #0x0C0]802 stp x24,x25, [x0, #0x0C0]
798 stp x26,x27, [x0, #0x0D0]803 stp x26,x27, [x0, #0x0D0]
799 stp x28,x29, [x0, #0x0E0]804 stp x28,x29, [x0, #0x0E0]
805#endif
800 str x30, [x0, #0x0F0]806 str x30, [x0, #0x0F0]
801 mov x1,sp807 mov x1,sp
802 str x1, [x0, #0x0F8]808 str x1, [x0, #0x0F8]
803 str x30, [x0, #0x100] // store return address as pc809 str x30, [x0, #0x100] // store return address as pc
810 str xzr, [x0, #0x108] // zero __ra_sign_state
804 // skip cpsr811 // skip cpsr
805#if defined(__ARM_FP) && __ARM_FP != 0812#if defined(__ARM_FP) && __ARM_FP != 0
806 stp d0, d1, [x0, #0x110]813 stp d0, d1, [x0, #0x110]
...@@ -1096,8 +1103,21 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -1096,8 +1103,21 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
1096# On entry:1103# On entry:
1097# thread_state pointer is in r01104# thread_state pointer is in r0
1098#1105#
1106# The context layout is hexagon_thread_state_t: unsigned int __r[35]
1107# __r[0..31] = r0..r31, __r[32] = predicates, __r[33] = PC, __r[34] = unused
1108# Offsets: __r[n] is at byte offset n*4.
1109#
1099#define OFFSET(offset) (offset/4)1110#define OFFSET(offset) (offset/4)
1100DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)1111DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
1112 // Save r1-r7 first (r0 is the context pointer, saved last)
1113 memw(r0+#4) = r1
1114 memw(r0+#8) = r2
1115 memw(r0+#12) = r3
1116 memw(r0+#16) = r4
1117 memw(r0+#20) = r5
1118 memw(r0+#24) = r6
1119 memw(r0+#28) = r7
1120
1101 memw(r0+#32) = r81121 memw(r0+#32) = r8
1102 memw(r0+#36) = r91122 memw(r0+#36) = r9
1103 memw(r0+#40) = r101123 memw(r0+#40) = r10
...@@ -1127,12 +1147,17 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -1127,12 +1147,17 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
1127 memw(r0+#116) = r291147 memw(r0+#116) = r29
1128 memw(r0+#120) = r301148 memw(r0+#120) = r30
1129 memw(r0+#124) = r311149 memw(r0+#124) = r31
1130 r1 = c4 // Predicate register1150
1151 r1 = c4 // Predicate register
1131 memw(r0+#128) = r11152 memw(r0+#128) = r1
1132 r1 = memw(r30) // *FP == Saved FP1153
1133 r1 = r311154 r1 = r31 // Store return address as PC
1134 memw(r0+#132) = r11155 memw(r0+#132) = r1
11351156
1157 // Save r0 (the context pointer itself) last
1158 memw(r0+#0) = r0
1159
1160 r0 = #0 // return UNW_ESUCCESS
1136 jumpr r311161 jumpr r31
11371162
1138#elif defined(__sparc__) && defined(__arch64__)1163#elif defined(__sparc__) && defined(__arch64__)
lib/libunwind/src/libunwind.cpp+15-19
...@@ -32,7 +32,7 @@...@@ -32,7 +32,7 @@
3232
33using namespace libunwind;33using namespace libunwind;
3434
35/// internal object to represent this processes address space35/// internal object to represent this process's address space
36LocalAddressSpace LocalAddressSpace::sThisAddressSpace;36LocalAddressSpace LocalAddressSpace::sThisAddressSpace;
3737
38_LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space =38_LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space =
...@@ -131,23 +131,19 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,...@@ -131,23 +131,19 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
131 {131 {
132 // It is only valid to set the IP within the current function. This is132 // It is only valid to set the IP within the current function. This is
133 // important for ptrauth, otherwise the IP cannot be correctly signed.133 // important for ptrauth, otherwise the IP cannot be correctly signed.
134 // The current signature of `value` is via the schema:134 //
135 // __ptrauth(ptrauth_key_return_address, <<sp>>, 0)135 // However many JITs do not configure CFI frames, so we cannot actually
136 // For this to be generally usable we manually re-sign it to the136 // enforce this - at least not without an extremely expensive syscall.
137 // directly supported schema:137 //
138 // __ptrauth(ptrauth_key_return_address, 1, 0)138 // For the forseeable future this will need to be a debug only assertion
139 unw_word_t139 // so we just strip and assert to avoid the unnecessary auths in release
140 __unwind_ptrauth_restricted_intptr(ptrauth_key_return_address, 1,140 // builds.
141 0) authenticated_value;141 unw_word_t stripped_value = (unw_word_t)ptrauth_strip(
142 unw_word_t opaque_value = (uint64_t)ptrauth_auth_and_resign(142 (void *)value, ptrauth_key_return_address);
143 (void *)value, ptrauth_key_return_address, sp,143 if (stripped_value < info.start_ip && stripped_value > info.end_ip)
144 ptrauth_key_return_address, &authenticated_value);144 _LIBUNWIND_LOG("Badly behaved use of unw_set_reg: moving IP(0x%zX) "
145 memmove(reinterpret_cast<void *>(&authenticated_value),145 "outside of CFI bounds function (0x%zX, 0x%zX)",
146 reinterpret_cast<void *>(&opaque_value),146 stripped_value, info.start_ip, info.end_ip);
147 sizeof(authenticated_value));
148 if (authenticated_value < info.start_ip ||
149 authenticated_value > info.end_ip)
150 _LIBUNWIND_ABORT("PC vs frame info mismatch");
151147
152 // PC should have been signed with the sp, so we verify that148 // PC should have been signed with the sp, so we verify that
153 // roundtripping does not fail. The `ptrauth_auth_and_resign` is149 // roundtripping does not fail. The `ptrauth_auth_and_resign` is
...@@ -306,7 +302,7 @@ _LIBUNWIND_HIDDEN int __unw_is_fpreg(unw_cursor_t *cursor,...@@ -306,7 +302,7 @@ _LIBUNWIND_HIDDEN int __unw_is_fpreg(unw_cursor_t *cursor,
306}302}
307_LIBUNWIND_WEAK_ALIAS(__unw_is_fpreg, unw_is_fpreg)303_LIBUNWIND_WEAK_ALIAS(__unw_is_fpreg, unw_is_fpreg)
308304
309/// Checks if a register is a floating-point register.305/// Get name of specified register at cursor position in stack frame.
310_LIBUNWIND_HIDDEN const char *__unw_regname(unw_cursor_t *cursor,306_LIBUNWIND_HIDDEN const char *__unw_regname(unw_cursor_t *cursor,
311 unw_regnum_t regNum) {307 unw_regnum_t regNum) {
312 _LIBUNWIND_TRACE_API("__unw_regname(cursor=%p, regNum=%d)",308 _LIBUNWIND_TRACE_API("__unw_regname(cursor=%p, regNum=%d)",
lib/libunwind/src/libunwind_ext.h+2-2
...@@ -120,10 +120,10 @@ typedef int (*unw_find_dynamic_unwind_sections)(...@@ -120,10 +120,10 @@ typedef int (*unw_find_dynamic_unwind_sections)(
120extern int __unw_add_find_dynamic_unwind_sections(120extern int __unw_add_find_dynamic_unwind_sections(
121 unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);121 unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
122122
123// Deregister a dynacim unwind-info lookup callback.123// Deregister a dynamic unwind-info lookup callback.
124//124//
125// Returns UNW_ESUCCESS for successful deregistrations. If the given callback125// Returns UNW_ESUCCESS for successful deregistrations. If the given callback
126// has already been registered then UNW_EINVAL will be returned.126// is not present then UNW_EINVAL will be returned.
127extern int __unw_remove_find_dynamic_unwind_sections(127extern int __unw_remove_find_dynamic_unwind_sections(
128 unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);128 unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
129129
lib/std/Target.zig+6-2
...@@ -1247,7 +1247,7 @@ pub const Cpu = struct {...@@ -1247,7 +1247,7 @@ pub const Cpu = struct {
1247 pub const Set = struct {1247 pub const Set = struct {
1248 ints: [usize_count]usize,1248 ints: [usize_count]usize,
12491249
1250 pub const needed_bit_count = 347;1250 pub const needed_bit_count = 378;
1251 pub const byte_count = @divCeil(needed_bit_count, 8);1251 pub const byte_count = @divCeil(needed_bit_count, 8);
1252 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);1252 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
1253 pub const Index = std.math.Log2Int(@Int(.unsigned, usize_count * @bitSizeOf(usize)));1253 pub const Index = std.math.Log2Int(@Int(.unsigned, usize_count * @bitSizeOf(usize)));
...@@ -1961,9 +1961,11 @@ pub const Cpu = struct {...@@ -1961,9 +1961,11 @@ pub const Cpu = struct {
1961 => &.{.lanai},1961 => &.{.lanai},
19621962
1963 .loongarch64_lp64,1963 .loongarch64_lp64,
1964 .loongarch64_preserve_none,
1964 => &.{.loongarch64},1965 => &.{.loongarch64},
19651966
1966 .loongarch32_ilp32,1967 .loongarch32_ilp32,
1968 .loongarch32_preserve_none,
1967 => &.{.loongarch32},1969 => &.{.loongarch32},
19681970
1969 .m68k_sysv,1971 .m68k_sysv,
...@@ -2401,7 +2403,6 @@ pub fn supportsAddressSpace(...@@ -2401,7 +2403,6 @@ pub fn supportsAddressSpace(
2401 .param => is_nvptx,2403 .param => is_nvptx,
2402 .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,2404 .input, .output, .uniform, .push_constant, .storage_buffer => is_spirv,
2403 .physical_storage_buffer => arch == .spirv64,2405 .physical_storage_buffer => arch == .spirv64,
2404 .externref, .funcref => target.cpu.has(.wasm, .reference_types),
2405 };2406 };
2406}2407}
24072408
...@@ -2566,6 +2567,9 @@ pub const DynamicLinker = struct {...@@ -2566,6 +2567,9 @@ pub const DynamicLinker = struct {
2566 .aarch64_be,2567 .aarch64_be,
2567 => |arch| if (abi == .gnu) initFmt("/lib/ld-{s}.so.1", .{@tagName(arch)}) else none,2568 => |arch| if (abi == .gnu) initFmt("/lib/ld-{s}.so.1", .{@tagName(arch)}) else none,
25682569
2570 .riscv64,
2571 => if (abi == .gnu) init("/lib/ld-riscv64-lp64.so.1") else none,
2572
2569 .x86 => if (abi == .gnu) init("/lib/ld.so.1") else none,2573 .x86 => if (abi == .gnu) init("/lib/ld.so.1") else none,
2570 .x86_64 => initFmt("/lib/ld-{s}.so.1", .{switch (abi) {2574 .x86_64 => initFmt("/lib/ld-{s}.so.1", .{switch (abi) {
2571 .gnu => "x86-64",2575 .gnu => "x86-64",
lib/std/Target/aarch64.zig+191-33
...@@ -10,6 +10,7 @@ pub const Feature = enum {...@@ -10,6 +10,7 @@ pub const Feature = enum {
10 aes,10 aes,
11 aggressive_fma,11 aggressive_fma,
12 aggressive_interleaving,12 aggressive_interleaving,
13 align_cmp_csel_pairs,
13 alternate_sextload_cvt_f32_pattern,14 alternate_sextload_cvt_f32_pattern,
14 altnzcv,15 altnzcv,
15 alu_lsl_fast,16 alu_lsl_fast,
...@@ -38,7 +39,6 @@ pub const Feature = enum {...@@ -38,7 +39,6 @@ pub const Feature = enum {
38 ccpp,39 ccpp,
39 chk,40 chk,
40 clrbhb,41 clrbhb,
41 cmh,
42 cmp_bcc_fusion,42 cmp_bcc_fusion,
43 cmpbr,43 cmpbr,
44 complxnum,44 complxnum,
...@@ -48,6 +48,7 @@ pub const Feature = enum {...@@ -48,6 +48,7 @@ pub const Feature = enum {
48 crypto,48 crypto,
49 cssc,49 cssc,
50 d128,50 d128,
51 disable_distinct_predicate_dst_reg,
51 disable_fast_inc_vl,52 disable_fast_inc_vl,
52 disable_latency_sched_heuristic,53 disable_latency_sched_heuristic,
53 disable_ldp,54 disable_ldp,
...@@ -71,8 +72,10 @@ pub const Feature = enum {...@@ -71,8 +72,10 @@ pub const Feature = enum {
71 f8f16mm,72 f8f16mm,
72 f8f32mm,73 f8f32mm,
73 faminmax,74 faminmax,
75 fast_ld1_single,
74 fgt,76 fgt,
75 fix_cortex_a53_835769,77 fix_cortex_a53_835769,
78 fixed_load_latency_4,
76 flagm,79 flagm,
77 fmv,80 fmv,
78 force_32bit_jump_tables,81 force_32bit_jump_tables,
...@@ -95,14 +98,16 @@ pub const Feature = enum {...@@ -95,14 +98,16 @@ pub const Feature = enum {
95 fuse_crypto_eor,98 fuse_crypto_eor,
96 fuse_csel,99 fuse_csel,
97 fuse_cset,100 fuse_cset,
101 fuse_fcsel,
98 fuse_literals,102 fuse_literals,
99 gcie,103 gcie,
100 gcs,104 gcs,
101 harden_sls_blr,105 harden_sls_blr,
102 harden_sls_nocomdat,106 harden_sls_nocomdat,
103 harden_sls_retbr,107 harden_sls_retbr,
108 has_limited_64bit_vector_mul_bandwidth,
104 hbc,109 hbc,
105 hcx,110 hinte,
106 i8mm,111 i8mm,
107 ite,112 ite,
108 jsconv,113 jsconv,
...@@ -121,12 +126,13 @@ pub const Feature = enum {...@@ -121,12 +126,13 @@ pub const Feature = enum {
121 mops,126 mops,
122 mops_go,127 mops_go,
123 mpam,128 mpam,
124 mpamv2,
125 mte,129 mte,
126 mtetc,130 mtetc,
127 neon,131 neon,
128 nmi,132 nmi,
129 no_bti_at_return_twice,133 no_bti_at_return_twice,
134 no_lfi_loads,
135 no_lfi_stores,
130 no_neg_immediates,136 no_neg_immediates,
131 no_sve_fp_ld1r,137 no_sve_fp_ld1r,
132 no_zcz_fpr64,138 no_zcz_fpr64,
...@@ -138,7 +144,6 @@ pub const Feature = enum {...@@ -138,7 +144,6 @@ pub const Feature = enum {
138 pan_rwv,144 pan_rwv,
139 pauth,145 pauth,
140 pauth_lr,146 pauth_lr,
141 pcdphint,
142 perfmon,147 perfmon,
143 poe2,148 poe2,
144 pops,149 pops,
...@@ -328,6 +333,11 @@ pub const all_features = blk: {...@@ -328,6 +333,11 @@ pub const all_features = blk: {
328 .description = "Make use of aggressive interleaving during vectorization",333 .description = "Make use of aggressive interleaving during vectorization",
329 .dependencies = featureSet(&[_]Feature{}),334 .dependencies = featureSet(&[_]Feature{}),
330 };335 };
336 result[@backingInt(Feature.align_cmp_csel_pairs)] = .{
337 .llvm_name = "align-cmp-csel-pairs",
338 .description = "Align certain CMP/FCMP and CSEL/FCSEL instruction pairs",
339 .dependencies = featureSet(&[_]Feature{}),
340 };
331 result[@backingInt(Feature.alternate_sextload_cvt_f32_pattern)] = .{341 result[@backingInt(Feature.alternate_sextload_cvt_f32_pattern)] = .{
332 .llvm_name = "alternate-sextload-cvt-f32-pattern",342 .llvm_name = "alternate-sextload-cvt-f32-pattern",
333 .description = "Use alternative pattern for sextload convert to f32",343 .description = "Use alternative pattern for sextload convert to f32",
...@@ -476,11 +486,6 @@ pub const all_features = blk: {...@@ -476,11 +486,6 @@ pub const all_features = blk: {
476 .description = "Enable Clear BHB instruction",486 .description = "Enable Clear BHB instruction",
477 .dependencies = featureSet(&[_]Feature{}),487 .dependencies = featureSet(&[_]Feature{}),
478 };488 };
479 result[@backingInt(Feature.cmh)] = .{
480 .llvm_name = "cmh",
481 .description = "Enable Armv9.7-A Contention Management Hints",
482 .dependencies = featureSet(&[_]Feature{}),
483 };
484 result[@backingInt(Feature.cmp_bcc_fusion)] = .{489 result[@backingInt(Feature.cmp_bcc_fusion)] = .{
485 .llvm_name = "cmp-bcc-fusion",490 .llvm_name = "cmp-bcc-fusion",
486 .description = "CPU fuses cmp+bcc operations",491 .description = "CPU fuses cmp+bcc operations",
...@@ -533,6 +538,11 @@ pub const all_features = blk: {...@@ -533,6 +538,11 @@ pub const all_features = blk: {
533 .lse128,538 .lse128,
534 }),539 }),
535 };540 };
541 result[@backingInt(Feature.disable_distinct_predicate_dst_reg)] = .{
542 .llvm_name = "disable-distinct-predicate-dst-reg",
543 .description = "Disabling selecting a distinct predicate register for the destination operand of instructions that take a governing predicate",
544 .dependencies = featureSet(&[_]Feature{}),
545 };
536 result[@backingInt(Feature.disable_fast_inc_vl)] = .{546 result[@backingInt(Feature.disable_fast_inc_vl)] = .{
537 .llvm_name = "disable-fast-inc-vl",547 .llvm_name = "disable-fast-inc-vl",
538 .description = "Do not prefer INC/DEC, ALL, { 1, 2, 4 } over ADDVL",548 .description = "Do not prefer INC/DEC, ALL, { 1, 2, 4 } over ADDVL",
...@@ -545,7 +555,7 @@ pub const all_features = blk: {...@@ -545,7 +555,7 @@ pub const all_features = blk: {
545 };555 };
546 result[@backingInt(Feature.disable_ldp)] = .{556 result[@backingInt(Feature.disable_ldp)] = .{
547 .llvm_name = "disable-ldp",557 .llvm_name = "disable-ldp",
548 .description = "Do not emit ldp",558 .description = "Prefer not to emit ldp",
549 .dependencies = featureSet(&[_]Feature{}),559 .dependencies = featureSet(&[_]Feature{}),
550 };560 };
551 result[@backingInt(Feature.disable_maximize_scalable_bandwidth)] = .{561 result[@backingInt(Feature.disable_maximize_scalable_bandwidth)] = .{
...@@ -555,7 +565,7 @@ pub const all_features = blk: {...@@ -555,7 +565,7 @@ pub const all_features = blk: {
555 };565 };
556 result[@backingInt(Feature.disable_stp)] = .{566 result[@backingInt(Feature.disable_stp)] = .{
557 .llvm_name = "disable-stp",567 .llvm_name = "disable-stp",
558 .description = "Do not emit stp",568 .description = "Prefer not to emit stp",
559 .dependencies = featureSet(&[_]Feature{}),569 .dependencies = featureSet(&[_]Feature{}),
560 };570 };
561 result[@backingInt(Feature.disable_unpredicated_ld_st_lower)] = .{571 result[@backingInt(Feature.disable_unpredicated_ld_st_lower)] = .{
...@@ -671,6 +681,11 @@ pub const all_features = blk: {...@@ -671,6 +681,11 @@ pub const all_features = blk: {
671 .neon,681 .neon,
672 }),682 }),
673 };683 };
684 result[@backingInt(Feature.fast_ld1_single)] = .{
685 .llvm_name = "fast-ld1-single",
686 .description = "Single-element LD1 to vector lane has same performance as regular load",
687 .dependencies = featureSet(&[_]Feature{}),
688 };
674 result[@backingInt(Feature.fgt)] = .{689 result[@backingInt(Feature.fgt)] = .{
675 .llvm_name = "fgt",690 .llvm_name = "fgt",
676 .description = "Enable fine grained virtualization traps extension",691 .description = "Enable fine grained virtualization traps extension",
...@@ -681,6 +696,11 @@ pub const all_features = blk: {...@@ -681,6 +696,11 @@ pub const all_features = blk: {
681 .description = "Mitigate Cortex-A53 Erratum 835769",696 .description = "Mitigate Cortex-A53 Erratum 835769",
682 .dependencies = featureSet(&[_]Feature{}),697 .dependencies = featureSet(&[_]Feature{}),
683 };698 };
699 result[@backingInt(Feature.fixed_load_latency_4)] = .{
700 .llvm_name = "fixed-load-latency-4",
701 .description = "Use a fixed latency of 4 for loads instead of querying the scheduling model",
702 .dependencies = featureSet(&[_]Feature{}),
703 };
684 result[@backingInt(Feature.flagm)] = .{704 result[@backingInt(Feature.flagm)] = .{
685 .llvm_name = "flagm",705 .llvm_name = "flagm",
686 .description = "Enable Armv8.4-A Flag Manipulation instructions",706 .description = "Enable Armv8.4-A Flag Manipulation instructions",
...@@ -813,6 +833,11 @@ pub const all_features = blk: {...@@ -813,6 +833,11 @@ pub const all_features = blk: {
813 .description = "CPU can fuse CMP and CSET operations",833 .description = "CPU can fuse CMP and CSET operations",
814 .dependencies = featureSet(&[_]Feature{}),834 .dependencies = featureSet(&[_]Feature{}),
815 };835 };
836 result[@backingInt(Feature.fuse_fcsel)] = .{
837 .llvm_name = "fuse-fcsel",
838 .description = "CPU can fuse FCMP and FCSEL operations",
839 .dependencies = featureSet(&[_]Feature{}),
840 };
816 result[@backingInt(Feature.fuse_literals)] = .{841 result[@backingInt(Feature.fuse_literals)] = .{
817 .llvm_name = "fuse-literals",842 .llvm_name = "fuse-literals",
818 .description = "CPU fuses literal generation operations",843 .description = "CPU fuses literal generation operations",
...@@ -845,14 +870,19 @@ pub const all_features = blk: {...@@ -845,14 +870,19 @@ pub const all_features = blk: {
845 .description = "Harden against straight line speculation across RET and BR instructions",870 .description = "Harden against straight line speculation across RET and BR instructions",
846 .dependencies = featureSet(&[_]Feature{}),871 .dependencies = featureSet(&[_]Feature{}),
847 };872 };
873 result[@backingInt(Feature.has_limited_64bit_vector_mul_bandwidth)] = .{
874 .llvm_name = "has-limited-64bit-vector-mul-bandwidth",
875 .description = "Has limited 64bit vector multiply bandwidth compared to scalar multiply",
876 .dependencies = featureSet(&[_]Feature{}),
877 };
848 result[@backingInt(Feature.hbc)] = .{878 result[@backingInt(Feature.hbc)] = .{
849 .llvm_name = "hbc",879 .llvm_name = "hbc",
850 .description = "Enable Armv8.8-A Hinted Conditional Branches Extension",880 .description = "Enable Armv8.8-A Hinted Conditional Branches Extension",
851 .dependencies = featureSet(&[_]Feature{}),881 .dependencies = featureSet(&[_]Feature{}),
852 };882 };
853 result[@backingInt(Feature.hcx)] = .{883 result[@backingInt(Feature.hinte)] = .{
854 .llvm_name = "hcx",884 .llvm_name = "hinte",
855 .description = "Enable Armv8.7-A HCRX_EL2 system register",885 .description = "Enable extended A64 hint instruction space",
856 .dependencies = featureSet(&[_]Feature{}),886 .dependencies = featureSet(&[_]Feature{}),
857 };887 };
858 result[@backingInt(Feature.i8mm)] = .{888 result[@backingInt(Feature.i8mm)] = .{
...@@ -962,11 +992,6 @@ pub const all_features = blk: {...@@ -962,11 +992,6 @@ pub const all_features = blk: {
962 .description = "Enable Armv8.4-A Memory system Partitioning and Monitoring extension",992 .description = "Enable Armv8.4-A Memory system Partitioning and Monitoring extension",
963 .dependencies = featureSet(&[_]Feature{}),993 .dependencies = featureSet(&[_]Feature{}),
964 };994 };
965 result[@backingInt(Feature.mpamv2)] = .{
966 .llvm_name = "mpamv2",
967 .description = "Enable Armv9.7-A MPAMv2 Lookaside Buffer Invalidate instructions",
968 .dependencies = featureSet(&[_]Feature{}),
969 };
970 result[@backingInt(Feature.mte)] = .{995 result[@backingInt(Feature.mte)] = .{
971 .llvm_name = "mte",996 .llvm_name = "mte",
972 .description = "Enable Memory Tagging Extension",997 .description = "Enable Memory Tagging Extension",
...@@ -996,6 +1021,16 @@ pub const all_features = blk: {...@@ -996,6 +1021,16 @@ pub const all_features = blk: {
996 .description = "Don't place a BTI instruction after a return-twice",1021 .description = "Don't place a BTI instruction after a return-twice",
997 .dependencies = featureSet(&[_]Feature{}),1022 .dependencies = featureSet(&[_]Feature{}),
998 };1023 };
1024 result[@backingInt(Feature.no_lfi_loads)] = .{
1025 .llvm_name = "no-lfi-loads",
1026 .description = "Disable LFI sandboxing for load instructions",
1027 .dependencies = featureSet(&[_]Feature{}),
1028 };
1029 result[@backingInt(Feature.no_lfi_stores)] = .{
1030 .llvm_name = "no-lfi-stores",
1031 .description = "Disable LFI sandboxing for store instructions",
1032 .dependencies = featureSet(&[_]Feature{}),
1033 };
999 result[@backingInt(Feature.no_neg_immediates)] = .{1034 result[@backingInt(Feature.no_neg_immediates)] = .{
1000 .llvm_name = "no-neg-immediates",1035 .llvm_name = "no-neg-immediates",
1001 .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.",1036 .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.",
...@@ -1063,11 +1098,6 @@ pub const all_features = blk: {...@@ -1063,11 +1098,6 @@ pub const all_features = blk: {
1063 .description = "Enable Armv9.5-A PAC enhancements",1098 .description = "Enable Armv9.5-A PAC enhancements",
1064 .dependencies = featureSet(&[_]Feature{}),1099 .dependencies = featureSet(&[_]Feature{}),
1065 };1100 };
1066 result[@backingInt(Feature.pcdphint)] = .{
1067 .llvm_name = "pcdphint",
1068 .description = "Enable Armv9.6-A Producer Consumer Data Placement hints",
1069 .dependencies = featureSet(&[_]Feature{}),
1070 };
1071 result[@backingInt(Feature.perfmon)] = .{1101 result[@backingInt(Feature.perfmon)] = .{
1072 .llvm_name = "perfmon",1102 .llvm_name = "perfmon",
1073 .description = "Enable Armv8.0-A PMUv3 Performance Monitors extension",1103 .description = "Enable Armv8.0-A PMUv3 Performance Monitors extension",
...@@ -1813,7 +1843,6 @@ pub const all_features = blk: {...@@ -1813,7 +1843,6 @@ pub const all_features = blk: {
1813 .llvm_name = "v8.7a",1843 .llvm_name = "v8.7a",
1814 .description = "Support ARM v8.7a architecture",1844 .description = "Support ARM v8.7a architecture",
1815 .dependencies = featureSet(&[_]Feature{1845 .dependencies = featureSet(&[_]Feature{
1816 .hcx,
1817 .spe_eef,1846 .spe_eef,
1818 .v8_6a,1847 .v8_6a,
1819 .wfxt,1848 .wfxt,
...@@ -1931,6 +1960,7 @@ pub const all_features = blk: {...@@ -1931,6 +1960,7 @@ pub const all_features = blk: {
1931 .description = "Support ARM v9.6a architecture",1960 .description = "Support ARM v9.6a architecture",
1932 .dependencies = featureSet(&[_]Feature{1961 .dependencies = featureSet(&[_]Feature{
1933 .cmpbr,1962 .cmpbr,
1963 .hinte,
1934 .lsui,1964 .lsui,
1935 .occmo,1965 .occmo,
1936 .v9_5a,1966 .v9_5a,
...@@ -2265,12 +2295,14 @@ pub const cpu = struct {...@@ -2265,12 +2295,14 @@ pub const cpu = struct {
2265 .features = featureSet(&[_]Feature{2295 .features = featureSet(&[_]Feature{
2266 .aes,2296 .aes,
2267 .aggressive_fma,2297 .aggressive_fma,
2298 .align_cmp_csel_pairs,
2268 .alternate_sextload_cvt_f32_pattern,2299 .alternate_sextload_cvt_f32_pattern,
2269 .altnzcv,2300 .altnzcv,
2270 .arith_bcc_fusion,2301 .arith_bcc_fusion,
2271 .arith_cbz_fusion,2302 .arith_cbz_fusion,
2272 .ccdp,2303 .ccdp,
2273 .disable_latency_sched_heuristic,2304 .disable_latency_sched_heuristic,
2305 .fast_ld1_single,
2274 .fp16fml,2306 .fp16fml,
2275 .fptoint,2307 .fptoint,
2276 .fuse_address,2308 .fuse_address,
...@@ -2301,10 +2333,12 @@ pub const cpu = struct {...@@ -2301,10 +2333,12 @@ pub const cpu = struct {
2301 .llvm_name = "apple-a15",2333 .llvm_name = "apple-a15",
2302 .features = featureSet(&[_]Feature{2334 .features = featureSet(&[_]Feature{
2303 .aes,2335 .aes,
2336 .align_cmp_csel_pairs,
2304 .alternate_sextload_cvt_f32_pattern,2337 .alternate_sextload_cvt_f32_pattern,
2305 .arith_bcc_fusion,2338 .arith_bcc_fusion,
2306 .arith_cbz_fusion,2339 .arith_cbz_fusion,
2307 .disable_latency_sched_heuristic,2340 .disable_latency_sched_heuristic,
2341 .fast_ld1_single,
2308 .fp16fml,2342 .fp16fml,
2309 .fpac,2343 .fpac,
2310 .fuse_address,2344 .fuse_address,
...@@ -2332,10 +2366,12 @@ pub const cpu = struct {...@@ -2332,10 +2366,12 @@ pub const cpu = struct {
2332 .llvm_name = "apple-a16",2366 .llvm_name = "apple-a16",
2333 .features = featureSet(&[_]Feature{2367 .features = featureSet(&[_]Feature{
2334 .aes,2368 .aes,
2369 .align_cmp_csel_pairs,
2335 .alternate_sextload_cvt_f32_pattern,2370 .alternate_sextload_cvt_f32_pattern,
2336 .arith_bcc_fusion,2371 .arith_bcc_fusion,
2337 .arith_cbz_fusion,2372 .arith_cbz_fusion,
2338 .disable_latency_sched_heuristic,2373 .disable_latency_sched_heuristic,
2374 .fast_ld1_single,
2339 .fp16fml,2375 .fp16fml,
2340 .fpac,2376 .fpac,
2341 .fuse_address,2377 .fuse_address,
...@@ -2344,8 +2380,8 @@ pub const cpu = struct {...@@ -2344,8 +2380,8 @@ pub const cpu = struct {
2344 .fuse_arith_logic,2380 .fuse_arith_logic,
2345 .fuse_crypto_eor,2381 .fuse_crypto_eor,
2346 .fuse_csel,2382 .fuse_csel,
2383 .fuse_fcsel,
2347 .fuse_literals,2384 .fuse_literals,
2348 .hcx,
2349 .max_interleave_factor_4,2385 .max_interleave_factor_4,
2350 .no_zcz_fpr64,2386 .no_zcz_fpr64,
2351 .perfmon,2387 .perfmon,
...@@ -2364,10 +2400,12 @@ pub const cpu = struct {...@@ -2364,10 +2400,12 @@ pub const cpu = struct {
2364 .llvm_name = "apple-a17",2400 .llvm_name = "apple-a17",
2365 .features = featureSet(&[_]Feature{2401 .features = featureSet(&[_]Feature{
2366 .aes,2402 .aes,
2403 .align_cmp_csel_pairs,
2367 .alternate_sextload_cvt_f32_pattern,2404 .alternate_sextload_cvt_f32_pattern,
2368 .arith_bcc_fusion,2405 .arith_bcc_fusion,
2369 .arith_cbz_fusion,2406 .arith_cbz_fusion,
2370 .disable_latency_sched_heuristic,2407 .disable_latency_sched_heuristic,
2408 .fast_ld1_single,
2371 .fp16fml,2409 .fp16fml,
2372 .fpac,2410 .fpac,
2373 .fuse_address,2411 .fuse_address,
...@@ -2376,8 +2414,8 @@ pub const cpu = struct {...@@ -2376,8 +2414,8 @@ pub const cpu = struct {
2376 .fuse_arith_logic,2414 .fuse_arith_logic,
2377 .fuse_crypto_eor,2415 .fuse_crypto_eor,
2378 .fuse_csel,2416 .fuse_csel,
2417 .fuse_fcsel,
2379 .fuse_literals,2418 .fuse_literals,
2380 .hcx,
2381 .max_interleave_factor_4,2419 .max_interleave_factor_4,
2382 .no_zcz_fpr64,2420 .no_zcz_fpr64,
2383 .perfmon,2421 .perfmon,
...@@ -2396,10 +2434,12 @@ pub const cpu = struct {...@@ -2396,10 +2434,12 @@ pub const cpu = struct {
2396 .llvm_name = "apple-a18",2434 .llvm_name = "apple-a18",
2397 .features = featureSet(&[_]Feature{2435 .features = featureSet(&[_]Feature{
2398 .aes,2436 .aes,
2437 .align_cmp_csel_pairs,
2399 .alternate_sextload_cvt_f32_pattern,2438 .alternate_sextload_cvt_f32_pattern,
2400 .arith_bcc_fusion,2439 .arith_bcc_fusion,
2401 .arith_cbz_fusion,2440 .arith_cbz_fusion,
2402 .disable_latency_sched_heuristic,2441 .disable_latency_sched_heuristic,
2442 .fast_ld1_single,
2403 .fp16fml,2443 .fp16fml,
2404 .fpac,2444 .fpac,
2405 .fuse_address,2445 .fuse_address,
...@@ -2408,6 +2448,7 @@ pub const cpu = struct {...@@ -2408,6 +2448,7 @@ pub const cpu = struct {
2408 .fuse_arith_logic,2448 .fuse_arith_logic,
2409 .fuse_crypto_eor,2449 .fuse_crypto_eor,
2410 .fuse_csel,2450 .fuse_csel,
2451 .fuse_fcsel,
2411 .fuse_literals,2452 .fuse_literals,
2412 .max_interleave_factor_4,2453 .max_interleave_factor_4,
2413 .no_zcz_fpr64,2454 .no_zcz_fpr64,
...@@ -2429,11 +2470,13 @@ pub const cpu = struct {...@@ -2429,11 +2470,13 @@ pub const cpu = struct {
2429 .llvm_name = "apple-a19",2470 .llvm_name = "apple-a19",
2430 .features = featureSet(&[_]Feature{2471 .features = featureSet(&[_]Feature{
2431 .aes,2472 .aes,
2473 .align_cmp_csel_pairs,
2432 .alternate_sextload_cvt_f32_pattern,2474 .alternate_sextload_cvt_f32_pattern,
2433 .arith_bcc_fusion,2475 .arith_bcc_fusion,
2434 .arith_cbz_fusion,2476 .arith_cbz_fusion,
2435 .cssc,2477 .cssc,
2436 .disable_latency_sched_heuristic,2478 .disable_latency_sched_heuristic,
2479 .fast_ld1_single,
2437 .fp16fml,2480 .fp16fml,
2438 .fpac,2481 .fpac,
2439 .fuse_address,2482 .fuse_address,
...@@ -2442,6 +2485,7 @@ pub const cpu = struct {...@@ -2442,6 +2485,7 @@ pub const cpu = struct {
2442 .fuse_arith_logic,2485 .fuse_arith_logic,
2443 .fuse_crypto_eor,2486 .fuse_crypto_eor,
2444 .fuse_csel,2487 .fuse_csel,
2488 .fuse_fcsel,
2445 .fuse_literals,2489 .fuse_literals,
2446 .hbc,2490 .hbc,
2447 .max_interleave_factor_4,2491 .max_interleave_factor_4,
...@@ -2541,12 +2585,14 @@ pub const cpu = struct {...@@ -2541,12 +2585,14 @@ pub const cpu = struct {
2541 .features = featureSet(&[_]Feature{2585 .features = featureSet(&[_]Feature{
2542 .aes,2586 .aes,
2543 .aggressive_fma,2587 .aggressive_fma,
2588 .align_cmp_csel_pairs,
2544 .alternate_sextload_cvt_f32_pattern,2589 .alternate_sextload_cvt_f32_pattern,
2545 .altnzcv,2590 .altnzcv,
2546 .arith_bcc_fusion,2591 .arith_bcc_fusion,
2547 .arith_cbz_fusion,2592 .arith_cbz_fusion,
2548 .ccdp,2593 .ccdp,
2549 .disable_latency_sched_heuristic,2594 .disable_latency_sched_heuristic,
2595 .fast_ld1_single,
2550 .fp16fml,2596 .fp16fml,
2551 .fptoint,2597 .fptoint,
2552 .fuse_address,2598 .fuse_address,
...@@ -2577,10 +2623,12 @@ pub const cpu = struct {...@@ -2577,10 +2623,12 @@ pub const cpu = struct {
2577 .llvm_name = "apple-m2",2623 .llvm_name = "apple-m2",
2578 .features = featureSet(&[_]Feature{2624 .features = featureSet(&[_]Feature{
2579 .aes,2625 .aes,
2626 .align_cmp_csel_pairs,
2580 .alternate_sextload_cvt_f32_pattern,2627 .alternate_sextload_cvt_f32_pattern,
2581 .arith_bcc_fusion,2628 .arith_bcc_fusion,
2582 .arith_cbz_fusion,2629 .arith_cbz_fusion,
2583 .disable_latency_sched_heuristic,2630 .disable_latency_sched_heuristic,
2631 .fast_ld1_single,
2584 .fp16fml,2632 .fp16fml,
2585 .fpac,2633 .fpac,
2586 .fuse_address,2634 .fuse_address,
...@@ -2608,10 +2656,12 @@ pub const cpu = struct {...@@ -2608,10 +2656,12 @@ pub const cpu = struct {
2608 .llvm_name = "apple-m3",2656 .llvm_name = "apple-m3",
2609 .features = featureSet(&[_]Feature{2657 .features = featureSet(&[_]Feature{
2610 .aes,2658 .aes,
2659 .align_cmp_csel_pairs,
2611 .alternate_sextload_cvt_f32_pattern,2660 .alternate_sextload_cvt_f32_pattern,
2612 .arith_bcc_fusion,2661 .arith_bcc_fusion,
2613 .arith_cbz_fusion,2662 .arith_cbz_fusion,
2614 .disable_latency_sched_heuristic,2663 .disable_latency_sched_heuristic,
2664 .fast_ld1_single,
2615 .fp16fml,2665 .fp16fml,
2616 .fpac,2666 .fpac,
2617 .fuse_address,2667 .fuse_address,
...@@ -2620,8 +2670,8 @@ pub const cpu = struct {...@@ -2620,8 +2670,8 @@ pub const cpu = struct {
2620 .fuse_arith_logic,2670 .fuse_arith_logic,
2621 .fuse_crypto_eor,2671 .fuse_crypto_eor,
2622 .fuse_csel,2672 .fuse_csel,
2673 .fuse_fcsel,
2623 .fuse_literals,2674 .fuse_literals,
2624 .hcx,
2625 .max_interleave_factor_4,2675 .max_interleave_factor_4,
2626 .no_zcz_fpr64,2676 .no_zcz_fpr64,
2627 .perfmon,2677 .perfmon,
...@@ -2640,10 +2690,12 @@ pub const cpu = struct {...@@ -2640,10 +2690,12 @@ pub const cpu = struct {
2640 .llvm_name = "apple-m4",2690 .llvm_name = "apple-m4",
2641 .features = featureSet(&[_]Feature{2691 .features = featureSet(&[_]Feature{
2642 .aes,2692 .aes,
2693 .align_cmp_csel_pairs,
2643 .alternate_sextload_cvt_f32_pattern,2694 .alternate_sextload_cvt_f32_pattern,
2644 .arith_bcc_fusion,2695 .arith_bcc_fusion,
2645 .arith_cbz_fusion,2696 .arith_cbz_fusion,
2646 .disable_latency_sched_heuristic,2697 .disable_latency_sched_heuristic,
2698 .fast_ld1_single,
2647 .fp16fml,2699 .fp16fml,
2648 .fpac,2700 .fpac,
2649 .fuse_address,2701 .fuse_address,
...@@ -2652,6 +2704,7 @@ pub const cpu = struct {...@@ -2652,6 +2704,7 @@ pub const cpu = struct {
2652 .fuse_arith_logic,2704 .fuse_arith_logic,
2653 .fuse_crypto_eor,2705 .fuse_crypto_eor,
2654 .fuse_csel,2706 .fuse_csel,
2707 .fuse_fcsel,
2655 .fuse_literals,2708 .fuse_literals,
2656 .max_interleave_factor_4,2709 .max_interleave_factor_4,
2657 .no_zcz_fpr64,2710 .no_zcz_fpr64,
...@@ -2673,11 +2726,13 @@ pub const cpu = struct {...@@ -2673,11 +2726,13 @@ pub const cpu = struct {
2673 .llvm_name = "apple-m5",2726 .llvm_name = "apple-m5",
2674 .features = featureSet(&[_]Feature{2727 .features = featureSet(&[_]Feature{
2675 .aes,2728 .aes,
2729 .align_cmp_csel_pairs,
2676 .alternate_sextload_cvt_f32_pattern,2730 .alternate_sextload_cvt_f32_pattern,
2677 .arith_bcc_fusion,2731 .arith_bcc_fusion,
2678 .arith_cbz_fusion,2732 .arith_cbz_fusion,
2679 .cssc,2733 .cssc,
2680 .disable_latency_sched_heuristic,2734 .disable_latency_sched_heuristic,
2735 .fast_ld1_single,
2681 .fp16fml,2736 .fp16fml,
2682 .fpac,2737 .fpac,
2683 .fuse_address,2738 .fuse_address,
...@@ -2686,6 +2741,7 @@ pub const cpu = struct {...@@ -2686,6 +2741,7 @@ pub const cpu = struct {
2686 .fuse_arith_logic,2741 .fuse_arith_logic,
2687 .fuse_crypto_eor,2742 .fuse_crypto_eor,
2688 .fuse_csel,2743 .fuse_csel,
2744 .fuse_fcsel,
2689 .fuse_literals,2745 .fuse_literals,
2690 .hbc,2746 .hbc,
2691 .max_interleave_factor_4,2747 .max_interleave_factor_4,
...@@ -2712,10 +2768,12 @@ pub const cpu = struct {...@@ -2712,10 +2768,12 @@ pub const cpu = struct {
2712 .llvm_name = "apple-s10",2768 .llvm_name = "apple-s10",
2713 .features = featureSet(&[_]Feature{2769 .features = featureSet(&[_]Feature{
2714 .aes,2770 .aes,
2771 .align_cmp_csel_pairs,
2715 .alternate_sextload_cvt_f32_pattern,2772 .alternate_sextload_cvt_f32_pattern,
2716 .arith_bcc_fusion,2773 .arith_bcc_fusion,
2717 .arith_cbz_fusion,2774 .arith_cbz_fusion,
2718 .disable_latency_sched_heuristic,2775 .disable_latency_sched_heuristic,
2776 .fast_ld1_single,
2719 .fp16fml,2777 .fp16fml,
2720 .fpac,2778 .fpac,
2721 .fuse_address,2779 .fuse_address,
...@@ -2724,8 +2782,8 @@ pub const cpu = struct {...@@ -2724,8 +2782,8 @@ pub const cpu = struct {
2724 .fuse_arith_logic,2782 .fuse_arith_logic,
2725 .fuse_crypto_eor,2783 .fuse_crypto_eor,
2726 .fuse_csel,2784 .fuse_csel,
2785 .fuse_fcsel,
2727 .fuse_literals,2786 .fuse_literals,
2728 .hcx,
2729 .max_interleave_factor_4,2787 .max_interleave_factor_4,
2730 .no_zcz_fpr64,2788 .no_zcz_fpr64,
2731 .perfmon,2789 .perfmon,
...@@ -2864,10 +2922,12 @@ pub const cpu = struct {...@@ -2864,10 +2922,12 @@ pub const cpu = struct {
2864 .llvm_name = "apple-s9",2922 .llvm_name = "apple-s9",
2865 .features = featureSet(&[_]Feature{2923 .features = featureSet(&[_]Feature{
2866 .aes,2924 .aes,
2925 .align_cmp_csel_pairs,
2867 .alternate_sextload_cvt_f32_pattern,2926 .alternate_sextload_cvt_f32_pattern,
2868 .arith_bcc_fusion,2927 .arith_bcc_fusion,
2869 .arith_cbz_fusion,2928 .arith_cbz_fusion,
2870 .disable_latency_sched_heuristic,2929 .disable_latency_sched_heuristic,
2930 .fast_ld1_single,
2871 .fp16fml,2931 .fp16fml,
2872 .fpac,2932 .fpac,
2873 .fuse_address,2933 .fuse_address,
...@@ -2876,8 +2936,8 @@ pub const cpu = struct {...@@ -2876,8 +2936,8 @@ pub const cpu = struct {
2876 .fuse_arith_logic,2936 .fuse_arith_logic,
2877 .fuse_crypto_eor,2937 .fuse_crypto_eor,
2878 .fuse_csel,2938 .fuse_csel,
2939 .fuse_fcsel,
2879 .fuse_literals,2940 .fuse_literals,
2880 .hcx,
2881 .max_interleave_factor_4,2941 .max_interleave_factor_4,
2882 .no_zcz_fpr64,2942 .no_zcz_fpr64,
2883 .perfmon,2943 .perfmon,
...@@ -2891,6 +2951,34 @@ pub const cpu = struct {...@@ -2891,6 +2951,34 @@ pub const cpu = struct {
2891 .zcz_gpr64,2951 .zcz_gpr64,
2892 }),2952 }),
2893 };2953 };
2954 pub const armagicpu: CpuModel = .{
2955 .name = "armagicpu",
2956 .llvm_name = "armagicpu",
2957 .features = featureSet(&[_]Feature{
2958 .alu_lsl_fast,
2959 .avoid_ldapur,
2960 .brbe,
2961 .enable_select_opt,
2962 .ete,
2963 .fp16fml,
2964 .fpac,
2965 .fuse_adrp_add,
2966 .fuse_aes,
2967 .fuse_csel,
2968 .fuse_cset,
2969 .has_limited_64bit_vector_mul_bandwidth,
2970 .ls64,
2971 .mte,
2972 .perfmon,
2973 .predictable_select_expensive,
2974 .rand,
2975 .spe,
2976 .sve_bitperm,
2977 .use_fixed_over_scalable_if_equal_cost,
2978 .use_postra_scheduler,
2979 .v9_2a,
2980 }),
2981 };
2894 pub const c1_nano: CpuModel = .{2982 pub const c1_nano: CpuModel = .{
2895 .name = "c1_nano",2983 .name = "c1_nano",
2896 .llvm_name = "c1-nano",2984 .llvm_name = "c1-nano",
...@@ -2987,6 +3075,7 @@ pub const cpu = struct {...@@ -2987,6 +3075,7 @@ pub const cpu = struct {
2987 .fuse_aes,3075 .fuse_aes,
2988 .fuse_csel,3076 .fuse_csel,
2989 .fuse_cset,3077 .fuse_cset,
3078 .max_interleave_factor_4,
2990 .mte,3079 .mte,
2991 .perfmon,3080 .perfmon,
2992 .predictable_select_expensive,3081 .predictable_select_expensive,
...@@ -3016,7 +3105,6 @@ pub const cpu = struct {...@@ -3016,7 +3105,6 @@ pub const cpu = struct {
3016 .features = featureSet(&[_]Feature{3105 .features = featureSet(&[_]Feature{
3017 .alu_lsl_fast,3106 .alu_lsl_fast,
3018 .bf16,3107 .bf16,
3019 .disable_maximize_scalable_bandwidth,
3020 .enable_select_opt,3108 .enable_select_opt,
3021 .ete,3109 .ete,
3022 .fp16fml,3110 .fp16fml,
...@@ -3025,11 +3113,13 @@ pub const cpu = struct {...@@ -3025,11 +3113,13 @@ pub const cpu = struct {
3025 .fuse_aes,3113 .fuse_aes,
3026 .fuse_csel,3114 .fuse_csel,
3027 .fuse_cset,3115 .fuse_cset,
3116 .has_limited_64bit_vector_mul_bandwidth,
3028 .i8mm,3117 .i8mm,
3029 .mte,3118 .mte,
3030 .perfmon,3119 .perfmon,
3031 .predictable_select_expensive,3120 .predictable_select_expensive,
3032 .sve_bitperm,3121 .sve_bitperm,
3122 .use_fixed_over_scalable_if_equal_cost,
3033 .use_postra_scheduler,3123 .use_postra_scheduler,
3034 .v9a,3124 .v9a,
3035 }),3125 }),
...@@ -3562,6 +3652,7 @@ pub const cpu = struct {...@@ -3562,6 +3652,7 @@ pub const cpu = struct {
3562 .fullfp16,3652 .fullfp16,
3563 .fuse_adrp_add,3653 .fuse_adrp_add,
3564 .fuse_aes,3654 .fuse_aes,
3655 .max_interleave_factor_4,
3565 .perfmon,3656 .perfmon,
3566 .predictable_select_expensive,3657 .predictable_select_expensive,
3567 .rcpc,3658 .rcpc,
...@@ -3587,6 +3678,7 @@ pub const cpu = struct {...@@ -3587,6 +3678,7 @@ pub const cpu = struct {
3587 .fuse_adrp_add,3678 .fuse_adrp_add,
3588 .fuse_aes,3679 .fuse_aes,
3589 .lse2,3680 .lse2,
3681 .max_interleave_factor_4,
3590 .pauth,3682 .pauth,
3591 .perfmon,3683 .perfmon,
3592 .predictable_select_expensive,3684 .predictable_select_expensive,
...@@ -3612,6 +3704,7 @@ pub const cpu = struct {...@@ -3612,6 +3704,7 @@ pub const cpu = struct {
3612 .fuse_adrp_add,3704 .fuse_adrp_add,
3613 .fuse_aes,3705 .fuse_aes,
3614 .i8mm,3706 .i8mm,
3707 .max_interleave_factor_4,
3615 .mte,3708 .mte,
3616 .perfmon,3709 .perfmon,
3617 .predictable_select_expensive,3710 .predictable_select_expensive,
...@@ -3635,6 +3728,7 @@ pub const cpu = struct {...@@ -3635,6 +3728,7 @@ pub const cpu = struct {
3635 .fuse_adrp_add,3728 .fuse_adrp_add,
3636 .fuse_aes,3729 .fuse_aes,
3637 .i8mm,3730 .i8mm,
3731 .max_interleave_factor_4,
3638 .mte,3732 .mte,
3639 .perfmon,3733 .perfmon,
3640 .predictable_select_expensive,3734 .predictable_select_expensive,
...@@ -3659,6 +3753,7 @@ pub const cpu = struct {...@@ -3659,6 +3753,7 @@ pub const cpu = struct {
3659 .fuse_aes,3753 .fuse_aes,
3660 .fuse_csel,3754 .fuse_csel,
3661 .fuse_cset,3755 .fuse_cset,
3756 .max_interleave_factor_4,
3662 .mte,3757 .mte,
3663 .perfmon,3758 .perfmon,
3664 .predictable_select_expensive,3759 .predictable_select_expensive,
...@@ -3683,6 +3778,7 @@ pub const cpu = struct {...@@ -3683,6 +3778,7 @@ pub const cpu = struct {
3683 .fuse_aes,3778 .fuse_aes,
3684 .fuse_csel,3779 .fuse_csel,
3685 .fuse_cset,3780 .fuse_cset,
3781 .max_interleave_factor_4,
3686 .mte,3782 .mte,
3687 .perfmon,3783 .perfmon,
3688 .predictable_select_expensive,3784 .predictable_select_expensive,
...@@ -3898,6 +3994,7 @@ pub const cpu = struct {...@@ -3898,6 +3994,7 @@ pub const cpu = struct {
3898 .fuse_aes,3994 .fuse_aes,
3899 .fuse_csel,3995 .fuse_csel,
3900 .fuse_cset,3996 .fuse_cset,
3997 .max_interleave_factor_4,
3901 .mte,3998 .mte,
3902 .perfmon,3999 .perfmon,
3903 .predictable_select_expensive,4000 .predictable_select_expensive,
...@@ -3917,6 +4014,7 @@ pub const cpu = struct {...@@ -3917,6 +4014,7 @@ pub const cpu = struct {
3917 .features = featureSet(&[_]Feature{4014 .features = featureSet(&[_]Feature{
3918 .enable_select_opt,4015 .enable_select_opt,
3919 .ete,4016 .ete,
4017 .fixed_load_latency_4,
3920 .fuse_adrp_add,4018 .fuse_adrp_add,
3921 .fuse_aes,4019 .fuse_aes,
3922 .neon,4020 .neon,
...@@ -3955,6 +4053,36 @@ pub const cpu = struct {...@@ -3955,6 +4053,36 @@ pub const cpu = struct {
3955 .v9a,4053 .v9a,
3956 }),4054 }),
3957 };4055 };
4056 pub const hip12: CpuModel = .{
4057 .name = "hip12",
4058 .llvm_name = "hip12",
4059 .features = featureSet(&[_]Feature{
4060 .addr_lsl_slow_14,
4061 .alu_lsl_fast,
4062 .brbe,
4063 .cmp_bcc_fusion,
4064 .ete,
4065 .fp16fml,
4066 .fpac,
4067 .fuse_aes,
4068 .hbc,
4069 .ls64,
4070 .nmi,
4071 .perfmon,
4072 .rand,
4073 .rcpc3,
4074 .rme,
4075 .spe,
4076 .store_pair_suppress,
4077 .sve2,
4078 .sve_aes,
4079 .sve_bitperm,
4080 .sve_sha3,
4081 .sve_sm4,
4082 .use_postra_scheduler,
4083 .v8_7a,
4084 }),
4085 };
3958 pub const kryo: CpuModel = .{4086 pub const kryo: CpuModel = .{
3959 .name = "kryo",4087 .name = "kryo",
3960 .llvm_name = "kryo",4088 .llvm_name = "kryo",
...@@ -4045,7 +4173,6 @@ pub const cpu = struct {...@@ -4045,7 +4173,6 @@ pub const cpu = struct {
4045 .features = featureSet(&[_]Feature{4173 .features = featureSet(&[_]Feature{
4046 .alu_lsl_fast,4174 .alu_lsl_fast,
4047 .bf16,4175 .bf16,
4048 .disable_maximize_scalable_bandwidth,
4049 .enable_select_opt,4176 .enable_select_opt,
4050 .ete,4177 .ete,
4051 .fp16fml,4178 .fp16fml,
...@@ -4054,11 +4181,13 @@ pub const cpu = struct {...@@ -4054,11 +4181,13 @@ pub const cpu = struct {
4054 .fuse_aes,4181 .fuse_aes,
4055 .fuse_csel,4182 .fuse_csel,
4056 .fuse_cset,4183 .fuse_cset,
4184 .has_limited_64bit_vector_mul_bandwidth,
4057 .i8mm,4185 .i8mm,
4058 .mte,4186 .mte,
4059 .perfmon,4187 .perfmon,
4060 .predictable_select_expensive,4188 .predictable_select_expensive,
4061 .sve_bitperm,4189 .sve_bitperm,
4190 .use_fixed_over_scalable_if_equal_cost,
4062 .use_postra_scheduler,4191 .use_postra_scheduler,
4063 .v9a,4192 .v9a,
4064 }),4193 }),
...@@ -4169,6 +4298,7 @@ pub const cpu = struct {...@@ -4169,6 +4298,7 @@ pub const cpu = struct {
4169 .rand,4298 .rand,
4170 .spe,4299 .spe,
4171 .sve_bitperm,4300 .sve_bitperm,
4301 .use_fixed_over_scalable_if_equal_cost,
4172 .use_postra_scheduler,4302 .use_postra_scheduler,
4173 .v9_2a,4303 .v9_2a,
4174 }),4304 }),
...@@ -4188,14 +4318,15 @@ pub const cpu = struct {...@@ -4188,14 +4318,15 @@ pub const cpu = struct {
4188 .fuse_aes,4318 .fuse_aes,
4189 .fuse_csel,4319 .fuse_csel,
4190 .fuse_cset,4320 .fuse_cset,
4321 .has_limited_64bit_vector_mul_bandwidth,
4191 .ls64,4322 .ls64,
4192 .max_interleave_factor_4,
4193 .mte,4323 .mte,
4194 .perfmon,4324 .perfmon,
4195 .predictable_select_expensive,4325 .predictable_select_expensive,
4196 .rand,4326 .rand,
4197 .spe,4327 .spe,
4198 .sve_bitperm,4328 .sve_bitperm,
4329 .use_fixed_over_scalable_if_equal_cost,
4199 .use_postra_scheduler,4330 .use_postra_scheduler,
4200 .v9_2a,4331 .v9_2a,
4201 }),4332 }),
...@@ -4248,6 +4379,33 @@ pub const cpu = struct {...@@ -4248,6 +4379,33 @@ pub const cpu = struct {
4248 .v8_6a,4379 .v8_6a,
4249 }),4380 }),
4250 };4381 };
4382 pub const rigel: CpuModel = .{
4383 .name = "rigel",
4384 .llvm_name = "rigel",
4385 .features = featureSet(&[_]Feature{
4386 .brbe,
4387 .chk,
4388 .ete,
4389 .faminmax,
4390 .fp16fml,
4391 .fp8dot2,
4392 .fp8dot4,
4393 .fp8fma,
4394 .fpac,
4395 .ls64,
4396 .lut,
4397 .mte,
4398 .olympus,
4399 .perfmon,
4400 .rand,
4401 .spe,
4402 .sve_aes,
4403 .sve_bitperm,
4404 .sve_sha3,
4405 .sve_sm4,
4406 .v9_2a,
4407 }),
4408 };
4251 pub const saphira: CpuModel = .{4409 pub const saphira: CpuModel = .{
4252 .name = "saphira",4410 .name = "saphira",
4253 .llvm_name = "saphira",4411 .llvm_name = "saphira",
lib/std/Target/amdgcn.zig+998-133
...@@ -6,6 +6,7 @@ const CpuModel = std.Target.Cpu.Model;...@@ -6,6 +6,7 @@ const CpuModel = std.Target.Cpu.Model;
66
7pub const Feature = enum {7pub const Feature = enum {
8 @"1024_addressable_vgprs",8 @"1024_addressable_vgprs",
9 @"1536_physical_vgprs",
9 @"16_bit_insts",10 @"16_bit_insts",
10 @"45_bit_num_records_buffer_resource",11 @"45_bit_num_records_buffer_resource",
11 @"64_bit_literals",12 @"64_bit_literals",
...@@ -18,12 +19,12 @@ pub const Feature = enum {...@@ -18,12 +19,12 @@ pub const Feature = enum {
18 addressablelocalmemorysize327680,19 addressablelocalmemorysize327680,
19 addressablelocalmemorysize65536,20 addressablelocalmemorysize65536,
20 agent_scope_fine_grained_remote_memory_atomics,21 agent_scope_fine_grained_remote_memory_atomics,
21 allocate1_5xvgprs,
22 aperture_regs,22 aperture_regs,
23 architected_flat_scratch,23 architected_flat_scratch,
24 architected_sgprs,24 architected_sgprs,
25 ashr_pk_insts,25 ashr_pk_insts,
26 assembler_permissive_wavesize,26 assembler_permissive_wavesize,
27 asynccnt,
27 atomic_buffer_global_pk_add_f16_insts,28 atomic_buffer_global_pk_add_f16_insts,
28 atomic_buffer_global_pk_add_f16_no_rtn_insts,29 atomic_buffer_global_pk_add_f16_no_rtn_insts,
29 atomic_buffer_pk_add_bf16_inst,30 atomic_buffer_pk_add_bf16_inst,
...@@ -75,9 +76,12 @@ pub const Feature = enum {...@@ -75,9 +76,12 @@ pub const Feature = enum {
75 dpp,76 dpp,
76 dpp8,77 dpp8,
77 dpp_64bit,78 dpp_64bit,
79 dpp_row_bcast,
78 dpp_src1_sgpr,80 dpp_src1_sgpr,
81 dpp_wavefront_shifts,
79 ds128,82 ds128,
80 ds_src2_insts,83 ds_src2_insts,
84 dx10_clamp_and_ieee_mode,
81 emulated_system_scope_atomics,85 emulated_system_scope_atomics,
82 extended_image_insts,86 extended_image_insts,
83 f16bf16_to_fp6bf6_cvt_scale_insts,87 f16bf16_to_fp6bf6_cvt_scale_insts,
...@@ -91,13 +95,17 @@ pub const Feature = enum {...@@ -91,13 +95,17 @@ pub const Feature = enum {
91 flat_global_insts,95 flat_global_insts,
92 flat_gvs_mode,96 flat_gvs_mode,
93 flat_inst_offsets,97 flat_inst_offsets,
98 flat_offset_bits_12,
99 flat_offset_bits_24,
94 flat_scratch,100 flat_scratch,
95 flat_scratch_insts,101 flat_scratch_insts,
96 flat_segment_offset_bug,102 flat_segment_offset_bug,
103 flat_signed_offset,
97 fma_mix_bf16_insts,104 fma_mix_bf16_insts,
98 fma_mix_insts,105 fma_mix_insts,
99 fmacf64_inst,106 fmacf64_inst,
100 fmaf,107 fmaf,
108 formatted_mubuf_insts,
101 fp4_cvt_scale_insts,109 fp4_cvt_scale_insts,
102 fp64,110 fp64,
103 fp6bf6_cvt_scale_insts,111 fp6bf6_cvt_scale_insts,
...@@ -116,10 +124,15 @@ pub const Feature = enum {...@@ -116,10 +124,15 @@ pub const Feature = enum {
116 gfx10_b_encoding,124 gfx10_b_encoding,
117 gfx10_insts,125 gfx10_insts,
118 gfx11,126 gfx11,
127 gfx11_7_insts,
119 gfx11_insts,128 gfx11_insts,
120 gfx12,129 gfx12,
121 gfx1250_insts,130 gfx1250_insts,
131 gfx1251_gemm_insts,
132 gfx125x_lowest_rate_wmma,
122 gfx12_insts,133 gfx12_insts,
134 gfx13,
135 gfx13_insts,
123 gfx7_gfx8_gfx9_insts,136 gfx7_gfx8_gfx9_insts,
124 gfx8_insts,137 gfx8_insts,
125 gfx9,138 gfx9,
...@@ -135,6 +148,8 @@ pub const Feature = enum {...@@ -135,6 +148,8 @@ pub const Feature = enum {
135 image_insts,148 image_insts,
136 image_store_d16_bug,149 image_store_d16_bug,
137 inst_fwd_prefetch_bug,150 inst_fwd_prefetch_bug,
151 instcachelinesize128,
152 instcachelinesize64,
138 int_clamp_insts,153 int_clamp_insts,
139 inv_2pi_inline_imm,154 inv_2pi_inline_imm,
140 kernarg_preload,155 kernarg_preload,
...@@ -149,6 +164,7 @@ pub const Feature = enum {...@@ -149,6 +164,7 @@ pub const Feature = enum {
149 mad_intra_fwd_bug,164 mad_intra_fwd_bug,
150 mad_mac_f32_insts,165 mad_mac_f32_insts,
151 mad_mix_insts,166 mad_mix_insts,
167 mad_nc_64_32_insts,
152 mad_u32_inst,168 mad_u32_inst,
153 mai_insts,169 mai_insts,
154 max_hard_clause_length_32,170 max_hard_clause_length_32,
...@@ -161,22 +177,31 @@ pub const Feature = enum {...@@ -161,22 +177,31 @@ pub const Feature = enum {
161 mfma_inline_literal_bug,177 mfma_inline_literal_bug,
162 mimg_r128,178 mimg_r128,
163 min3_max3_pkf16,179 min3_max3_pkf16,
180 min_max_i64_insts,
164 minimum3_maximum3_f16,181 minimum3_maximum3_f16,
165 minimum3_maximum3_f32,182 minimum3_maximum3_f32,
166 minimum3_maximum3_pkf16,183 minimum3_maximum3_pkf16,
167 movrel,184 movrel,
185 mqsad_insts,
186 mqsad_pk_insts,
168 msaa_load_dst_sel_bug,187 msaa_load_dst_sel_bug,
188 msad_insts,
189 mtbuf_insts,
169 negative_scratch_offset_bug,190 negative_scratch_offset_bug,
170 negative_unaligned_scratch_offset_bug,191 negative_unaligned_scratch_offset_bug,
171 no_data_dep_hazard,192 no_data_dep_hazard,
193 no_f16_pseudo_scalar_trans_inline_constants,
172 no_sdst_cmpx,194 no_sdst_cmpx,
173 nsa_clause_bug,195 nsa_clause_bug,
174 nsa_encoding,196 nsa_encoding,
175 nsa_to_vmem_bug,197 nsa_to_vmem_bug,
176 offset_3f_bug,198 offset_3f_bug,
177 packed_fp32_ops,199 packed_fp32_ops,
200 packed_fp64_ops,
178 packed_tid,201 packed_tid,
202 packed_u64_ops,
179 partial_nsa_encoding,203 partial_nsa_encoding,
204 permlane16_insts,
180 permlane16_swap,205 permlane16_swap,
181 permlane32_swap,206 permlane32_swap,
182 pk_add_min_max_insts,207 pk_add_min_max_insts,
...@@ -185,23 +210,25 @@ pub const Feature = enum {...@@ -185,23 +210,25 @@ pub const Feature = enum {
185 precise_memory,210 precise_memory,
186 priv_enabled_trap2_nop_bug,211 priv_enabled_trap2_nop_bug,
187 prng_inst,212 prng_inst,
188 promote_alloca,
189 prt_strict_null,213 prt_strict_null,
190 pseudo_scalar_trans,214 pseudo_scalar_trans,
191 qsad_insts,215 qsad_insts,
192 r128_a16,216 r128_a16,
193 real_true16,217 real_true16,
194 relaxed_buffer_oob_mode,
195 required_export_priority,218 required_export_priority,
196 requires_cov6,219 requires_cov6,
220 requires_initial_unclause_vmem,
197 restricted_soffset,221 restricted_soffset,
222 s_barrier_leave_imm,
198 s_memrealtime,223 s_memrealtime,
199 s_memtime_inst,224 s_memtime_inst,
200 s_wakeup_barrier_inst,225 s_wakeup_barrier_inst,
226 s_wakeup_imm,
201 sad_insts,227 sad_insts,
202 safe_cu_prefetch,228 safe_cu_prefetch,
203 safe_smem_prefetch,229 safe_smem_prefetch,
204 salu_float,230 salu_float,
231 salu_minimum_maximum_insts,
205 scalar_atomics,232 scalar_atomics,
206 scalar_dwordx3_loads,233 scalar_dwordx3_loads,
207 scalar_flat_scratch_insts,234 scalar_flat_scratch_insts,
...@@ -219,13 +246,17 @@ pub const Feature = enum {...@@ -219,13 +246,17 @@ pub const Feature = enum {
219 shader_cycles_hi_lo_registers,246 shader_cycles_hi_lo_registers,
220 shader_cycles_register,247 shader_cycles_register,
221 si_scheduler,248 si_scheduler,
249 smem_prefetch_insts,
222 smem_to_vector_write_hazard,250 smem_to_vector_write_hazard,
223 southern_islands,251 southern_islands,
224 sramecc,252 sramecc,
225 sramecc_support,253 sramecc_support,
254 swmmac_gfx1200_insts,
255 swmmac_gfx1250_insts,
226 tanh_insts,256 tanh_insts,
227 tensor_cvt_lut_insts,257 tensor_cvt_lut_insts,
228 tgsplit,258 tgsplit_support,
259 trans_coexecution_hazard,
229 transpose_load_f4f6_insts,260 transpose_load_f4f6_insts,
230 trap_handler,261 trap_handler,
231 trig_reduced_range,262 trig_reduced_range,
...@@ -236,7 +267,10 @@ pub const Feature = enum {...@@ -236,7 +267,10 @@ pub const Feature = enum {
236 unaligned_scratch_access,267 unaligned_scratch_access,
237 unpacked_d16_vmem,268 unpacked_d16_vmem,
238 unsafe_ds_offset_folding,269 unsafe_ds_offset_folding,
270 use_add_pc64_inst,
239 user_sgpr_init16_bug,271 user_sgpr_init16_bug,
272 v_mov_b64_inst,
273 v_mul_u64_inst,
240 valu_trans_use_hazard,274 valu_trans_use_hazard,
241 vcmpx_exec_war_hazard,275 vcmpx_exec_war_hazard,
242 vcmpx_permlane_hazard,276 vcmpx_permlane_hazard,
...@@ -249,6 +283,7 @@ pub const Feature = enum {...@@ -249,6 +283,7 @@ pub const Feature = enum {
249 volcanic_islands,283 volcanic_islands,
250 vop3_literal,284 vop3_literal,
251 vop3p,285 vop3p,
286 vop3px2_increments_va_vdst_twice,
252 vopd,287 vopd,
253 vscnt,288 vscnt,
254 wait_xcnt,289 wait_xcnt,
...@@ -256,8 +291,12 @@ pub const Feature = enum {...@@ -256,8 +291,12 @@ pub const Feature = enum {
256 wavefrontsize16,291 wavefrontsize16,
257 wavefrontsize32,292 wavefrontsize32,
258 wavefrontsize64,293 wavefrontsize64,
294 wmma_128b_insts,
295 wmma_256b_insts,
296 wmma_coexecution_hazards,
259 xf32_insts,297 xf32_insts,
260 xnack,298 xnack,
299 xnack_on_off_modes,
261 xnack_support,300 xnack_support,
262};301};
263302
...@@ -276,6 +315,11 @@ pub const all_features = blk: {...@@ -276,6 +315,11 @@ pub const all_features = blk: {
276 .description = "Has 1024 addressable VGPRs",315 .description = "Has 1024 addressable VGPRs",
277 .dependencies = featureSet(&[_]Feature{}),316 .dependencies = featureSet(&[_]Feature{}),
278 };317 };
318 result[@backingInt(Feature.@"1536_physical_vgprs")] = .{
319 .llvm_name = "1536-physical-vgprs",
320 .description = "Has 1536 physical VGPRs per SIMD",
321 .dependencies = featureSet(&[_]Feature{}),
322 };
279 result[@backingInt(Feature.@"16_bit_insts")] = .{323 result[@backingInt(Feature.@"16_bit_insts")] = .{
280 .llvm_name = "16-bit-insts",324 .llvm_name = "16-bit-insts",
281 .description = "Has i16/f16 instructions",325 .description = "Has i16/f16 instructions",
...@@ -336,11 +380,6 @@ pub const all_features = blk: {...@@ -336,11 +380,6 @@ pub const all_features = blk: {
336 .description = "Agent (device) scoped atomic operations, excluding those directly supported by PCIe (i.e. integer atomic add, exchange, and compare-and-swap), are functional for allocations in host or peer device memory.",380 .description = "Agent (device) scoped atomic operations, excluding those directly supported by PCIe (i.e. integer atomic add, exchange, and compare-and-swap), are functional for allocations in host or peer device memory.",
337 .dependencies = featureSet(&[_]Feature{}),381 .dependencies = featureSet(&[_]Feature{}),
338 };382 };
339 result[@backingInt(Feature.allocate1_5xvgprs)] = .{
340 .llvm_name = "allocate1_5xvgprs",
341 .description = "Has 50% more physical VGPRs and 50% larger allocation granule",
342 .dependencies = featureSet(&[_]Feature{}),
343 };
344 result[@backingInt(Feature.aperture_regs)] = .{383 result[@backingInt(Feature.aperture_regs)] = .{
345 .llvm_name = "aperture-regs",384 .llvm_name = "aperture-regs",
346 .description = "Has Memory Aperture Base and Size Registers",385 .description = "Has Memory Aperture Base and Size Registers",
...@@ -363,7 +402,12 @@ pub const all_features = blk: {...@@ -363,7 +402,12 @@ pub const all_features = blk: {
363 };402 };
364 result[@backingInt(Feature.assembler_permissive_wavesize)] = .{403 result[@backingInt(Feature.assembler_permissive_wavesize)] = .{
365 .llvm_name = "assembler-permissive-wavesize",404 .llvm_name = "assembler-permissive-wavesize",
366 .description = "allow parsing wave32 and wave64 variants of instructions",405 .description = "Allow parsing wave32 and wave64 variants of instructions",
406 .dependencies = featureSet(&[_]Feature{}),
407 };
408 result[@backingInt(Feature.asynccnt)] = .{
409 .llvm_name = "asynccnt",
410 .description = "Has separate asynccnt counter",
367 .dependencies = featureSet(&[_]Feature{}),411 .dependencies = featureSet(&[_]Feature{}),
368 };412 };
369 result[@backingInt(Feature.atomic_buffer_global_pk_add_f16_insts)] = .{413 result[@backingInt(Feature.atomic_buffer_global_pk_add_f16_insts)] = .{
...@@ -637,11 +681,21 @@ pub const all_features = blk: {...@@ -637,11 +681,21 @@ pub const all_features = blk: {
637 .description = "Support DPP (Data Parallel Primitives) extension in DP ALU",681 .description = "Support DPP (Data Parallel Primitives) extension in DP ALU",
638 .dependencies = featureSet(&[_]Feature{}),682 .dependencies = featureSet(&[_]Feature{}),
639 };683 };
684 result[@backingInt(Feature.dpp_row_bcast)] = .{
685 .llvm_name = "dpp-row-bcast",
686 .description = "Support DPP row_bcast15/row_bcast31",
687 .dependencies = featureSet(&[_]Feature{}),
688 };
640 result[@backingInt(Feature.dpp_src1_sgpr)] = .{689 result[@backingInt(Feature.dpp_src1_sgpr)] = .{
641 .llvm_name = "dpp-src1-sgpr",690 .llvm_name = "dpp-src1-sgpr",
642 .description = "Support SGPR for Src1 of DPP instructions",691 .description = "Support SGPR for Src1 of DPP instructions",
643 .dependencies = featureSet(&[_]Feature{}),692 .dependencies = featureSet(&[_]Feature{}),
644 };693 };
694 result[@backingInt(Feature.dpp_wavefront_shifts)] = .{
695 .llvm_name = "dpp-wavefront-shifts",
696 .description = "Support DPP wave_shl/wave_rol/wave_shr/wave_ror",
697 .dependencies = featureSet(&[_]Feature{}),
698 };
645 result[@backingInt(Feature.ds128)] = .{699 result[@backingInt(Feature.ds128)] = .{
646 .llvm_name = "enable-ds128",700 .llvm_name = "enable-ds128",
647 .description = "Use ds_{read|write}_b128",701 .description = "Use ds_{read|write}_b128",
...@@ -652,6 +706,11 @@ pub const all_features = blk: {...@@ -652,6 +706,11 @@ pub const all_features = blk: {
652 .description = "Has ds_*_src2 instructions",706 .description = "Has ds_*_src2 instructions",
653 .dependencies = featureSet(&[_]Feature{}),707 .dependencies = featureSet(&[_]Feature{}),
654 };708 };
709 result[@backingInt(Feature.dx10_clamp_and_ieee_mode)] = .{
710 .llvm_name = "dx10-clamp-and-ieee-mode",
711 .description = "Target has DX10_CLAMP and IEEE_MODE kernel descriptor bits",
712 .dependencies = featureSet(&[_]Feature{}),
713 };
655 result[@backingInt(Feature.emulated_system_scope_atomics)] = .{714 result[@backingInt(Feature.emulated_system_scope_atomics)] = .{
656 .llvm_name = "emulated-system-scope-atomics",715 .llvm_name = "emulated-system-scope-atomics",
657 .description = "System scope atomics unsupported by the PCI-e are emulated in HW via CAS loop and functional.",716 .description = "System scope atomics unsupported by the PCI-e are emulated in HW via CAS loop and functional.",
...@@ -723,6 +782,16 @@ pub const all_features = blk: {...@@ -723,6 +782,16 @@ pub const all_features = blk: {
723 .description = "Flat instructions have immediate offset addressing mode",782 .description = "Flat instructions have immediate offset addressing mode",
724 .dependencies = featureSet(&[_]Feature{}),783 .dependencies = featureSet(&[_]Feature{}),
725 };784 };
785 result[@backingInt(Feature.flat_offset_bits_12)] = .{
786 .llvm_name = "flat-offset-bits-12",
787 .description = "Number of bits for flat offset encoding",
788 .dependencies = featureSet(&[_]Feature{}),
789 };
790 result[@backingInt(Feature.flat_offset_bits_24)] = .{
791 .llvm_name = "flat-offset-bits-24",
792 .description = "Number of bits for flat offset encoding",
793 .dependencies = featureSet(&[_]Feature{}),
794 };
726 result[@backingInt(Feature.flat_scratch)] = .{795 result[@backingInt(Feature.flat_scratch)] = .{
727 .llvm_name = "enable-flat-scratch",796 .llvm_name = "enable-flat-scratch",
728 .description = "Use scratch_* flat memory instructions to access scratch",797 .description = "Use scratch_* flat memory instructions to access scratch",
...@@ -740,6 +809,11 @@ pub const all_features = blk: {...@@ -740,6 +809,11 @@ pub const all_features = blk: {
740 .description = "GFX10 bug where inst_offset is ignored when flat instructions access global memory",809 .description = "GFX10 bug where inst_offset is ignored when flat instructions access global memory",
741 .dependencies = featureSet(&[_]Feature{}),810 .dependencies = featureSet(&[_]Feature{}),
742 };811 };
812 result[@backingInt(Feature.flat_signed_offset)] = .{
813 .llvm_name = "flat-signed-offset",
814 .description = "Immediate offset of FLAT instructions are always signed",
815 .dependencies = featureSet(&[_]Feature{}),
816 };
743 result[@backingInt(Feature.fma_mix_bf16_insts)] = .{817 result[@backingInt(Feature.fma_mix_bf16_insts)] = .{
744 .llvm_name = "fma-mix-bf16-insts",818 .llvm_name = "fma-mix-bf16-insts",
745 .description = "Has v_fma_mix_f32_bf16, v_fma_mixlo_bf16, v_fma_mixhi_bf16 instructions",819 .description = "Has v_fma_mix_f32_bf16, v_fma_mixlo_bf16, v_fma_mixhi_bf16 instructions",
...@@ -760,6 +834,11 @@ pub const all_features = blk: {...@@ -760,6 +834,11 @@ pub const all_features = blk: {
760 .description = "Enable single precision FMA (not as fast as mul+add, but fused)",834 .description = "Enable single precision FMA (not as fast as mul+add, but fused)",
761 .dependencies = featureSet(&[_]Feature{}),835 .dependencies = featureSet(&[_]Feature{}),
762 };836 };
837 result[@backingInt(Feature.formatted_mubuf_insts)] = .{
838 .llvm_name = "formatted-mubuf-insts",
839 .description = "Has formatted memory untyped buffer instructions.",
840 .dependencies = featureSet(&[_]Feature{}),
841 };
763 result[@backingInt(Feature.fp4_cvt_scale_insts)] = .{842 result[@backingInt(Feature.fp4_cvt_scale_insts)] = .{
764 .llvm_name = "fp4-cvt-scale-insts",843 .llvm_name = "fp4-cvt-scale-insts",
765 .description = "Has fp4 conversion scale instructions",844 .description = "Has fp4 conversion scale instructions",
...@@ -841,13 +920,16 @@ pub const all_features = blk: {...@@ -841,13 +920,16 @@ pub const all_features = blk: {
841 .default_component_zero,920 .default_component_zero,
842 .dpp,921 .dpp,
843 .dpp8,922 .dpp8,
923 .dx10_clamp_and_ieee_mode,
844 .extended_image_insts,924 .extended_image_insts,
845 .fast_denormal_f32,925 .fast_denormal_f32,
846 .fast_fmaf,926 .fast_fmaf,
847 .flat_global_insts,927 .flat_global_insts,
848 .flat_inst_offsets,928 .flat_inst_offsets,
929 .flat_offset_bits_12,
849 .flat_scratch_insts,930 .flat_scratch_insts,
850 .fma_mix_insts,931 .fma_mix_insts,
932 .formatted_mubuf_insts,
851 .fp64,933 .fp64,
852 .g16,934 .g16,
853 .gds,935 .gds,
...@@ -856,14 +938,20 @@ pub const all_features = blk: {...@@ -856,14 +938,20 @@ pub const all_features = blk: {
856 .gfx9_insts,938 .gfx9_insts,
857 .gws,939 .gws,
858 .image_insts,940 .image_insts,
941 .instcachelinesize64,
859 .int_clamp_insts,942 .int_clamp_insts,
860 .inv_2pi_inline_imm,943 .inv_2pi_inline_imm,
861 .lerp_inst,944 .lerp_inst,
862 .max_hard_clause_length_63,945 .max_hard_clause_length_63,
863 .mimg_r128,946 .mimg_r128,
864 .movrel,947 .movrel,
948 .mqsad_insts,
949 .mqsad_pk_insts,
950 .msad_insts,
951 .mtbuf_insts,
865 .no_data_dep_hazard,952 .no_data_dep_hazard,
866 .no_sdst_cmpx,953 .no_sdst_cmpx,
954 .permlane16_insts,
867 .pk_fmac_f16_inst,955 .pk_fmac_f16_inst,
868 .qsad_insts,956 .qsad_insts,
869 .s_memrealtime,957 .s_memrealtime,
...@@ -929,6 +1017,7 @@ pub const all_features = blk: {...@@ -929,6 +1017,7 @@ pub const all_features = blk: {
929 .flat_inst_offsets,1017 .flat_inst_offsets,
930 .flat_scratch_insts,1018 .flat_scratch_insts,
931 .fma_mix_insts,1019 .fma_mix_insts,
1020 .formatted_mubuf_insts,
932 .fp64,1021 .fp64,
933 .g16,1022 .g16,
934 .gds,1023 .gds,
...@@ -940,14 +1029,20 @@ pub const all_features = blk: {...@@ -940,14 +1029,20 @@ pub const all_features = blk: {
940 .gfx8_insts,1029 .gfx8_insts,
941 .gfx9_insts,1030 .gfx9_insts,
942 .gws,1031 .gws,
1032 .instcachelinesize128,
943 .int_clamp_insts,1033 .int_clamp_insts,
944 .inv_2pi_inline_imm,1034 .inv_2pi_inline_imm,
945 .lerp_inst,1035 .lerp_inst,
946 .max_hard_clause_length_32,1036 .max_hard_clause_length_32,
947 .mimg_r128,1037 .mimg_r128,
948 .movrel,1038 .movrel,
1039 .mqsad_insts,
1040 .mqsad_pk_insts,
1041 .msad_insts,
1042 .mtbuf_insts,
949 .no_data_dep_hazard,1043 .no_data_dep_hazard,
950 .no_sdst_cmpx,1044 .no_sdst_cmpx,
1045 .permlane16_insts,
951 .pk_fmac_f16_inst,1046 .pk_fmac_f16_inst,
952 .qsad_insts,1047 .qsad_insts,
953 .sad_insts,1048 .sad_insts,
...@@ -962,6 +1057,11 @@ pub const all_features = blk: {...@@ -962,6 +1057,11 @@ pub const all_features = blk: {
962 .vscnt,1057 .vscnt,
963 }),1058 }),
964 };1059 };
1060 result[@backingInt(Feature.gfx11_7_insts)] = .{
1061 .llvm_name = "gfx11-7-insts",
1062 .description = "Additional instructions for GFX11.7",
1063 .dependencies = featureSet(&[_]Feature{}),
1064 };
965 result[@backingInt(Feature.gfx11_insts)] = .{1065 result[@backingInt(Feature.gfx11_insts)] = .{
966 .llvm_name = "gfx11-insts",1066 .llvm_name = "gfx11-insts",
967 .description = "Additional instructions for GFX11+",1067 .description = "Additional instructions for GFX11+",
...@@ -986,7 +1086,9 @@ pub const all_features = blk: {...@@ -986,7 +1086,9 @@ pub const all_features = blk: {
986 .fast_fmaf,1086 .fast_fmaf,
987 .flat_global_insts,1087 .flat_global_insts,
988 .flat_inst_offsets,1088 .flat_inst_offsets,
1089 .flat_offset_bits_24,
989 .flat_scratch_insts,1090 .flat_scratch_insts,
1091 .flat_signed_offset,
990 .fma_mix_insts,1092 .fma_mix_insts,
991 .fp64,1093 .fp64,
992 .g16,1094 .g16,
...@@ -999,6 +1101,7 @@ pub const all_features = blk: {...@@ -999,6 +1101,7 @@ pub const all_features = blk: {
999 .gfx8_insts,1101 .gfx8_insts,
1000 .gfx9_insts,1102 .gfx9_insts,
1001 .ieee_minimum_maximum_insts,1103 .ieee_minimum_maximum_insts,
1104 .instcachelinesize128,
1002 .int_clamp_insts,1105 .int_clamp_insts,
1003 .inv_2pi_inline_imm,1106 .inv_2pi_inline_imm,
1004 .max_hard_clause_length_32,1107 .max_hard_clause_length_32,
...@@ -1008,7 +1111,9 @@ pub const all_features = blk: {...@@ -1008,7 +1111,9 @@ pub const all_features = blk: {
1008 .movrel,1111 .movrel,
1009 .no_data_dep_hazard,1112 .no_data_dep_hazard,
1010 .no_sdst_cmpx,1113 .no_sdst_cmpx,
1114 .permlane16_insts,
1011 .pk_fmac_f16_inst,1115 .pk_fmac_f16_inst,
1116 .salu_minimum_maximum_insts,
1012 .true16,1117 .true16,
1013 .unaligned_buffer_access,1118 .unaligned_buffer_access,
1014 .unaligned_ds_access,1119 .unaligned_ds_access,
...@@ -1024,11 +1129,91 @@ pub const all_features = blk: {...@@ -1024,11 +1129,91 @@ pub const all_features = blk: {
1024 .description = "Additional instructions for GFX1250+",1129 .description = "Additional instructions for GFX1250+",
1025 .dependencies = featureSet(&[_]Feature{}),1130 .dependencies = featureSet(&[_]Feature{}),
1026 };1131 };
1132 result[@backingInt(Feature.gfx1251_gemm_insts)] = .{
1133 .llvm_name = "gfx1251-gemm-insts",
1134 .description = "Has additional gfx1251 DGEMM instructions",
1135 .dependencies = featureSet(&[_]Feature{}),
1136 };
1137 result[@backingInt(Feature.gfx125x_lowest_rate_wmma)] = .{
1138 .llvm_name = "gfx125x-lowest-rate-wmma",
1139 .description = "Has the lowest rate wmma in the gfx125x family, mainly for the gfx12-5-generic",
1140 .dependencies = featureSet(&[_]Feature{}),
1141 };
1027 result[@backingInt(Feature.gfx12_insts)] = .{1142 result[@backingInt(Feature.gfx12_insts)] = .{
1028 .llvm_name = "gfx12-insts",1143 .llvm_name = "gfx12-insts",
1029 .description = "Additional instructions for GFX12+",1144 .description = "Additional instructions for GFX12+",
1030 .dependencies = featureSet(&[_]Feature{}),1145 .dependencies = featureSet(&[_]Feature{}),
1031 };1146 };
1147 result[@backingInt(Feature.gfx13)] = .{
1148 .llvm_name = "gfx13",
1149 .description = "GFX13 GPU generation",
1150 .dependencies = featureSet(&[_]Feature{
1151 .@"16_bit_insts",
1152 .a16,
1153 .add_no_carry_insts,
1154 .agent_scope_fine_grained_remote_memory_atomics,
1155 .aperture_regs,
1156 .atomic_fmin_fmax_flat_f32,
1157 .atomic_fmin_fmax_global_f32,
1158 .ci_insts,
1159 .default_component_broadcast,
1160 .dpp,
1161 .dpp8,
1162 .extended_image_insts,
1163 .fast_denormal_f32,
1164 .fast_fmaf,
1165 .flat_global_insts,
1166 .flat_inst_offsets,
1167 .flat_offset_bits_24,
1168 .flat_scratch_insts,
1169 .flat_signed_offset,
1170 .fma_mix_insts,
1171 .formatted_mubuf_insts,
1172 .fp64,
1173 .g16,
1174 .gfx10_3_insts,
1175 .gfx10_a_encoding,
1176 .gfx10_b_encoding,
1177 .gfx10_insts,
1178 .gfx11_insts,
1179 .gfx12_insts,
1180 .gfx13_insts,
1181 .gfx8_insts,
1182 .gfx9_insts,
1183 .ieee_minimum_maximum_insts,
1184 .image_insts,
1185 .instcachelinesize128,
1186 .int_clamp_insts,
1187 .inv_2pi_inline_imm,
1188 .max_hard_clause_length_32,
1189 .mimg_r128,
1190 .minimum3_maximum3_f16,
1191 .minimum3_maximum3_f32,
1192 .movrel,
1193 .mtbuf_insts,
1194 .no_data_dep_hazard,
1195 .no_sdst_cmpx,
1196 .permlane16_insts,
1197 .pk_fmac_f16_inst,
1198 .salu_minimum_maximum_insts,
1199 .true16,
1200 .unaligned_buffer_access,
1201 .unaligned_ds_access,
1202 .unaligned_scratch_access,
1203 .vop3_literal,
1204 .vop3p,
1205 .vopd,
1206 .vscnt,
1207 }),
1208 };
1209 result[@backingInt(Feature.gfx13_insts)] = .{
1210 .llvm_name = "gfx13-insts",
1211 .description = "Additional instructions for GFX13+",
1212 .dependencies = featureSet(&[_]Feature{
1213 .s_barrier_leave_imm,
1214 .s_wakeup_imm,
1215 }),
1216 };
1032 result[@backingInt(Feature.gfx7_gfx8_gfx9_insts)] = .{1217 result[@backingInt(Feature.gfx7_gfx8_gfx9_insts)] = .{
1033 .llvm_name = "gfx7-gfx8-gfx9-insts",1218 .llvm_name = "gfx7-gfx8-gfx9-insts",
1034 .description = "Instructions shared in GFX7, GFX8, GFX9",1219 .description = "Instructions shared in GFX7, GFX8, GFX9",
...@@ -1054,20 +1239,29 @@ pub const all_features = blk: {...@@ -1054,20 +1239,29 @@ pub const all_features = blk: {
1054 .cvt_pknorm_vop3_insts,1239 .cvt_pknorm_vop3_insts,
1055 .default_component_zero,1240 .default_component_zero,
1056 .dpp,1241 .dpp,
1242 .dpp_row_bcast,
1243 .dpp_wavefront_shifts,
1244 .dx10_clamp_and_ieee_mode,
1057 .fast_denormal_f32,1245 .fast_denormal_f32,
1058 .fast_fmaf,1246 .fast_fmaf,
1059 .flat_global_insts,1247 .flat_global_insts,
1060 .flat_inst_offsets,1248 .flat_inst_offsets,
1061 .flat_scratch_insts,1249 .flat_scratch_insts,
1250 .formatted_mubuf_insts,
1062 .fp64,1251 .fp64,
1063 .gcn3_encoding,1252 .gcn3_encoding,
1064 .gfx7_gfx8_gfx9_insts,1253 .gfx7_gfx8_gfx9_insts,
1065 .gfx8_insts,1254 .gfx8_insts,
1066 .gfx9_insts,1255 .gfx9_insts,
1067 .gws,1256 .gws,
1257 .instcachelinesize64,
1068 .int_clamp_insts,1258 .int_clamp_insts,
1069 .inv_2pi_inline_imm,1259 .inv_2pi_inline_imm,
1070 .lerp_inst,1260 .lerp_inst,
1261 .mqsad_insts,
1262 .mqsad_pk_insts,
1263 .msad_insts,
1264 .mtbuf_insts,
1071 .negative_scratch_offset_bug,1265 .negative_scratch_offset_bug,
1072 .qsad_insts,1266 .qsad_insts,
1073 .r128_a16,1267 .r128_a16,
...@@ -1089,7 +1283,7 @@ pub const all_features = blk: {...@@ -1089,7 +1283,7 @@ pub const all_features = blk: {
1089 .vmem_write_vgpr_in_order,1283 .vmem_write_vgpr_in_order,
1090 .vop3p,1284 .vop3p,
1091 .wavefrontsize64,1285 .wavefrontsize64,
1092 .xnack_support,1286 .xnack_on_off_modes,
1093 }),1287 }),
1094 };1288 };
1095 result[@backingInt(Feature.gfx90a_insts)] = .{1289 result[@backingInt(Feature.gfx90a_insts)] = .{
...@@ -1142,7 +1336,7 @@ pub const all_features = blk: {...@@ -1142,7 +1336,7 @@ pub const all_features = blk: {
1142 };1336 };
1143 result[@backingInt(Feature.ieee_minimum_maximum_insts)] = .{1337 result[@backingInt(Feature.ieee_minimum_maximum_insts)] = .{
1144 .llvm_name = "ieee-minimum-maximum-insts",1338 .llvm_name = "ieee-minimum-maximum-insts",
1145 .description = "Has v_minimum/maximum_f16/f32/f64, v_minimummaximum/maximumminimum_f16/f32 and v_pk_minimum/maximum_f16 instructions",1339 .description = "Has v_minimum/maximum_f16/f32/f64, v_minimummaximum/maximumminimum_f16/f32 andv_pk_minimum/maximum_f16 instructions",
1146 .dependencies = featureSet(&[_]Feature{}),1340 .dependencies = featureSet(&[_]Feature{}),
1147 };1341 };
1148 result[@backingInt(Feature.image_gather4_d16_bug)] = .{1342 result[@backingInt(Feature.image_gather4_d16_bug)] = .{
...@@ -1165,6 +1359,16 @@ pub const all_features = blk: {...@@ -1165,6 +1359,16 @@ pub const all_features = blk: {
1165 .description = "S_INST_PREFETCH instruction causes shader to hang",1359 .description = "S_INST_PREFETCH instruction causes shader to hang",
1166 .dependencies = featureSet(&[_]Feature{}),1360 .dependencies = featureSet(&[_]Feature{}),
1167 };1361 };
1362 result[@backingInt(Feature.instcachelinesize128)] = .{
1363 .llvm_name = "instcachelinesize128",
1364 .description = "Instruction cache line size in bytes.",
1365 .dependencies = featureSet(&[_]Feature{}),
1366 };
1367 result[@backingInt(Feature.instcachelinesize64)] = .{
1368 .llvm_name = "instcachelinesize64",
1369 .description = "Instruction cache line size in bytes.",
1370 .dependencies = featureSet(&[_]Feature{}),
1371 };
1168 result[@backingInt(Feature.int_clamp_insts)] = .{1372 result[@backingInt(Feature.int_clamp_insts)] = .{
1169 .llvm_name = "int-clamp-insts",1373 .llvm_name = "int-clamp-insts",
1170 .description = "Support clamp for integer destination",1374 .description = "Support clamp for integer destination",
...@@ -1235,6 +1439,11 @@ pub const all_features = blk: {...@@ -1235,6 +1439,11 @@ pub const all_features = blk: {
1235 .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions",1439 .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions",
1236 .dependencies = featureSet(&[_]Feature{}),1440 .dependencies = featureSet(&[_]Feature{}),
1237 };1441 };
1442 result[@backingInt(Feature.mad_nc_64_32_insts)] = .{
1443 .llvm_name = "mad-nc-64-32-insts",
1444 .description = "Has v_mad_nc_{u64_u32|i64_i32} instructions",
1445 .dependencies = featureSet(&[_]Feature{}),
1446 };
1238 result[@backingInt(Feature.mad_u32_inst)] = .{1447 result[@backingInt(Feature.mad_u32_inst)] = .{
1239 .llvm_name = "mad-u32-inst",1448 .llvm_name = "mad-u32-inst",
1240 .description = "Has v_mad_u32 instruction",1449 .description = "Has v_mad_u32 instruction",
...@@ -1295,6 +1504,11 @@ pub const all_features = blk: {...@@ -1295,6 +1504,11 @@ pub const all_features = blk: {
1295 .description = "Has v_pk_min3_num_f16 and v_pk_max3_num_f16 instructions",1504 .description = "Has v_pk_min3_num_f16 and v_pk_max3_num_f16 instructions",
1296 .dependencies = featureSet(&[_]Feature{}),1505 .dependencies = featureSet(&[_]Feature{}),
1297 };1506 };
1507 result[@backingInt(Feature.min_max_i64_insts)] = .{
1508 .llvm_name = "min-max-i64-insts",
1509 .description = "Has v_{min|max}_{i|u}64 instructions",
1510 .dependencies = featureSet(&[_]Feature{}),
1511 };
1298 result[@backingInt(Feature.minimum3_maximum3_f16)] = .{1512 result[@backingInt(Feature.minimum3_maximum3_f16)] = .{
1299 .llvm_name = "minimum3-maximum3-f16",1513 .llvm_name = "minimum3-maximum3-f16",
1300 .description = "Has v_minimum3_f16 and v_maximum3_f16 instructions",1514 .description = "Has v_minimum3_f16 and v_maximum3_f16 instructions",
...@@ -1315,11 +1529,31 @@ pub const all_features = blk: {...@@ -1315,11 +1529,31 @@ pub const all_features = blk: {
1315 .description = "Has v_movrel*_b32 instructions",1529 .description = "Has v_movrel*_b32 instructions",
1316 .dependencies = featureSet(&[_]Feature{}),1530 .dependencies = featureSet(&[_]Feature{}),
1317 };1531 };
1532 result[@backingInt(Feature.mqsad_insts)] = .{
1533 .llvm_name = "mqsad-insts",
1534 .description = "Has v_mqsad_u32_u8 instruction",
1535 .dependencies = featureSet(&[_]Feature{}),
1536 };
1537 result[@backingInt(Feature.mqsad_pk_insts)] = .{
1538 .llvm_name = "mqsad-pk-insts",
1539 .description = "Has v_mqsad_pk_u16_u8 instruction",
1540 .dependencies = featureSet(&[_]Feature{}),
1541 };
1318 result[@backingInt(Feature.msaa_load_dst_sel_bug)] = .{1542 result[@backingInt(Feature.msaa_load_dst_sel_bug)] = .{
1319 .llvm_name = "msaa-load-dst-sel-bug",1543 .llvm_name = "msaa-load-dst-sel-bug",
1320 .description = "MSAA loads not honoring dst_sel bug",1544 .description = "MSAA loads not honoring dst_sel bug",
1321 .dependencies = featureSet(&[_]Feature{}),1545 .dependencies = featureSet(&[_]Feature{}),
1322 };1546 };
1547 result[@backingInt(Feature.msad_insts)] = .{
1548 .llvm_name = "msad-insts",
1549 .description = "Has v_msad_u8 instruction",
1550 .dependencies = featureSet(&[_]Feature{}),
1551 };
1552 result[@backingInt(Feature.mtbuf_insts)] = .{
1553 .llvm_name = "mtbuf-insts",
1554 .description = "Has memory typed buffer instructions.",
1555 .dependencies = featureSet(&[_]Feature{}),
1556 };
1323 result[@backingInt(Feature.negative_scratch_offset_bug)] = .{1557 result[@backingInt(Feature.negative_scratch_offset_bug)] = .{
1324 .llvm_name = "negative-scratch-offset-bug",1558 .llvm_name = "negative-scratch-offset-bug",
1325 .description = "Negative immediate offsets in scratch instructions with an SGPR offset page fault on GFX9",1559 .description = "Negative immediate offsets in scratch instructions with an SGPR offset page fault on GFX9",
...@@ -1327,7 +1561,7 @@ pub const all_features = blk: {...@@ -1327,7 +1561,7 @@ pub const all_features = blk: {
1327 };1561 };
1328 result[@backingInt(Feature.negative_unaligned_scratch_offset_bug)] = .{1562 result[@backingInt(Feature.negative_unaligned_scratch_offset_bug)] = .{
1329 .llvm_name = "negative-unaligned-scratch-offset-bug",1563 .llvm_name = "negative-unaligned-scratch-offset-bug",
1330 .description = "Scratch instructions with a VGPR offset and a negative immediate offset that is not a multiple of 4 read wrong memory on GFX10",1564 .description = "Scratch instructions with a VGPR offset and a negative immediate offset thatis not a multiple of 4 read wrong memory on GFX10",
1331 .dependencies = featureSet(&[_]Feature{}),1565 .dependencies = featureSet(&[_]Feature{}),
1332 };1566 };
1333 result[@backingInt(Feature.no_data_dep_hazard)] = .{1567 result[@backingInt(Feature.no_data_dep_hazard)] = .{
...@@ -1335,6 +1569,11 @@ pub const all_features = blk: {...@@ -1335,6 +1569,11 @@ pub const all_features = blk: {
1335 .description = "Does not need SW waitstates",1569 .description = "Does not need SW waitstates",
1336 .dependencies = featureSet(&[_]Feature{}),1570 .dependencies = featureSet(&[_]Feature{}),
1337 };1571 };
1572 result[@backingInt(Feature.no_f16_pseudo_scalar_trans_inline_constants)] = .{
1573 .llvm_name = "no-f16-pseudo-scalar-trans-inline-constants",
1574 .description = "Inline constants are not supported for F16 pseudo scalar transcendentals",
1575 .dependencies = featureSet(&[_]Feature{}),
1576 };
1338 result[@backingInt(Feature.no_sdst_cmpx)] = .{1577 result[@backingInt(Feature.no_sdst_cmpx)] = .{
1339 .llvm_name = "no-sdst-cmpx",1578 .llvm_name = "no-sdst-cmpx",
1340 .description = "V_CMPX does not write VCC/SGPR in addition to EXEC",1579 .description = "V_CMPX does not write VCC/SGPR in addition to EXEC",
...@@ -1365,16 +1604,31 @@ pub const all_features = blk: {...@@ -1365,16 +1604,31 @@ pub const all_features = blk: {
1365 .description = "Support packed fp32 instructions",1604 .description = "Support packed fp32 instructions",
1366 .dependencies = featureSet(&[_]Feature{}),1605 .dependencies = featureSet(&[_]Feature{}),
1367 };1606 };
1607 result[@backingInt(Feature.packed_fp64_ops)] = .{
1608 .llvm_name = "packed-fp64-ops",
1609 .description = "Support packed fp64 instructions",
1610 .dependencies = featureSet(&[_]Feature{}),
1611 };
1368 result[@backingInt(Feature.packed_tid)] = .{1612 result[@backingInt(Feature.packed_tid)] = .{
1369 .llvm_name = "packed-tid",1613 .llvm_name = "packed-tid",
1370 .description = "Workitem IDs are packed into v0 at kernel launch",1614 .description = "Workitem IDs are packed into v0 at kernel launch",
1371 .dependencies = featureSet(&[_]Feature{}),1615 .dependencies = featureSet(&[_]Feature{}),
1372 };1616 };
1617 result[@backingInt(Feature.packed_u64_ops)] = .{
1618 .llvm_name = "packed-u64-ops",
1619 .description = "Support packed uint64 instructions",
1620 .dependencies = featureSet(&[_]Feature{}),
1621 };
1373 result[@backingInt(Feature.partial_nsa_encoding)] = .{1622 result[@backingInt(Feature.partial_nsa_encoding)] = .{
1374 .llvm_name = "partial-nsa-encoding",1623 .llvm_name = "partial-nsa-encoding",
1375 .description = "Support partial NSA encoding for image instructions",1624 .description = "Support partial NSA encoding for image instructions",
1376 .dependencies = featureSet(&[_]Feature{}),1625 .dependencies = featureSet(&[_]Feature{}),
1377 };1626 };
1627 result[@backingInt(Feature.permlane16_insts)] = .{
1628 .llvm_name = "permlane16-insts",
1629 .description = "Has v_permlane16_b32/v_permlanex16_b32 instructions",
1630 .dependencies = featureSet(&[_]Feature{}),
1631 };
1378 result[@backingInt(Feature.permlane16_swap)] = .{1632 result[@backingInt(Feature.permlane16_swap)] = .{
1379 .llvm_name = "permlane16-swap",1633 .llvm_name = "permlane16-swap",
1380 .description = "Has v_permlane16_swap_b32 instructions",1634 .description = "Has v_permlane16_swap_b32 instructions",
...@@ -1415,11 +1669,6 @@ pub const all_features = blk: {...@@ -1415,11 +1669,6 @@ pub const all_features = blk: {
1415 .description = "Has v_prng_b32 instruction",1669 .description = "Has v_prng_b32 instruction",
1416 .dependencies = featureSet(&[_]Feature{}),1670 .dependencies = featureSet(&[_]Feature{}),
1417 };1671 };
1418 result[@backingInt(Feature.promote_alloca)] = .{
1419 .llvm_name = "promote-alloca",
1420 .description = "Enable promote alloca pass",
1421 .dependencies = featureSet(&[_]Feature{}),
1422 };
1423 result[@backingInt(Feature.prt_strict_null)] = .{1672 result[@backingInt(Feature.prt_strict_null)] = .{
1424 .llvm_name = "enable-prt-strict-null",1673 .llvm_name = "enable-prt-strict-null",
1425 .description = "Enable zeroing of result registers for sparse texture fetches",1674 .description = "Enable zeroing of result registers for sparse texture fetches",
...@@ -1445,11 +1694,6 @@ pub const all_features = blk: {...@@ -1445,11 +1694,6 @@ pub const all_features = blk: {
1445 .description = "Use true 16-bit registers",1694 .description = "Use true 16-bit registers",
1446 .dependencies = featureSet(&[_]Feature{}),1695 .dependencies = featureSet(&[_]Feature{}),
1447 };1696 };
1448 result[@backingInt(Feature.relaxed_buffer_oob_mode)] = .{
1449 .llvm_name = "relaxed-buffer-oob-mode",
1450 .description = "Disable strict out-of-bounds buffer guarantees. An OOB access may potentially cause an adjacent access to be treated as if it were also OOB",
1451 .dependencies = featureSet(&[_]Feature{}),
1452 };
1453 result[@backingInt(Feature.required_export_priority)] = .{1697 result[@backingInt(Feature.required_export_priority)] = .{
1454 .llvm_name = "required-export-priority",1698 .llvm_name = "required-export-priority",
1455 .description = "Export priority must be explicitly manipulated on GFX11.5",1699 .description = "Export priority must be explicitly manipulated on GFX11.5",
...@@ -1460,11 +1704,21 @@ pub const all_features = blk: {...@@ -1460,11 +1704,21 @@ pub const all_features = blk: {
1460 .description = "Target Requires Code Object V6",1704 .description = "Target Requires Code Object V6",
1461 .dependencies = featureSet(&[_]Feature{}),1705 .dependencies = featureSet(&[_]Feature{}),
1462 };1706 };
1707 result[@backingInt(Feature.requires_initial_unclause_vmem)] = .{
1708 .llvm_name = "requires-initial-unclause-vmem",
1709 .description = "Hardware entrypoints require first VMEM instruction to be unclaused",
1710 .dependencies = featureSet(&[_]Feature{}),
1711 };
1463 result[@backingInt(Feature.restricted_soffset)] = .{1712 result[@backingInt(Feature.restricted_soffset)] = .{
1464 .llvm_name = "restricted-soffset",1713 .llvm_name = "restricted-soffset",
1465 .description = "Has restricted SOffset (immediate not supported).",1714 .description = "Has restricted SOffset (immediate not supported).",
1466 .dependencies = featureSet(&[_]Feature{}),1715 .dependencies = featureSet(&[_]Feature{}),
1467 };1716 };
1717 result[@backingInt(Feature.s_barrier_leave_imm)] = .{
1718 .llvm_name = "s-barrier-leave-imm",
1719 .description = "s_barrier_leave takes an immediate operand",
1720 .dependencies = featureSet(&[_]Feature{}),
1721 };
1468 result[@backingInt(Feature.s_memrealtime)] = .{1722 result[@backingInt(Feature.s_memrealtime)] = .{
1469 .llvm_name = "s-memrealtime",1723 .llvm_name = "s-memrealtime",
1470 .description = "Has s_memrealtime instruction",1724 .description = "Has s_memrealtime instruction",
...@@ -1480,6 +1734,11 @@ pub const all_features = blk: {...@@ -1480,6 +1734,11 @@ pub const all_features = blk: {
1480 .description = "Has s_wakeup_barrier instruction.",1734 .description = "Has s_wakeup_barrier instruction.",
1481 .dependencies = featureSet(&[_]Feature{}),1735 .dependencies = featureSet(&[_]Feature{}),
1482 };1736 };
1737 result[@backingInt(Feature.s_wakeup_imm)] = .{
1738 .llvm_name = "s-wakeup-imm",
1739 .description = "s_wakeup takes an immediate operand",
1740 .dependencies = featureSet(&[_]Feature{}),
1741 };
1483 result[@backingInt(Feature.sad_insts)] = .{1742 result[@backingInt(Feature.sad_insts)] = .{
1484 .llvm_name = "sad-insts",1743 .llvm_name = "sad-insts",
1485 .description = "Has v_sad* instructions",1744 .description = "Has v_sad* instructions",
...@@ -1500,6 +1759,11 @@ pub const all_features = blk: {...@@ -1500,6 +1759,11 @@ pub const all_features = blk: {
1500 .description = "Has SALU floating point instructions",1759 .description = "Has SALU floating point instructions",
1501 .dependencies = featureSet(&[_]Feature{}),1760 .dependencies = featureSet(&[_]Feature{}),
1502 };1761 };
1762 result[@backingInt(Feature.salu_minimum_maximum_insts)] = .{
1763 .llvm_name = "salu-minimum-maximum-insts",
1764 .description = "Has s_minimum/maximum_f16/f32 instructions",
1765 .dependencies = featureSet(&[_]Feature{}),
1766 };
1503 result[@backingInt(Feature.scalar_atomics)] = .{1767 result[@backingInt(Feature.scalar_atomics)] = .{
1504 .llvm_name = "scalar-atomics",1768 .llvm_name = "scalar-atomics",
1505 .description = "Has atomic scalar memory instructions",1769 .description = "Has atomic scalar memory instructions",
...@@ -1564,16 +1828,23 @@ pub const all_features = blk: {...@@ -1564,16 +1828,23 @@ pub const all_features = blk: {
1564 .cvt_pknorm_vop2_insts,1828 .cvt_pknorm_vop2_insts,
1565 .default_component_zero,1829 .default_component_zero,
1566 .ds_src2_insts,1830 .ds_src2_insts,
1831 .dx10_clamp_and_ieee_mode,
1567 .extended_image_insts,1832 .extended_image_insts,
1833 .formatted_mubuf_insts,
1568 .fp64,1834 .fp64,
1569 .gds,1835 .gds,
1570 .gfx7_gfx8_gfx9_insts,1836 .gfx7_gfx8_gfx9_insts,
1571 .gws,1837 .gws,
1572 .image_insts,1838 .image_insts,
1839 .instcachelinesize64,
1573 .lerp_inst,1840 .lerp_inst,
1574 .mad_mac_f32_insts,1841 .mad_mac_f32_insts,
1575 .mimg_r128,1842 .mimg_r128,
1576 .movrel,1843 .movrel,
1844 .mqsad_insts,
1845 .mqsad_pk_insts,
1846 .msad_insts,
1847 .mtbuf_insts,
1577 .qsad_insts,1848 .qsad_insts,
1578 .s_memtime_inst,1849 .s_memtime_inst,
1579 .sad_insts,1850 .sad_insts,
...@@ -1613,6 +1884,11 @@ pub const all_features = blk: {...@@ -1613,6 +1884,11 @@ pub const all_features = blk: {
1613 .description = "Enable SI Machine Scheduler",1884 .description = "Enable SI Machine Scheduler",
1614 .dependencies = featureSet(&[_]Feature{}),1885 .dependencies = featureSet(&[_]Feature{}),
1615 };1886 };
1887 result[@backingInt(Feature.smem_prefetch_insts)] = .{
1888 .llvm_name = "smem-prefetch-insts",
1889 .description = "Has s_prefetch_inst, s_prefetch_inst_pc_rel, s_prefetch_data and s_prefetch_data_pc_rel instructions",
1890 .dependencies = featureSet(&[_]Feature{}),
1891 };
1616 result[@backingInt(Feature.smem_to_vector_write_hazard)] = .{1892 result[@backingInt(Feature.smem_to_vector_write_hazard)] = .{
1617 .llvm_name = "smem-to-vector-write-hazard",1893 .llvm_name = "smem-to-vector-write-hazard",
1618 .description = "s_load_dword followed by v_cmp page faults",1894 .description = "s_load_dword followed by v_cmp page faults",
...@@ -1629,16 +1905,22 @@ pub const all_features = blk: {...@@ -1629,16 +1905,22 @@ pub const all_features = blk: {
1629 .cvt_pknorm_vop2_insts,1905 .cvt_pknorm_vop2_insts,
1630 .default_component_zero,1906 .default_component_zero,
1631 .ds_src2_insts,1907 .ds_src2_insts,
1908 .dx10_clamp_and_ieee_mode,
1632 .extended_image_insts,1909 .extended_image_insts,
1910 .formatted_mubuf_insts,
1633 .fp64,1911 .fp64,
1634 .gds,1912 .gds,
1635 .gws,1913 .gws,
1636 .image_insts,1914 .image_insts,
1915 .instcachelinesize64,
1637 .ldsbankcount32,1916 .ldsbankcount32,
1638 .lerp_inst,1917 .lerp_inst,
1639 .mad_mac_f32_insts,1918 .mad_mac_f32_insts,
1640 .mimg_r128,1919 .mimg_r128,
1641 .movrel,1920 .movrel,
1921 .mqsad_pk_insts,
1922 .msad_insts,
1923 .mtbuf_insts,
1642 .s_memtime_inst,1924 .s_memtime_inst,
1643 .sad_insts,1925 .sad_insts,
1644 .trig_reduced_range,1926 .trig_reduced_range,
...@@ -1656,6 +1938,16 @@ pub const all_features = blk: {...@@ -1656,6 +1938,16 @@ pub const all_features = blk: {
1656 .description = "Hardware supports SRAMECC",1938 .description = "Hardware supports SRAMECC",
1657 .dependencies = featureSet(&[_]Feature{}),1939 .dependencies = featureSet(&[_]Feature{}),
1658 };1940 };
1941 result[@backingInt(Feature.swmmac_gfx1200_insts)] = .{
1942 .llvm_name = "swmmac-gfx1200-insts",
1943 .description = "Has GFX1200 SWMMAC instructions",
1944 .dependencies = featureSet(&[_]Feature{}),
1945 };
1946 result[@backingInt(Feature.swmmac_gfx1250_insts)] = .{
1947 .llvm_name = "swmmac-gfx1250-insts",
1948 .description = "Has GFX1250 SWMMAC instructions",
1949 .dependencies = featureSet(&[_]Feature{}),
1950 };
1659 result[@backingInt(Feature.tanh_insts)] = .{1951 result[@backingInt(Feature.tanh_insts)] = .{
1660 .llvm_name = "tanh-insts",1952 .llvm_name = "tanh-insts",
1661 .description = "Has v_tanh_f32/f16 instructions",1953 .description = "Has v_tanh_f32/f16 instructions",
...@@ -1666,9 +1958,14 @@ pub const all_features = blk: {...@@ -1666,9 +1958,14 @@ pub const all_features = blk: {
1666 .description = "Has v_perm_pk16* instructions",1958 .description = "Has v_perm_pk16* instructions",
1667 .dependencies = featureSet(&[_]Feature{}),1959 .dependencies = featureSet(&[_]Feature{}),
1668 };1960 };
1669 result[@backingInt(Feature.tgsplit)] = .{1961 result[@backingInt(Feature.tgsplit_support)] = .{
1670 .llvm_name = "tgsplit",1962 .llvm_name = "tgsplit-support",
1671 .description = "Enable threadgroup split execution",1963 .description = "Hardware support for threadgroup split execution mode",
1964 .dependencies = featureSet(&[_]Feature{}),
1965 };
1966 result[@backingInt(Feature.trans_coexecution_hazard)] = .{
1967 .llvm_name = "trans-coexecution-hazard",
1968 .description = "Hazard when TRANS co-executes with other VALU instruction",
1672 .dependencies = featureSet(&[_]Feature{}),1969 .dependencies = featureSet(&[_]Feature{}),
1673 };1970 };
1674 result[@backingInt(Feature.transpose_load_f4f6_insts)] = .{1971 result[@backingInt(Feature.transpose_load_f4f6_insts)] = .{
...@@ -1721,11 +2018,26 @@ pub const all_features = blk: {...@@ -1721,11 +2018,26 @@ pub const all_features = blk: {
1721 .description = "Force using DS instruction immediate offsets on SI",2018 .description = "Force using DS instruction immediate offsets on SI",
1722 .dependencies = featureSet(&[_]Feature{}),2019 .dependencies = featureSet(&[_]Feature{}),
1723 };2020 };
2021 result[@backingInt(Feature.use_add_pc64_inst)] = .{
2022 .llvm_name = "use-add-pc64-inst",
2023 .description = "Use s_add_pc_i64 instruction.",
2024 .dependencies = featureSet(&[_]Feature{}),
2025 };
1724 result[@backingInt(Feature.user_sgpr_init16_bug)] = .{2026 result[@backingInt(Feature.user_sgpr_init16_bug)] = .{
1725 .llvm_name = "user-sgpr-init16-bug",2027 .llvm_name = "user-sgpr-init16-bug",
1726 .description = "Bug requiring at least 16 user+system SGPRs to be enabled",2028 .description = "Bug requiring at least 16 user+system SGPRs to be enabled",
1727 .dependencies = featureSet(&[_]Feature{}),2029 .dependencies = featureSet(&[_]Feature{}),
1728 };2030 };
2031 result[@backingInt(Feature.v_mov_b64_inst)] = .{
2032 .llvm_name = "v-mov-b64-inst",
2033 .description = "Has v_mov_b64 instruction",
2034 .dependencies = featureSet(&[_]Feature{}),
2035 };
2036 result[@backingInt(Feature.v_mul_u64_inst)] = .{
2037 .llvm_name = "v-mul-u64-inst",
2038 .description = "Has v_mul_u64 instruction.",
2039 .dependencies = featureSet(&[_]Feature{}),
2040 };
1729 result[@backingInt(Feature.valu_trans_use_hazard)] = .{2041 result[@backingInt(Feature.valu_trans_use_hazard)] = .{
1730 .llvm_name = "valu-trans-use-hazard",2042 .llvm_name = "valu-trans-use-hazard",
1731 .description = "Hazard when TRANS instructions are closely followed by a use of the result",2043 .description = "Hazard when TRANS instructions are closely followed by a use of the result",
...@@ -1758,7 +2070,7 @@ pub const all_features = blk: {...@@ -1758,7 +2070,7 @@ pub const all_features = blk: {
1758 };2070 };
1759 result[@backingInt(Feature.vmem_to_lds_load_insts)] = .{2071 result[@backingInt(Feature.vmem_to_lds_load_insts)] = .{
1760 .llvm_name = "vmem-to-lds-load-insts",2072 .llvm_name = "vmem-to-lds-load-insts",
1761 .description = "The platform has memory to lds instructions (global_load w/lds bit set, buffer_load w/lds bit set or global_load_lds. This does not include scratch_load_lds.",2073 .description = "The platform has memory to lds instructions (global_load w/lds bit set, buffer_loadw/lds bit set or global_load_lds. This does not include scratch_load_lds.",
1762 .dependencies = featureSet(&[_]Feature{}),2074 .dependencies = featureSet(&[_]Feature{}),
1763 };2075 };
1764 result[@backingInt(Feature.vmem_to_scalar_write_hazard)] = .{2076 result[@backingInt(Feature.vmem_to_scalar_write_hazard)] = .{
...@@ -1782,10 +2094,14 @@ pub const all_features = blk: {...@@ -1782,10 +2094,14 @@ pub const all_features = blk: {
1782 .cvt_pknorm_vop2_insts,2094 .cvt_pknorm_vop2_insts,
1783 .default_component_zero,2095 .default_component_zero,
1784 .dpp,2096 .dpp,
2097 .dpp_row_bcast,
2098 .dpp_wavefront_shifts,
1785 .ds_src2_insts,2099 .ds_src2_insts,
2100 .dx10_clamp_and_ieee_mode,
1786 .extended_image_insts,2101 .extended_image_insts,
1787 .fast_denormal_f32,2102 .fast_denormal_f32,
1788 .flat_address_space,2103 .flat_address_space,
2104 .formatted_mubuf_insts,
1789 .fp64,2105 .fp64,
1790 .gcn3_encoding,2106 .gcn3_encoding,
1791 .gds,2107 .gds,
...@@ -1793,12 +2109,17 @@ pub const all_features = blk: {...@@ -1793,12 +2109,17 @@ pub const all_features = blk: {
1793 .gfx8_insts,2109 .gfx8_insts,
1794 .gws,2110 .gws,
1795 .image_insts,2111 .image_insts,
2112 .instcachelinesize64,
1796 .int_clamp_insts,2113 .int_clamp_insts,
1797 .inv_2pi_inline_imm,2114 .inv_2pi_inline_imm,
1798 .lerp_inst,2115 .lerp_inst,
1799 .mad_mac_f32_insts,2116 .mad_mac_f32_insts,
1800 .mimg_r128,2117 .mimg_r128,
1801 .movrel,2118 .movrel,
2119 .mqsad_insts,
2120 .mqsad_pk_insts,
2121 .msad_insts,
2122 .mtbuf_insts,
1802 .qsad_insts,2123 .qsad_insts,
1803 .s_memrealtime,2124 .s_memrealtime,
1804 .s_memtime_inst,2125 .s_memtime_inst,
...@@ -1824,6 +2145,11 @@ pub const all_features = blk: {...@@ -1824,6 +2145,11 @@ pub const all_features = blk: {
1824 .description = "Has VOP3P packed instructions",2145 .description = "Has VOP3P packed instructions",
1825 .dependencies = featureSet(&[_]Feature{}),2146 .dependencies = featureSet(&[_]Feature{}),
1826 };2147 };
2148 result[@backingInt(Feature.vop3px2_increments_va_vdst_twice)] = .{
2149 .llvm_name = "vop3px2-increments-va-vdst-twice",
2150 .description = "VOP3PX2 encoded instructions increment the VaVdst counter twice",
2151 .dependencies = featureSet(&[_]Feature{}),
2152 };
1827 result[@backingInt(Feature.vopd)] = .{2153 result[@backingInt(Feature.vopd)] = .{
1828 .llvm_name = "vopd",2154 .llvm_name = "vopd",
1829 .description = "Has VOPD dual issue wave32 instructions",2155 .description = "Has VOPD dual issue wave32 instructions",
...@@ -1859,6 +2185,21 @@ pub const all_features = blk: {...@@ -1859,6 +2185,21 @@ pub const all_features = blk: {
1859 .description = "The number of threads per wavefront",2185 .description = "The number of threads per wavefront",
1860 .dependencies = featureSet(&[_]Feature{}),2186 .dependencies = featureSet(&[_]Feature{}),
1861 };2187 };
2188 result[@backingInt(Feature.wmma_128b_insts)] = .{
2189 .llvm_name = "wmma-128b-insts",
2190 .description = "Has WMMA instructions where A and B matrices do not have duplicated data",
2191 .dependencies = featureSet(&[_]Feature{}),
2192 };
2193 result[@backingInt(Feature.wmma_256b_insts)] = .{
2194 .llvm_name = "wmma-256b-insts",
2195 .description = "Has WMMA instructions where A and B matrices have duplicated data",
2196 .dependencies = featureSet(&[_]Feature{}),
2197 };
2198 result[@backingInt(Feature.wmma_coexecution_hazards)] = .{
2199 .llvm_name = "wmma-coexecution-hazards",
2200 .description = "Hazards when WMMA co-executes with other WMMA/VALU instruction",
2201 .dependencies = featureSet(&[_]Feature{}),
2202 };
1862 result[@backingInt(Feature.xf32_insts)] = .{2203 result[@backingInt(Feature.xf32_insts)] = .{
1863 .llvm_name = "xf32-insts",2204 .llvm_name = "xf32-insts",
1864 .description = "Has instructions that support xf32 format, such as v_mfma_f32_16x16x8_xf32 and v_mfma_f32_32x32x4_xf32",2205 .description = "Has instructions that support xf32 format, such as v_mfma_f32_16x16x8_xf32 and v_mfma_f32_32x32x4_xf32",
...@@ -1867,7 +2208,16 @@ pub const all_features = blk: {...@@ -1867,7 +2208,16 @@ pub const all_features = blk: {
1867 result[@backingInt(Feature.xnack)] = .{2208 result[@backingInt(Feature.xnack)] = .{
1868 .llvm_name = "xnack",2209 .llvm_name = "xnack",
1869 .description = "Enable XNACK support",2210 .description = "Enable XNACK support",
1870 .dependencies = featureSet(&[_]Feature{}),2211 .dependencies = featureSet(&[_]Feature{
2212 .xnack_support,
2213 }),
2214 };
2215 result[@backingInt(Feature.xnack_on_off_modes)] = .{
2216 .llvm_name = "xnack-on-off-modes",
2217 .description = "Target supports XNACK on/off modes",
2218 .dependencies = featureSet(&[_]Feature{
2219 .xnack_support,
2220 }),
1871 };2221 };
1872 result[@backingInt(Feature.xnack_support)] = .{2222 result[@backingInt(Feature.xnack_support)] = .{
1873 .llvm_name = "xnack-support",2223 .llvm_name = "xnack-support",
...@@ -1900,7 +2250,7 @@ pub const cpu = struct {...@@ -1900,7 +2250,7 @@ pub const cpu = struct {
1900 .ldsbankcount32,2250 .ldsbankcount32,
1901 .unpacked_d16_vmem,2251 .unpacked_d16_vmem,
1902 .volcanic_islands,2252 .volcanic_islands,
1903 .xnack_support,2253 .xnack_on_off_modes,
1904 }),2254 }),
1905 };2255 };
1906 pub const fiji: CpuModel = .{2256 pub const fiji: CpuModel = .{
...@@ -1951,7 +2301,7 @@ pub const cpu = struct {...@@ -1951,7 +2301,7 @@ pub const cpu = struct {
1951 .vcmpx_exec_war_hazard,2301 .vcmpx_exec_war_hazard,
1952 .vcmpx_permlane_hazard,2302 .vcmpx_permlane_hazard,
1953 .vmem_to_scalar_write_hazard,2303 .vmem_to_scalar_write_hazard,
1954 .xnack_support,2304 .xnack_on_off_modes,
1955 }),2305 }),
1956 };2306 };
1957 pub const gfx1011: CpuModel = .{2307 pub const gfx1011: CpuModel = .{
...@@ -1987,7 +2337,7 @@ pub const cpu = struct {...@@ -1987,7 +2337,7 @@ pub const cpu = struct {
1987 .vcmpx_exec_war_hazard,2337 .vcmpx_exec_war_hazard,
1988 .vcmpx_permlane_hazard,2338 .vcmpx_permlane_hazard,
1989 .vmem_to_scalar_write_hazard,2339 .vmem_to_scalar_write_hazard,
1990 .xnack_support,2340 .xnack_on_off_modes,
1991 }),2341 }),
1992 };2342 };
1993 pub const gfx1012: CpuModel = .{2343 pub const gfx1012: CpuModel = .{
...@@ -2023,7 +2373,7 @@ pub const cpu = struct {...@@ -2023,7 +2373,7 @@ pub const cpu = struct {
2023 .vcmpx_exec_war_hazard,2373 .vcmpx_exec_war_hazard,
2024 .vcmpx_permlane_hazard,2374 .vcmpx_permlane_hazard,
2025 .vmem_to_scalar_write_hazard,2375 .vmem_to_scalar_write_hazard,
2026 .xnack_support,2376 .xnack_on_off_modes,
2027 }),2377 }),
2028 };2378 };
2029 pub const gfx1013: CpuModel = .{2379 pub const gfx1013: CpuModel = .{
...@@ -2054,7 +2404,7 @@ pub const cpu = struct {...@@ -2054,7 +2404,7 @@ pub const cpu = struct {
2054 .vcmpx_exec_war_hazard,2404 .vcmpx_exec_war_hazard,
2055 .vcmpx_permlane_hazard,2405 .vcmpx_permlane_hazard,
2056 .vmem_to_scalar_write_hazard,2406 .vmem_to_scalar_write_hazard,
2057 .xnack_support,2407 .xnack_on_off_modes,
2058 }),2408 }),
2059 };2409 };
2060 pub const gfx1030: CpuModel = .{2410 pub const gfx1030: CpuModel = .{
...@@ -2232,7 +2582,7 @@ pub const cpu = struct {...@@ -2232,7 +2582,7 @@ pub const cpu = struct {
2232 .vcmpx_exec_war_hazard,2582 .vcmpx_exec_war_hazard,
2233 .vcmpx_permlane_hazard,2583 .vcmpx_permlane_hazard,
2234 .vmem_to_scalar_write_hazard,2584 .vmem_to_scalar_write_hazard,
2235 .xnack_support,2585 .xnack_on_off_modes,
2236 }),2586 }),
2237 };2587 };
2238 pub const gfx10_3_generic: CpuModel = .{2588 pub const gfx10_3_generic: CpuModel = .{
...@@ -2261,7 +2611,7 @@ pub const cpu = struct {...@@ -2261,7 +2611,7 @@ pub const cpu = struct {
2261 .name = "gfx1100",2611 .name = "gfx1100",
2262 .llvm_name = "gfx1100",2612 .llvm_name = "gfx1100",
2263 .features = featureSet(&[_]Feature{2613 .features = featureSet(&[_]Feature{
2264 .allocate1_5xvgprs,2614 .@"1536_physical_vgprs",
2265 .architected_flat_scratch,2615 .architected_flat_scratch,
2266 .atomic_fadd_no_rtn_insts,2616 .atomic_fadd_no_rtn_insts,
2267 .atomic_fadd_rtn_insts,2617 .atomic_fadd_rtn_insts,
...@@ -2274,6 +2624,7 @@ pub const cpu = struct {...@@ -2274,6 +2624,7 @@ pub const cpu = struct {
2274 .dot7_insts,2624 .dot7_insts,
2275 .dot8_insts,2625 .dot8_insts,
2276 .dot9_insts,2626 .dot9_insts,
2627 .dx10_clamp_and_ieee_mode,
2277 .flat_atomic_fadd_f32_inst,2628 .flat_atomic_fadd_f32_inst,
2278 .gfx11,2629 .gfx11,
2279 .image_insts,2630 .image_insts,
...@@ -2290,13 +2641,14 @@ pub const cpu = struct {...@@ -2290,13 +2641,14 @@ pub const cpu = struct {
2290 .user_sgpr_init16_bug,2641 .user_sgpr_init16_bug,
2291 .valu_trans_use_hazard,2642 .valu_trans_use_hazard,
2292 .vcmpx_permlane_hazard,2643 .vcmpx_permlane_hazard,
2644 .wmma_256b_insts,
2293 }),2645 }),
2294 };2646 };
2295 pub const gfx1101: CpuModel = .{2647 pub const gfx1101: CpuModel = .{
2296 .name = "gfx1101",2648 .name = "gfx1101",
2297 .llvm_name = "gfx1101",2649 .llvm_name = "gfx1101",
2298 .features = featureSet(&[_]Feature{2650 .features = featureSet(&[_]Feature{
2299 .allocate1_5xvgprs,2651 .@"1536_physical_vgprs",
2300 .architected_flat_scratch,2652 .architected_flat_scratch,
2301 .atomic_fadd_no_rtn_insts,2653 .atomic_fadd_no_rtn_insts,
2302 .atomic_fadd_rtn_insts,2654 .atomic_fadd_rtn_insts,
...@@ -2309,6 +2661,7 @@ pub const cpu = struct {...@@ -2309,6 +2661,7 @@ pub const cpu = struct {
2309 .dot7_insts,2661 .dot7_insts,
2310 .dot8_insts,2662 .dot8_insts,
2311 .dot9_insts,2663 .dot9_insts,
2664 .dx10_clamp_and_ieee_mode,
2312 .flat_atomic_fadd_f32_inst,2665 .flat_atomic_fadd_f32_inst,
2313 .gfx11,2666 .gfx11,
2314 .image_insts,2667 .image_insts,
...@@ -2324,6 +2677,7 @@ pub const cpu = struct {...@@ -2324,6 +2677,7 @@ pub const cpu = struct {
2324 .shader_cycles_register,2677 .shader_cycles_register,
2325 .valu_trans_use_hazard,2678 .valu_trans_use_hazard,
2326 .vcmpx_permlane_hazard,2679 .vcmpx_permlane_hazard,
2680 .wmma_256b_insts,
2327 }),2681 }),
2328 };2682 };
2329 pub const gfx1102: CpuModel = .{2683 pub const gfx1102: CpuModel = .{
...@@ -2342,6 +2696,7 @@ pub const cpu = struct {...@@ -2342,6 +2696,7 @@ pub const cpu = struct {
2342 .dot7_insts,2696 .dot7_insts,
2343 .dot8_insts,2697 .dot8_insts,
2344 .dot9_insts,2698 .dot9_insts,
2699 .dx10_clamp_and_ieee_mode,
2345 .flat_atomic_fadd_f32_inst,2700 .flat_atomic_fadd_f32_inst,
2346 .gfx11,2701 .gfx11,
2347 .image_insts,2702 .image_insts,
...@@ -2358,6 +2713,7 @@ pub const cpu = struct {...@@ -2358,6 +2713,7 @@ pub const cpu = struct {
2358 .user_sgpr_init16_bug,2713 .user_sgpr_init16_bug,
2359 .valu_trans_use_hazard,2714 .valu_trans_use_hazard,
2360 .vcmpx_permlane_hazard,2715 .vcmpx_permlane_hazard,
2716 .wmma_256b_insts,
2361 }),2717 }),
2362 };2718 };
2363 pub const gfx1103: CpuModel = .{2719 pub const gfx1103: CpuModel = .{
...@@ -2376,6 +2732,7 @@ pub const cpu = struct {...@@ -2376,6 +2732,7 @@ pub const cpu = struct {
2376 .dot7_insts,2732 .dot7_insts,
2377 .dot8_insts,2733 .dot8_insts,
2378 .dot9_insts,2734 .dot9_insts,
2735 .dx10_clamp_and_ieee_mode,
2379 .flat_atomic_fadd_f32_inst,2736 .flat_atomic_fadd_f32_inst,
2380 .gfx11,2737 .gfx11,
2381 .image_insts,2738 .image_insts,
...@@ -2391,6 +2748,7 @@ pub const cpu = struct {...@@ -2391,6 +2748,7 @@ pub const cpu = struct {
2391 .shader_cycles_register,2748 .shader_cycles_register,
2392 .valu_trans_use_hazard,2749 .valu_trans_use_hazard,
2393 .vcmpx_permlane_hazard,2750 .vcmpx_permlane_hazard,
2751 .wmma_256b_insts,
2394 }),2752 }),
2395 };2753 };
2396 pub const gfx1150: CpuModel = .{2754 pub const gfx1150: CpuModel = .{
...@@ -2410,6 +2768,7 @@ pub const cpu = struct {...@@ -2410,6 +2768,7 @@ pub const cpu = struct {
2410 .dot8_insts,2768 .dot8_insts,
2411 .dot9_insts,2769 .dot9_insts,
2412 .dpp_src1_sgpr,2770 .dpp_src1_sgpr,
2771 .dx10_clamp_and_ieee_mode,
2413 .flat_atomic_fadd_f32_inst,2772 .flat_atomic_fadd_f32_inst,
2414 .gfx11,2773 .gfx11,
2415 .image_insts,2774 .image_insts,
...@@ -2424,13 +2783,14 @@ pub const cpu = struct {...@@ -2424,13 +2783,14 @@ pub const cpu = struct {
2424 .salu_float,2783 .salu_float,
2425 .shader_cycles_register,2784 .shader_cycles_register,
2426 .vcmpx_permlane_hazard,2785 .vcmpx_permlane_hazard,
2786 .wmma_256b_insts,
2427 }),2787 }),
2428 };2788 };
2429 pub const gfx1151: CpuModel = .{2789 pub const gfx1151: CpuModel = .{
2430 .name = "gfx1151",2790 .name = "gfx1151",
2431 .llvm_name = "gfx1151",2791 .llvm_name = "gfx1151",
2432 .features = featureSet(&[_]Feature{2792 .features = featureSet(&[_]Feature{
2433 .allocate1_5xvgprs,2793 .@"1536_physical_vgprs",
2434 .architected_flat_scratch,2794 .architected_flat_scratch,
2435 .atomic_fadd_no_rtn_insts,2795 .atomic_fadd_no_rtn_insts,
2436 .atomic_fadd_rtn_insts,2796 .atomic_fadd_rtn_insts,
...@@ -2444,6 +2804,7 @@ pub const cpu = struct {...@@ -2444,6 +2804,7 @@ pub const cpu = struct {
2444 .dot8_insts,2804 .dot8_insts,
2445 .dot9_insts,2805 .dot9_insts,
2446 .dpp_src1_sgpr,2806 .dpp_src1_sgpr,
2807 .dx10_clamp_and_ieee_mode,
2447 .flat_atomic_fadd_f32_inst,2808 .flat_atomic_fadd_f32_inst,
2448 .gfx11,2809 .gfx11,
2449 .image_insts,2810 .image_insts,
...@@ -2458,6 +2819,7 @@ pub const cpu = struct {...@@ -2458,6 +2819,7 @@ pub const cpu = struct {
2458 .salu_float,2819 .salu_float,
2459 .shader_cycles_register,2820 .shader_cycles_register,
2460 .vcmpx_permlane_hazard,2821 .vcmpx_permlane_hazard,
2822 .wmma_256b_insts,
2461 }),2823 }),
2462 };2824 };
2463 pub const gfx1152: CpuModel = .{2825 pub const gfx1152: CpuModel = .{
...@@ -2477,6 +2839,7 @@ pub const cpu = struct {...@@ -2477,6 +2839,7 @@ pub const cpu = struct {
2477 .dot8_insts,2839 .dot8_insts,
2478 .dot9_insts,2840 .dot9_insts,
2479 .dpp_src1_sgpr,2841 .dpp_src1_sgpr,
2842 .dx10_clamp_and_ieee_mode,
2480 .flat_atomic_fadd_f32_inst,2843 .flat_atomic_fadd_f32_inst,
2481 .gfx11,2844 .gfx11,
2482 .image_insts,2845 .image_insts,
...@@ -2491,6 +2854,7 @@ pub const cpu = struct {...@@ -2491,6 +2854,7 @@ pub const cpu = struct {
2491 .salu_float,2854 .salu_float,
2492 .shader_cycles_register,2855 .shader_cycles_register,
2493 .vcmpx_permlane_hazard,2856 .vcmpx_permlane_hazard,
2857 .wmma_256b_insts,
2494 }),2858 }),
2495 };2859 };
2496 pub const gfx1153: CpuModel = .{2860 pub const gfx1153: CpuModel = .{
...@@ -2510,6 +2874,7 @@ pub const cpu = struct {...@@ -2510,6 +2874,7 @@ pub const cpu = struct {
2510 .dot8_insts,2874 .dot8_insts,
2511 .dot9_insts,2875 .dot9_insts,
2512 .dpp_src1_sgpr,2876 .dpp_src1_sgpr,
2877 .dx10_clamp_and_ieee_mode,
2513 .flat_atomic_fadd_f32_inst,2878 .flat_atomic_fadd_f32_inst,
2514 .gfx11,2879 .gfx11,
2515 .image_insts,2880 .image_insts,
...@@ -2523,11 +2888,12 @@ pub const cpu = struct {...@@ -2523,11 +2888,12 @@ pub const cpu = struct {
2523 .salu_float,2888 .salu_float,
2524 .shader_cycles_register,2889 .shader_cycles_register,
2525 .vcmpx_permlane_hazard,2890 .vcmpx_permlane_hazard,
2891 .wmma_256b_insts,
2526 }),2892 }),
2527 };2893 };
2528 pub const gfx11_generic: CpuModel = .{2894 pub const gfx1154: CpuModel = .{
2529 .name = "gfx11_generic",2895 .name = "gfx1154",
2530 .llvm_name = "gfx11-generic",2896 .llvm_name = "gfx1154",
2531 .features = featureSet(&[_]Feature{2897 .features = featureSet(&[_]Feature{
2532 .architected_flat_scratch,2898 .architected_flat_scratch,
2533 .atomic_fadd_no_rtn_insts,2899 .atomic_fadd_no_rtn_insts,
...@@ -2541,47 +2907,32 @@ pub const cpu = struct {...@@ -2541,47 +2907,32 @@ pub const cpu = struct {
2541 .dot7_insts,2907 .dot7_insts,
2542 .dot8_insts,2908 .dot8_insts,
2543 .dot9_insts,2909 .dot9_insts,
2910 .dpp_src1_sgpr,
2911 .dx10_clamp_and_ieee_mode,
2544 .flat_atomic_fadd_f32_inst,2912 .flat_atomic_fadd_f32_inst,
2545 .gfx11,2913 .gfx11,
2546 .image_insts,2914 .image_insts,
2547 .ldsbankcount32,2915 .ldsbankcount32,
2548 .mad_intra_fwd_bug,
2549 .memory_atomic_fadd_f32_denormal_support,2916 .memory_atomic_fadd_f32_denormal_support,
2550 .msaa_load_dst_sel_bug,
2551 .nsa_encoding,2917 .nsa_encoding,
2552 .packed_tid,2918 .packed_tid,
2553 .partial_nsa_encoding,2919 .partial_nsa_encoding,
2554 .priv_enabled_trap2_nop_bug,
2555 .real_true16,2920 .real_true16,
2556 .required_export_priority,2921 .required_export_priority,
2557 .requires_cov6,2922 .salu_float,
2558 .shader_cycles_register,2923 .shader_cycles_register,
2559 .user_sgpr_init16_bug,
2560 .valu_trans_use_hazard,
2561 .vcmpx_permlane_hazard,2924 .vcmpx_permlane_hazard,
2925 .wmma_256b_insts,
2562 }),2926 }),
2563 };2927 };
2564 pub const gfx1200: CpuModel = .{2928 pub const gfx1170: CpuModel = .{
2565 .name = "gfx1200",2929 .name = "gfx1170",
2566 .llvm_name = "gfx1200",2930 .llvm_name = "gfx1170",
2567 .features = featureSet(&[_]Feature{2931 .features = featureSet(&[_]Feature{
2568 .addressablelocalmemorysize65536,
2569 .allocate1_5xvgprs,
2570 .architected_flat_scratch,2932 .architected_flat_scratch,
2571 .architected_sgprs,
2572 .atomic_buffer_global_pk_add_f16_insts,
2573 .atomic_buffer_pk_add_bf16_inst,
2574 .atomic_ds_pk_add_16_insts,
2575 .atomic_fadd_no_rtn_insts,2933 .atomic_fadd_no_rtn_insts,
2576 .atomic_fadd_rtn_insts,2934 .atomic_fadd_rtn_insts,
2577 .atomic_flat_pk_add_16_insts,
2578 .atomic_global_pk_add_bf16_inst,
2579 .back_off_barrier,2935 .back_off_barrier,
2580 .bvh_dual_bvh_8_insts,
2581 .cube_insts,
2582 .cvt_norm_insts,
2583 .cvt_pknorm_vop2_insts,
2584 .cvt_pknorm_vop3_insts,
2585 .d16_write_vgpr32,2936 .d16_write_vgpr32,
2586 .dl_insts,2937 .dl_insts,
2587 .dot10_insts,2938 .dot10_insts,
...@@ -2591,49 +2942,36 @@ pub const cpu = struct {...@@ -2591,49 +2942,36 @@ pub const cpu = struct {
2591 .dot8_insts,2942 .dot8_insts,
2592 .dot9_insts,2943 .dot9_insts,
2593 .dpp_src1_sgpr,2944 .dpp_src1_sgpr,
2594 .extended_image_insts,
2595 .flat_atomic_fadd_f32_inst,2945 .flat_atomic_fadd_f32_inst,
2596 .fp8_conversion_insts,2946 .fp8_conversion_insts,
2597 .gfx12,2947 .gfx11,
2948 .gfx11_7_insts,
2949 .ieee_minimum_maximum_insts,
2598 .image_insts,2950 .image_insts,
2599 .ldsbankcount32,2951 .ldsbankcount32,
2600 .lerp_inst,
2601 .memory_atomic_fadd_f32_denormal_support,2952 .memory_atomic_fadd_f32_denormal_support,
2953 .minimum3_maximum3_f16,
2954 .minimum3_maximum3_f32,
2955 .no_f16_pseudo_scalar_trans_inline_constants,
2602 .nsa_encoding,2956 .nsa_encoding,
2603 .packed_tid,2957 .packed_tid,
2604 .partial_nsa_encoding,2958 .partial_nsa_encoding,
2605 .pseudo_scalar_trans,2959 .real_true16,
2606 .qsad_insts,
2607 .restricted_soffset,
2608 .sad_insts,
2609 .salu_float,2960 .salu_float,
2610 .scalar_dwordx3_loads,2961 .shader_cycles_register,
2611 .shader_cycles_hi_lo_registers,2962 .swmmac_gfx1200_insts,
2612 .vcmpx_permlane_hazard,2963 .vcmpx_permlane_hazard,
2613 .waits_before_system_scope_stores,2964 .wmma_128b_insts,
2614 }),2965 }),
2615 };2966 };
2616 pub const gfx1201: CpuModel = .{2967 pub const gfx1171: CpuModel = .{
2617 .name = "gfx1201",2968 .name = "gfx1171",
2618 .llvm_name = "gfx1201",2969 .llvm_name = "gfx1171",
2619 .features = featureSet(&[_]Feature{2970 .features = featureSet(&[_]Feature{
2620 .addressablelocalmemorysize65536,
2621 .allocate1_5xvgprs,
2622 .architected_flat_scratch,2971 .architected_flat_scratch,
2623 .architected_sgprs,
2624 .atomic_buffer_global_pk_add_f16_insts,
2625 .atomic_buffer_pk_add_bf16_inst,
2626 .atomic_ds_pk_add_16_insts,
2627 .atomic_fadd_no_rtn_insts,2972 .atomic_fadd_no_rtn_insts,
2628 .atomic_fadd_rtn_insts,2973 .atomic_fadd_rtn_insts,
2629 .atomic_flat_pk_add_16_insts,
2630 .atomic_global_pk_add_bf16_inst,
2631 .back_off_barrier,2974 .back_off_barrier,
2632 .bvh_dual_bvh_8_insts,
2633 .cube_insts,
2634 .cvt_norm_insts,
2635 .cvt_pknorm_vop2_insts,
2636 .cvt_pknorm_vop3_insts,
2637 .d16_write_vgpr32,2975 .d16_write_vgpr32,
2638 .dl_insts,2976 .dl_insts,
2639 .dot10_insts,2977 .dot10_insts,
...@@ -2643,61 +2981,304 @@ pub const cpu = struct {...@@ -2643,61 +2981,304 @@ pub const cpu = struct {
2643 .dot8_insts,2981 .dot8_insts,
2644 .dot9_insts,2982 .dot9_insts,
2645 .dpp_src1_sgpr,2983 .dpp_src1_sgpr,
2646 .extended_image_insts,
2647 .flat_atomic_fadd_f32_inst,2984 .flat_atomic_fadd_f32_inst,
2648 .fp8_conversion_insts,2985 .fp8_conversion_insts,
2649 .gfx12,2986 .gfx11,
2987 .gfx11_7_insts,
2988 .ieee_minimum_maximum_insts,
2650 .image_insts,2989 .image_insts,
2651 .ldsbankcount32,2990 .ldsbankcount32,
2652 .lerp_inst,
2653 .memory_atomic_fadd_f32_denormal_support,2991 .memory_atomic_fadd_f32_denormal_support,
2992 .minimum3_maximum3_f16,
2993 .minimum3_maximum3_f32,
2994 .no_f16_pseudo_scalar_trans_inline_constants,
2654 .nsa_encoding,2995 .nsa_encoding,
2655 .packed_tid,2996 .packed_tid,
2656 .partial_nsa_encoding,2997 .partial_nsa_encoding,
2657 .pseudo_scalar_trans,2998 .real_true16,
2658 .qsad_insts,
2659 .restricted_soffset,
2660 .sad_insts,
2661 .salu_float,2999 .salu_float,
2662 .scalar_dwordx3_loads,3000 .shader_cycles_register,
2663 .shader_cycles_hi_lo_registers,3001 .swmmac_gfx1200_insts,
2664 .vcmpx_permlane_hazard,3002 .vcmpx_permlane_hazard,
2665 .waits_before_system_scope_stores,3003 .wmma_128b_insts,
2666 }),3004 }),
2667 };3005 };
2668 pub const gfx1250: CpuModel = .{3006 pub const gfx1172: CpuModel = .{
2669 .name = "gfx1250",3007 .name = "gfx1172",
2670 .llvm_name = "gfx1250",3008 .llvm_name = "gfx1172",
2671 .features = featureSet(&[_]Feature{3009 .features = featureSet(&[_]Feature{
2672 .@"1024_addressable_vgprs",
2673 .@"45_bit_num_records_buffer_resource",
2674 .@"64_bit_literals",
2675 .add_min_max_insts,
2676 .add_sub_u64_insts,
2677 .addressablelocalmemorysize327680,
2678 .architected_flat_scratch,3010 .architected_flat_scratch,
2679 .architected_sgprs,
2680 .ashr_pk_insts,
2681 .atomic_buffer_global_pk_add_f16_insts,
2682 .atomic_buffer_pk_add_bf16_inst,
2683 .atomic_ds_pk_add_16_insts,
2684 .atomic_fadd_no_rtn_insts,3011 .atomic_fadd_no_rtn_insts,
2685 .atomic_fadd_rtn_insts,3012 .atomic_fadd_rtn_insts,
2686 .atomic_flat_pk_add_16_insts,3013 .back_off_barrier,
2687 .atomic_fmin_fmax_flat_f64,3014 .d16_write_vgpr32,
2688 .atomic_fmin_fmax_global_f64,3015 .dl_insts,
2689 .atomic_global_pk_add_bf16_inst,3016 .dot10_insts,
2690 .bf16_cvt_insts,3017 .dot11_insts,
2691 .bf16_pk_insts,3018 .dot12_insts,
2692 .bf16_trans_insts,3019 .dot7_insts,
2693 .bitop3_insts,3020 .dot8_insts,
2694 .clusters,3021 .dot9_insts,
2695 .cube_insts,3022 .dpp_src1_sgpr,
2696 .cumode,3023 .flat_atomic_fadd_f32_inst,
2697 .cvt_norm_insts,3024 .fp8_conversion_insts,
2698 .cvt_pk_f16_f32_inst,3025 .gfx11,
2699 .cvt_pknorm_vop2_insts,3026 .gfx11_7_insts,
2700 .cvt_pknorm_vop3_insts,3027 .ieee_minimum_maximum_insts,
3028 .image_insts,
3029 .ldsbankcount32,
3030 .memory_atomic_fadd_f32_denormal_support,
3031 .minimum3_maximum3_f16,
3032 .minimum3_maximum3_f32,
3033 .no_f16_pseudo_scalar_trans_inline_constants,
3034 .nsa_encoding,
3035 .packed_tid,
3036 .partial_nsa_encoding,
3037 .real_true16,
3038 .salu_float,
3039 .shader_cycles_register,
3040 .swmmac_gfx1200_insts,
3041 .vcmpx_permlane_hazard,
3042 .wmma_128b_insts,
3043 }),
3044 };
3045 pub const gfx11_7_generic: CpuModel = .{
3046 .name = "gfx11_7_generic",
3047 .llvm_name = "gfx11-7-generic",
3048 .features = featureSet(&[_]Feature{
3049 .architected_flat_scratch,
3050 .atomic_fadd_no_rtn_insts,
3051 .atomic_fadd_rtn_insts,
3052 .back_off_barrier,
3053 .d16_write_vgpr32,
3054 .dl_insts,
3055 .dot10_insts,
3056 .dot11_insts,
3057 .dot12_insts,
3058 .dot7_insts,
3059 .dot8_insts,
3060 .dot9_insts,
3061 .dpp_src1_sgpr,
3062 .flat_atomic_fadd_f32_inst,
3063 .fp8_conversion_insts,
3064 .gfx11,
3065 .gfx11_7_insts,
3066 .ieee_minimum_maximum_insts,
3067 .image_insts,
3068 .ldsbankcount32,
3069 .memory_atomic_fadd_f32_denormal_support,
3070 .minimum3_maximum3_f16,
3071 .minimum3_maximum3_f32,
3072 .no_f16_pseudo_scalar_trans_inline_constants,
3073 .nsa_encoding,
3074 .packed_tid,
3075 .partial_nsa_encoding,
3076 .real_true16,
3077 .requires_cov6,
3078 .salu_float,
3079 .shader_cycles_register,
3080 .swmmac_gfx1200_insts,
3081 .vcmpx_permlane_hazard,
3082 .wmma_128b_insts,
3083 }),
3084 };
3085 pub const gfx11_generic: CpuModel = .{
3086 .name = "gfx11_generic",
3087 .llvm_name = "gfx11-generic",
3088 .features = featureSet(&[_]Feature{
3089 .architected_flat_scratch,
3090 .atomic_fadd_no_rtn_insts,
3091 .atomic_fadd_rtn_insts,
3092 .back_off_barrier,
3093 .d16_write_vgpr32,
3094 .dl_insts,
3095 .dot10_insts,
3096 .dot12_insts,
3097 .dot5_insts,
3098 .dot7_insts,
3099 .dot8_insts,
3100 .dot9_insts,
3101 .dx10_clamp_and_ieee_mode,
3102 .flat_atomic_fadd_f32_inst,
3103 .gfx11,
3104 .image_insts,
3105 .ldsbankcount32,
3106 .mad_intra_fwd_bug,
3107 .memory_atomic_fadd_f32_denormal_support,
3108 .msaa_load_dst_sel_bug,
3109 .nsa_encoding,
3110 .packed_tid,
3111 .partial_nsa_encoding,
3112 .priv_enabled_trap2_nop_bug,
3113 .real_true16,
3114 .required_export_priority,
3115 .requires_cov6,
3116 .shader_cycles_register,
3117 .user_sgpr_init16_bug,
3118 .valu_trans_use_hazard,
3119 .vcmpx_permlane_hazard,
3120 .wmma_256b_insts,
3121 }),
3122 };
3123 pub const gfx1200: CpuModel = .{
3124 .name = "gfx1200",
3125 .llvm_name = "gfx1200",
3126 .features = featureSet(&[_]Feature{
3127 .@"1536_physical_vgprs",
3128 .addressablelocalmemorysize65536,
3129 .architected_flat_scratch,
3130 .architected_sgprs,
3131 .atomic_buffer_global_pk_add_f16_insts,
3132 .atomic_buffer_pk_add_bf16_inst,
3133 .atomic_ds_pk_add_16_insts,
3134 .atomic_fadd_no_rtn_insts,
3135 .atomic_fadd_rtn_insts,
3136 .atomic_flat_pk_add_16_insts,
3137 .atomic_global_pk_add_bf16_inst,
3138 .back_off_barrier,
3139 .bvh_dual_bvh_8_insts,
3140 .cube_insts,
3141 .cvt_norm_insts,
3142 .cvt_pknorm_vop2_insts,
3143 .cvt_pknorm_vop3_insts,
3144 .d16_write_vgpr32,
3145 .dl_insts,
3146 .dot10_insts,
3147 .dot11_insts,
3148 .dot12_insts,
3149 .dot7_insts,
3150 .dot8_insts,
3151 .dot9_insts,
3152 .dpp_src1_sgpr,
3153 .extended_image_insts,
3154 .flat_atomic_fadd_f32_inst,
3155 .formatted_mubuf_insts,
3156 .fp8_conversion_insts,
3157 .gfx12,
3158 .image_insts,
3159 .ldsbankcount32,
3160 .lerp_inst,
3161 .memory_atomic_fadd_f32_denormal_support,
3162 .mqsad_insts,
3163 .mqsad_pk_insts,
3164 .msad_insts,
3165 .mtbuf_insts,
3166 .no_f16_pseudo_scalar_trans_inline_constants,
3167 .nsa_encoding,
3168 .packed_tid,
3169 .partial_nsa_encoding,
3170 .pseudo_scalar_trans,
3171 .qsad_insts,
3172 .real_true16,
3173 .restricted_soffset,
3174 .sad_insts,
3175 .salu_float,
3176 .scalar_dwordx3_loads,
3177 .shader_cycles_hi_lo_registers,
3178 .smem_prefetch_insts,
3179 .swmmac_gfx1200_insts,
3180 .vcmpx_permlane_hazard,
3181 .waits_before_system_scope_stores,
3182 .wmma_128b_insts,
3183 }),
3184 };
3185 pub const gfx1201: CpuModel = .{
3186 .name = "gfx1201",
3187 .llvm_name = "gfx1201",
3188 .features = featureSet(&[_]Feature{
3189 .@"1536_physical_vgprs",
3190 .addressablelocalmemorysize65536,
3191 .architected_flat_scratch,
3192 .architected_sgprs,
3193 .atomic_buffer_global_pk_add_f16_insts,
3194 .atomic_buffer_pk_add_bf16_inst,
3195 .atomic_ds_pk_add_16_insts,
3196 .atomic_fadd_no_rtn_insts,
3197 .atomic_fadd_rtn_insts,
3198 .atomic_flat_pk_add_16_insts,
3199 .atomic_global_pk_add_bf16_inst,
3200 .back_off_barrier,
3201 .bvh_dual_bvh_8_insts,
3202 .cube_insts,
3203 .cvt_norm_insts,
3204 .cvt_pknorm_vop2_insts,
3205 .cvt_pknorm_vop3_insts,
3206 .d16_write_vgpr32,
3207 .dl_insts,
3208 .dot10_insts,
3209 .dot11_insts,
3210 .dot12_insts,
3211 .dot7_insts,
3212 .dot8_insts,
3213 .dot9_insts,
3214 .dpp_src1_sgpr,
3215 .extended_image_insts,
3216 .flat_atomic_fadd_f32_inst,
3217 .formatted_mubuf_insts,
3218 .fp8_conversion_insts,
3219 .gfx12,
3220 .image_insts,
3221 .ldsbankcount32,
3222 .lerp_inst,
3223 .memory_atomic_fadd_f32_denormal_support,
3224 .mqsad_insts,
3225 .mqsad_pk_insts,
3226 .msad_insts,
3227 .mtbuf_insts,
3228 .no_f16_pseudo_scalar_trans_inline_constants,
3229 .nsa_encoding,
3230 .packed_tid,
3231 .partial_nsa_encoding,
3232 .pseudo_scalar_trans,
3233 .qsad_insts,
3234 .real_true16,
3235 .restricted_soffset,
3236 .sad_insts,
3237 .salu_float,
3238 .scalar_dwordx3_loads,
3239 .shader_cycles_hi_lo_registers,
3240 .smem_prefetch_insts,
3241 .swmmac_gfx1200_insts,
3242 .vcmpx_permlane_hazard,
3243 .waits_before_system_scope_stores,
3244 .wmma_128b_insts,
3245 }),
3246 };
3247 pub const gfx1250: CpuModel = .{
3248 .name = "gfx1250",
3249 .llvm_name = "gfx1250",
3250 .features = featureSet(&[_]Feature{
3251 .@"1024_addressable_vgprs",
3252 .@"45_bit_num_records_buffer_resource",
3253 .@"64_bit_literals",
3254 .add_min_max_insts,
3255 .add_sub_u64_insts,
3256 .addressablelocalmemorysize327680,
3257 .architected_flat_scratch,
3258 .architected_sgprs,
3259 .ashr_pk_insts,
3260 .asynccnt,
3261 .atomic_buffer_global_pk_add_f16_insts,
3262 .atomic_buffer_pk_add_bf16_inst,
3263 .atomic_ds_pk_add_16_insts,
3264 .atomic_fadd_no_rtn_insts,
3265 .atomic_fadd_rtn_insts,
3266 .atomic_flat_pk_add_16_insts,
3267 .atomic_fmin_fmax_flat_f64,
3268 .atomic_fmin_fmax_global_f64,
3269 .atomic_global_pk_add_bf16_inst,
3270 .back_off_barrier,
3271 .bf16_cvt_insts,
3272 .bf16_pk_insts,
3273 .bf16_trans_insts,
3274 .bitop3_insts,
3275 .clusters,
3276 .cube_insts,
3277 .cumode,
3278 .cvt_norm_insts,
3279 .cvt_pk_f16_f32_inst,
3280 .cvt_pknorm_vop2_insts,
3281 .cvt_pknorm_vop3_insts,
2701 .d16_write_vgpr32,3282 .d16_write_vgpr32,
2702 .dl_insts,3283 .dl_insts,
2703 .dot7_insts,3284 .dot7_insts,
...@@ -2719,12 +3300,18 @@ pub const cpu = struct {...@@ -2719,12 +3300,18 @@ pub const cpu = struct {
2719 .ldsbankcount32,3300 .ldsbankcount32,
2720 .lerp_inst,3301 .lerp_inst,
2721 .lshl_add_u64_inst,3302 .lshl_add_u64_inst,
3303 .mad_nc_64_32_insts,
2722 .mad_u32_inst,3304 .mad_u32_inst,
2723 .max_hard_clause_length_63,3305 .max_hard_clause_length_63,
2724 .mcast_load_insts,3306 .mcast_load_insts,
2725 .memory_atomic_fadd_f32_denormal_support,3307 .memory_atomic_fadd_f32_denormal_support,
2726 .min3_max3_pkf16,3308 .min3_max3_pkf16,
3309 .min_max_i64_insts,
2727 .minimum3_maximum3_pkf16,3310 .minimum3_maximum3_pkf16,
3311 .mqsad_insts,
3312 .mqsad_pk_insts,
3313 .msad_insts,
3314 .no_f16_pseudo_scalar_trans_inline_constants,
2728 .packed_fp32_ops,3315 .packed_fp32_ops,
2729 .packed_tid,3316 .packed_tid,
2730 .permlane16_swap,3317 .permlane16_swap,
...@@ -2732,6 +3319,8 @@ pub const cpu = struct {...@@ -2732,6 +3319,8 @@ pub const cpu = struct {
2732 .prng_inst,3319 .prng_inst,
2733 .pseudo_scalar_trans,3320 .pseudo_scalar_trans,
2734 .qsad_insts,3321 .qsad_insts,
3322 .real_true16,
3323 .requires_initial_unclause_vmem,
2735 .restricted_soffset,3324 .restricted_soffset,
2736 .s_wakeup_barrier_inst,3325 .s_wakeup_barrier_inst,
2737 .sad_insts,3326 .sad_insts,
...@@ -2740,17 +3329,24 @@ pub const cpu = struct {...@@ -2740,17 +3329,24 @@ pub const cpu = struct {
2740 .setprio_inc_wg_inst,3329 .setprio_inc_wg_inst,
2741 .setreg_vgpr_msb_fixup,3330 .setreg_vgpr_msb_fixup,
2742 .shader_cycles_hi_lo_registers,3331 .shader_cycles_hi_lo_registers,
3332 .smem_prefetch_insts,
2743 .sramecc_support,3333 .sramecc_support,
3334 .swmmac_gfx1200_insts,
3335 .swmmac_gfx1250_insts,
2744 .tanh_insts,3336 .tanh_insts,
2745 .tensor_cvt_lut_insts,3337 .tensor_cvt_lut_insts,
3338 .trans_coexecution_hazard,
2746 .transpose_load_f4f6_insts,3339 .transpose_load_f4f6_insts,
3340 .v_mov_b64_inst,
3341 .v_mul_u64_inst,
2747 .vcmpx_permlane_hazard,3342 .vcmpx_permlane_hazard,
2748 .vgpr_align2,3343 .vgpr_align2,
2749 .vmem_pref_insts,3344 .vmem_pref_insts,
3345 .vop3px2_increments_va_vdst_twice,
2750 .wait_xcnt,3346 .wait_xcnt,
2751 .wavefrontsize32,3347 .wavefrontsize32,
3348 .wmma_coexecution_hazards,
2752 .xnack,3349 .xnack,
2753 .xnack_support,
2754 }),3350 }),
2755 };3351 };
2756 pub const gfx1251: CpuModel = .{3352 pub const gfx1251: CpuModel = .{
...@@ -2766,6 +3362,7 @@ pub const cpu = struct {...@@ -2766,6 +3362,7 @@ pub const cpu = struct {
2766 .architected_flat_scratch,3362 .architected_flat_scratch,
2767 .architected_sgprs,3363 .architected_sgprs,
2768 .ashr_pk_insts,3364 .ashr_pk_insts,
3365 .asynccnt,
2769 .atomic_buffer_global_pk_add_f16_insts,3366 .atomic_buffer_global_pk_add_f16_insts,
2770 .atomic_buffer_pk_add_bf16_inst,3367 .atomic_buffer_pk_add_bf16_inst,
2771 .atomic_ds_pk_add_16_insts,3368 .atomic_ds_pk_add_16_insts,
...@@ -2775,6 +3372,7 @@ pub const cpu = struct {...@@ -2775,6 +3372,7 @@ pub const cpu = struct {
2775 .atomic_fmin_fmax_flat_f64,3372 .atomic_fmin_fmax_flat_f64,
2776 .atomic_fmin_fmax_global_f64,3373 .atomic_fmin_fmax_global_f64,
2777 .atomic_global_pk_add_bf16_inst,3374 .atomic_global_pk_add_bf16_inst,
3375 .back_off_barrier,
2778 .bf16_cvt_insts,3376 .bf16_cvt_insts,
2779 .bf16_pk_insts,3377 .bf16_pk_insts,
2780 .bf16_trans_insts,3378 .bf16_trans_insts,
...@@ -2800,27 +3398,40 @@ pub const cpu = struct {...@@ -2800,27 +3398,40 @@ pub const cpu = struct {
2800 .fmacf64_inst,3398 .fmacf64_inst,
2801 .fp8_conversion_insts,3399 .fp8_conversion_insts,
2802 .fp8e5m3_insts,3400 .fp8e5m3_insts,
3401 .full_rate_64_ops,
2803 .gfx12,3402 .gfx12,
2804 .gfx1250_insts,3403 .gfx1250_insts,
3404 .gfx1251_gemm_insts,
3405 .gfx125x_lowest_rate_wmma,
2805 .globally_addressable_scratch,3406 .globally_addressable_scratch,
2806 .kernarg_preload,3407 .kernarg_preload,
2807 .lds_barrier_arrive_atomic,3408 .lds_barrier_arrive_atomic,
2808 .ldsbankcount32,3409 .ldsbankcount32,
2809 .lerp_inst,3410 .lerp_inst,
2810 .lshl_add_u64_inst,3411 .lshl_add_u64_inst,
3412 .mad_nc_64_32_insts,
2811 .mad_u32_inst,3413 .mad_u32_inst,
2812 .max_hard_clause_length_63,3414 .max_hard_clause_length_63,
2813 .mcast_load_insts,3415 .mcast_load_insts,
2814 .memory_atomic_fadd_f32_denormal_support,3416 .memory_atomic_fadd_f32_denormal_support,
2815 .min3_max3_pkf16,3417 .min3_max3_pkf16,
3418 .min_max_i64_insts,
2816 .minimum3_maximum3_pkf16,3419 .minimum3_maximum3_pkf16,
3420 .mqsad_insts,
3421 .mqsad_pk_insts,
3422 .msad_insts,
3423 .no_f16_pseudo_scalar_trans_inline_constants,
2817 .packed_fp32_ops,3424 .packed_fp32_ops,
3425 .packed_fp64_ops,
2818 .packed_tid,3426 .packed_tid,
3427 .packed_u64_ops,
2819 .permlane16_swap,3428 .permlane16_swap,
2820 .pk_add_min_max_insts,3429 .pk_add_min_max_insts,
2821 .prng_inst,3430 .prng_inst,
2822 .pseudo_scalar_trans,3431 .pseudo_scalar_trans,
2823 .qsad_insts,3432 .qsad_insts,
3433 .real_true16,
3434 .requires_initial_unclause_vmem,
2824 .restricted_soffset,3435 .restricted_soffset,
2825 .s_wakeup_barrier_inst,3436 .s_wakeup_barrier_inst,
2826 .sad_insts,3437 .sad_insts,
...@@ -2828,25 +3439,127 @@ pub const cpu = struct {...@@ -2828,25 +3439,127 @@ pub const cpu = struct {
2828 .scalar_dwordx3_loads,3439 .scalar_dwordx3_loads,
2829 .setprio_inc_wg_inst,3440 .setprio_inc_wg_inst,
2830 .shader_cycles_hi_lo_registers,3441 .shader_cycles_hi_lo_registers,
3442 .smem_prefetch_insts,
2831 .sramecc_support,3443 .sramecc_support,
3444 .swmmac_gfx1200_insts,
3445 .swmmac_gfx1250_insts,
2832 .tanh_insts,3446 .tanh_insts,
2833 .tensor_cvt_lut_insts,3447 .tensor_cvt_lut_insts,
3448 .trans_coexecution_hazard,
2834 .transpose_load_f4f6_insts,3449 .transpose_load_f4f6_insts,
3450 .use_add_pc64_inst,
3451 .v_mov_b64_inst,
3452 .v_mul_u64_inst,
2835 .vcmpx_permlane_hazard,3453 .vcmpx_permlane_hazard,
2836 .vgpr_align2,3454 .vgpr_align2,
2837 .vmem_pref_insts,3455 .vmem_pref_insts,
3456 .vop3px2_increments_va_vdst_twice,
2838 .wait_xcnt,3457 .wait_xcnt,
2839 .wavefrontsize32,3458 .wavefrontsize32,
3459 .wmma_coexecution_hazards,
3460 .xnack,
3461 }),
3462 };
3463 pub const gfx12_5_generic: CpuModel = .{
3464 .name = "gfx12_5_generic",
3465 .llvm_name = "gfx12-5-generic",
3466 .features = featureSet(&[_]Feature{
3467 .@"1024_addressable_vgprs",
3468 .@"45_bit_num_records_buffer_resource",
3469 .@"64_bit_literals",
3470 .add_min_max_insts,
3471 .add_sub_u64_insts,
3472 .addressablelocalmemorysize327680,
3473 .architected_flat_scratch,
3474 .architected_sgprs,
3475 .ashr_pk_insts,
3476 .asynccnt,
3477 .atomic_buffer_global_pk_add_f16_insts,
3478 .atomic_buffer_pk_add_bf16_inst,
3479 .atomic_ds_pk_add_16_insts,
3480 .atomic_fadd_no_rtn_insts,
3481 .atomic_fadd_rtn_insts,
3482 .atomic_flat_pk_add_16_insts,
3483 .atomic_fmin_fmax_flat_f64,
3484 .atomic_fmin_fmax_global_f64,
3485 .atomic_global_pk_add_bf16_inst,
3486 .back_off_barrier,
3487 .bf16_cvt_insts,
3488 .bf16_pk_insts,
3489 .bf16_trans_insts,
3490 .bitop3_insts,
3491 .clusters,
3492 .cumode,
3493 .cvt_pk_f16_f32_inst,
3494 .d16_write_vgpr32,
3495 .dl_insts,
3496 .dot7_insts,
3497 .dot8_insts,
3498 .dpp_src1_sgpr,
3499 .emulated_system_scope_atomics,
3500 .flat_atomic_fadd_f32_inst,
3501 .flat_buffer_global_fadd_f64_inst,
3502 .flat_gvs_mode,
3503 .fma_mix_bf16_insts,
3504 .fmacf64_inst,
3505 .fp8_conversion_insts,
3506 .fp8e5m3_insts,
3507 .gfx12,
3508 .gfx1250_insts,
3509 .gfx125x_lowest_rate_wmma,
3510 .globally_addressable_scratch,
3511 .kernarg_preload,
3512 .lds_barrier_arrive_atomic,
3513 .ldsbankcount32,
3514 .lshl_add_u64_inst,
3515 .mad_nc_64_32_insts,
3516 .mad_u32_inst,
3517 .max_hard_clause_length_63,
3518 .mcast_load_insts,
3519 .memory_atomic_fadd_f32_denormal_support,
3520 .min3_max3_pkf16,
3521 .min_max_i64_insts,
3522 .minimum3_maximum3_pkf16,
3523 .no_f16_pseudo_scalar_trans_inline_constants,
3524 .packed_fp32_ops,
3525 .packed_tid,
3526 .permlane16_swap,
3527 .pk_add_min_max_insts,
3528 .prng_inst,
3529 .pseudo_scalar_trans,
3530 .real_true16,
3531 .requires_cov6,
3532 .requires_initial_unclause_vmem,
3533 .restricted_soffset,
3534 .s_wakeup_barrier_inst,
3535 .salu_float,
3536 .scalar_dwordx3_loads,
3537 .setprio_inc_wg_inst,
3538 .setreg_vgpr_msb_fixup,
3539 .shader_cycles_hi_lo_registers,
3540 .smem_prefetch_insts,
3541 .sramecc_support,
3542 .tanh_insts,
3543 .tensor_cvt_lut_insts,
3544 .trans_coexecution_hazard,
3545 .transpose_load_f4f6_insts,
3546 .v_mov_b64_inst,
3547 .v_mul_u64_inst,
3548 .vcmpx_permlane_hazard,
3549 .vgpr_align2,
3550 .vmem_pref_insts,
3551 .wait_xcnt,
3552 .wavefrontsize32,
3553 .wmma_coexecution_hazards,
2840 .xnack,3554 .xnack,
2841 .xnack_support,
2842 }),3555 }),
2843 };3556 };
2844 pub const gfx12_generic: CpuModel = .{3557 pub const gfx12_generic: CpuModel = .{
2845 .name = "gfx12_generic",3558 .name = "gfx12_generic",
2846 .llvm_name = "gfx12-generic",3559 .llvm_name = "gfx12-generic",
2847 .features = featureSet(&[_]Feature{3560 .features = featureSet(&[_]Feature{
3561 .@"1536_physical_vgprs",
2848 .addressablelocalmemorysize65536,3562 .addressablelocalmemorysize65536,
2849 .allocate1_5xvgprs,
2850 .architected_flat_scratch,3563 .architected_flat_scratch,
2851 .architected_sgprs,3564 .architected_sgprs,
2852 .atomic_buffer_global_pk_add_f16_insts,3565 .atomic_buffer_global_pk_add_f16_insts,
...@@ -2873,25 +3586,170 @@ pub const cpu = struct {...@@ -2873,25 +3586,170 @@ pub const cpu = struct {
2873 .dpp_src1_sgpr,3586 .dpp_src1_sgpr,
2874 .extended_image_insts,3587 .extended_image_insts,
2875 .flat_atomic_fadd_f32_inst,3588 .flat_atomic_fadd_f32_inst,
3589 .formatted_mubuf_insts,
2876 .fp8_conversion_insts,3590 .fp8_conversion_insts,
2877 .gfx12,3591 .gfx12,
2878 .image_insts,3592 .image_insts,
2879 .ldsbankcount32,3593 .ldsbankcount32,
2880 .lerp_inst,3594 .lerp_inst,
2881 .memory_atomic_fadd_f32_denormal_support,3595 .memory_atomic_fadd_f32_denormal_support,
3596 .mqsad_insts,
3597 .mqsad_pk_insts,
3598 .msad_insts,
3599 .mtbuf_insts,
3600 .no_f16_pseudo_scalar_trans_inline_constants,
2882 .nsa_encoding,3601 .nsa_encoding,
2883 .packed_tid,3602 .packed_tid,
2884 .partial_nsa_encoding,3603 .partial_nsa_encoding,
2885 .pseudo_scalar_trans,3604 .pseudo_scalar_trans,
2886 .qsad_insts,3605 .qsad_insts,
3606 .real_true16,
2887 .requires_cov6,3607 .requires_cov6,
2888 .restricted_soffset,3608 .restricted_soffset,
2889 .sad_insts,3609 .sad_insts,
2890 .salu_float,3610 .salu_float,
2891 .scalar_dwordx3_loads,3611 .scalar_dwordx3_loads,
2892 .shader_cycles_hi_lo_registers,3612 .shader_cycles_hi_lo_registers,
3613 .smem_prefetch_insts,
3614 .swmmac_gfx1200_insts,
2893 .vcmpx_permlane_hazard,3615 .vcmpx_permlane_hazard,
2894 .waits_before_system_scope_stores,3616 .waits_before_system_scope_stores,
3617 .wmma_128b_insts,
3618 }),
3619 };
3620 pub const gfx1310: CpuModel = .{
3621 .name = "gfx1310",
3622 .llvm_name = "gfx1310",
3623 .features = featureSet(&[_]Feature{
3624 .@"1536_physical_vgprs",
3625 .@"64_bit_literals",
3626 .addressablelocalmemorysize65536,
3627 .architected_flat_scratch,
3628 .architected_sgprs,
3629 .ashr_pk_insts,
3630 .atomic_buffer_global_pk_add_f16_insts,
3631 .atomic_buffer_pk_add_bf16_inst,
3632 .atomic_ds_pk_add_16_insts,
3633 .atomic_fadd_no_rtn_insts,
3634 .atomic_fadd_rtn_insts,
3635 .atomic_flat_pk_add_16_insts,
3636 .atomic_fmin_fmax_flat_f64,
3637 .atomic_fmin_fmax_global_f64,
3638 .atomic_global_pk_add_bf16_inst,
3639 .bf16_cvt_insts,
3640 .bf16_pk_insts,
3641 .bf16_trans_insts,
3642 .bitop3_insts,
3643 .clusters,
3644 .cube_insts,
3645 .cvt_norm_insts,
3646 .cvt_pk_f16_f32_inst,
3647 .cvt_pknorm_vop2_insts,
3648 .cvt_pknorm_vop3_insts,
3649 .dl_insts,
3650 .dot7_insts,
3651 .dot8_insts,
3652 .dpp_src1_sgpr,
3653 .f16bf16_to_fp6bf6_cvt_scale_insts,
3654 .flat_atomic_fadd_f32_inst,
3655 .flat_gvs_mode,
3656 .fma_mix_bf16_insts,
3657 .fmacf64_inst,
3658 .fp8_conversion_insts,
3659 .gfx1250_insts,
3660 .gfx13,
3661 .globally_addressable_scratch,
3662 .ldsbankcount32,
3663 .lerp_inst,
3664 .mqsad_insts,
3665 .mqsad_pk_insts,
3666 .msad_insts,
3667 .nsa_encoding,
3668 .packed_tid,
3669 .partial_nsa_encoding,
3670 .permlane16_swap,
3671 .prng_inst,
3672 .pseudo_scalar_trans,
3673 .qsad_insts,
3674 .restricted_soffset,
3675 .s_wakeup_barrier_inst,
3676 .sad_insts,
3677 .salu_float,
3678 .scalar_dwordx3_loads,
3679 .shader_cycles_register,
3680 .smem_prefetch_insts,
3681 .tanh_insts,
3682 .tensor_cvt_lut_insts,
3683 .transpose_load_f4f6_insts,
3684 .vcmpx_permlane_hazard,
3685 }),
3686 };
3687 pub const gfx13_generic: CpuModel = .{
3688 .name = "gfx13_generic",
3689 .llvm_name = "gfx13-generic",
3690 .features = featureSet(&[_]Feature{
3691 .@"1536_physical_vgprs",
3692 .@"64_bit_literals",
3693 .addressablelocalmemorysize65536,
3694 .architected_flat_scratch,
3695 .architected_sgprs,
3696 .ashr_pk_insts,
3697 .atomic_buffer_global_pk_add_f16_insts,
3698 .atomic_buffer_pk_add_bf16_inst,
3699 .atomic_ds_pk_add_16_insts,
3700 .atomic_fadd_no_rtn_insts,
3701 .atomic_fadd_rtn_insts,
3702 .atomic_flat_pk_add_16_insts,
3703 .atomic_fmin_fmax_flat_f64,
3704 .atomic_fmin_fmax_global_f64,
3705 .atomic_global_pk_add_bf16_inst,
3706 .bf16_cvt_insts,
3707 .bf16_pk_insts,
3708 .bf16_trans_insts,
3709 .bitop3_insts,
3710 .clusters,
3711 .cube_insts,
3712 .cvt_norm_insts,
3713 .cvt_pk_f16_f32_inst,
3714 .cvt_pknorm_vop2_insts,
3715 .cvt_pknorm_vop3_insts,
3716 .dl_insts,
3717 .dot7_insts,
3718 .dot8_insts,
3719 .dpp_src1_sgpr,
3720 .f16bf16_to_fp6bf6_cvt_scale_insts,
3721 .flat_atomic_fadd_f32_inst,
3722 .flat_gvs_mode,
3723 .fma_mix_bf16_insts,
3724 .fmacf64_inst,
3725 .fp8_conversion_insts,
3726 .gfx1250_insts,
3727 .gfx13,
3728 .globally_addressable_scratch,
3729 .ldsbankcount32,
3730 .lerp_inst,
3731 .mqsad_insts,
3732 .mqsad_pk_insts,
3733 .msad_insts,
3734 .nsa_encoding,
3735 .packed_tid,
3736 .partial_nsa_encoding,
3737 .permlane16_swap,
3738 .prng_inst,
3739 .pseudo_scalar_trans,
3740 .qsad_insts,
3741 .requires_cov6,
3742 .restricted_soffset,
3743 .s_wakeup_barrier_inst,
3744 .sad_insts,
3745 .salu_float,
3746 .scalar_dwordx3_loads,
3747 .shader_cycles_register,
3748 .smem_prefetch_insts,
3749 .tanh_insts,
3750 .tensor_cvt_lut_insts,
3751 .transpose_load_f4f6_insts,
3752 .vcmpx_permlane_hazard,
2895 }),3753 }),
2896 };3754 };
2897 pub const gfx600: CpuModel = .{3755 pub const gfx600: CpuModel = .{
...@@ -2977,7 +3835,7 @@ pub const cpu = struct {...@@ -2977,7 +3835,7 @@ pub const cpu = struct {
2977 .ldsbankcount32,3835 .ldsbankcount32,
2978 .unpacked_d16_vmem,3836 .unpacked_d16_vmem,
2979 .volcanic_islands,3837 .volcanic_islands,
2980 .xnack_support,3838 .xnack_on_off_modes,
2981 }),3839 }),
2982 };3840 };
2983 pub const gfx802: CpuModel = .{3841 pub const gfx802: CpuModel = .{
...@@ -3017,7 +3875,7 @@ pub const cpu = struct {...@@ -3017,7 +3875,7 @@ pub const cpu = struct {
3017 .image_store_d16_bug,3875 .image_store_d16_bug,
3018 .ldsbankcount16,3876 .ldsbankcount16,
3019 .volcanic_islands,3877 .volcanic_islands,
3020 .xnack_support,3878 .xnack_on_off_modes,
3021 }),3879 }),
3022 };3880 };
3023 pub const gfx900: CpuModel = .{3881 pub const gfx900: CpuModel = .{
...@@ -3175,6 +4033,7 @@ pub const cpu = struct {...@@ -3175,6 +4033,7 @@ pub const cpu = struct {
3175 .packed_tid,4033 .packed_tid,
3176 .pk_fmac_f16_inst,4034 .pk_fmac_f16_inst,
3177 .sramecc_support,4035 .sramecc_support,
4036 .tgsplit_support,
3178 .vgpr_align2,4037 .vgpr_align2,
3179 }),4038 }),
3180 };4039 };
...@@ -3239,6 +4098,8 @@ pub const cpu = struct {...@@ -3239,6 +4098,8 @@ pub const cpu = struct {
3239 .packed_tid,4098 .packed_tid,
3240 .pk_fmac_f16_inst,4099 .pk_fmac_f16_inst,
3241 .sramecc_support,4100 .sramecc_support,
4101 .tgsplit_support,
4102 .v_mov_b64_inst,
3242 .vgpr_align2,4103 .vgpr_align2,
3243 .xf32_insts,4104 .xf32_insts,
3244 }),4105 }),
...@@ -3295,6 +4156,8 @@ pub const cpu = struct {...@@ -3295,6 +4156,8 @@ pub const cpu = struct {
3295 .pk_fmac_f16_inst,4156 .pk_fmac_f16_inst,
3296 .prng_inst,4157 .prng_inst,
3297 .sramecc_support,4158 .sramecc_support,
4159 .tgsplit_support,
4160 .v_mov_b64_inst,
3298 .vgpr_align2,4161 .vgpr_align2,
3299 }),4162 }),
3300 };4163 };
...@@ -3342,6 +4205,8 @@ pub const cpu = struct {...@@ -3342,6 +4205,8 @@ pub const cpu = struct {
3342 .pk_fmac_f16_inst,4205 .pk_fmac_f16_inst,
3343 .requires_cov6,4206 .requires_cov6,
3344 .sramecc_support,4207 .sramecc_support,
4208 .tgsplit_support,
4209 .v_mov_b64_inst,
3345 .vgpr_align2,4210 .vgpr_align2,
3346 }),4211 }),
3347 };4212 };
...@@ -3452,7 +4317,7 @@ pub const cpu = struct {...@@ -3452,7 +4317,7 @@ pub const cpu = struct {
3452 .image_store_d16_bug,4317 .image_store_d16_bug,
3453 .ldsbankcount16,4318 .ldsbankcount16,
3454 .volcanic_islands,4319 .volcanic_islands,
3455 .xnack_support,4320 .xnack_on_off_modes,
3456 }),4321 }),
3457 };4322 };
3458 pub const tahiti: CpuModel = .{4323 pub const tahiti: CpuModel = .{
lib/std/Target/hexagon.zig+204
...@@ -34,7 +34,41 @@ pub const Feature = enum {...@@ -34,7 +34,41 @@ pub const Feature = enum {
34 nvs,34 nvs,
35 packets,35 packets,
36 prev65,36 prev65,
37 reserved_r10,
38 reserved_r11,
39 reserved_r12,
40 reserved_r13,
41 reserved_r14,
42 reserved_r15,
43 reserved_r16,
44 reserved_r17,
45 reserved_r18,
37 reserved_r19,46 reserved_r19,
47 reserved_r20,
48 reserved_r21,
49 reserved_r22,
50 reserved_r23,
51 reserved_r24,
52 reserved_r25,
53 reserved_r26,
54 reserved_r27,
55 reserved_r28,
56 reserved_r6,
57 reserved_r7,
58 reserved_r8,
59 reserved_r9,
60 scs_reg_r16,
61 scs_reg_r17,
62 scs_reg_r18,
63 scs_reg_r19,
64 scs_reg_r20,
65 scs_reg_r21,
66 scs_reg_r22,
67 scs_reg_r23,
68 scs_reg_r24,
69 scs_reg_r25,
70 scs_reg_r26,
71 scs_reg_r27,
38 small_data,72 small_data,
39 tinycore,73 tinycore,
40 v5,74 v5,
...@@ -241,11 +275,181 @@ pub const all_features = blk: {...@@ -241,11 +275,181 @@ pub const all_features = blk: {
241 .description = "Support features deprecated in v65",275 .description = "Support features deprecated in v65",
242 .dependencies = featureSet(&[_]Feature{}),276 .dependencies = featureSet(&[_]Feature{}),
243 };277 };
278 result[@backingInt(Feature.reserved_r10)] = .{
279 .llvm_name = "reserved-r10",
280 .description = "Reserve register R10",
281 .dependencies = featureSet(&[_]Feature{}),
282 };
283 result[@backingInt(Feature.reserved_r11)] = .{
284 .llvm_name = "reserved-r11",
285 .description = "Reserve register R11",
286 .dependencies = featureSet(&[_]Feature{}),
287 };
288 result[@backingInt(Feature.reserved_r12)] = .{
289 .llvm_name = "reserved-r12",
290 .description = "Reserve register R12",
291 .dependencies = featureSet(&[_]Feature{}),
292 };
293 result[@backingInt(Feature.reserved_r13)] = .{
294 .llvm_name = "reserved-r13",
295 .description = "Reserve register R13",
296 .dependencies = featureSet(&[_]Feature{}),
297 };
298 result[@backingInt(Feature.reserved_r14)] = .{
299 .llvm_name = "reserved-r14",
300 .description = "Reserve register R14",
301 .dependencies = featureSet(&[_]Feature{}),
302 };
303 result[@backingInt(Feature.reserved_r15)] = .{
304 .llvm_name = "reserved-r15",
305 .description = "Reserve register R15",
306 .dependencies = featureSet(&[_]Feature{}),
307 };
308 result[@backingInt(Feature.reserved_r16)] = .{
309 .llvm_name = "reserved-r16",
310 .description = "Reserve register R16",
311 .dependencies = featureSet(&[_]Feature{}),
312 };
313 result[@backingInt(Feature.reserved_r17)] = .{
314 .llvm_name = "reserved-r17",
315 .description = "Reserve register R17",
316 .dependencies = featureSet(&[_]Feature{}),
317 };
318 result[@backingInt(Feature.reserved_r18)] = .{
319 .llvm_name = "reserved-r18",
320 .description = "Reserve register R18",
321 .dependencies = featureSet(&[_]Feature{}),
322 };
244 result[@backingInt(Feature.reserved_r19)] = .{323 result[@backingInt(Feature.reserved_r19)] = .{
245 .llvm_name = "reserved-r19",324 .llvm_name = "reserved-r19",
246 .description = "Reserve register R19",325 .description = "Reserve register R19",
247 .dependencies = featureSet(&[_]Feature{}),326 .dependencies = featureSet(&[_]Feature{}),
248 };327 };
328 result[@backingInt(Feature.reserved_r20)] = .{
329 .llvm_name = "reserved-r20",
330 .description = "Reserve register R20",
331 .dependencies = featureSet(&[_]Feature{}),
332 };
333 result[@backingInt(Feature.reserved_r21)] = .{
334 .llvm_name = "reserved-r21",
335 .description = "Reserve register R21",
336 .dependencies = featureSet(&[_]Feature{}),
337 };
338 result[@backingInt(Feature.reserved_r22)] = .{
339 .llvm_name = "reserved-r22",
340 .description = "Reserve register R22",
341 .dependencies = featureSet(&[_]Feature{}),
342 };
343 result[@backingInt(Feature.reserved_r23)] = .{
344 .llvm_name = "reserved-r23",
345 .description = "Reserve register R23",
346 .dependencies = featureSet(&[_]Feature{}),
347 };
348 result[@backingInt(Feature.reserved_r24)] = .{
349 .llvm_name = "reserved-r24",
350 .description = "Reserve register R24",
351 .dependencies = featureSet(&[_]Feature{}),
352 };
353 result[@backingInt(Feature.reserved_r25)] = .{
354 .llvm_name = "reserved-r25",
355 .description = "Reserve register R25",
356 .dependencies = featureSet(&[_]Feature{}),
357 };
358 result[@backingInt(Feature.reserved_r26)] = .{
359 .llvm_name = "reserved-r26",
360 .description = "Reserve register R26",
361 .dependencies = featureSet(&[_]Feature{}),
362 };
363 result[@backingInt(Feature.reserved_r27)] = .{
364 .llvm_name = "reserved-r27",
365 .description = "Reserve register R27",
366 .dependencies = featureSet(&[_]Feature{}),
367 };
368 result[@backingInt(Feature.reserved_r28)] = .{
369 .llvm_name = "reserved-r28",
370 .description = "Reserve register R28",
371 .dependencies = featureSet(&[_]Feature{}),
372 };
373 result[@backingInt(Feature.reserved_r6)] = .{
374 .llvm_name = "reserved-r6",
375 .description = "Reserve register R6",
376 .dependencies = featureSet(&[_]Feature{}),
377 };
378 result[@backingInt(Feature.reserved_r7)] = .{
379 .llvm_name = "reserved-r7",
380 .description = "Reserve register R7",
381 .dependencies = featureSet(&[_]Feature{}),
382 };
383 result[@backingInt(Feature.reserved_r8)] = .{
384 .llvm_name = "reserved-r8",
385 .description = "Reserve register R8",
386 .dependencies = featureSet(&[_]Feature{}),
387 };
388 result[@backingInt(Feature.reserved_r9)] = .{
389 .llvm_name = "reserved-r9",
390 .description = "Reserve register R9",
391 .dependencies = featureSet(&[_]Feature{}),
392 };
393 result[@backingInt(Feature.scs_reg_r16)] = .{
394 .llvm_name = "scs-reg-r16",
395 .description = "Use register R16 as the shadow call stack pointer",
396 .dependencies = featureSet(&[_]Feature{}),
397 };
398 result[@backingInt(Feature.scs_reg_r17)] = .{
399 .llvm_name = "scs-reg-r17",
400 .description = "Use register R17 as the shadow call stack pointer",
401 .dependencies = featureSet(&[_]Feature{}),
402 };
403 result[@backingInt(Feature.scs_reg_r18)] = .{
404 .llvm_name = "scs-reg-r18",
405 .description = "Use register R18 as the shadow call stack pointer",
406 .dependencies = featureSet(&[_]Feature{}),
407 };
408 result[@backingInt(Feature.scs_reg_r19)] = .{
409 .llvm_name = "scs-reg-r19",
410 .description = "Use register R19 as the shadow call stack pointer",
411 .dependencies = featureSet(&[_]Feature{}),
412 };
413 result[@backingInt(Feature.scs_reg_r20)] = .{
414 .llvm_name = "scs-reg-r20",
415 .description = "Use register R20 as the shadow call stack pointer",
416 .dependencies = featureSet(&[_]Feature{}),
417 };
418 result[@backingInt(Feature.scs_reg_r21)] = .{
419 .llvm_name = "scs-reg-r21",
420 .description = "Use register R21 as the shadow call stack pointer",
421 .dependencies = featureSet(&[_]Feature{}),
422 };
423 result[@backingInt(Feature.scs_reg_r22)] = .{
424 .llvm_name = "scs-reg-r22",
425 .description = "Use register R22 as the shadow call stack pointer",
426 .dependencies = featureSet(&[_]Feature{}),
427 };
428 result[@backingInt(Feature.scs_reg_r23)] = .{
429 .llvm_name = "scs-reg-r23",
430 .description = "Use register R23 as the shadow call stack pointer",
431 .dependencies = featureSet(&[_]Feature{}),
432 };
433 result[@backingInt(Feature.scs_reg_r24)] = .{
434 .llvm_name = "scs-reg-r24",
435 .description = "Use register R24 as the shadow call stack pointer",
436 .dependencies = featureSet(&[_]Feature{}),
437 };
438 result[@backingInt(Feature.scs_reg_r25)] = .{
439 .llvm_name = "scs-reg-r25",
440 .description = "Use register R25 as the shadow call stack pointer",
441 .dependencies = featureSet(&[_]Feature{}),
442 };
443 result[@backingInt(Feature.scs_reg_r26)] = .{
444 .llvm_name = "scs-reg-r26",
445 .description = "Use register R26 as the shadow call stack pointer",
446 .dependencies = featureSet(&[_]Feature{}),
447 };
448 result[@backingInt(Feature.scs_reg_r27)] = .{
449 .llvm_name = "scs-reg-r27",
450 .description = "Use register R27 as the shadow call stack pointer",
451 .dependencies = featureSet(&[_]Feature{}),
452 };
249 result[@backingInt(Feature.small_data)] = .{453 result[@backingInt(Feature.small_data)] = .{
250 .llvm_name = "small-data",454 .llvm_name = "small-data",
251 .description = "Allow GP-relative addressing of global variables",455 .description = "Allow GP-relative addressing of global variables",
lib/std/Target/mips.zig+23
...@@ -13,6 +13,7 @@ pub const Feature = enum {...@@ -13,6 +13,7 @@ pub const Feature = enum {
13 dspr2,13 dspr2,
14 dspr3,14 dspr3,
15 eva,15 eva,
16 fix_r5900,
16 fp64,17 fp64,
17 fpxx,18 fpxx,
18 ginv,19 ginv,
...@@ -52,6 +53,7 @@ pub const Feature = enum {...@@ -52,6 +53,7 @@ pub const Feature = enum {
52 notraps,53 notraps,
53 p5600,54 p5600,
54 ptr64,55 ptr64,
56 r5900,
55 single_float,57 single_float,
56 soft_float,58 soft_float,
57 strict_align,59 strict_align,
...@@ -121,6 +123,11 @@ pub const all_features = blk: {...@@ -121,6 +123,11 @@ pub const all_features = blk: {
121 .description = "Mips EVA ASE",123 .description = "Mips EVA ASE",
122 .dependencies = featureSet(&[_]Feature{}),124 .dependencies = featureSet(&[_]Feature{}),
123 };125 };
126 result[@backingInt(Feature.fix_r5900)] = .{
127 .llvm_name = "fix-r5900",
128 .description = "Enable R5900 short loop erratum fix",
129 .dependencies = featureSet(&[_]Feature{}),
130 };
124 result[@backingInt(Feature.fp64)] = .{131 result[@backingInt(Feature.fp64)] = .{
125 .llvm_name = "fp64",132 .llvm_name = "fp64",
126 .description = "Support 64-bit FP registers",133 .description = "Support 64-bit FP registers",
...@@ -372,6 +379,15 @@ pub const all_features = blk: {...@@ -372,6 +379,15 @@ pub const all_features = blk: {
372 .description = "Pointers are 64-bit wide",379 .description = "Pointers are 64-bit wide",
373 .dependencies = featureSet(&[_]Feature{}),380 .dependencies = featureSet(&[_]Feature{}),
374 };381 };
382 result[@backingInt(Feature.r5900)] = .{
383 .llvm_name = "r5900",
384 .description = "R5900 (PS2 Emotion Engine) Support",
385 .dependencies = featureSet(&[_]Feature{
386 .fix_r5900,
387 .mips3,
388 .single_float,
389 }),
390 };
375 result[@backingInt(Feature.single_float)] = .{391 result[@backingInt(Feature.single_float)] = .{
376 .llvm_name = "single-float",392 .llvm_name = "single-float",
377 .description = "Only supports single precision float",393 .description = "Only supports single precision float",
...@@ -596,4 +612,11 @@ pub const cpu = struct {...@@ -596,4 +612,11 @@ pub const cpu = struct {
596 .soft_float,612 .soft_float,
597 }),613 }),
598 };614 };
615 pub const r5900: CpuModel = .{
616 .name = "r5900",
617 .llvm_name = "r5900",
618 .features = featureSet(&[_]Feature{
619 .r5900,
620 }),
621 };
599};622};
lib/std/Target/nvptx.zig+18
...@@ -36,6 +36,9 @@ pub const Feature = enum {...@@ -36,6 +36,9 @@ pub const Feature = enum {
36 ptx87,36 ptx87,
37 ptx88,37 ptx88,
38 ptx90,38 ptx90,
39 ptx91,
40 ptx92,
41 ptx93,
39 sm_100,42 sm_100,
40 sm_100a,43 sm_100a,
41 sm_100f,44 sm_100f,
...@@ -242,6 +245,21 @@ pub const all_features = blk: {...@@ -242,6 +245,21 @@ pub const all_features = blk: {
242 .description = "Use PTX version 90",245 .description = "Use PTX version 90",
243 .dependencies = featureSet(&[_]Feature{}),246 .dependencies = featureSet(&[_]Feature{}),
244 };247 };
248 result[@backingInt(Feature.ptx91)] = .{
249 .llvm_name = "ptx91",
250 .description = "Use PTX version 91",
251 .dependencies = featureSet(&[_]Feature{}),
252 };
253 result[@backingInt(Feature.ptx92)] = .{
254 .llvm_name = "ptx92",
255 .description = "Use PTX version 92",
256 .dependencies = featureSet(&[_]Feature{}),
257 };
258 result[@backingInt(Feature.ptx93)] = .{
259 .llvm_name = "ptx93",
260 .description = "Use PTX version 93",
261 .dependencies = featureSet(&[_]Feature{}),
262 };
245 result[@backingInt(Feature.sm_100)] = .{263 result[@backingInt(Feature.sm_100)] = .{
246 .llvm_name = "sm_100",264 .llvm_name = "sm_100",
247 .description = "Target SM 100",265 .description = "Target SM 100",
lib/std/Target/powerpc.zig+51-2
...@@ -43,6 +43,7 @@ pub const Feature = enum {...@@ -43,6 +43,7 @@ pub const Feature = enum {
43 fuse_wideimm,43 fuse_wideimm,
44 fuse_zeromove,44 fuse_zeromove,
45 fusion,45 fusion,
46 future_vector,
46 hard_float,47 hard_float,
47 htm,48 htm,
48 icbt,49 icbt,
...@@ -83,6 +84,7 @@ pub const Feature = enum {...@@ -83,6 +84,7 @@ pub const Feature = enum {
83 spe,84 spe,
84 stfiwx,85 stfiwx,
85 two_const_nr,86 two_const_nr,
87 use_ptrgl_helper,
86 vectors_use_two_units,88 vectors_use_two_units,
87 vsx,89 vsx,
88};90};
...@@ -342,6 +344,14 @@ pub const all_features = blk: {...@@ -342,6 +344,14 @@ pub const all_features = blk: {
342 .description = "Target supports instruction fusion",344 .description = "Target supports instruction fusion",
343 .dependencies = featureSet(&[_]Feature{}),345 .dependencies = featureSet(&[_]Feature{}),
344 };346 };
347 result[@backingInt(Feature.future_vector)] = .{
348 .llvm_name = "future-vector",
349 .description = "Enable Future vector instructions",
350 .dependencies = featureSet(&[_]Feature{
351 .isa_future_instructions,
352 .power10_vector,
353 }),
354 };
345 result[@backingInt(Feature.hard_float)] = .{355 result[@backingInt(Feature.hard_float)] = .{
346 .llvm_name = "hard-float",356 .llvm_name = "hard-float",
347 .description = "Enable floating-point instructions",357 .description = "Enable floating-point instructions",
...@@ -441,6 +451,7 @@ pub const all_features = blk: {...@@ -441,6 +451,7 @@ pub const all_features = blk: {
441 .description = "32Byte load and store instructions",451 .description = "32Byte load and store instructions",
442 .dependencies = featureSet(&[_]Feature{452 .dependencies = featureSet(&[_]Feature{
443 .isa_v30_instructions,453 .isa_v30_instructions,
454 .vsx,
444 }),455 }),
445 };456 };
446 result[@backingInt(Feature.partword_atomics)] = .{457 result[@backingInt(Feature.partword_atomics)] = .{
...@@ -580,6 +591,11 @@ pub const all_features = blk: {...@@ -580,6 +591,11 @@ pub const all_features = blk: {
580 .description = "Requires two constant Newton-Raphson computation",591 .description = "Requires two constant Newton-Raphson computation",
581 .dependencies = featureSet(&[_]Feature{}),592 .dependencies = featureSet(&[_]Feature{}),
582 };593 };
594 result[@backingInt(Feature.use_ptrgl_helper)] = .{
595 .llvm_name = "use-ptrgl-helper",
596 .description = "Use ._ptrgl for indirect calls",
597 .dependencies = featureSet(&[_]Feature{}),
598 };
583 result[@backingInt(Feature.vectors_use_two_units)] = .{599 result[@backingInt(Feature.vectors_use_two_units)] = .{
584 .llvm_name = "vectors-use-two-units",600 .llvm_name = "vectors-use-two-units",
585 .description = "Vectors use two units",601 .description = "Vectors use two units",
...@@ -747,6 +763,19 @@ pub const cpu = struct {...@@ -747,6 +763,19 @@ pub const cpu = struct {
747 .stfiwx,763 .stfiwx,
748 }),764 }),
749 };765 };
766 pub const cell: CpuModel = .{
767 .name = "cell",
768 .llvm_name = null,
769 .features = featureSet(&[_]Feature{
770 .@"64bit_support",
771 .altivec,
772 .fres,
773 .frsqrte,
774 .fsqrt,
775 .mfocrf,
776 .stfiwx,
777 }),
778 };
750 pub const e500: CpuModel = .{779 pub const e500: CpuModel = .{
751 .name = "e500",780 .name = "e500",
752 .llvm_name = "e500",781 .llvm_name = "e500",
...@@ -765,6 +794,15 @@ pub const cpu = struct {...@@ -765,6 +794,15 @@ pub const cpu = struct {
765 .stfiwx,794 .stfiwx,
766 }),795 }),
767 };796 };
797 pub const e500v2: CpuModel = .{
798 .name = "e500v2",
799 .llvm_name = null,
800 .features = featureSet(&[_]Feature{
801 .efpu2,
802 .isel,
803 .msync,
804 }),
805 };
768 pub const e5500: CpuModel = .{806 pub const e5500: CpuModel = .{
769 .name = "e5500",807 .name = "e5500",
770 .llvm_name = "e5500",808 .llvm_name = "e5500",
...@@ -776,6 +814,18 @@ pub const cpu = struct {...@@ -776,6 +814,18 @@ pub const cpu = struct {
776 .stfiwx,814 .stfiwx,
777 }),815 }),
778 };816 };
817 pub const e6500: CpuModel = .{
818 .name = "e6500",
819 .llvm_name = null,
820 .features = featureSet(&[_]Feature{
821 .@"64bit_support",
822 .altivec,
823 .booke,
824 .isel,
825 .mfocrf,
826 .stfiwx,
827 }),
828 };
779 pub const future: CpuModel = .{829 pub const future: CpuModel = .{
780 .name = "future",830 .name = "future",
781 .llvm_name = "future",831 .llvm_name = "future",
...@@ -803,8 +853,8 @@ pub const cpu = struct {...@@ -803,8 +853,8 @@ pub const cpu = struct {
803 .fuse_logical_add,853 .fuse_logical_add,
804 .fuse_sha3,854 .fuse_sha3,
805 .fuse_store,855 .fuse_store,
856 .future_vector,
806 .icbt,857 .icbt,
807 .isa_future_instructions,
808 .isa_v206_instructions,858 .isa_v206_instructions,
809 .isel,859 .isel,
810 .ldbrx,860 .ldbrx,
...@@ -814,7 +864,6 @@ pub const cpu = struct {...@@ -814,7 +864,6 @@ pub const cpu = struct {
814 .partword_atomics,864 .partword_atomics,
815 .pcrelative_memops,865 .pcrelative_memops,
816 .popcntd,866 .popcntd,
817 .power10_vector,
818 .ppc_postra_sched,867 .ppc_postra_sched,
819 .ppc_prera_sched,868 .ppc_prera_sched,
820 .predictable_select_expensive,869 .predictable_select_expensive,
lib/std/Target/riscv.zig+673-134
...@@ -8,13 +8,8 @@ pub const Feature = enum {...@@ -8,13 +8,8 @@ pub const Feature = enum {
8 @"32bit",8 @"32bit",
9 @"64bit",9 @"64bit",
10 a,10 a,
11 add_load_fusion,
12 addi_load_fusion,
13 andes45,11 andes45,
14 auipc_addi_fusion,
15 auipc_load_fusion,
16 b,12 b,
17 bfext_fusion,
18 c,13 c,
19 conditional_cmv_fusion,14 conditional_cmv_fusion,
20 d,15 d,
...@@ -25,6 +20,7 @@ pub const Feature = enum {...@@ -25,6 +20,7 @@ pub const Feature = enum {
25 disable_postmisched_store_clustering,20 disable_postmisched_store_clustering,
26 dlen_factor_2,21 dlen_factor_2,
27 e,22 e,
23 enable_select_opt,
28 enable_vsetvli_sched_heuristic,24 enable_vsetvli_sched_heuristic,
29 exact_asm,25 exact_asm,
30 experimental,26 experimental,
...@@ -32,26 +28,57 @@ pub const Feature = enum {...@@ -32,26 +28,57 @@ pub const Feature = enum {
32 experimental_rvm23u32,28 experimental_rvm23u32,
33 experimental_smpmpmt,29 experimental_smpmpmt,
34 experimental_svukte,30 experimental_svukte,
35 experimental_xrivosvisni,31 experimental_xqccmt,
36 experimental_xrivosvizip,
37 experimental_xsfmclic,32 experimental_xsfmclic,
38 experimental_xsfsclic,33 experimental_xsfsclic,
34 experimental_y,
39 experimental_zibi,35 experimental_zibi,
40 experimental_zicfilp,36 experimental_zicfilp,
41 experimental_zicfiss,37 experimental_zicfiss,
38 experimental_zvabd,
42 experimental_zvbc32e,39 experimental_zvbc32e,
40 experimental_zvdot4a8i,
41 experimental_zvfbdota32f,
43 experimental_zvfbfa,42 experimental_zvfbfa,
44 experimental_zvfofp8min,43 experimental_zvfofp8min,
44 experimental_zvfqwbdota8f,
45 experimental_zvfqwdota8f,
46 experimental_zvfwbdota16bf,
47 experimental_zvfwdota16bf,
45 experimental_zvkgs,48 experimental_zvkgs,
46 experimental_zvqdotq,49 experimental_zvqwbdota16i,
50 experimental_zvqwbdota8i,
51 experimental_zvqwdota16i,
52 experimental_zvqwdota8i,
53 experimental_zvvfmm,
54 experimental_zvvmm,
55 experimental_zvvmtls,
56 experimental_zvvmttls,
57 experimental_zvzip,
47 f,58 f,
48 forced_atomics,59 forced_atomics,
60 fusion_add_load,
61 fusion_add_mem,
62 fusion_addi_load,
63 fusion_auipc_addi,
64 fusion_auipc_load,
65 fusion_bfext,
66 fusion_ld_add,
67 fusion_logic_imm_reg,
68 fusion_logic_reg_imm,
69 fusion_logic_reg_reg,
70 fusion_lui_addi,
71 fusion_lui_load,
72 fusion_mul_add,
73 fusion_qc_e_li_load_store,
74 fusion_shift_bit_extract,
75 fusion_shifted_zextw,
76 fusion_shxadd_load,
77 fusion_zexth,
78 fusion_zextw,
49 h,79 h,
50 i,80 i,
51 ld_add_fusion,
52 log_vrgather,81 log_vrgather,
53 lui_addi_fusion,
54 lui_load_fusion,
55 m,82 m,
56 mips_p8700,83 mips_p8700,
57 no_default_unroll,84 no_default_unroll,
...@@ -67,6 +94,7 @@ pub const Feature = enum {...@@ -67,6 +94,7 @@ pub const Feature = enum {
67 optimized_zero_stride_load,94 optimized_zero_stride_load,
68 permissive_zalrsc,95 permissive_zalrsc,
69 predictable_select_expensive,96 predictable_select_expensive,
97 prefer_ascending_load_store,
70 prefer_vsetvli_over_read_vlenb,98 prefer_vsetvli_over_read_vlenb,
71 prefer_w_inst,99 prefer_w_inst,
72 q,100 q,
...@@ -118,17 +146,16 @@ pub const Feature = enum {...@@ -118,17 +146,16 @@ pub const Feature = enum {
118 sha,146 sha,
119 shcounterenw,147 shcounterenw,
120 shgatpa,148 shgatpa,
121 shifted_zextw_fusion,
122 shlcofideleg,149 shlcofideleg,
123 short_forward_branch_ialu,150 short_forward_branch_ialu,
124 short_forward_branch_iload,151 short_forward_branch_iload,
125 short_forward_branch_iminmax,152 short_forward_branch_iminmax,
153 short_forward_branch_imm,
126 short_forward_branch_imul,154 short_forward_branch_imul,
127 shtvala,155 shtvala,
128 shvsatpa,156 shvsatpa,
129 shvstvala,157 shvstvala,
130 shvstvecd,158 shvstvecd,
131 shxadd_load_fusion,
132 single_element_vec_fp64,159 single_element_vec_fp64,
133 smaia,160 smaia,
134 smcdeleg,161 smcdeleg,
...@@ -165,6 +192,7 @@ pub const Feature = enum {...@@ -165,6 +192,7 @@ pub const Feature = enum {
165 svinval,192 svinval,
166 svnapot,193 svnapot,
167 svpbmt,194 svpbmt,
195 svrsw60t59b,
168 svvptc,196 svvptc,
169 tagged_globals,197 tagged_globals,
170 unaligned_scalar_mem,198 unaligned_scalar_mem,
...@@ -174,6 +202,7 @@ pub const Feature = enum {...@@ -174,6 +202,7 @@ pub const Feature = enum {
174 ventana_veyron,202 ventana_veyron,
175 vl_dependent_latency,203 vl_dependent_latency,
176 vxrm_pipeline_flush,204 vxrm_pipeline_flush,
205 xaifet,
177 xandesbfhcvt,206 xandesbfhcvt,
178 xandesperf,207 xandesperf,
179 xandesvbfhcvt,208 xandesvbfhcvt,
...@@ -181,6 +210,7 @@ pub const Feature = enum {...@@ -181,6 +210,7 @@ pub const Feature = enum {
181 xandesvpackfph,210 xandesvpackfph,
182 xandesvsinth,211 xandesvsinth,
183 xandesvsintload,212 xandesvsintload,
213 xcheriot,
184 xcvalu,214 xcvalu,
185 xcvbi,215 xcvbi,
186 xcvbitmanip,216 xcvbitmanip,
...@@ -215,6 +245,7 @@ pub const Feature = enum {...@@ -215,6 +245,7 @@ pub const Feature = enum {
215 xsfcease,245 xsfcease,
216 xsfmm128t,246 xsfmm128t,
217 xsfmm16t,247 xsfmm16t,
248 xsfmm32a,
218 xsfmm32a16f,249 xsfmm32a16f,
219 xsfmm32a32f,250 xsfmm32a32f,
220 xsfmm32a8f,251 xsfmm32a8f,
...@@ -236,6 +267,7 @@ pub const Feature = enum {...@@ -236,6 +267,7 @@ pub const Feature = enum {
236 xsifivecdiscarddlone,267 xsifivecdiscarddlone,
237 xsifivecflushdlone,268 xsifivecflushdlone,
238 xsmtvdot,269 xsmtvdot,
270 xsmtvdotii,
239 xtheadba,271 xtheadba,
240 xtheadbb,272 xtheadbb,
241 xtheadbs,273 xtheadbs,
...@@ -275,8 +307,6 @@ pub const Feature = enum {...@@ -275,8 +307,6 @@ pub const Feature = enum {
275 zcmp,307 zcmp,
276 zcmt,308 zcmt,
277 zdinx,309 zdinx,
278 zexth_fusion,
279 zextw_fusion,
280 zfa,310 zfa,
281 zfbfmin,311 zfbfmin,
282 zfh,312 zfh,
...@@ -290,6 +320,7 @@ pub const Feature = enum {...@@ -290,6 +320,7 @@ pub const Feature = enum {
290 zicboz,320 zicboz,
291 ziccamoa,321 ziccamoa,
292 ziccamoc,322 ziccamoc,
323 ziccid,
293 ziccif,324 ziccif,
294 zicclsm,325 zicclsm,
295 ziccrse,326 ziccrse,
...@@ -301,7 +332,7 @@ pub const Feature = enum {...@@ -301,7 +332,7 @@ pub const Feature = enum {
301 zihintpause,332 zihintpause,
302 zihpm,333 zihpm,
303 zilsd,334 zilsd,
304 zilsd_4byte_align,335 zilsd_word_align,
305 zimop,336 zimop,
306 zk,337 zk,
307 zkn,338 zkn,
...@@ -382,31 +413,11 @@ pub const all_features = blk: {...@@ -382,31 +413,11 @@ pub const all_features = blk: {
382 .zalrsc,413 .zalrsc,
383 }),414 }),
384 };415 };
385 result[@backingInt(Feature.add_load_fusion)] = .{
386 .llvm_name = "add-load-fusion",
387 .description = "Enable ADD(.UW) + load macrofusion",
388 .dependencies = featureSet(&[_]Feature{}),
389 };
390 result[@backingInt(Feature.addi_load_fusion)] = .{
391 .llvm_name = "addi-load-fusion",
392 .description = "Enable ADDI + load macrofusion",
393 .dependencies = featureSet(&[_]Feature{}),
394 };
395 result[@backingInt(Feature.andes45)] = .{416 result[@backingInt(Feature.andes45)] = .{
396 .llvm_name = "andes45",417 .llvm_name = "andes45",
397 .description = "Andes 45-Series processors",418 .description = "Andes 45-Series processors",
398 .dependencies = featureSet(&[_]Feature{}),419 .dependencies = featureSet(&[_]Feature{}),
399 };420 };
400 result[@backingInt(Feature.auipc_addi_fusion)] = .{
401 .llvm_name = "auipc-addi-fusion",
402 .description = "Enable AUIPC+ADDI macrofusion",
403 .dependencies = featureSet(&[_]Feature{}),
404 };
405 result[@backingInt(Feature.auipc_load_fusion)] = .{
406 .llvm_name = "auipc-load-fusion",
407 .description = "Enable AUIPC + load macrofusion",
408 .dependencies = featureSet(&[_]Feature{}),
409 };
410 result[@backingInt(Feature.b)] = .{421 result[@backingInt(Feature.b)] = .{
411 .llvm_name = "b",422 .llvm_name = "b",
412 .description = "'B' (the collection of the Zba, Zbb, Zbs extensions)",423 .description = "'B' (the collection of the Zba, Zbb, Zbs extensions)",
...@@ -416,11 +427,6 @@ pub const all_features = blk: {...@@ -416,11 +427,6 @@ pub const all_features = blk: {
416 .zbs,427 .zbs,
417 }),428 }),
418 };429 };
419 result[@backingInt(Feature.bfext_fusion)] = .{
420 .llvm_name = "bfext-fusion",
421 .description = "Enable SLLI+SRLI (bitfield extract) macrofusion",
422 .dependencies = featureSet(&[_]Feature{}),
423 };
424 result[@backingInt(Feature.c)] = .{430 result[@backingInt(Feature.c)] = .{
425 .llvm_name = "c",431 .llvm_name = "c",
426 .description = "'C' (Compressed Instructions)",432 .description = "'C' (Compressed Instructions)",
...@@ -475,6 +481,11 @@ pub const all_features = blk: {...@@ -475,6 +481,11 @@ pub const all_features = blk: {
475 .description = "'E' (Embedded Instruction Set with 16 GPRs)",481 .description = "'E' (Embedded Instruction Set with 16 GPRs)",
476 .dependencies = featureSet(&[_]Feature{}),482 .dependencies = featureSet(&[_]Feature{}),
477 };483 };
484 result[@backingInt(Feature.enable_select_opt)] = .{
485 .llvm_name = "enable-select-opt",
486 .description = "Enable the select optimize pass for select loop heuristics",
487 .dependencies = featureSet(&[_]Feature{}),
488 };
478 result[@backingInt(Feature.enable_vsetvli_sched_heuristic)] = .{489 result[@backingInt(Feature.enable_vsetvli_sched_heuristic)] = .{
479 .llvm_name = "enable-vsetvli-sched-heuristic",490 .llvm_name = "enable-vsetvli-sched-heuristic",
480 .description = "Enable vsetvli-based scheduling heuristic",491 .description = "Enable vsetvli-based scheduling heuristic",
...@@ -493,7 +504,12 @@ pub const all_features = blk: {...@@ -493,7 +504,12 @@ pub const all_features = blk: {
493 result[@backingInt(Feature.experimental_p)] = .{504 result[@backingInt(Feature.experimental_p)] = .{
494 .llvm_name = "experimental-p",505 .llvm_name = "experimental-p",
495 .description = "'P' ('Base P' (Packed SIMD))",506 .description = "'P' ('Base P' (Packed SIMD))",
496 .dependencies = featureSet(&[_]Feature{}),507 .dependencies = featureSet(&[_]Feature{
508 .zba,
509 .zbb,
510 .zicsr,
511 .zmmul,
512 }),
497 };513 };
498 result[@backingInt(Feature.experimental_rvm23u32)] = .{514 result[@backingInt(Feature.experimental_rvm23u32)] = .{
499 .llvm_name = "experimental-rvm23u32",515 .llvm_name = "experimental-rvm23u32",
...@@ -522,15 +538,13 @@ pub const all_features = blk: {...@@ -522,15 +538,13 @@ pub const all_features = blk: {
522 .description = "'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)",538 .description = "'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)",
523 .dependencies = featureSet(&[_]Feature{}),539 .dependencies = featureSet(&[_]Feature{}),
524 };540 };
525 result[@backingInt(Feature.experimental_xrivosvisni)] = .{541 result[@backingInt(Feature.experimental_xqccmt)] = .{
526 .llvm_name = "experimental-xrivosvisni",542 .llvm_name = "experimental-xqccmt",
527 .description = "'XRivosVisni' (Rivos Vector Integer Small New)",543 .description = "'Xqccmt' (Qualcomm 16-bit Table Jump)",
528 .dependencies = featureSet(&[_]Feature{}),544 .dependencies = featureSet(&[_]Feature{
529 };545 .zca,
530 result[@backingInt(Feature.experimental_xrivosvizip)] = .{546 .zicsr,
531 .llvm_name = "experimental-xrivosvizip",547 }),
532 .description = "'XRivosVizip' (Rivos Vector Register Zips)",
533 .dependencies = featureSet(&[_]Feature{}),
534 };548 };
535 result[@backingInt(Feature.experimental_xsfmclic)] = .{549 result[@backingInt(Feature.experimental_xsfmclic)] = .{
536 .llvm_name = "experimental-xsfmclic",550 .llvm_name = "experimental-xsfmclic",
...@@ -542,6 +556,11 @@ pub const all_features = blk: {...@@ -542,6 +556,11 @@ pub const all_features = blk: {
542 .description = "'XSfsclic' (SiFive CLIC Supervisor-mode CSRs)",556 .description = "'XSfsclic' (SiFive CLIC Supervisor-mode CSRs)",
543 .dependencies = featureSet(&[_]Feature{}),557 .dependencies = featureSet(&[_]Feature{}),
544 };558 };
559 result[@backingInt(Feature.experimental_y)] = .{
560 .llvm_name = "experimental-y",
561 .description = "'Y' ('Base Y' (CHERI))",
562 .dependencies = featureSet(&[_]Feature{}),
563 };
545 result[@backingInt(Feature.experimental_zibi)] = .{564 result[@backingInt(Feature.experimental_zibi)] = .{
546 .llvm_name = "experimental-zibi",565 .llvm_name = "experimental-zibi",
547 .description = "'Zibi' (Branch with Immediate)",566 .description = "'Zibi' (Branch with Immediate)",
...@@ -562,6 +581,11 @@ pub const all_features = blk: {...@@ -562,6 +581,11 @@ pub const all_features = blk: {
562 .zimop,581 .zimop,
563 }),582 }),
564 };583 };
584 result[@backingInt(Feature.experimental_zvabd)] = .{
585 .llvm_name = "experimental-zvabd",
586 .description = "'Zvabd' (Vector Absolute Difference)",
587 .dependencies = featureSet(&[_]Feature{}),
588 };
565 result[@backingInt(Feature.experimental_zvbc32e)] = .{589 result[@backingInt(Feature.experimental_zvbc32e)] = .{
566 .llvm_name = "experimental-zvbc32e",590 .llvm_name = "experimental-zvbc32e",
567 .description = "'Zvbc32e' (Vector Carryless Multiplication with 32-bits elements)",591 .description = "'Zvbc32e' (Vector Carryless Multiplication with 32-bits elements)",
...@@ -569,6 +593,20 @@ pub const all_features = blk: {...@@ -569,6 +593,20 @@ pub const all_features = blk: {
569 .zve32x,593 .zve32x,
570 }),594 }),
571 };595 };
596 result[@backingInt(Feature.experimental_zvdot4a8i)] = .{
597 .llvm_name = "experimental-zvdot4a8i",
598 .description = "'Zvdot4a8i' (Vector 4-element Dot Product of packed 8-bit Integers)",
599 .dependencies = featureSet(&[_]Feature{
600 .zve32x,
601 }),
602 };
603 result[@backingInt(Feature.experimental_zvfbdota32f)] = .{
604 .llvm_name = "experimental-zvfbdota32f",
605 .description = "'Zvfbdota32f' (FP32 batched dot-product extension)",
606 .dependencies = featureSet(&[_]Feature{
607 .zve32f,
608 }),
609 };
572 result[@backingInt(Feature.experimental_zvfbfa)] = .{610 result[@backingInt(Feature.experimental_zvfbfa)] = .{
573 .llvm_name = "experimental-zvfbfa",611 .llvm_name = "experimental-zvfbfa",
574 .description = "'Zvfbfa' (Additional BF16 vector compute support)",612 .description = "'Zvfbfa' (Additional BF16 vector compute support)",
...@@ -584,6 +622,34 @@ pub const all_features = blk: {...@@ -584,6 +622,34 @@ pub const all_features = blk: {
584 .zve32f,622 .zve32f,
585 }),623 }),
586 };624 };
625 result[@backingInt(Feature.experimental_zvfqwbdota8f)] = .{
626 .llvm_name = "experimental-zvfqwbdota8f",
627 .description = "'Zvfqwbdota8f' (OCP FP8 batched dot-product extension)",
628 .dependencies = featureSet(&[_]Feature{
629 .zve32f,
630 }),
631 };
632 result[@backingInt(Feature.experimental_zvfqwdota8f)] = .{
633 .llvm_name = "experimental-zvfqwdota8f",
634 .description = "'Zvfqwdota8f' (OCP FP8 Dot-Product)",
635 .dependencies = featureSet(&[_]Feature{
636 .zve32f,
637 }),
638 };
639 result[@backingInt(Feature.experimental_zvfwbdota16bf)] = .{
640 .llvm_name = "experimental-zvfwbdota16bf",
641 .description = "'Zvfwbdota16bf' (BF16 batched dot-product extension)",
642 .dependencies = featureSet(&[_]Feature{
643 .zve32f,
644 }),
645 };
646 result[@backingInt(Feature.experimental_zvfwdota16bf)] = .{
647 .llvm_name = "experimental-zvfwdota16bf",
648 .description = "'Zvfwdota16bf' (BF16 Dot-Product)",
649 .dependencies = featureSet(&[_]Feature{
650 .zve32f,
651 }),
652 };
587 result[@backingInt(Feature.experimental_zvkgs)] = .{653 result[@backingInt(Feature.experimental_zvkgs)] = .{
588 .llvm_name = "experimental-zvkgs",654 .llvm_name = "experimental-zvkgs",
589 .description = "'Zvkgs' (Vector-Scalar GCM instructions for Cryptography)",655 .description = "'Zvkgs' (Vector-Scalar GCM instructions for Cryptography)",
...@@ -591,9 +657,65 @@ pub const all_features = blk: {...@@ -591,9 +657,65 @@ pub const all_features = blk: {
591 .zvkg,657 .zvkg,
592 }),658 }),
593 };659 };
594 result[@backingInt(Feature.experimental_zvqdotq)] = .{660 result[@backingInt(Feature.experimental_zvqwbdota16i)] = .{
595 .llvm_name = "experimental-zvqdotq",661 .llvm_name = "experimental-zvqwbdota16i",
596 .description = "'Zvqdotq' (Vector quad widening 4D Dot Product)",662 .description = "'Zvqwbdota16i' (16-bit integer batched dot-product extension)",
663 .dependencies = featureSet(&[_]Feature{
664 .zve64x,
665 }),
666 };
667 result[@backingInt(Feature.experimental_zvqwbdota8i)] = .{
668 .llvm_name = "experimental-zvqwbdota8i",
669 .description = "'Zvqwbdota8i' (8-bit integer batched dot-product extension)",
670 .dependencies = featureSet(&[_]Feature{
671 .zve32x,
672 }),
673 };
674 result[@backingInt(Feature.experimental_zvqwdota16i)] = .{
675 .llvm_name = "experimental-zvqwdota16i",
676 .description = "'Zvqwdota16i' (16-bit Integer Dot-Product)",
677 .dependencies = featureSet(&[_]Feature{
678 .zve64x,
679 }),
680 };
681 result[@backingInt(Feature.experimental_zvqwdota8i)] = .{
682 .llvm_name = "experimental-zvqwdota8i",
683 .description = "'Zvqwdota8i' (8-bit Integer Dot-Product)",
684 .dependencies = featureSet(&[_]Feature{
685 .zve32x,
686 }),
687 };
688 result[@backingInt(Feature.experimental_zvvfmm)] = .{
689 .llvm_name = "experimental-zvvfmm",
690 .description = "'Zvvfmm' (Floating-Point Matrix Multiply-Accumulate)",
691 .dependencies = featureSet(&[_]Feature{
692 .zve32f,
693 }),
694 };
695 result[@backingInt(Feature.experimental_zvvmm)] = .{
696 .llvm_name = "experimental-zvvmm",
697 .description = "'Zvvmm' (Integer Matrix Multiply-Accumulate)",
698 .dependencies = featureSet(&[_]Feature{
699 .zve32x,
700 }),
701 };
702 result[@backingInt(Feature.experimental_zvvmtls)] = .{
703 .llvm_name = "experimental-zvvmtls",
704 .description = "'Zvvmtls' (Matrix Tile Load/Store)",
705 .dependencies = featureSet(&[_]Feature{
706 .zve32x,
707 }),
708 };
709 result[@backingInt(Feature.experimental_zvvmttls)] = .{
710 .llvm_name = "experimental-zvvmttls",
711 .description = "'Zvvmttls' (Transposing Matrix Tile Load/Store)",
712 .dependencies = featureSet(&[_]Feature{
713 .zve32x,
714 }),
715 };
716 result[@backingInt(Feature.experimental_zvzip)] = .{
717 .llvm_name = "experimental-zvzip",
718 .description = "'Zvzip' (Vector Reordering Structured Data)",
597 .dependencies = featureSet(&[_]Feature{719 .dependencies = featureSet(&[_]Feature{
598 .zve32x,720 .zve32x,
599 }),721 }),
...@@ -610,36 +732,116 @@ pub const all_features = blk: {...@@ -610,36 +732,116 @@ pub const all_features = blk: {
610 .description = "Assume that lock-free native-width atomics are available",732 .description = "Assume that lock-free native-width atomics are available",
611 .dependencies = featureSet(&[_]Feature{}),733 .dependencies = featureSet(&[_]Feature{}),
612 };734 };
613 result[@backingInt(Feature.h)] = .{735 result[@backingInt(Feature.fusion_add_load)] = .{
614 .llvm_name = "h",736 .llvm_name = "fusion-add-load",
615 .description = "'H' (Hypervisor)",737 .description = "Enable ADD(.UW) + load macrofusion",
616 .dependencies = featureSet(&[_]Feature{}),738 .dependencies = featureSet(&[_]Feature{}),
617 };739 };
618 result[@backingInt(Feature.i)] = .{740 result[@backingInt(Feature.fusion_add_mem)] = .{
619 .llvm_name = "i",741 .llvm_name = "fusion-add-mem",
620 .description = "'I' (Base Integer Instruction Set)",742 .description = "Enable ADD+LOAD/STORE macrofusion",
743 .dependencies = featureSet(&[_]Feature{}),
744 };
745 result[@backingInt(Feature.fusion_addi_load)] = .{
746 .llvm_name = "fusion-addi-load",
747 .description = "Enable ADDI + load macrofusion",
748 .dependencies = featureSet(&[_]Feature{}),
749 };
750 result[@backingInt(Feature.fusion_auipc_addi)] = .{
751 .llvm_name = "fusion-auipc-addi",
752 .description = "Enable AUIPC+ADDI macrofusion",
753 .dependencies = featureSet(&[_]Feature{}),
754 };
755 result[@backingInt(Feature.fusion_auipc_load)] = .{
756 .llvm_name = "fusion-auipc-load",
757 .description = "Enable AUIPC + load macrofusion",
758 .dependencies = featureSet(&[_]Feature{}),
759 };
760 result[@backingInt(Feature.fusion_bfext)] = .{
761 .llvm_name = "fusion-bfext",
762 .description = "Enable SLLI+SRLI (bitfield extract) macrofusion",
621 .dependencies = featureSet(&[_]Feature{}),763 .dependencies = featureSet(&[_]Feature{}),
622 };764 };
623 result[@backingInt(Feature.ld_add_fusion)] = .{765 result[@backingInt(Feature.fusion_ld_add)] = .{
624 .llvm_name = "ld-add-fusion",766 .llvm_name = "fusion-ld-add",
625 .description = "Enable LD+ADD macrofusion",767 .description = "Enable LD+ADD macrofusion",
626 .dependencies = featureSet(&[_]Feature{}),768 .dependencies = featureSet(&[_]Feature{}),
627 };769 };
628 result[@backingInt(Feature.log_vrgather)] = .{770 result[@backingInt(Feature.fusion_logic_imm_reg)] = .{
629 .llvm_name = "log-vrgather",771 .llvm_name = "fusion-logic-imm-reg",
630 .description = "Has vrgather.vv with LMUL*log2(LMUL) latency",772 .description = "Enable ANDI/ORI/XORI+AND/OR/XOR macrofusion",
773 .dependencies = featureSet(&[_]Feature{}),
774 };
775 result[@backingInt(Feature.fusion_logic_reg_imm)] = .{
776 .llvm_name = "fusion-logic-reg-imm",
777 .description = "Enable AND/OR/XOR+ANDI/ORI/XORI macrofusion",
778 .dependencies = featureSet(&[_]Feature{}),
779 };
780 result[@backingInt(Feature.fusion_logic_reg_reg)] = .{
781 .llvm_name = "fusion-logic-reg-reg",
782 .description = "Enable AND/OR/XOR+AND/OR/XOR macrofusion",
631 .dependencies = featureSet(&[_]Feature{}),783 .dependencies = featureSet(&[_]Feature{}),
632 };784 };
633 result[@backingInt(Feature.lui_addi_fusion)] = .{785 result[@backingInt(Feature.fusion_lui_addi)] = .{
634 .llvm_name = "lui-addi-fusion",786 .llvm_name = "fusion-lui-addi",
635 .description = "Enable LUI+ADDI macro fusion",787 .description = "Enable LUI+ADDI macro fusion",
636 .dependencies = featureSet(&[_]Feature{}),788 .dependencies = featureSet(&[_]Feature{}),
637 };789 };
638 result[@backingInt(Feature.lui_load_fusion)] = .{790 result[@backingInt(Feature.fusion_lui_load)] = .{
639 .llvm_name = "lui-load-fusion",791 .llvm_name = "fusion-lui-load",
640 .description = "Enable LUI + load macrofusion",792 .description = "Enable LUI + load macrofusion",
641 .dependencies = featureSet(&[_]Feature{}),793 .dependencies = featureSet(&[_]Feature{}),
642 };794 };
795 result[@backingInt(Feature.fusion_mul_add)] = .{
796 .llvm_name = "fusion-mul-add",
797 .description = "Enable MUL+ADD macrofusion",
798 .dependencies = featureSet(&[_]Feature{}),
799 };
800 result[@backingInt(Feature.fusion_qc_e_li_load_store)] = .{
801 .llvm_name = "fusion-qc-e-li-load-store",
802 .description = "Enable QC.E.LI + Load/Store macrofusion",
803 .dependencies = featureSet(&[_]Feature{}),
804 };
805 result[@backingInt(Feature.fusion_shift_bit_extract)] = .{
806 .llvm_name = "fusion-shift-bit-extract",
807 .description = "Enable SLLI+SRLI/SRAI macrofusion",
808 .dependencies = featureSet(&[_]Feature{}),
809 };
810 result[@backingInt(Feature.fusion_shifted_zextw)] = .{
811 .llvm_name = "fusion-shifted-zextw",
812 .description = "Enable SLLI+SRLI to be fused when computing (shifted) word zero extension",
813 .dependencies = featureSet(&[_]Feature{}),
814 };
815 result[@backingInt(Feature.fusion_shxadd_load)] = .{
816 .llvm_name = "fusion-shxadd-load",
817 .description = "Enable SH(1|2|3)ADD(.UW) + load macrofusion",
818 .dependencies = featureSet(&[_]Feature{}),
819 };
820 result[@backingInt(Feature.fusion_zexth)] = .{
821 .llvm_name = "fusion-zexth",
822 .description = "Enable SLLI+SRLI to be fused to zero extension of halfword",
823 .dependencies = featureSet(&[_]Feature{}),
824 };
825 result[@backingInt(Feature.fusion_zextw)] = .{
826 .llvm_name = "fusion-zextw",
827 .description = "Enable SLLI+SRLI to be fused to zero extension of word",
828 .dependencies = featureSet(&[_]Feature{}),
829 };
830 result[@backingInt(Feature.h)] = .{
831 .llvm_name = "h",
832 .description = "'H' (Hypervisor)",
833 .dependencies = featureSet(&[_]Feature{}),
834 };
835 result[@backingInt(Feature.i)] = .{
836 .llvm_name = "i",
837 .description = "'I' (Base Integer Instruction Set)",
838 .dependencies = featureSet(&[_]Feature{}),
839 };
840 result[@backingInt(Feature.log_vrgather)] = .{
841 .llvm_name = "log-vrgather",
842 .description = "Has vrgather.vv with LMUL*log2(LMUL) latency",
843 .dependencies = featureSet(&[_]Feature{}),
844 };
643 result[@backingInt(Feature.m)] = .{845 result[@backingInt(Feature.m)] = .{
644 .llvm_name = "m",846 .llvm_name = "m",
645 .description = "'M' (Integer Multiplication and Division)",847 .description = "'M' (Integer Multiplication and Division)",
...@@ -654,7 +856,7 @@ pub const all_features = blk: {...@@ -654,7 +856,7 @@ pub const all_features = blk: {
654 };856 };
655 result[@backingInt(Feature.no_default_unroll)] = .{857 result[@backingInt(Feature.no_default_unroll)] = .{
656 .llvm_name = "no-default-unroll",858 .llvm_name = "no-default-unroll",
657 .description = "Disable default unroll preference.",859 .description = "Disable default unroll preference",
658 .dependencies = featureSet(&[_]Feature{}),860 .dependencies = featureSet(&[_]Feature{}),
659 };861 };
660 result[@backingInt(Feature.no_sink_splat_operands)] = .{862 result[@backingInt(Feature.no_sink_splat_operands)] = .{
...@@ -664,7 +866,7 @@ pub const all_features = blk: {...@@ -664,7 +866,7 @@ pub const all_features = blk: {
664 };866 };
665 result[@backingInt(Feature.no_trailing_seq_cst_fence)] = .{867 result[@backingInt(Feature.no_trailing_seq_cst_fence)] = .{
666 .llvm_name = "no-trailing-seq-cst-fence",868 .llvm_name = "no-trailing-seq-cst-fence",
667 .description = "Disable trailing fence for seq-cst store.",869 .description = "Disable trailing fence for seq-cst store",
668 .dependencies = featureSet(&[_]Feature{}),870 .dependencies = featureSet(&[_]Feature{}),
669 };871 };
670 result[@backingInt(Feature.optimized_nf2_segment_load_store)] = .{872 result[@backingInt(Feature.optimized_nf2_segment_load_store)] = .{
...@@ -717,6 +919,11 @@ pub const all_features = blk: {...@@ -717,6 +919,11 @@ pub const all_features = blk: {
717 .description = "Prefer likely predicted branches over selects",919 .description = "Prefer likely predicted branches over selects",
718 .dependencies = featureSet(&[_]Feature{}),920 .dependencies = featureSet(&[_]Feature{}),
719 };921 };
922 result[@backingInt(Feature.prefer_ascending_load_store)] = .{
923 .llvm_name = "prefer-ascending-load-store",
924 .description = "Prefer ascending load/store order for better clustering and performance",
925 .dependencies = featureSet(&[_]Feature{}),
926 };
720 result[@backingInt(Feature.prefer_vsetvli_over_read_vlenb)] = .{927 result[@backingInt(Feature.prefer_vsetvli_over_read_vlenb)] = .{
721 .llvm_name = "prefer-vsetvli-over-read-vlenb",928 .llvm_name = "prefer-vsetvli-over-read-vlenb",
722 .description = "Prefer vsetvli over read vlenb CSR to calculate VLEN",929 .description = "Prefer vsetvli over read vlenb CSR to calculate VLEN",
...@@ -736,7 +943,7 @@ pub const all_features = blk: {...@@ -736,7 +943,7 @@ pub const all_features = blk: {
736 };943 };
737 result[@backingInt(Feature.relax)] = .{944 result[@backingInt(Feature.relax)] = .{
738 .llvm_name = "relax",945 .llvm_name = "relax",
739 .description = "Enable Linker relaxation.",946 .description = "Enable Linker relaxation",
740 .dependencies = featureSet(&[_]Feature{}),947 .dependencies = featureSet(&[_]Feature{}),
741 };948 };
742 result[@backingInt(Feature.reserve_x1)] = .{949 result[@backingInt(Feature.reserve_x1)] = .{
...@@ -1187,7 +1394,7 @@ pub const all_features = blk: {...@@ -1187,7 +1394,7 @@ pub const all_features = blk: {
1187 };1394 };
1188 result[@backingInt(Feature.save_restore)] = .{1395 result[@backingInt(Feature.save_restore)] = .{
1189 .llvm_name = "save-restore",1396 .llvm_name = "save-restore",
1190 .description = "Enable save/restore.",1397 .description = "Enable save/restore",
1191 .dependencies = featureSet(&[_]Feature{}),1398 .dependencies = featureSet(&[_]Feature{}),
1192 };1399 };
1193 result[@backingInt(Feature.sdext)] = .{1400 result[@backingInt(Feature.sdext)] = .{
...@@ -1224,11 +1431,6 @@ pub const all_features = blk: {...@@ -1224,11 +1431,6 @@ pub const all_features = blk: {
1224 .description = "'Shgatpa' (SvNNx4 mode supported for all modes supported by satp, as well as Bare)",1431 .description = "'Shgatpa' (SvNNx4 mode supported for all modes supported by satp, as well as Bare)",
1225 .dependencies = featureSet(&[_]Feature{}),1432 .dependencies = featureSet(&[_]Feature{}),
1226 };1433 };
1227 result[@backingInt(Feature.shifted_zextw_fusion)] = .{
1228 .llvm_name = "shifted-zextw-fusion",
1229 .description = "Enable SLLI+SRLI to be fused when computing (shifted) word zero extension",
1230 .dependencies = featureSet(&[_]Feature{}),
1231 };
1232 result[@backingInt(Feature.shlcofideleg)] = .{1434 result[@backingInt(Feature.shlcofideleg)] = .{
1233 .llvm_name = "shlcofideleg",1435 .llvm_name = "shlcofideleg",
1234 .description = "'Shlcofideleg' (Delegating LCOFI Interrupts to VS-mode)",1436 .description = "'Shlcofideleg' (Delegating LCOFI Interrupts to VS-mode)",
...@@ -1253,6 +1455,13 @@ pub const all_features = blk: {...@@ -1253,6 +1455,13 @@ pub const all_features = blk: {
1253 .short_forward_branch_ialu,1455 .short_forward_branch_ialu,
1254 }),1456 }),
1255 };1457 };
1458 result[@backingInt(Feature.short_forward_branch_imm)] = .{
1459 .llvm_name = "short-forward-branch-imm",
1460 .description = "Enable short forward branch optimization for branches with immediates",
1461 .dependencies = featureSet(&[_]Feature{
1462 .short_forward_branch_ialu,
1463 }),
1464 };
1256 result[@backingInt(Feature.short_forward_branch_imul)] = .{1465 result[@backingInt(Feature.short_forward_branch_imul)] = .{
1257 .llvm_name = "short-forward-branch-imul",1466 .llvm_name = "short-forward-branch-imul",
1258 .description = "Enable short forward branch optimization for MUL instruction",1467 .description = "Enable short forward branch optimization for MUL instruction",
...@@ -1280,11 +1489,6 @@ pub const all_features = blk: {...@@ -1280,11 +1489,6 @@ pub const all_features = blk: {
1280 .description = "'Shvstvecd' (vstvec supports Direct mode)",1489 .description = "'Shvstvecd' (vstvec supports Direct mode)",
1281 .dependencies = featureSet(&[_]Feature{}),1490 .dependencies = featureSet(&[_]Feature{}),
1282 };1491 };
1283 result[@backingInt(Feature.shxadd_load_fusion)] = .{
1284 .llvm_name = "shxadd-load-fusion",
1285 .description = "Enable SH(1|2|3)ADD(.UW) + load macrofusion",
1286 .dependencies = featureSet(&[_]Feature{}),
1287 };
1288 result[@backingInt(Feature.single_element_vec_fp64)] = .{1492 result[@backingInt(Feature.single_element_vec_fp64)] = .{
1289 .llvm_name = "single-element-vec-fp64",1493 .llvm_name = "single-element-vec-fp64",
1290 .description = "Certain vector FP64 operations produce a single result element per cycle",1494 .description = "Certain vector FP64 operations produce a single result element per cycle",
...@@ -1473,6 +1677,11 @@ pub const all_features = blk: {...@@ -1473,6 +1677,11 @@ pub const all_features = blk: {
1473 .description = "'Svpbmt' (Page-Based Memory Types)",1677 .description = "'Svpbmt' (Page-Based Memory Types)",
1474 .dependencies = featureSet(&[_]Feature{}),1678 .dependencies = featureSet(&[_]Feature{}),
1475 };1679 };
1680 result[@backingInt(Feature.svrsw60t59b)] = .{
1681 .llvm_name = "svrsw60t59b",
1682 .description = "'Svrsw60t59b' (PTE Reserved-for-Software Bits 60-59)",
1683 .dependencies = featureSet(&[_]Feature{}),
1684 };
1476 result[@backingInt(Feature.svvptc)] = .{1685 result[@backingInt(Feature.svvptc)] = .{
1477 .llvm_name = "svvptc",1686 .llvm_name = "svvptc",
1478 .description = "'Svvptc' (Obviating Memory-Management Instructions after Marking PTEs Valid)",1687 .description = "'Svvptc' (Obviating Memory-Management Instructions after Marking PTEs Valid)",
...@@ -1521,6 +1730,13 @@ pub const all_features = blk: {...@@ -1521,6 +1730,13 @@ pub const all_features = blk: {
1521 .description = "VXRM writes causes pipeline flush",1730 .description = "VXRM writes causes pipeline flush",
1522 .dependencies = featureSet(&[_]Feature{}),1731 .dependencies = featureSet(&[_]Feature{}),
1523 };1732 };
1733 result[@backingInt(Feature.xaifet)] = .{
1734 .llvm_name = "xaifet",
1735 .description = "'XAIFET' (AI Foundry ET Extension)",
1736 .dependencies = featureSet(&[_]Feature{
1737 .f,
1738 }),
1739 };
1524 result[@backingInt(Feature.xandesbfhcvt)] = .{1740 result[@backingInt(Feature.xandesbfhcvt)] = .{
1525 .llvm_name = "xandesbfhcvt",1741 .llvm_name = "xandesbfhcvt",
1526 .description = "'XAndesBFHCvt' (Andes Scalar BFLOAT16 Conversion Extension)",1742 .description = "'XAndesBFHCvt' (Andes Scalar BFLOAT16 Conversion Extension)",
...@@ -1568,6 +1784,15 @@ pub const all_features = blk: {...@@ -1568,6 +1784,15 @@ pub const all_features = blk: {
1568 .zve32x,1784 .zve32x,
1569 }),1785 }),
1570 };1786 };
1787 result[@backingInt(Feature.xcheriot)] = .{
1788 .llvm_name = "xcheriot",
1789 .description = "'XCheriot' (CHERIoT extension)",
1790 .dependencies = featureSet(&[_]Feature{
1791 .e,
1792 .m,
1793 .zca,
1794 }),
1795 };
1571 result[@backingInt(Feature.xcvalu)] = .{1796 result[@backingInt(Feature.xcvalu)] = .{
1572 .llvm_name = "xcvalu",1797 .llvm_name = "xcvalu",
1573 .description = "'XCValu' (CORE-V ALU Operations)",1798 .description = "'XCValu' (CORE-V ALU Operations)",
...@@ -1787,6 +2012,15 @@ pub const all_features = blk: {...@@ -1787,6 +2012,15 @@ pub const all_features = blk: {
1787 .zvl64b,2012 .zvl64b,
1788 }),2013 }),
1789 };2014 };
2015 result[@backingInt(Feature.xsfmm32a)] = .{
2016 .llvm_name = "xsfmm32a",
2017 .description = "'XSfmm32a' (TEW=32-bit accumulation operands - int: 8b; float: fp16, bf16, fp32)",
2018 .dependencies = featureSet(&[_]Feature{
2019 .xsfmm32a16f,
2020 .xsfmm32a32f,
2021 .xsfmm32a8i,
2022 }),
2023 };
1790 result[@backingInt(Feature.xsfmm32a16f)] = .{2024 result[@backingInt(Feature.xsfmm32a16f)] = .{
1791 .llvm_name = "xsfmm32a16f",2025 .llvm_name = "xsfmm32a16f",
1792 .description = "'XSfmm32a16f' (TEW=32-bit accumulation, operands - float: 16b, widen=2 (IEEE, BF))",2026 .description = "'XSfmm32a16f' (TEW=32-bit accumulation, operands - float: 16b, widen=2 (IEEE, BF))",
...@@ -1938,6 +2172,13 @@ pub const all_features = blk: {...@@ -1938,6 +2172,13 @@ pub const all_features = blk: {
1938 .zve32f,2172 .zve32f,
1939 }),2173 }),
1940 };2174 };
2175 result[@backingInt(Feature.xsmtvdotii)] = .{
2176 .llvm_name = "xsmtvdotii",
2177 .description = "'XSMTVDotII' (SpacemiT Vector Extension for Matrix 2.0)",
2178 .dependencies = featureSet(&[_]Feature{
2179 .zve32f,
2180 }),
2181 };
1941 result[@backingInt(Feature.xtheadba)] = .{2182 result[@backingInt(Feature.xtheadba)] = .{
1942 .llvm_name = "xtheadba",2183 .llvm_name = "xtheadba",
1943 .description = "'XTHeadBa' (T-Head address calculation instructions)",2184 .description = "'XTHeadBa' (T-Head address calculation instructions)",
...@@ -2069,7 +2310,9 @@ pub const all_features = blk: {...@@ -2069,7 +2310,9 @@ pub const all_features = blk: {
2069 result[@backingInt(Feature.zbc)] = .{2310 result[@backingInt(Feature.zbc)] = .{
2070 .llvm_name = "zbc",2311 .llvm_name = "zbc",
2071 .description = "'Zbc' (Carry-Less Multiplication)",2312 .description = "'Zbc' (Carry-Less Multiplication)",
2072 .dependencies = featureSet(&[_]Feature{}),2313 .dependencies = featureSet(&[_]Feature{
2314 .zbkc,
2315 }),
2073 };2316 };
2074 result[@backingInt(Feature.zbkb)] = .{2317 result[@backingInt(Feature.zbkb)] = .{
2075 .llvm_name = "zbkb",2318 .llvm_name = "zbkb",
...@@ -2165,16 +2408,6 @@ pub const all_features = blk: {...@@ -2165,16 +2408,6 @@ pub const all_features = blk: {
2165 .zfinx,2408 .zfinx,
2166 }),2409 }),
2167 };2410 };
2168 result[@backingInt(Feature.zexth_fusion)] = .{
2169 .llvm_name = "zexth-fusion",
2170 .description = "Enable SLLI+SRLI to be fused to zero extension of halfword",
2171 .dependencies = featureSet(&[_]Feature{}),
2172 };
2173 result[@backingInt(Feature.zextw_fusion)] = .{
2174 .llvm_name = "zextw-fusion",
2175 .description = "Enable SLLI+SRLI to be fused to zero extension of word",
2176 .dependencies = featureSet(&[_]Feature{}),
2177 };
2178 result[@backingInt(Feature.zfa)] = .{2411 result[@backingInt(Feature.zfa)] = .{
2179 .llvm_name = "zfa",2412 .llvm_name = "zfa",
2180 .description = "'Zfa' (Additional Floating-Point)",2413 .description = "'Zfa' (Additional Floating-Point)",
...@@ -2254,6 +2487,13 @@ pub const all_features = blk: {...@@ -2254,6 +2487,13 @@ pub const all_features = blk: {
2254 .description = "'Ziccamoc' (Main Memory Supports Atomics in Zacas)",2487 .description = "'Ziccamoc' (Main Memory Supports Atomics in Zacas)",
2255 .dependencies = featureSet(&[_]Feature{}),2488 .dependencies = featureSet(&[_]Feature{}),
2256 };2489 };
2490 result[@backingInt(Feature.ziccid)] = .{
2491 .llvm_name = "ziccid",
2492 .description = "'Ziccid' (Instruction/Data Coherence and Consistency)",
2493 .dependencies = featureSet(&[_]Feature{
2494 .ziccif,
2495 }),
2496 };
2257 result[@backingInt(Feature.ziccif)] = .{2497 result[@backingInt(Feature.ziccif)] = .{
2258 .llvm_name = "ziccif",2498 .llvm_name = "ziccif",
2259 .description = "'Ziccif' (Main Memory Supports Instruction Fetch with Atomicity Requirement)",2499 .description = "'Ziccif' (Main Memory Supports Instruction Fetch with Atomicity Requirement)",
...@@ -2313,8 +2553,8 @@ pub const all_features = blk: {...@@ -2313,8 +2553,8 @@ pub const all_features = blk: {
2313 .description = "'Zilsd' (Load/Store Pair Instructions)",2553 .description = "'Zilsd' (Load/Store Pair Instructions)",
2314 .dependencies = featureSet(&[_]Feature{}),2554 .dependencies = featureSet(&[_]Feature{}),
2315 };2555 };
2316 result[@backingInt(Feature.zilsd_4byte_align)] = .{2556 result[@backingInt(Feature.zilsd_word_align)] = .{
2317 .llvm_name = "zilsd-4byte-align",2557 .llvm_name = "zilsd-word-align",
2318 .description = "Allow 4-byte alignment for Zilsd LD/SD instructions",2558 .description = "Allow 4-byte alignment for Zilsd LD/SD instructions",
2319 .dependencies = featureSet(&[_]Feature{}),2559 .dependencies = featureSet(&[_]Feature{}),
2320 };2560 };
...@@ -2543,6 +2783,7 @@ pub const all_features = blk: {...@@ -2543,6 +2783,7 @@ pub const all_features = blk: {
2543 .description = "'Zvknhb' (Vector SHA-2 (SHA-256 and SHA-512))",2783 .description = "'Zvknhb' (Vector SHA-2 (SHA-256 and SHA-512))",
2544 .dependencies = featureSet(&[_]Feature{2784 .dependencies = featureSet(&[_]Feature{
2545 .zve64x,2785 .zve64x,
2786 .zvknha,
2546 }),2787 }),
2547 };2788 };
2548 result[@backingInt(Feature.zvks)] = .{2789 result[@backingInt(Feature.zvks)] = .{
...@@ -2681,6 +2922,16 @@ pub const all_features = blk: {...@@ -2681,6 +2922,16 @@ pub const all_features = blk: {
2681};2922};
26822923
2683pub const cpu = struct {2924pub const cpu = struct {
2925 pub const an_erbium: CpuModel = .{
2926 .name = "an_erbium",
2927 .llvm_name = "an-erbium",
2928 .features = featureSet(&[_]Feature{
2929 .@"64bit",
2930 .c,
2931 .m,
2932 .xaifet,
2933 }),
2934 };
2684 pub const andes_45_series: CpuModel = .{2935 pub const andes_45_series: CpuModel = .{
2685 .name = "andes_45_series",2936 .name = "andes_45_series",
2686 .llvm_name = "andes-45-series",2937 .llvm_name = "andes-45-series",
...@@ -2833,6 +3084,16 @@ pub const cpu = struct {...@@ -2833,6 +3084,16 @@ pub const cpu = struct {
2833 .m,3084 .m,
2834 }),3085 }),
2835 };3086 };
3087 pub const et_soc1: CpuModel = .{
3088 .name = "et_soc1",
3089 .llvm_name = "et-soc1",
3090 .features = featureSet(&[_]Feature{
3091 .@"64bit",
3092 .c,
3093 .m,
3094 .xaifet,
3095 }),
3096 };
2836 pub const generic: CpuModel = .{3097 pub const generic: CpuModel = .{
2837 .name = "generic",3098 .name = "generic",
2838 .llvm_name = "generic",3099 .llvm_name = "generic",
...@@ -2848,6 +3109,7 @@ pub const cpu = struct {...@@ -2848,6 +3109,7 @@ pub const cpu = struct {
2848 .llvm_name = "generic-rv32",3109 .llvm_name = "generic-rv32",
2849 .features = featureSet(&[_]Feature{3110 .features = featureSet(&[_]Feature{
2850 .@"32bit",3111 .@"32bit",
3112 .enable_select_opt,
2851 .i,3113 .i,
2852 .optimized_nf2_segment_load_store,3114 .optimized_nf2_segment_load_store,
2853 }),3115 }),
...@@ -2857,6 +3119,7 @@ pub const cpu = struct {...@@ -2857,6 +3119,7 @@ pub const cpu = struct {
2857 .llvm_name = "generic-rv64",3119 .llvm_name = "generic-rv64",
2858 .features = featureSet(&[_]Feature{3120 .features = featureSet(&[_]Feature{
2859 .@"64bit",3121 .@"64bit",
3122 .enable_select_opt,
2860 .i,3123 .i,
2861 .optimized_nf2_segment_load_store,3124 .optimized_nf2_segment_load_store,
2862 }),3125 }),
...@@ -3020,13 +3283,13 @@ pub const cpu = struct {...@@ -3020,13 +3283,13 @@ pub const cpu = struct {
3020 .features = featureSet(&[_]Feature{3283 .features = featureSet(&[_]Feature{
3021 .@"64bit",3284 .@"64bit",
3022 .a,3285 .a,
3023 .auipc_addi_fusion,
3024 .b,3286 .b,
3025 .c,3287 .c,
3026 .conditional_cmv_fusion,3288 .conditional_cmv_fusion,
3027 .d,3289 .d,
3290 .fusion_auipc_addi,
3291 .fusion_lui_addi,
3028 .i,3292 .i,
3029 .lui_addi_fusion,
3030 .m,3293 .m,
3031 .no_default_unroll,3294 .no_default_unroll,
3032 .unaligned_scalar_mem,3295 .unaligned_scalar_mem,
...@@ -3055,12 +3318,12 @@ pub const cpu = struct {...@@ -3055,12 +3318,12 @@ pub const cpu = struct {
3055 .features = featureSet(&[_]Feature{3318 .features = featureSet(&[_]Feature{
3056 .@"64bit",3319 .@"64bit",
3057 .a,3320 .a,
3058 .auipc_addi_fusion,
3059 .b,3321 .b,
3060 .c,3322 .c,
3061 .conditional_cmv_fusion,3323 .conditional_cmv_fusion,
3324 .fusion_auipc_addi,
3325 .fusion_lui_addi,
3062 .i,3326 .i,
3063 .lui_addi_fusion,
3064 .m,3327 .m,
3065 .no_default_unroll,3328 .no_default_unroll,
3066 .no_sink_splat_operands,3329 .no_sink_splat_operands,
...@@ -3099,12 +3362,13 @@ pub const cpu = struct {...@@ -3099,12 +3362,13 @@ pub const cpu = struct {
3099 .features = featureSet(&[_]Feature{3362 .features = featureSet(&[_]Feature{
3100 .@"64bit",3363 .@"64bit",
3101 .a,3364 .a,
3102 .auipc_addi_fusion,
3103 .c,3365 .c,
3104 .conditional_cmv_fusion,3366 .conditional_cmv_fusion,
3105 .d,3367 .d,
3368 .enable_select_opt,
3369 .fusion_auipc_addi,
3370 .fusion_lui_addi,
3106 .i,3371 .i,
3107 .lui_addi_fusion,
3108 .m,3372 .m,
3109 .no_default_unroll,3373 .no_default_unroll,
3110 .use_postra_scheduler,3374 .use_postra_scheduler,
...@@ -3119,12 +3383,12 @@ pub const cpu = struct {...@@ -3119,12 +3383,12 @@ pub const cpu = struct {
3119 .features = featureSet(&[_]Feature{3383 .features = featureSet(&[_]Feature{
3120 .@"64bit",3384 .@"64bit",
3121 .a,3385 .a,
3122 .auipc_addi_fusion,
3123 .b,3386 .b,
3124 .c,3387 .c,
3125 .conditional_cmv_fusion,3388 .conditional_cmv_fusion,
3389 .fusion_auipc_addi,
3390 .fusion_lui_addi,
3126 .i,3391 .i,
3127 .lui_addi_fusion,
3128 .m,3392 .m,
3129 .no_default_unroll,3393 .no_default_unroll,
3130 .no_sink_splat_operands,3394 .no_sink_splat_operands,
...@@ -3155,18 +3419,18 @@ pub const cpu = struct {...@@ -3155,18 +3419,18 @@ pub const cpu = struct {
3155 .zvksg,3419 .zvksg,
3156 }),3420 }),
3157 };3421 };
3158 pub const sifive_p870: CpuModel = .{3422 pub const sifive_p870_d: CpuModel = .{
3159 .name = "sifive_p870",3423 .name = "sifive_p870_d",
3160 .llvm_name = "sifive-p870",3424 .llvm_name = "sifive-p870-d",
3161 .features = featureSet(&[_]Feature{3425 .features = featureSet(&[_]Feature{
3162 .@"64bit",3426 .@"64bit",
3163 .a,3427 .a,
3164 .auipc_addi_fusion,
3165 .b,3428 .b,
3166 .c,3429 .c,
3167 .conditional_cmv_fusion,3430 .conditional_cmv_fusion,
3431 .fusion_auipc_addi,
3432 .fusion_lui_addi,
3168 .i,3433 .i,
3169 .lui_addi_fusion,
3170 .m,3434 .m,
3171 .no_default_unroll,3435 .no_default_unroll,
3172 .no_sink_splat_operands,3436 .no_sink_splat_operands,
...@@ -3294,6 +3558,103 @@ pub const cpu = struct {...@@ -3294,6 +3558,103 @@ pub const cpu = struct {
3294 .zifencei,3558 .zifencei,
3295 }),3559 }),
3296 };3560 };
3561 pub const sifive_x160: CpuModel = .{
3562 .name = "sifive_x160",
3563 .llvm_name = "sifive-x160",
3564 .features = featureSet(&[_]Feature{
3565 .@"32bit",
3566 .a,
3567 .b,
3568 .c,
3569 .dlen_factor_2,
3570 .experimental_zicfilp,
3571 .experimental_zvdot4a8i,
3572 .experimental_zvfbfa,
3573 .i,
3574 .m,
3575 .no_default_unroll,
3576 .optimized_nf2_segment_load_store,
3577 .optimized_zero_stride_load,
3578 .short_forward_branch_ialu,
3579 .use_postra_scheduler,
3580 .vl_dependent_latency,
3581 .xsfcease,
3582 .zawrs,
3583 .zce,
3584 .zcf,
3585 .zcmop,
3586 .zfa,
3587 .zfh,
3588 .zicbom,
3589 .zicbop,
3590 .zicboz,
3591 .zicond,
3592 .zifencei,
3593 .zihintntl,
3594 .zihintpause,
3595 .zihpm,
3596 .zimop,
3597 .zkt,
3598 .zvbb,
3599 .zvfbfwma,
3600 .zvfh,
3601 .zvkt,
3602 .zvl128b,
3603 }),
3604 };
3605 pub const sifive_x180: CpuModel = .{
3606 .name = "sifive_x180",
3607 .llvm_name = "sifive-x180",
3608 .features = featureSet(&[_]Feature{
3609 .@"64bit",
3610 .a,
3611 .b,
3612 .c,
3613 .dlen_factor_2,
3614 .experimental_zicfilp,
3615 .experimental_zvdot4a8i,
3616 .experimental_zvfbfa,
3617 .i,
3618 .m,
3619 .no_default_unroll,
3620 .optimized_nf2_segment_load_store,
3621 .optimized_zero_stride_load,
3622 .short_forward_branch_ialu,
3623 .use_postra_scheduler,
3624 .v,
3625 .vl_dependent_latency,
3626 .xsfcease,
3627 .xsfvfbfexp16e,
3628 .xsfvfexp16e,
3629 .xsfvfexp32e,
3630 .xsfvfexpa,
3631 .xsifivecflushdlone,
3632 .za64rs,
3633 .zawrs,
3634 .zcb,
3635 .zcd,
3636 .zcmop,
3637 .zfa,
3638 .zfh,
3639 .zic64b,
3640 .zicbom,
3641 .zicbop,
3642 .zicboz,
3643 .ziccamoa,
3644 .ziccif,
3645 .ziccrse,
3646 .zicond,
3647 .zifencei,
3648 .zihintntl,
3649 .zihintpause,
3650 .zihpm,
3651 .zimop,
3652 .zkt,
3653 .zvbb,
3654 .zvfbfwma,
3655 .zvkt,
3656 }),
3657 };
3297 pub const sifive_x280: CpuModel = .{3658 pub const sifive_x280: CpuModel = .{
3298 .name = "sifive_x280",3659 .name = "sifive_x280",
3299 .llvm_name = "sifive-x280",3660 .llvm_name = "sifive-x280",
...@@ -3372,7 +3733,7 @@ pub const cpu = struct {...@@ -3372,7 +3733,7 @@ pub const cpu = struct {
3372 };3733 };
3373 pub const spacemit_a100: CpuModel = .{3734 pub const spacemit_a100: CpuModel = .{
3374 .name = "spacemit_a100",3735 .name = "spacemit_a100",
3375 .llvm_name = null,3736 .llvm_name = "spacemit-a100",
3376 .features = featureSet(&[_]Feature{3737 .features = featureSet(&[_]Feature{
3377 .@"64bit",3738 .@"64bit",
3378 .a,3739 .a,
...@@ -3405,10 +3766,10 @@ pub const cpu = struct {...@@ -3405,10 +3766,10 @@ pub const cpu = struct {
3405 .unaligned_scalar_mem,3766 .unaligned_scalar_mem,
3406 .v,3767 .v,
3407 .vxrm_pipeline_flush,3768 .vxrm_pipeline_flush,
3769 .xsmtvdotii,
3408 .za64rs,3770 .za64rs,
3409 .zawrs,3771 .zawrs,
3410 .zbc,3772 .zbc,
3411 .zbkc,
3412 .zcb,3773 .zcb,
3413 .zcmop,3774 .zcmop,
3414 .zfa,3775 .zfa,
...@@ -3433,7 +3794,6 @@ pub const cpu = struct {...@@ -3433,7 +3794,6 @@ pub const cpu = struct {
3433 .zvfbfwma,3794 .zvfbfwma,
3434 .zvfh,3795 .zvfh,
3435 .zvkng,3796 .zvkng,
3436 .zvknha,
3437 .zvksc,3797 .zvksc,
3438 .zvksg,3798 .zvksg,
3439 .zvl1024b,3799 .zvl1024b,
...@@ -3441,27 +3801,75 @@ pub const cpu = struct {...@@ -3441,27 +3801,75 @@ pub const cpu = struct {
3441 };3801 };
3442 pub const spacemit_x100: CpuModel = .{3802 pub const spacemit_x100: CpuModel = .{
3443 .name = "spacemit_x100",3803 .name = "spacemit_x100",
3444 .llvm_name = null,3804 .llvm_name = "spacemit-x100",
3445 .features = featureSet(&[_]Feature{3805 .features = featureSet(&[_]Feature{
3806 .@"64bit",
3807 .a,
3808 .b,
3809 .c,
3446 .dlen_factor_2,3810 .dlen_factor_2,
3811 .fusion_add_mem,
3812 .fusion_logic_imm_reg,
3813 .fusion_logic_reg_imm,
3814 .fusion_logic_reg_reg,
3815 .fusion_mul_add,
3816 .fusion_shift_bit_extract,
3817 .i,
3818 .m,
3819 .no_default_unroll,
3447 .optimized_nf2_segment_load_store,3820 .optimized_nf2_segment_load_store,
3448 .optimized_nf3_segment_load_store,3821 .optimized_nf3_segment_load_store,
3449 .optimized_nf4_segment_load_store,3822 .optimized_nf4_segment_load_store,
3450 .rva23s64,3823 .sha,
3451 .smepmp,3824 .smepmp,
3452 .smnpm,3825 .smnpm,
3453 .smstateen,3826 .smstateen,
3827 .ssccptr,
3828 .sscofpmf,
3829 .sscounterenw,
3830 .ssnpm,
3454 .sspm,3831 .sspm,
3832 .sstc,
3833 .sstvala,
3834 .sstvecd,
3835 .ssu64xl,
3836 .supm,
3837 .svade,
3838 .svbare,
3839 .svinval,
3840 .svnapot,
3841 .svpbmt,
3455 .unaligned_scalar_mem,3842 .unaligned_scalar_mem,
3843 .v,
3456 .vxrm_pipeline_flush,3844 .vxrm_pipeline_flush,
3457 .xsmtvdot,3845 .xsmtvdot,
3846 .za64rs,
3847 .zawrs,
3458 .zbc,3848 .zbc,
3459 .zbkc,3849 .zcb,
3850 .zcmop,
3851 .zfa,
3460 .zfh,3852 .zfh,
3853 .zic64b,
3854 .zicbom,
3855 .zicbop,
3856 .zicboz,
3857 .ziccamoa,
3858 .ziccif,
3859 .zicclsm,
3860 .ziccrse,
3861 .zicntr,
3862 .zicond,
3863 .zifencei,
3864 .zihintntl,
3865 .zihintpause,
3866 .zihpm,
3867 .zimop,
3868 .zkt,
3869 .zvbb,
3461 .zvfbfwma,3870 .zvfbfwma,
3462 .zvfh,3871 .zvfh,
3463 .zvkng,3872 .zvkng,
3464 .zvknha,
3465 .zvksc,3873 .zvksc,
3466 .zvksg,3874 .zvksg,
3467 .zvl256b,3875 .zvl256b,
...@@ -3476,11 +3884,13 @@ pub const cpu = struct {...@@ -3476,11 +3884,13 @@ pub const cpu = struct {
3476 .b,3884 .b,
3477 .c,3885 .c,
3478 .dlen_factor_2,3886 .dlen_factor_2,
3887 .enable_select_opt,
3479 .i,3888 .i,
3480 .m,3889 .m,
3481 .optimized_nf2_segment_load_store,3890 .optimized_nf2_segment_load_store,
3482 .optimized_nf3_segment_load_store,3891 .optimized_nf3_segment_load_store,
3483 .optimized_nf4_segment_load_store,3892 .optimized_nf4_segment_load_store,
3893 .prefer_ascending_load_store,
3484 .ssccptr,3894 .ssccptr,
3485 .sscofpmf,3895 .sscofpmf,
3486 .sscounterenw,3896 .sscounterenw,
...@@ -3498,7 +3908,6 @@ pub const cpu = struct {...@@ -3498,7 +3908,6 @@ pub const cpu = struct {
3498 .xsmtvdot,3908 .xsmtvdot,
3499 .za64rs,3909 .za64rs,
3500 .zbc,3910 .zbc,
3501 .zbkc,
3502 .zfh,3911 .zfh,
3503 .zic64b,3912 .zic64b,
3504 .zicbom,3913 .zicbom,
...@@ -3652,9 +4061,9 @@ pub const cpu = struct {...@@ -3652,9 +4061,9 @@ pub const cpu = struct {
3652 .zkn,4061 .zkn,
3653 }),4062 }),
3654 };4063 };
3655 pub const tt_ascalon_d8: CpuModel = .{4064 pub const tt_ascalon_x: CpuModel = .{
3656 .name = "tt_ascalon_d8",4065 .name = "tt_ascalon_x",
3657 .llvm_name = "tt-ascalon-d8",4066 .llvm_name = "tt-ascalon-x",
3658 .features = featureSet(&[_]Feature{4067 .features = featureSet(&[_]Feature{
3659 .@"64bit",4068 .@"64bit",
3660 .a,4069 .a,
...@@ -3674,6 +4083,10 @@ pub const cpu = struct {...@@ -3674,6 +4083,10 @@ pub const cpu = struct {
3674 .optimized_zero_stride_load,4083 .optimized_zero_stride_load,
3675 .sha,4084 .sha,
3676 .smaia,4085 .smaia,
4086 .smmpm,
4087 .smnpm,
4088 .smrnmi,
4089 .smstateen,
3677 .ssaia,4090 .ssaia,
3678 .ssccptr,4091 .ssccptr,
3679 .sscofpmf,4092 .sscofpmf,
...@@ -3715,6 +4128,7 @@ pub const cpu = struct {...@@ -3715,6 +4128,7 @@ pub const cpu = struct {
3715 .zihintpause,4128 .zihintpause,
3716 .zihpm,4129 .zihpm,
3717 .zimop,4130 .zimop,
4131 .zkr,
3718 .zkt,4132 .zkt,
3719 .zvbb,4133 .zvbb,
3720 .zvbc,4134 .zvbc,
...@@ -3730,27 +4144,27 @@ pub const cpu = struct {...@@ -3730,27 +4144,27 @@ pub const cpu = struct {
3730 .features = featureSet(&[_]Feature{4144 .features = featureSet(&[_]Feature{
3731 .@"64bit",4145 .@"64bit",
3732 .a,4146 .a,
3733 .add_load_fusion,
3734 .auipc_addi_fusion,
3735 .auipc_load_fusion,
3736 .c,4147 .c,
3737 .d,4148 .d,
3738 .disable_misched_load_clustering,4149 .disable_misched_load_clustering,
3739 .disable_postmisched_load_clustering,4150 .disable_postmisched_load_clustering,
3740 .disable_postmisched_store_clustering,4151 .disable_postmisched_store_clustering,
4152 .fusion_add_load,
4153 .fusion_auipc_addi,
4154 .fusion_auipc_load,
4155 .fusion_lui_addi,
4156 .fusion_lui_load,
4157 .fusion_shifted_zextw,
4158 .fusion_zexth,
4159 .fusion_zextw,
3741 .i,4160 .i,
3742 .lui_addi_fusion,
3743 .lui_load_fusion,
3744 .m,4161 .m,
3745 .shifted_zextw_fusion,
3746 .ventana_veyron,4162 .ventana_veyron,
3747 .xventanacondops,4163 .xventanacondops,
3748 .zba,4164 .zba,
3749 .zbb,4165 .zbb,
3750 .zbc,4166 .zbc,
3751 .zbs,4167 .zbs,
3752 .zexth_fusion,
3753 .zextw_fusion,
3754 .zicbom,4168 .zicbom,
3755 .zicbop,4169 .zicbop,
3756 .zicboz,4170 .zicboz,
...@@ -3768,11 +4182,13 @@ pub const cpu = struct {...@@ -3768,11 +4182,13 @@ pub const cpu = struct {
3768 .a,4182 .a,
3769 .b,4183 .b,
3770 .c,4184 .c,
4185 .fusion_shifted_zextw,
4186 .fusion_zexth,
4187 .fusion_zextw,
3771 .i,4188 .i,
3772 .m,4189 .m,
3773 .no_default_unroll,4190 .no_default_unroll,
3774 .sha,4191 .sha,
3775 .shifted_zextw_fusion,
3776 .smaia,4192 .smaia,
3777 .smcsrind,4193 .smcsrind,
3778 .smdbltrp,4194 .smdbltrp,
...@@ -3806,8 +4222,6 @@ pub const cpu = struct {...@@ -3806,8 +4222,6 @@ pub const cpu = struct {
3806 .zbc,4222 .zbc,
3807 .zcb,4223 .zcb,
3808 .zcmop,4224 .zcmop,
3809 .zexth_fusion,
3810 .zextw_fusion,
3811 .zfa,4225 .zfa,
3812 .zfh,4226 .zfh,
3813 .zic64b,4227 .zic64b,
...@@ -3841,17 +4255,17 @@ pub const cpu = struct {...@@ -3841,17 +4255,17 @@ pub const cpu = struct {
3841 .a,4255 .a,
3842 .c,4256 .c,
3843 .d,4257 .d,
4258 .fusion_shifted_zextw,
4259 .fusion_zexth,
4260 .fusion_zextw,
3844 .i,4261 .i,
3845 .m,4262 .m,
3846 .no_default_unroll,4263 .no_default_unroll,
3847 .shifted_zextw_fusion,
3848 .svinval,4264 .svinval,
3849 .zba,4265 .zba,
3850 .zbb,4266 .zbb,
3851 .zbc,4267 .zbc,
3852 .zbs,4268 .zbs,
3853 .zexth_fusion,
3854 .zextw_fusion,
3855 .zicbom,4269 .zicbom,
3856 .zicboz,4270 .zicboz,
3857 .zifencei,4271 .zifencei,
...@@ -3860,4 +4274,129 @@ pub const cpu = struct {...@@ -3860,4 +4274,129 @@ pub const cpu = struct {
3860 .zksh,4274 .zksh,
3861 }),4275 }),
3862 };4276 };
4277 pub const xt_c910v2: CpuModel = .{
4278 .name = "xt_c910v2",
4279 .llvm_name = "xt-c910v2",
4280 .features = featureSet(&[_]Feature{
4281 .@"64bit",
4282 .a,
4283 .b,
4284 .c,
4285 .i,
4286 .m,
4287 .ssccptr,
4288 .sscofpmf,
4289 .sscounterenw,
4290 .sstc,
4291 .sstvala,
4292 .sstvecd,
4293 .ssu64xl,
4294 .svade,
4295 .svbare,
4296 .svinval,
4297 .svnapot,
4298 .svpbmt,
4299 .unaligned_scalar_mem,
4300 .use_postra_scheduler,
4301 .vxrm_pipeline_flush,
4302 .xtheadba,
4303 .xtheadbb,
4304 .xtheadbs,
4305 .xtheadcmo,
4306 .xtheadcondmov,
4307 .xtheadfmemidx,
4308 .xtheadmac,
4309 .xtheadmemidx,
4310 .xtheadmempair,
4311 .xtheadsync,
4312 .za64rs,
4313 .zawrs,
4314 .zbc,
4315 .zcb,
4316 .zcd,
4317 .zcmop,
4318 .zfa,
4319 .zfbfmin,
4320 .zfh,
4321 .zic64b,
4322 .zicbom,
4323 .zicbop,
4324 .zicboz,
4325 .ziccamoa,
4326 .ziccif,
4327 .zicclsm,
4328 .ziccrse,
4329 .zicntr,
4330 .zicond,
4331 .zifencei,
4332 .zihintntl,
4333 .zihintpause,
4334 .zihpm,
4335 .zimop,
4336 .zkt,
4337 }),
4338 };
4339 pub const xt_c920v2: CpuModel = .{
4340 .name = "xt_c920v2",
4341 .llvm_name = "xt-c920v2",
4342 .features = featureSet(&[_]Feature{
4343 .@"64bit",
4344 .a,
4345 .b,
4346 .c,
4347 .i,
4348 .m,
4349 .ssccptr,
4350 .sscofpmf,
4351 .sscounterenw,
4352 .sstc,
4353 .sstvala,
4354 .sstvecd,
4355 .ssu64xl,
4356 .svade,
4357 .svbare,
4358 .svinval,
4359 .svnapot,
4360 .svpbmt,
4361 .unaligned_scalar_mem,
4362 .use_postra_scheduler,
4363 .vxrm_pipeline_flush,
4364 .xtheadba,
4365 .xtheadbb,
4366 .xtheadbs,
4367 .xtheadcmo,
4368 .xtheadcondmov,
4369 .xtheadfmemidx,
4370 .xtheadmac,
4371 .xtheadmemidx,
4372 .xtheadmempair,
4373 .xtheadsync,
4374 .xtheadvdot,
4375 .za64rs,
4376 .zawrs,
4377 .zbc,
4378 .zcb,
4379 .zcd,
4380 .zcmop,
4381 .zfa,
4382 .zfh,
4383 .zic64b,
4384 .zicbom,
4385 .zicbop,
4386 .zicboz,
4387 .ziccamoa,
4388 .ziccif,
4389 .ziccrse,
4390 .zicntr,
4391 .zicond,
4392 .zifencei,
4393 .zihintntl,
4394 .zihintpause,
4395 .zihpm,
4396 .zimop,
4397 .zkt,
4398 .zvfbfwma,
4399 .zvfh,
4400 }),
4401 };
3863};4402};
lib/std/Target/sparc.zig+1
...@@ -462,6 +462,7 @@ pub const cpu = struct {...@@ -462,6 +462,7 @@ pub const cpu = struct {
462 .name = "leon3",462 .name = "leon3",
463 .llvm_name = "leon3",463 .llvm_name = "leon3",
464 .features = featureSet(&[_]Feature{464 .features = featureSet(&[_]Feature{
465 .hasleoncasa,
465 .hasumacsmac,466 .hasumacsmac,
466 .leon,467 .leon,
467 }),468 }),
lib/std/Target/wasm.zig+13-4
...@@ -19,6 +19,7 @@ pub const Feature = enum {...@@ -19,6 +19,7 @@ pub const Feature = enum {
19 nontrapping_bulk_memory_len0,19 nontrapping_bulk_memory_len0,
20 nontrapping_fptoint,20 nontrapping_fptoint,
21 reference_types,21 reference_types,
22 relaxed_atomics,
22 relaxed_simd,23 relaxed_simd,
23 sign_ext,24 sign_ext,
24 simd128,25 simd128,
...@@ -60,7 +61,10 @@ pub const all_features = blk: {...@@ -60,7 +61,10 @@ pub const all_features = blk: {
60 result[@backingInt(Feature.exception_handling)] = .{61 result[@backingInt(Feature.exception_handling)] = .{
61 .llvm_name = "exception-handling",62 .llvm_name = "exception-handling",
62 .description = "Enable Wasm exception handling",63 .description = "Enable Wasm exception handling",
63 .dependencies = featureSet(&[_]Feature{}),64 .dependencies = featureSet(&[_]Feature{
65 .multivalue,
66 .reference_types,
67 }),
64 };68 };
65 result[@backingInt(Feature.extended_const)] = .{69 result[@backingInt(Feature.extended_const)] = .{
66 .llvm_name = "extended-const",70 .llvm_name = "extended-const",
...@@ -75,7 +79,9 @@ pub const all_features = blk: {...@@ -75,7 +79,9 @@ pub const all_features = blk: {
75 result[@backingInt(Feature.gc)] = .{79 result[@backingInt(Feature.gc)] = .{
76 .llvm_name = "gc",80 .llvm_name = "gc",
77 .description = "Enable wasm gc",81 .description = "Enable wasm gc",
78 .dependencies = featureSet(&[_]Feature{}),82 .dependencies = featureSet(&[_]Feature{
83 .reference_types,
84 }),
79 };85 };
80 result[@backingInt(Feature.multimemory)] = .{86 result[@backingInt(Feature.multimemory)] = .{
81 .llvm_name = "multimemory",87 .llvm_name = "multimemory",
...@@ -111,6 +117,11 @@ pub const all_features = blk: {...@@ -111,6 +117,11 @@ pub const all_features = blk: {
111 .call_indirect_overlong,117 .call_indirect_overlong,
112 }),118 }),
113 };119 };
120 result[@backingInt(Feature.relaxed_atomics)] = .{
121 .llvm_name = "relaxed-atomics",
122 .description = "Enable relaxed-atomics proposal",
123 .dependencies = featureSet(&[_]Feature{}),
124 };
114 result[@backingInt(Feature.relaxed_simd)] = .{125 result[@backingInt(Feature.relaxed_simd)] = .{
115 .llvm_name = "relaxed-simd",126 .llvm_name = "relaxed-simd",
116 .description = "Enable relaxed-simd instructions",127 .description = "Enable relaxed-simd instructions",
...@@ -156,10 +167,8 @@ pub const cpu = struct {...@@ -156,10 +167,8 @@ pub const cpu = struct {
156 .fp16,167 .fp16,
157 .gc,168 .gc,
158 .multimemory,169 .multimemory,
159 .multivalue,
160 .mutable_globals,170 .mutable_globals,
161 .nontrapping_fptoint,171 .nontrapping_fptoint,
162 .reference_types,
163 .relaxed_simd,172 .relaxed_simd,
164 .sign_ext,173 .sign_ext,
165 .simd128,174 .simd128,
lib/std/Target/x86.zig+533-16
...@@ -20,7 +20,6 @@ pub const Feature = enum {...@@ -20,7 +20,6 @@ pub const Feature = enum {
20 amx_fp8,20 amx_fp8,
21 amx_int8,21 amx_int8,
22 amx_movrs,22 amx_movrs,
23 amx_tf32,
24 amx_tile,23 amx_tile,
25 avx,24 avx,
26 avx10_1,25 avx10_1,
...@@ -28,6 +27,7 @@ pub const Feature = enum {...@@ -28,6 +27,7 @@ pub const Feature = enum {
28 avx2,27 avx2,
29 avx512bf16,28 avx512bf16,
30 avx512bitalg,29 avx512bitalg,
30 avx512bmm,
31 avx512bw,31 avx512bw,
32 avx512cd,32 avx512cd,
33 avx512dq,33 avx512dq,
...@@ -67,13 +67,17 @@ pub const Feature = enum {...@@ -67,13 +67,17 @@ pub const Feature = enum {
67 enqcmd,67 enqcmd,
68 ermsb,68 ermsb,
69 f16c,69 f16c,
70 false_deps_bls,
71 false_deps_compress,
72 false_deps_expand,
70 false_deps_getmant,73 false_deps_getmant,
71 false_deps_lzcnt_tzcnt,74 false_deps_lzcnt,
72 false_deps_mulc,75 false_deps_mulc,
73 false_deps_mullq,76 false_deps_mullq,
74 false_deps_perm,77 false_deps_perm,
75 false_deps_popcnt,78 false_deps_popcnt,
76 false_deps_range,79 false_deps_range,
80 false_deps_tzcnt,
77 fast_11bytenop,81 fast_11bytenop,
78 fast_15bytenop,82 fast_15bytenop,
79 fast_7bytenop,83 fast_7bytenop,
...@@ -105,6 +109,7 @@ pub const Feature = enum {...@@ -105,6 +109,7 @@ pub const Feature = enum {
105 idivq_to_divl,109 idivq_to_divl,
106 inline_asm_use_gpr32,110 inline_asm_use_gpr32,
107 invpcid,111 invpcid,
112 jmpabs,
108 kl,113 kl,
109 lea_sp,114 lea_sp,
110 lea_uses_ag,115 lea_uses_ag,
...@@ -137,6 +142,7 @@ pub const Feature = enum {...@@ -137,6 +142,7 @@ pub const Feature = enum {
137 prefer_legacy_setcc,142 prefer_legacy_setcc,
138 prefer_mask_registers,143 prefer_mask_registers,
139 prefer_movmsk_over_vtest,144 prefer_movmsk_over_vtest,
145 prefer_ndd_mem,
140 prefer_no_gather,146 prefer_no_gather,
141 prefer_no_scatter,147 prefer_no_scatter,
142 prefetchi,148 prefetchi,
...@@ -149,6 +155,31 @@ pub const Feature = enum {...@@ -149,6 +155,31 @@ pub const Feature = enum {
149 rdpru,155 rdpru,
150 rdrnd,156 rdrnd,
151 rdseed,157 rdseed,
158 reserve_edi,
159 reserve_r10,
160 reserve_r11,
161 reserve_r12,
162 reserve_r13,
163 reserve_r14,
164 reserve_r15,
165 reserve_r16,
166 reserve_r17,
167 reserve_r18,
168 reserve_r19,
169 reserve_r20,
170 reserve_r21,
171 reserve_r22,
172 reserve_r23,
173 reserve_r24,
174 reserve_r25,
175 reserve_r26,
176 reserve_r27,
177 reserve_r28,
178 reserve_r29,
179 reserve_r30,
180 reserve_r31,
181 reserve_r8,
182 reserve_r9,
152 retpoline,183 retpoline,
153 retpoline_external_thunk,184 retpoline_external_thunk,
154 retpoline_indirect_branches,185 retpoline_indirect_branches,
...@@ -164,6 +195,7 @@ pub const Feature = enum {...@@ -164,6 +195,7 @@ pub const Feature = enum {
164 shstk,195 shstk,
165 slow_3ops_lea,196 slow_3ops_lea,
166 slow_incdec,197 slow_incdec,
198 slow_indirect_call,
167 slow_lea,199 slow_lea,
168 slow_pmaddwd,200 slow_pmaddwd,
169 slow_pmulld,201 slow_pmulld,
...@@ -313,13 +345,6 @@ pub const all_features = blk: {...@@ -313,13 +345,6 @@ pub const all_features = blk: {
313 .amx_tile,345 .amx_tile,
314 }),346 }),
315 };347 };
316 result[@backingInt(Feature.amx_tf32)] = .{
317 .llvm_name = "amx-tf32",
318 .description = "Support AMX-TF32 instructions",
319 .dependencies = featureSet(&[_]Feature{
320 .amx_tile,
321 }),
322 };
323 result[@backingInt(Feature.amx_tile)] = .{348 result[@backingInt(Feature.amx_tile)] = .{
324 .llvm_name = "amx-tile",349 .llvm_name = "amx-tile",
325 .description = "Support AMX-TILE instructions",350 .description = "Support AMX-TILE instructions",
...@@ -377,6 +402,13 @@ pub const all_features = blk: {...@@ -377,6 +402,13 @@ pub const all_features = blk: {
377 .avx512bw,402 .avx512bw,
378 }),403 }),
379 };404 };
405 result[@backingInt(Feature.avx512bmm)] = .{
406 .llvm_name = "avx512bmm",
407 .description = "Enable AVX512 Bit Matrix Multiply",
408 .dependencies = featureSet(&[_]Feature{
409 .avx512bw,
410 }),
411 };
380 result[@backingInt(Feature.avx512bw)] = .{412 result[@backingInt(Feature.avx512bw)] = .{
381 .llvm_name = "avx512bw",413 .llvm_name = "avx512bw",
382 .description = "Enable AVX-512 Byte and Word Instructions",414 .description = "Enable AVX-512 Byte and Word Instructions",
...@@ -616,14 +648,29 @@ pub const all_features = blk: {...@@ -616,14 +648,29 @@ pub const all_features = blk: {
616 .avx,648 .avx,
617 }),649 }),
618 };650 };
651 result[@backingInt(Feature.false_deps_bls)] = .{
652 .llvm_name = "false-deps-bls",
653 .description = "BLSR/BLSI/BLSMSK have a false dependency on dest register",
654 .dependencies = featureSet(&[_]Feature{}),
655 };
656 result[@backingInt(Feature.false_deps_compress)] = .{
657 .llvm_name = "false-deps-compress",
658 .description = "V[P]COMPRESSPD/PS/Q/D/W/B with zero-masking has a false dependency on dest register",
659 .dependencies = featureSet(&[_]Feature{}),
660 };
661 result[@backingInt(Feature.false_deps_expand)] = .{
662 .llvm_name = "false-deps-expand",
663 .description = "V[P]EXPANDPD/PS/Q/D/W/B with zero-masking has a false dependency on dest register",
664 .dependencies = featureSet(&[_]Feature{}),
665 };
619 result[@backingInt(Feature.false_deps_getmant)] = .{666 result[@backingInt(Feature.false_deps_getmant)] = .{
620 .llvm_name = "false-deps-getmant",667 .llvm_name = "false-deps-getmant",
621 .description = "VGETMANTSS/SD/SH and VGETMANDPS/PD(memory version) has a false dependency on dest register",668 .description = "VGETMANTSS/SD/SH and VGETMANDPS/PD(memory version) has a false dependency on dest register",
622 .dependencies = featureSet(&[_]Feature{}),669 .dependencies = featureSet(&[_]Feature{}),
623 };670 };
624 result[@backingInt(Feature.false_deps_lzcnt_tzcnt)] = .{671 result[@backingInt(Feature.false_deps_lzcnt)] = .{
625 .llvm_name = "false-deps-lzcnt-tzcnt",672 .llvm_name = "false-deps-lzcnt",
626 .description = "LZCNT/TZCNT have a false dependency on dest register",673 .description = "LZCNT has a false dependency on dest register",
627 .dependencies = featureSet(&[_]Feature{}),674 .dependencies = featureSet(&[_]Feature{}),
628 };675 };
629 result[@backingInt(Feature.false_deps_mulc)] = .{676 result[@backingInt(Feature.false_deps_mulc)] = .{
...@@ -651,6 +698,11 @@ pub const all_features = blk: {...@@ -651,6 +698,11 @@ pub const all_features = blk: {
651 .description = "VRANGEPD/PS/SD/SS has a false dependency on dest register",698 .description = "VRANGEPD/PS/SD/SS has a false dependency on dest register",
652 .dependencies = featureSet(&[_]Feature{}),699 .dependencies = featureSet(&[_]Feature{}),
653 };700 };
701 result[@backingInt(Feature.false_deps_tzcnt)] = .{
702 .llvm_name = "false-deps-tzcnt",
703 .description = "TZCNT has a false dependency on dest register",
704 .dependencies = featureSet(&[_]Feature{}),
705 };
654 result[@backingInt(Feature.fast_11bytenop)] = .{706 result[@backingInt(Feature.fast_11bytenop)] = .{
655 .llvm_name = "fast-11bytenop",707 .llvm_name = "fast-11bytenop",
656 .description = "Target can quickly decode up to 11 byte NOPs",708 .description = "Target can quickly decode up to 11 byte NOPs",
...@@ -813,6 +865,11 @@ pub const all_features = blk: {...@@ -813,6 +865,11 @@ pub const all_features = blk: {
813 .description = "Invalidate Process-Context Identifier",865 .description = "Invalidate Process-Context Identifier",
814 .dependencies = featureSet(&[_]Feature{}),866 .dependencies = featureSet(&[_]Feature{}),
815 };867 };
868 result[@backingInt(Feature.jmpabs)] = .{
869 .llvm_name = "jmpabs",
870 .description = "Support 64-bit absolute JMP",
871 .dependencies = featureSet(&[_]Feature{}),
872 };
816 result[@backingInt(Feature.kl)] = .{873 result[@backingInt(Feature.kl)] = .{
817 .llvm_name = "kl",874 .llvm_name = "kl",
818 .description = "Support Key Locker kl Instructions",875 .description = "Support Key Locker kl Instructions",
...@@ -977,6 +1034,11 @@ pub const all_features = blk: {...@@ -977,6 +1034,11 @@ pub const all_features = blk: {
977 .description = "Prefer movmsk over vtest instruction",1034 .description = "Prefer movmsk over vtest instruction",
978 .dependencies = featureSet(&[_]Feature{}),1035 .dependencies = featureSet(&[_]Feature{}),
979 };1036 };
1037 result[@backingInt(Feature.prefer_ndd_mem)] = .{
1038 .llvm_name = "prefer-ndd-mem",
1039 .description = "Prefer NDD memory addressing",
1040 .dependencies = featureSet(&[_]Feature{}),
1041 };
980 result[@backingInt(Feature.prefer_no_gather)] = .{1042 result[@backingInt(Feature.prefer_no_gather)] = .{
981 .llvm_name = "prefer-no-gather",1043 .llvm_name = "prefer-no-gather",
982 .description = "Prefer no gather instructions",1044 .description = "Prefer no gather instructions",
...@@ -1037,6 +1099,131 @@ pub const all_features = blk: {...@@ -1037,6 +1099,131 @@ pub const all_features = blk: {
1037 .description = "Support RDSEED instruction",1099 .description = "Support RDSEED instruction",
1038 .dependencies = featureSet(&[_]Feature{}),1100 .dependencies = featureSet(&[_]Feature{}),
1039 };1101 };
1102 result[@backingInt(Feature.reserve_edi)] = .{
1103 .llvm_name = "reserve-edi",
1104 .description = "Reserve EDI, making it unavailable as a GPR",
1105 .dependencies = featureSet(&[_]Feature{}),
1106 };
1107 result[@backingInt(Feature.reserve_r10)] = .{
1108 .llvm_name = "reserve-r10",
1109 .description = "Reserve R10, making it unavailable as a GPR",
1110 .dependencies = featureSet(&[_]Feature{}),
1111 };
1112 result[@backingInt(Feature.reserve_r11)] = .{
1113 .llvm_name = "reserve-r11",
1114 .description = "Reserve R11, making it unavailable as a GPR",
1115 .dependencies = featureSet(&[_]Feature{}),
1116 };
1117 result[@backingInt(Feature.reserve_r12)] = .{
1118 .llvm_name = "reserve-r12",
1119 .description = "Reserve R12, making it unavailable as a GPR",
1120 .dependencies = featureSet(&[_]Feature{}),
1121 };
1122 result[@backingInt(Feature.reserve_r13)] = .{
1123 .llvm_name = "reserve-r13",
1124 .description = "Reserve R13, making it unavailable as a GPR",
1125 .dependencies = featureSet(&[_]Feature{}),
1126 };
1127 result[@backingInt(Feature.reserve_r14)] = .{
1128 .llvm_name = "reserve-r14",
1129 .description = "Reserve R14, making it unavailable as a GPR",
1130 .dependencies = featureSet(&[_]Feature{}),
1131 };
1132 result[@backingInt(Feature.reserve_r15)] = .{
1133 .llvm_name = "reserve-r15",
1134 .description = "Reserve R15, making it unavailable as a GPR",
1135 .dependencies = featureSet(&[_]Feature{}),
1136 };
1137 result[@backingInt(Feature.reserve_r16)] = .{
1138 .llvm_name = "reserve-r16",
1139 .description = "Reserve R16, making it unavailable as a GPR",
1140 .dependencies = featureSet(&[_]Feature{}),
1141 };
1142 result[@backingInt(Feature.reserve_r17)] = .{
1143 .llvm_name = "reserve-r17",
1144 .description = "Reserve R17, making it unavailable as a GPR",
1145 .dependencies = featureSet(&[_]Feature{}),
1146 };
1147 result[@backingInt(Feature.reserve_r18)] = .{
1148 .llvm_name = "reserve-r18",
1149 .description = "Reserve R18, making it unavailable as a GPR",
1150 .dependencies = featureSet(&[_]Feature{}),
1151 };
1152 result[@backingInt(Feature.reserve_r19)] = .{
1153 .llvm_name = "reserve-r19",
1154 .description = "Reserve R19, making it unavailable as a GPR",
1155 .dependencies = featureSet(&[_]Feature{}),
1156 };
1157 result[@backingInt(Feature.reserve_r20)] = .{
1158 .llvm_name = "reserve-r20",
1159 .description = "Reserve R20, making it unavailable as a GPR",
1160 .dependencies = featureSet(&[_]Feature{}),
1161 };
1162 result[@backingInt(Feature.reserve_r21)] = .{
1163 .llvm_name = "reserve-r21",
1164 .description = "Reserve R21, making it unavailable as a GPR",
1165 .dependencies = featureSet(&[_]Feature{}),
1166 };
1167 result[@backingInt(Feature.reserve_r22)] = .{
1168 .llvm_name = "reserve-r22",
1169 .description = "Reserve R22, making it unavailable as a GPR",
1170 .dependencies = featureSet(&[_]Feature{}),
1171 };
1172 result[@backingInt(Feature.reserve_r23)] = .{
1173 .llvm_name = "reserve-r23",
1174 .description = "Reserve R23, making it unavailable as a GPR",
1175 .dependencies = featureSet(&[_]Feature{}),
1176 };
1177 result[@backingInt(Feature.reserve_r24)] = .{
1178 .llvm_name = "reserve-r24",
1179 .description = "Reserve R24, making it unavailable as a GPR",
1180 .dependencies = featureSet(&[_]Feature{}),
1181 };
1182 result[@backingInt(Feature.reserve_r25)] = .{
1183 .llvm_name = "reserve-r25",
1184 .description = "Reserve R25, making it unavailable as a GPR",
1185 .dependencies = featureSet(&[_]Feature{}),
1186 };
1187 result[@backingInt(Feature.reserve_r26)] = .{
1188 .llvm_name = "reserve-r26",
1189 .description = "Reserve R26, making it unavailable as a GPR",
1190 .dependencies = featureSet(&[_]Feature{}),
1191 };
1192 result[@backingInt(Feature.reserve_r27)] = .{
1193 .llvm_name = "reserve-r27",
1194 .description = "Reserve R27, making it unavailable as a GPR",
1195 .dependencies = featureSet(&[_]Feature{}),
1196 };
1197 result[@backingInt(Feature.reserve_r28)] = .{
1198 .llvm_name = "reserve-r28",
1199 .description = "Reserve R28, making it unavailable as a GPR",
1200 .dependencies = featureSet(&[_]Feature{}),
1201 };
1202 result[@backingInt(Feature.reserve_r29)] = .{
1203 .llvm_name = "reserve-r29",
1204 .description = "Reserve R29, making it unavailable as a GPR",
1205 .dependencies = featureSet(&[_]Feature{}),
1206 };
1207 result[@backingInt(Feature.reserve_r30)] = .{
1208 .llvm_name = "reserve-r30",
1209 .description = "Reserve R30, making it unavailable as a GPR",
1210 .dependencies = featureSet(&[_]Feature{}),
1211 };
1212 result[@backingInt(Feature.reserve_r31)] = .{
1213 .llvm_name = "reserve-r31",
1214 .description = "Reserve R31, making it unavailable as a GPR",
1215 .dependencies = featureSet(&[_]Feature{}),
1216 };
1217 result[@backingInt(Feature.reserve_r8)] = .{
1218 .llvm_name = "reserve-r8",
1219 .description = "Reserve R8, making it unavailable as a GPR",
1220 .dependencies = featureSet(&[_]Feature{}),
1221 };
1222 result[@backingInt(Feature.reserve_r9)] = .{
1223 .llvm_name = "reserve-r9",
1224 .description = "Reserve R9, making it unavailable as a GPR",
1225 .dependencies = featureSet(&[_]Feature{}),
1226 };
1040 result[@backingInt(Feature.retpoline)] = .{1227 result[@backingInt(Feature.retpoline)] = .{
1041 .llvm_name = "retpoline",1228 .llvm_name = "retpoline",
1042 .description = "Remove speculation of indirect branches from the generated code, either by avoiding them entirely or lowering them with a speculation blocking construct",1229 .description = "Remove speculation of indirect branches from the generated code, either by avoiding them entirely or lowering them with a speculation blocking construct",
...@@ -1123,6 +1310,11 @@ pub const all_features = blk: {...@@ -1123,6 +1310,11 @@ pub const all_features = blk: {
1123 .description = "INC and DEC instructions are slower than ADD and SUB",1310 .description = "INC and DEC instructions are slower than ADD and SUB",
1124 .dependencies = featureSet(&[_]Feature{}),1311 .dependencies = featureSet(&[_]Feature{}),
1125 };1312 };
1313 result[@backingInt(Feature.slow_indirect_call)] = .{
1314 .llvm_name = "slow-indirect-call",
1315 .description = "Indirect calls from memory are slow",
1316 .dependencies = featureSet(&[_]Feature{}),
1317 };
1126 result[@backingInt(Feature.slow_lea)] = .{1318 result[@backingInt(Feature.slow_lea)] = .{
1127 .llvm_name = "slow-lea",1319 .llvm_name = "slow-lea",
1128 .description = "LEA instruction with certain arguments is slow",1320 .description = "LEA instruction with certain arguments is slow",
...@@ -2039,8 +2231,9 @@ pub const cpu = struct {...@@ -2039,8 +2231,9 @@ pub const cpu = struct {
2039 .cx16,2231 .cx16,
2040 .ermsb,2232 .ermsb,
2041 .f16c,2233 .f16c,
2042 .false_deps_lzcnt_tzcnt,2234 .false_deps_lzcnt,
2043 .false_deps_popcnt,2235 .false_deps_popcnt,
2236 .false_deps_tzcnt,
2044 .fast_15bytenop,2237 .fast_15bytenop,
2045 .fast_scalar_fsqrt,2238 .fast_scalar_fsqrt,
2046 .fast_shld_rotate,2239 .fast_shld_rotate,
...@@ -2159,6 +2352,239 @@ pub const cpu = struct {...@@ -2159,6 +2352,239 @@ pub const cpu = struct {
2159 .x87,2352 .x87,
2160 }),2353 }),
2161 };2354 };
2355 pub const c86_4g_m4: CpuModel = .{
2356 .name = "c86_4g_m4",
2357 .llvm_name = "c86-4g-m4",
2358 .features = featureSet(&[_]Feature{
2359 .@"64bit",
2360 .adx,
2361 .aes,
2362 .allow_light_256_bit,
2363 .avx2,
2364 .bmi,
2365 .bmi2,
2366 .clflushopt,
2367 .clzero,
2368 .cmov,
2369 .cx16,
2370 .f16c,
2371 .fast_15bytenop,
2372 .fast_bextr,
2373 .fast_imm16,
2374 .fast_lzcnt,
2375 .fast_movbe,
2376 .fast_scalar_fsqrt,
2377 .fast_scalar_shift_masks,
2378 .fast_variable_perlane_shuffle,
2379 .fast_vector_fsqrt,
2380 .fma,
2381 .fsgsbase,
2382 .fxsr,
2383 .idivq_to_divl,
2384 .lzcnt,
2385 .mmx,
2386 .movbe,
2387 .mwaitx,
2388 .nopl,
2389 .pclmul,
2390 .popcnt,
2391 .prfchw,
2392 .rdrnd,
2393 .rdseed,
2394 .sahf,
2395 .sbb_dep_breaking,
2396 .sha,
2397 .slow_shld,
2398 .sse4a,
2399 .vzeroupper,
2400 .x87,
2401 .xsavec,
2402 .xsaveopt,
2403 .xsaves,
2404 }),
2405 };
2406 pub const c86_4g_m6: CpuModel = .{
2407 .name = "c86_4g_m6",
2408 .llvm_name = "c86-4g-m6",
2409 .features = featureSet(&[_]Feature{
2410 .@"64bit",
2411 .adx,
2412 .aes,
2413 .allow_light_256_bit,
2414 .avx2,
2415 .bmi,
2416 .bmi2,
2417 .clflushopt,
2418 .clzero,
2419 .cmov,
2420 .cx16,
2421 .f16c,
2422 .fast_15bytenop,
2423 .fast_bextr,
2424 .fast_imm16,
2425 .fast_lzcnt,
2426 .fast_movbe,
2427 .fast_scalar_fsqrt,
2428 .fast_scalar_shift_masks,
2429 .fast_variable_perlane_shuffle,
2430 .fast_vector_fsqrt,
2431 .fma,
2432 .fsgsbase,
2433 .fxsr,
2434 .idivq_to_divl,
2435 .lzcnt,
2436 .mmx,
2437 .movbe,
2438 .mwaitx,
2439 .nopl,
2440 .pclmul,
2441 .popcnt,
2442 .prfchw,
2443 .rdrnd,
2444 .rdseed,
2445 .sahf,
2446 .sbb_dep_breaking,
2447 .sha,
2448 .slow_shld,
2449 .sse4a,
2450 .vzeroupper,
2451 .x87,
2452 .xsavec,
2453 .xsaveopt,
2454 .xsaves,
2455 }),
2456 };
2457 pub const c86_4g_m7: CpuModel = .{
2458 .name = "c86_4g_m7",
2459 .llvm_name = "c86-4g-m7",
2460 .features = featureSet(&[_]Feature{
2461 .@"64bit",
2462 .adx,
2463 .allow_light_256_bit,
2464 .avx512bf16,
2465 .avx512bitalg,
2466 .avx512cd,
2467 .avx512dq,
2468 .avx512ifma,
2469 .avx512vbmi,
2470 .avx512vbmi2,
2471 .avx512vl,
2472 .avx512vnni,
2473 .avx512vpopcntdq,
2474 .bmi,
2475 .bmi2,
2476 .branchfusion,
2477 .clflushopt,
2478 .clwb,
2479 .clzero,
2480 .cmov,
2481 .cx16,
2482 .fast_15bytenop,
2483 .fast_bextr,
2484 .fast_imm16,
2485 .fast_lzcnt,
2486 .fast_movbe,
2487 .fast_scalar_fsqrt,
2488 .fast_scalar_shift_masks,
2489 .fast_variable_perlane_shuffle,
2490 .fast_vector_fsqrt,
2491 .fsgsbase,
2492 .fxsr,
2493 .gfni,
2494 .idivq_to_divl,
2495 .lzcnt,
2496 .mmx,
2497 .movbe,
2498 .mwaitx,
2499 .nopl,
2500 .popcnt,
2501 .prefer_256_bit,
2502 .prefer_no_gather,
2503 .prefer_no_scatter,
2504 .prfchw,
2505 .rdrnd,
2506 .rdseed,
2507 .sahf,
2508 .sbb_dep_breaking,
2509 .sha,
2510 .slow_shld,
2511 .sse4a,
2512 .vaes,
2513 .vpclmulqdq,
2514 .vzeroupper,
2515 .wbnoinvd,
2516 .x87,
2517 .xsavec,
2518 .xsaveopt,
2519 .xsaves,
2520 }),
2521 };
2522 pub const c86_4g_m8: CpuModel = .{
2523 .name = "c86_4g_m8",
2524 .llvm_name = "c86-4g-m8",
2525 .features = featureSet(&[_]Feature{
2526 .@"64bit",
2527 .adx,
2528 .allow_light_256_bit,
2529 .avx512bf16,
2530 .avx512bitalg,
2531 .avx512cd,
2532 .avx512dq,
2533 .avx512ifma,
2534 .avx512vbmi,
2535 .avx512vbmi2,
2536 .avx512vl,
2537 .avx512vnni,
2538 .avx512vpopcntdq,
2539 .bmi,
2540 .bmi2,
2541 .branchfusion,
2542 .clflushopt,
2543 .clwb,
2544 .clzero,
2545 .cmov,
2546 .cx16,
2547 .fast_15bytenop,
2548 .fast_bextr,
2549 .fast_imm16,
2550 .fast_lzcnt,
2551 .fast_movbe,
2552 .fast_scalar_fsqrt,
2553 .fast_scalar_shift_masks,
2554 .fast_variable_perlane_shuffle,
2555 .fast_vector_fsqrt,
2556 .fsgsbase,
2557 .fxsr,
2558 .gfni,
2559 .idivq_to_divl,
2560 .lzcnt,
2561 .mmx,
2562 .movbe,
2563 .mwaitx,
2564 .nopl,
2565 .popcnt,
2566 .prefer_256_bit,
2567 .prefer_no_gather,
2568 .prefer_no_scatter,
2569 .prfchw,
2570 .rdrnd,
2571 .rdseed,
2572 .sahf,
2573 .sbb_dep_breaking,
2574 .sha,
2575 .shstk,
2576 .slow_shld,
2577 .sse4a,
2578 .vaes,
2579 .vpclmulqdq,
2580 .vzeroupper,
2581 .wbnoinvd,
2582 .x87,
2583 .xsavec,
2584 .xsaveopt,
2585 .xsaves,
2586 }),
2587 };
2162 pub const cannonlake: CpuModel = .{2588 pub const cannonlake: CpuModel = .{
2163 .name = "cannonlake",2589 .name = "cannonlake",
2164 .llvm_name = "cannonlake",2590 .llvm_name = "cannonlake",
...@@ -2467,7 +2893,6 @@ pub const cpu = struct {...@@ -2467,7 +2893,6 @@ pub const cpu = struct {
2467 .amx_fp8,2893 .amx_fp8,
2468 .amx_int8,2894 .amx_int8,
2469 .amx_movrs,2895 .amx_movrs,
2470 .amx_tf32,
2471 .avx10_2,2896 .avx10_2,
2472 .avxifma,2897 .avxifma,
2473 .avxneconvert,2898 .avxneconvert,
...@@ -2505,6 +2930,7 @@ pub const cpu = struct {...@@ -2505,6 +2930,7 @@ pub const cpu = struct {
2505 .gfni,2930 .gfni,
2506 .idivq_to_divl,2931 .idivq_to_divl,
2507 .invpcid,2932 .invpcid,
2933 .jmpabs,
2508 .lzcnt,2934 .lzcnt,
2509 .macrofusion,2935 .macrofusion,
2510 .mmx,2936 .mmx,
...@@ -2523,6 +2949,7 @@ pub const cpu = struct {...@@ -2523,6 +2949,7 @@ pub const cpu = struct {
2523 .popcnt,2949 .popcnt,
2524 .ppx,2950 .ppx,
2525 .prefer_256_bit,2951 .prefer_256_bit,
2952 .prefer_legacy_setcc,
2526 .prefetchi,2953 .prefetchi,
2527 .prfchw,2954 .prfchw,
2528 .ptwrite,2955 .ptwrite,
...@@ -3056,8 +3483,9 @@ pub const cpu = struct {...@@ -3056,8 +3483,9 @@ pub const cpu = struct {
3056 .cx16,3483 .cx16,
3057 .ermsb,3484 .ermsb,
3058 .f16c,3485 .f16c,
3059 .false_deps_lzcnt_tzcnt,3486 .false_deps_lzcnt,
3060 .false_deps_popcnt,3487 .false_deps_popcnt,
3488 .false_deps_tzcnt,
3061 .fast_15bytenop,3489 .fast_15bytenop,
3062 .fast_scalar_fsqrt,3490 .fast_scalar_fsqrt,
3063 .fast_shld_rotate,3491 .fast_shld_rotate,
...@@ -3679,6 +4107,7 @@ pub const cpu = struct {...@@ -3679,6 +4107,7 @@ pub const cpu = struct {
3679 .hreset,4107 .hreset,
3680 .idivq_to_divl,4108 .idivq_to_divl,
3681 .invpcid,4109 .invpcid,
4110 .jmpabs,
3682 .lzcnt,4111 .lzcnt,
3683 .macrofusion,4112 .macrofusion,
3684 .mmx,4113 .mmx,
...@@ -3696,6 +4125,7 @@ pub const cpu = struct {...@@ -3696,6 +4125,7 @@ pub const cpu = struct {
3696 .pku,4125 .pku,
3697 .popcnt,4126 .popcnt,
3698 .ppx,4127 .ppx,
4128 .prefer_legacy_setcc,
3699 .prefer_movmsk_over_vtest,4129 .prefer_movmsk_over_vtest,
3700 .prefetchi,4130 .prefetchi,
3701 .prfchw,4131 .prfchw,
...@@ -4813,8 +5243,9 @@ pub const cpu = struct {...@@ -4813,8 +5243,9 @@ pub const cpu = struct {
4813 .cmov,5243 .cmov,
4814 .cx16,5244 .cx16,
4815 .f16c,5245 .f16c,
4816 .false_deps_lzcnt_tzcnt,5246 .false_deps_lzcnt,
4817 .false_deps_popcnt,5247 .false_deps_popcnt,
5248 .false_deps_tzcnt,
4818 .fast_15bytenop,5249 .fast_15bytenop,
4819 .fast_scalar_fsqrt,5250 .fast_scalar_fsqrt,
4820 .fast_shld_rotate,5251 .fast_shld_rotate,
...@@ -5086,6 +5517,8 @@ pub const cpu = struct {...@@ -5086,6 +5517,8 @@ pub const cpu = struct {
5086 .clzero,5517 .clzero,
5087 .cmov,5518 .cmov,
5088 .cx16,5519 .cx16,
5520 .false_deps_compress,
5521 .false_deps_expand,
5089 .fast_15bytenop,5522 .fast_15bytenop,
5090 .fast_bextr,5523 .fast_bextr,
5091 .fast_dpwssd,5524 .fast_dpwssd,
...@@ -5159,6 +5592,10 @@ pub const cpu = struct {...@@ -5159,6 +5592,10 @@ pub const cpu = struct {
5159 .clzero,5592 .clzero,
5160 .cmov,5593 .cmov,
5161 .cx16,5594 .cx16,
5595 .false_deps_bls,
5596 .false_deps_compress,
5597 .false_deps_expand,
5598 .false_deps_tzcnt,
5162 .fast_15bytenop,5599 .fast_15bytenop,
5163 .fast_bextr,5600 .fast_bextr,
5164 .fast_dpwssd,5601 .fast_dpwssd,
...@@ -5195,6 +5632,7 @@ pub const cpu = struct {...@@ -5195,6 +5632,7 @@ pub const cpu = struct {
5195 .sbb_dep_breaking,5632 .sbb_dep_breaking,
5196 .sha,5633 .sha,
5197 .shstk,5634 .shstk,
5635 .slow_indirect_call,
5198 .smap,5636 .smap,
5199 .smep,5637 .smep,
5200 .sse4a,5638 .sse4a,
...@@ -5208,4 +5646,83 @@ pub const cpu = struct {...@@ -5208,4 +5646,83 @@ pub const cpu = struct {
5208 .xsaves,5646 .xsaves,
5209 }),5647 }),
5210 };5648 };
5649 pub const znver6: CpuModel = .{
5650 .name = "znver6",
5651 .llvm_name = "znver6",
5652 .features = featureSet(&[_]Feature{
5653 .@"64bit",
5654 .adx,
5655 .allow_light_256_bit,
5656 .avx512bf16,
5657 .avx512bitalg,
5658 .avx512bmm,
5659 .avx512cd,
5660 .avx512dq,
5661 .avx512fp16,
5662 .avx512ifma,
5663 .avx512vbmi,
5664 .avx512vbmi2,
5665 .avx512vl,
5666 .avx512vnni,
5667 .avx512vp2intersect,
5668 .avx512vpopcntdq,
5669 .avxifma,
5670 .avxneconvert,
5671 .avxvnni,
5672 .avxvnniint8,
5673 .bmi,
5674 .bmi2,
5675 .branchfusion,
5676 .clflushopt,
5677 .clwb,
5678 .clzero,
5679 .cmov,
5680 .cx16,
5681 .fast_15bytenop,
5682 .fast_bextr,
5683 .fast_dpwssd,
5684 .fast_imm16,
5685 .fast_lzcnt,
5686 .fast_movbe,
5687 .fast_scalar_fsqrt,
5688 .fast_scalar_shift_masks,
5689 .fast_variable_perlane_shuffle,
5690 .fast_vector_fsqrt,
5691 .fsgsbase,
5692 .fsrm,
5693 .fxsr,
5694 .gfni,
5695 .idivq_to_divl,
5696 .invpcid,
5697 .lzcnt,
5698 .macrofusion,
5699 .mmx,
5700 .movbe,
5701 .movdir64b,
5702 .movdiri,
5703 .mwaitx,
5704 .nopl,
5705 .pku,
5706 .popcnt,
5707 .prefetchi,
5708 .prfchw,
5709 .rdpid,
5710 .rdpru,
5711 .rdrnd,
5712 .rdseed,
5713 .sahf,
5714 .sbb_dep_breaking,
5715 .sha,
5716 .shstk,
5717 .sse4a,
5718 .vaes,
5719 .vpclmulqdq,
5720 .vzeroupper,
5721 .wbnoinvd,
5722 .x87,
5723 .xsavec,
5724 .xsaveopt,
5725 .xsaves,
5726 }),
5727 };
5211};5728};
lib/std/Target/xtensa.zig+35
...@@ -13,6 +13,7 @@ pub const Feature = enum {...@@ -13,6 +13,7 @@ pub const Feature = enum {
13 density,13 density,
14 dfpaccel,14 dfpaccel,
15 div32,15 div32,
16 esp32s2ops,
16 exception,17 exception,
17 extendedl32r,18 extendedl32r,
18 forced_atomics,19 forced_atomics,
...@@ -93,6 +94,11 @@ pub const all_features = blk: {...@@ -93,6 +94,11 @@ pub const all_features = blk: {
93 .description = "Enable Xtensa Div32 option",94 .description = "Enable Xtensa Div32 option",
94 .dependencies = featureSet(&[_]Feature{}),95 .dependencies = featureSet(&[_]Feature{}),
95 };96 };
97 result[@backingInt(Feature.esp32s2ops)] = .{
98 .llvm_name = "esp32s2ops",
99 .description = "Support Xtensa esp32-s2 ISA extension",
100 .dependencies = featureSet(&[_]Feature{}),
101 };
96 result[@backingInt(Feature.exception)] = .{102 result[@backingInt(Feature.exception)] = .{
97 .llvm_name = "exception",103 .llvm_name = "exception",
98 .description = "Enable Xtensa Exception option",104 .description = "Enable Xtensa Exception option",
...@@ -291,6 +297,35 @@ pub const cpu = struct {...@@ -291,6 +297,35 @@ pub const cpu = struct {
291 .windowed,297 .windowed,
292 }),298 }),
293 };299 };
300 pub const esp32s2: CpuModel = .{
301 .name = "esp32s2",
302 .llvm_name = "esp32s2",
303 .features = featureSet(&[_]Feature{
304 .clamps,
305 .coprocessor,
306 .dcache,
307 .debug,
308 .density,
309 .div32,
310 .esp32s2ops,
311 .exception,
312 .highpriinterrupts_level7,
313 .interrupt,
314 .minmax,
315 .miscsr,
316 .mul16,
317 .mul32,
318 .mul32high,
319 .nsa,
320 .prid,
321 .regprotect,
322 .rvector,
323 .sext,
324 .threadptr,
325 .timers3,
326 .windowed,
327 }),
328 };
294 pub const esp8266: CpuModel = .{329 pub const esp8266: CpuModel = .{
295 .name = "esp8266",330 .name = "esp8266",
296 .llvm_name = "esp8266",331 .llvm_name = "esp8266",
lib/std/c.zig+2
...@@ -11389,6 +11389,8 @@ pub extern "c" fn div(a: c_int, b: c_int) div_t;...@@ -11389,6 +11389,8 @@ pub extern "c" fn div(a: c_int, b: c_int) div_t;
11389pub extern "c" fn ldiv(a: c_long, b: c_long) ldiv_t;11389pub extern "c" fn ldiv(a: c_long, b: c_long) ldiv_t;
11390pub extern "c" fn lldiv(a: c_longlong, b: c_longlong) lldiv_t;11390pub extern "c" fn lldiv(a: c_longlong, b: c_longlong) lldiv_t;
1139111391
11392pub extern "c" fn wcslen(s: [*:0]const wchar_t) usize;
11393
11392pub extern "c" fn atoi(str: [*:0]const c_char) c_int;11394pub extern "c" fn atoi(str: [*:0]const c_char) c_int;
11393pub extern "c" fn atol(str: [*:0]const c_char) c_long;11395pub extern "c" fn atol(str: [*:0]const c_char) c_long;
11394pub extern "c" fn atoll(str: [*:0]const c_char) c_longlong;11396pub extern "c" fn atoll(str: [*:0]const c_char) c_longlong;
lib/std/crypto/ecdsa.zig+3
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1const builtin = @import("builtin");
1const std = @import("std");2const std = @import("std");
2const crypto = std.crypto;3const crypto = std.crypto;
3const fmt = std.fmt;4const fmt = std.fmt;
...@@ -439,6 +440,8 @@ test "Basic operations over EcdsaP384Sha384" {...@@ -439,6 +440,8 @@ test "Basic operations over EcdsaP384Sha384" {
439}440}
440441
441test "Basic operations over Secp256k1" {442test "Basic operations over Secp256k1" {
443 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
444
442 const io = testing.io;445 const io = testing.io;
443 const Scheme = EcdsaSecp256k1Sha256oSha256;446 const Scheme = EcdsaSecp256k1Sha256oSha256;
444 const kp = Scheme.KeyPair.generate(io);447 const kp = Scheme.KeyPair.generate(io);
lib/std/crypto/ml_dsa.zig+6
...@@ -2497,6 +2497,8 @@ test "polyPackT1 / polyUnpackT1 roundtrip" {...@@ -2497,6 +2497,8 @@ test "polyPackT1 / polyUnpackT1 roundtrip" {
2497}2497}
24982498
2499test "polyPackT0 / polyUnpackT0 roundtrip" {2499test "polyPackT0 / polyUnpackT0 roundtrip" {
2500 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/229620
2501
2500 // Create a test polynomial with coefficients in (Q-2^12, Q+2^12]2502 // Create a test polynomial with coefficients in (Q-2^12, Q+2^12]
2501 // This is the range (-2^12, 2^12] represented as unsigned around Q2503 // This is the range (-2^12, 2^12] represented as unsigned around Q
2502 const bound = 1 << 12; // 2^(D-1) where D=132504 const bound = 1 << 12; // 2^(D-1) where D=13
...@@ -2846,6 +2848,8 @@ fn testKeyGenerationBasic(comptime MlDsa: type, seed: [32]u8) !void {...@@ -2846,6 +2848,8 @@ fn testKeyGenerationBasic(comptime MlDsa: type, seed: [32]u8) !void {
2846}2848}
28472849
2848test "Key generation basic - all variants" {2850test "Key generation basic - all variants" {
2851 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/229620
2852
2849 inline for (.{2853 inline for (.{
2850 .{ .variant = MLDSA44, .seed_byte = 0x44 },2854 .{ .variant = MLDSA44, .seed_byte = 0x44 },
2851 .{ .variant = MLDSA65, .seed_byte = 0x65 },2855 .{ .variant = MLDSA65, .seed_byte = 0x65 },
...@@ -2857,6 +2861,8 @@ test "Key generation basic - all variants" {...@@ -2857,6 +2861,8 @@ test "Key generation basic - all variants" {
2857}2861}
28582862
2859test "Key generation determinism" {2863test "Key generation determinism" {
2864 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/229620
2865
2860 const seed = [_]u8{ 0x12, 0x34, 0x56, 0x78 } ++ @as([28]u8, @splat(0xAB));2866 const seed = [_]u8{ 0x12, 0x34, 0x56, 0x78 } ++ @as([28]u8, @splat(0xAB));
28612867
2862 // Generate two key pairs from the same seed2868 // Generate two key pairs from the same seed
lib/std/crypto/pcurves/tests/secp256k1.zig+19
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1const builtin = @import("builtin");
1const std = @import("std");2const std = @import("std");
2const fmt = std.fmt;3const fmt = std.fmt;
3const testing = std.testing;4const testing = std.testing;
...@@ -7,6 +8,8 @@ const Secp256k1 = @import("../secp256k1.zig").Secp256k1;...@@ -7,6 +8,8 @@ const Secp256k1 = @import("../secp256k1.zig").Secp256k1;
7const lambda: u256 = 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72;8const lambda: u256 = 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72;
89
9test "secp256k1 ECDH key exchange" {10test "secp256k1 ECDH key exchange" {
11 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
12
10 const io = testing.io;13 const io = testing.io;
11 const dha = Secp256k1.scalar.random(io, .little);14 const dha = Secp256k1.scalar.random(io, .little);
12 const dhb = Secp256k1.scalar.random(io, .little);15 const dhb = Secp256k1.scalar.random(io, .little);
...@@ -18,6 +21,8 @@ test "secp256k1 ECDH key exchange" {...@@ -18,6 +21,8 @@ test "secp256k1 ECDH key exchange" {
18}21}
1922
20test "secp256k1 ECDH key exchange including public multiplication" {23test "secp256k1 ECDH key exchange including public multiplication" {
24 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
25
21 const io = testing.io;26 const io = testing.io;
22 const dha = Secp256k1.scalar.random(io, .little);27 const dha = Secp256k1.scalar.random(io, .little);
23 const dhb = Secp256k1.scalar.random(io, .little);28 const dhb = Secp256k1.scalar.random(io, .little);
...@@ -29,6 +34,8 @@ test "secp256k1 ECDH key exchange including public multiplication" {...@@ -29,6 +34,8 @@ test "secp256k1 ECDH key exchange including public multiplication" {
29}34}
3035
31test "secp256k1 point from affine coordinates" {36test "secp256k1 point from affine coordinates" {
37 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
38
32 const xh = "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798";39 const xh = "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798";
33 const yh = "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8";40 const yh = "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8";
34 var xs: [32]u8 = undefined;41 var xs: [32]u8 = undefined;
...@@ -40,6 +47,8 @@ test "secp256k1 point from affine coordinates" {...@@ -40,6 +47,8 @@ test "secp256k1 point from affine coordinates" {
40}47}
4148
42test "secp256k1 test vectors" {49test "secp256k1 test vectors" {
50 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
51
43 const expected = [_][]const u8{52 const expected = [_][]const u8{
44 "0000000000000000000000000000000000000000000000000000000000000000",53 "0000000000000000000000000000000000000000000000000000000000000000",
45 "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",54 "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
...@@ -81,6 +90,8 @@ test "secp256k1 test vectors - doubling" {...@@ -81,6 +90,8 @@ test "secp256k1 test vectors - doubling" {
81}90}
8291
83test "secp256k1 compressed sec1 encoding/decoding" {92test "secp256k1 compressed sec1 encoding/decoding" {
93 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
94
84 const io = testing.io;95 const io = testing.io;
85 const p = Secp256k1.random(io);96 const p = Secp256k1.random(io);
86 const s = p.toCompressedSec1();97 const s = p.toCompressedSec1();
...@@ -89,6 +100,8 @@ test "secp256k1 compressed sec1 encoding/decoding" {...@@ -89,6 +100,8 @@ test "secp256k1 compressed sec1 encoding/decoding" {
89}100}
90101
91test "secp256k1 uncompressed sec1 encoding/decoding" {102test "secp256k1 uncompressed sec1 encoding/decoding" {
103 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
104
92 const io = testing.io;105 const io = testing.io;
93 const p = Secp256k1.random(io);106 const p = Secp256k1.random(io);
94 const s = p.toUncompressedSec1();107 const s = p.toUncompressedSec1();
...@@ -104,6 +117,8 @@ test "secp256k1 public key is the neutral element" {...@@ -104,6 +117,8 @@ test "secp256k1 public key is the neutral element" {
104}117}
105118
106test "secp256k1 public key is the neutral element (public verification)" {119test "secp256k1 public key is the neutral element (public verification)" {
120 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
121
107 const io = testing.io;122 const io = testing.io;
108 const n = Secp256k1.scalar.Scalar.zero.toBytes(.little);123 const n = Secp256k1.scalar.Scalar.zero.toBytes(.little);
109 const p = Secp256k1.random(io);124 const p = Secp256k1.random(io);
...@@ -131,6 +146,8 @@ test "secp256k1 uncompressed SEC1 must not accept infinity" {...@@ -131,6 +146,8 @@ test "secp256k1 uncompressed SEC1 must not accept infinity" {
131}146}
132147
133test "secp256k1 double base multiplication" {148test "secp256k1 double base multiplication" {
149 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
150
134 const p1 = Secp256k1.basePoint;151 const p1 = Secp256k1.basePoint;
135 const p2 = Secp256k1.basePoint.dbl();152 const p2 = Secp256k1.basePoint.dbl();
136 const s1: [32]u8 = @splat(0x01);153 const s1: [32]u8 = @splat(0x01);
...@@ -141,6 +158,8 @@ test "secp256k1 double base multiplication" {...@@ -141,6 +158,8 @@ test "secp256k1 double base multiplication" {
141}158}
142159
143test "secp256k1 public multiplication" {160test "secp256k1 public multiplication" {
161 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
162
144 const io = testing.io;163 const io = testing.io;
145 const n = Secp256k1.scalar.field_order;164 const n = Secp256k1.scalar.field_order;
146 const p = Secp256k1.random(io);165 const p = Secp256k1.random(io);
lib/std/debug.zig-3
...@@ -271,9 +271,6 @@ pub const sys_can_stack_trace = switch (builtin.cpu.arch) {...@@ -271,9 +271,6 @@ pub const sys_can_stack_trace = switch (builtin.cpu.arch) {
271 .bpfeb,271 .bpfeb,
272 => false,272 => false,
273273
274 // https://codeberg.org/ziglang/zig/issues/31127
275 .avr => false,
276
277 else => true,274 else => true,
278};275};
279276
lib/std/debug/Dwarf.zig-1
...@@ -1597,7 +1597,6 @@ pub fn spRegNum(arch: std.Target.Cpu.Arch) u16 {...@@ -1597,7 +1597,6 @@ pub fn spRegNum(arch: std.Target.Cpu.Arch) u16 {
1597/// library has a working implementation of unwinding for the current target.1597/// library has a working implementation of unwinding for the current target.
1598pub fn supportsUnwinding(target: *const std.Target) bool {1598pub fn supportsUnwinding(target: *const std.Target) bool {
1599 return switch (target.cpu.arch) {1599 return switch (target.cpu.arch) {
1600 .amdgcn,
1601 .nvptx,1600 .nvptx,
1602 .nvptx64,1601 .nvptx64,
1603 .spirv32,1602 .spirv32,
lib/std/lang.zig+2-4
...@@ -322,9 +322,11 @@ pub const CallingConvention = union(enum(u8)) {...@@ -322,9 +322,11 @@ pub const CallingConvention = union(enum(u8)) {
322322
323 /// The standard `loongarch64` calling convention.323 /// The standard `loongarch64` calling convention.
324 loongarch64_lp64: CommonOptions,324 loongarch64_lp64: CommonOptions,
325 loongarch64_preserve_none: CommonOptions,
325326
326 /// The standard `loongarch32` calling convention.327 /// The standard `loongarch32` calling convention.
327 loongarch32_ilp32: CommonOptions,328 loongarch32_ilp32: CommonOptions,
329 loongarch32_preserve_none: CommonOptions,
328330
329 // Calling conventions for the `m68k` architecture.331 // Calling conventions for the `m68k` architecture.
330 m68k_sysv: CommonOptions,332 m68k_sysv: CommonOptions,
...@@ -615,10 +617,6 @@ pub const AddressSpace = enum(u5) {...@@ -615,10 +617,6 @@ pub const AddressSpace = enum(u5) {
615617
616 /// This address space only addresses the "lookup" ram618 /// This address space only addresses the "lookup" ram
617 lut,619 lut,
618
619 // Web Assembly
620 externref,
621 funcref,
622};620};
623621
624/// This data structure is used by the Zig language code generation and622/// This data structure is used by the Zig language code generation and
lib/std/pdb.zig+1
...@@ -310,6 +310,7 @@ pub const SymbolKind = enum(u16) {...@@ -310,6 +310,7 @@ pub const SymbolKind = enum(u16) {
310 gmandata = 4381,310 gmandata = 4381,
311 lthread32 = 4370,311 lthread32 = 4370,
312 gthread32 = 4371,312 gthread32 = 4371,
313 _,
313};314};
314315
315pub const TypeIndex = u32;316pub const TypeIndex = u32;
lib/std/zig/llvm/Builder.zig+26-8
...@@ -508,7 +508,7 @@ pub const DataLayout = struct {...@@ -508,7 +508,7 @@ pub const DataLayout = struct {
508 "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128",508 "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
509 .sparc => "E-m:e-p:32:32-i64:64-i128:128-f128:64-n32-S64",509 .sparc => "E-m:e-p:32:32-i64:64-i128:128-f128:64-n32-S64",
510 .sparc64 => "E-m:e-i64:64-i128:128-n32:64-S128",510 .sparc64 => "E-m:e-i64:64-i128:128-n32:64-S128",
511 .s390x => "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64",511 .s390x => "E-S64-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64",
512 .x86 => if (target.os.tag == .windows or target.os.tag == .uefi) switch (target.abi) {512 .x86 => if (target.os.tag == .windows or target.os.tag == .uefi) switch (target.abi) {
513 .gnu => if (target.ofmt == .coff)513 .gnu => if (target.ofmt == .coff)
514 "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"514 "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32"
...@@ -2840,7 +2840,6 @@ pub const AddrSpace = enum(u24) {...@@ -2840,7 +2840,6 @@ pub const AddrSpace = enum(u24) {
2840 pub const gs: AddrSpace = @fromBackingInt(256);2840 pub const gs: AddrSpace = @fromBackingInt(256);
2841 pub const fs: AddrSpace = @fromBackingInt(257);2841 pub const fs: AddrSpace = @fromBackingInt(257);
2842 pub const ss: AddrSpace = @fromBackingInt(258);2842 pub const ss: AddrSpace = @fromBackingInt(258);
2843
2844 pub const ptr32_sptr: AddrSpace = @fromBackingInt(270);2843 pub const ptr32_sptr: AddrSpace = @fromBackingInt(270);
2845 pub const ptr32_uptr: AddrSpace = @fromBackingInt(271);2844 pub const ptr32_uptr: AddrSpace = @fromBackingInt(271);
2846 pub const ptr64: AddrSpace = @fromBackingInt(272);2845 pub const ptr64: AddrSpace = @fromBackingInt(272);
...@@ -2858,17 +2857,19 @@ pub const AddrSpace = enum(u24) {...@@ -2858,17 +2857,19 @@ pub const AddrSpace = enum(u24) {
2858 pub const program5: AddrSpace = @fromBackingInt(6);2857 pub const program5: AddrSpace = @fromBackingInt(6);
2859 };2858 };
28602859
2861 // See llvm/lib/Target/NVPTX/NVPTX.h2860 // See llvm/include/llvm/Support/NVPTXAddrSpace.h
2862 pub const nvptx = struct {2861 pub const nvptx = struct {
2863 pub const generic: AddrSpace = @fromBackingInt(0);2862 pub const generic: AddrSpace = @fromBackingInt(0);
2864 pub const global: AddrSpace = @fromBackingInt(1);2863 pub const global: AddrSpace = @fromBackingInt(1);
2865 pub const constant: AddrSpace = @fromBackingInt(2);
2866 pub const shared: AddrSpace = @fromBackingInt(3);2864 pub const shared: AddrSpace = @fromBackingInt(3);
2867 pub const param: AddrSpace = @fromBackingInt(4);2865 pub const constant: AddrSpace = @fromBackingInt(4);
2868 pub const local: AddrSpace = @fromBackingInt(5);2866 pub const local: AddrSpace = @fromBackingInt(5);
2867 pub const tensor: AddrSpace = @fromBackingInt(6);
2868 pub const shared_cluster: AddrSpace = @fromBackingInt(7);
2869 pub const entry_param: AddrSpace = @fromBackingInt(101);
2869 };2870 };
28702871
2871 // See llvm/lib/Target/AMDGPU/AMDGPU.h2872 // See llvm/include/llvm/Support/AMDGPUAddrSpace.h
2872 pub const amdgpu = struct {2873 pub const amdgpu = struct {
2873 pub const flat: AddrSpace = @fromBackingInt(0);2874 pub const flat: AddrSpace = @fromBackingInt(0);
2874 pub const global: AddrSpace = @fromBackingInt(1);2875 pub const global: AddrSpace = @fromBackingInt(1);
...@@ -2901,6 +2902,7 @@ pub const AddrSpace = enum(u24) {...@@ -2901,6 +2902,7 @@ pub const AddrSpace = enum(u24) {
2901 pub const streamout_register: AddrSpace = @fromBackingInt(128);2902 pub const streamout_register: AddrSpace = @fromBackingInt(128);
2902 };2903 };
29032904
2905 // See llvm/lib/Target/SPIRV/SPIRVUtils.h
2904 pub const spirv = struct {2906 pub const spirv = struct {
2905 pub const function: AddrSpace = @fromBackingInt(0);2907 pub const function: AddrSpace = @fromBackingInt(0);
2906 pub const cross_workgroup: AddrSpace = @fromBackingInt(1);2908 pub const cross_workgroup: AddrSpace = @fromBackingInt(1);
...@@ -2910,14 +2912,30 @@ pub const AddrSpace = enum(u24) {...@@ -2910,14 +2912,30 @@ pub const AddrSpace = enum(u24) {
2910 pub const device_only_intel: AddrSpace = @fromBackingInt(5);2912 pub const device_only_intel: AddrSpace = @fromBackingInt(5);
2911 pub const host_only_intel: AddrSpace = @fromBackingInt(6);2913 pub const host_only_intel: AddrSpace = @fromBackingInt(6);
2912 pub const input: AddrSpace = @fromBackingInt(7);2914 pub const input: AddrSpace = @fromBackingInt(7);
2915 pub const output: AddrSpace = @fromBackingInt(8);
2916 pub const code_section_intel: AddrSpace = @fromBackingInt(9);
2917 pub const private: AddrSpace = @fromBackingInt(10);
2918 pub const storage_buffer: AddrSpace = @fromBackingInt(11);
2919 pub const uniform: AddrSpace = @fromBackingInt(12);
2920 pub const push_constant: AddrSpace = @fromBackingInt(13);
2913 };2921 };
29142922
2915 // See llvm/include/llvm/CodeGen/WasmAddressSpaces.h2923 // See llvm/include/llvm/CodeGen/WasmAddressSpaces.h
2916 pub const wasm = struct {2924 pub const wasm = struct {
2917 pub const default: AddrSpace = @fromBackingInt(0);2925 pub const default: AddrSpace = @fromBackingInt(0);
2918 pub const variable: AddrSpace = @fromBackingInt(1);2926 pub const variable: AddrSpace = @fromBackingInt(1);
2919 pub const externref: AddrSpace = @fromBackingInt(10);2927 };
2920 pub const funcref: AddrSpace = @fromBackingInt(20);2928
2929 // See llvm/lib/TargetParser/TargetDataLayout.cpp
2930 pub const riscv = struct {
2931 pub const purecap: AddrSpace = @fromBackingInt(200);
2932 };
2933
2934 // See llvm/lib/Target/AArch64/AArch64ISelLowering.h
2935 pub const aarch64 = struct {
2936 pub const ptr32_sptr: AddrSpace = @fromBackingInt(270);
2937 pub const ptr32_uptr: AddrSpace = @fromBackingInt(271);
2938 pub const ptr64: AddrSpace = @fromBackingInt(272);
2921 };2939 };
29222940
2923 pub fn format(addr_space: AddrSpace, w: *Writer) Writer.Error!void {2941 pub fn format(addr_space: AddrSpace, w: *Writer) Writer.Error!void {
lib/std/zig/system/arm.zig+2
...@@ -121,11 +121,13 @@ pub const cpu_models = struct {...@@ -121,11 +121,13 @@ pub const cpu_models = struct {
121 // implementer = 0x48121 // implementer = 0x48
122 const HiSilicon = [_]E{122 const HiSilicon = [_]E{
123 E{ .part = 0xd01, .m64 = &A64.tsv110 },123 E{ .part = 0xd01, .m64 = &A64.tsv110 },
124 E{ .part = 0xd06, .m64 = &A64.hip12 },
124 };125 };
125 // implementer = 0x4e126 // implementer = 0x4e
126 const Nvidia = [_]E{127 const Nvidia = [_]E{
127 E{ .part = 0x004, .m64 = &A64.carmel },128 E{ .part = 0x004, .m64 = &A64.carmel },
128 E{ .part = 0x010, .m64 = &A64.olympus },129 E{ .part = 0x010, .m64 = &A64.olympus },
130 E{ .part = 0x011, .m64 = &A64.rigel },
129 };131 };
130 // implementer = 0x50132 // implementer = 0x50
131 const Ampere = [_]E{133 const Ampere = [_]E{
lib/std/zig/system/freebsd.zig+3-3
...@@ -80,11 +80,11 @@ const arm = struct {...@@ -80,11 +80,11 @@ const arm = struct {
80const powerpc = struct {80const powerpc = struct {
81 const models = .{81 const models = .{
82 .{ "Freescale e500v1 core", &std.Target.powerpc.cpu.e500 },82 .{ "Freescale e500v1 core", &std.Target.powerpc.cpu.e500 },
83 .{ "Freescale e500v2 core", &std.Target.powerpc.cpu.e500 }, // TODO: This should have efpu2.83 .{ "Freescale e500v2 core", &std.Target.powerpc.cpu.e500v2 },
84 .{ "Freescale e500mc core", &std.Target.powerpc.cpu.e500mc },84 .{ "Freescale e500mc core", &std.Target.powerpc.cpu.e500mc },
85 .{ "Freescale e5500 core", &std.Target.powerpc.cpu.e5500 },85 .{ "Freescale e5500 core", &std.Target.powerpc.cpu.e5500 },
86 .{ "Freescale e6500 core", &std.Target.powerpc.cpu.e5500 }, // TODO: This should have altivec.86 .{ "Freescale e6500 core", &std.Target.powerpc.cpu.e6500 },
87 .{ "IBM Cell Broadband Engine", &std.Target.powerpc.cpu.ppc64 },87 .{ "IBM Cell Broadband Engine", &std.Target.powerpc.cpu.cell },
88 .{ "IBM PowerPC 750FX", &std.Target.powerpc.cpu.@"750" },88 .{ "IBM PowerPC 750FX", &std.Target.powerpc.cpu.@"750" },
89 .{ "IBM PowerPC 970", &std.Target.powerpc.cpu.@"970" },89 .{ "IBM PowerPC 970", &std.Target.powerpc.cpu.@"970" },
90 .{ "IBM PowerPC 970FX", &std.Target.powerpc.cpu.@"970" },90 .{ "IBM PowerPC 970FX", &std.Target.powerpc.cpu.@"970" },
lib/std/zig/system/linux.zig+3-3
...@@ -442,16 +442,16 @@ const powerpc = struct {...@@ -442,16 +442,16 @@ const powerpc = struct {
442 .{ "750GX", &Target.powerpc.cpu.@"750" },442 .{ "750GX", &Target.powerpc.cpu.@"750" },
443 .{ "82xx", &Target.powerpc.cpu.@"603e" },443 .{ "82xx", &Target.powerpc.cpu.@"603e" },
444 .{ "APM821XX", &Target.powerpc.cpu.@"440" },444 .{ "APM821XX", &Target.powerpc.cpu.@"440" },
445 .{ "Cell", &Target.powerpc.cpu.ppc64 }, // TODO: Change with LLVM 23.445 .{ "Cell", &Target.powerpc.cpu.cell },
446 .{ "e300c1", &Target.powerpc.cpu.@"603e" },446 .{ "e300c1", &Target.powerpc.cpu.@"603e" },
447 .{ "e300c2", &Target.powerpc.cpu.@"603e" },447 .{ "e300c2", &Target.powerpc.cpu.@"603e" },
448 .{ "e300c3", &Target.powerpc.cpu.@"603e" },448 .{ "e300c3", &Target.powerpc.cpu.@"603e" },
449 .{ "e300c4", &Target.powerpc.cpu.@"603e" },449 .{ "e300c4", &Target.powerpc.cpu.@"603e" },
450 .{ "e500mc", &Target.powerpc.cpu.e500mc },450 .{ "e500mc", &Target.powerpc.cpu.e500mc },
451 .{ "e500v2", &Target.powerpc.cpu.e500 }, // TODO: Change with LLVM 23.451 .{ "e500v2", &Target.powerpc.cpu.e500v2 },
452 .{ "e500", &Target.powerpc.cpu.e500 },452 .{ "e500", &Target.powerpc.cpu.e500 },
453 .{ "e5500", &Target.powerpc.cpu.e5500 },453 .{ "e5500", &Target.powerpc.cpu.e5500 },
454 .{ "e6500", &Target.powerpc.cpu.e5500 }, // TODO: Change with LLVM 23.454 .{ "e6500", &Target.powerpc.cpu.e6500 },
455 .{ "G2_LE", &Target.powerpc.cpu.@"603e" },455 .{ "G2_LE", &Target.powerpc.cpu.@"603e" },
456 .{ "HX-C2000", &Target.powerpc.cpu.pwr8 },456 .{ "HX-C2000", &Target.powerpc.cpu.pwr8 },
457 .{ "POWER5+", &Target.powerpc.cpu.pwr5x },457 .{ "POWER5+", &Target.powerpc.cpu.pwr5x },
lib/std/zig/system/openbsd.zig+4-5
...@@ -38,11 +38,10 @@ const aarch64 = struct {...@@ -38,11 +38,10 @@ const aarch64 = struct {
38 .{ "Apple Avalanche Pro", &std.Target.aarch64.cpu.apple_m2 },38 .{ "Apple Avalanche Pro", &std.Target.aarch64.cpu.apple_m2 },
39 .{ "Apple Avalanche", &std.Target.aarch64.cpu.apple_m2 },39 .{ "Apple Avalanche", &std.Target.aarch64.cpu.apple_m2 },
40 .{ "Applied Micro X-Gene", &std.Target.aarch64.cpu.xgene1 },40 .{ "Applied Micro X-Gene", &std.Target.aarch64.cpu.xgene1 },
41 // TODO: Add these with LLVM 23.41 .{ "ARM C1-Nano", &std.Target.aarch64.cpu.c1_nano },
42 // .{ "ARM C1-Nano", &std.Target.aarch64.cpu.c1_nano },42 .{ "ARM C1-Pro", &std.Target.aarch64.cpu.c1_pro },
43 // .{ "ARM C1-Pro", &std.Target.aarch64.cpu.c1_pro },43 .{ "ARM C1-Ultra", &std.Target.aarch64.cpu.c1_ultra },
44 // .{ "ARM C1-Ultra", &std.Target.aarch64.cpu.c1_ultra },44 .{ "ARM C1-Premium", &std.Target.aarch64.cpu.c1_premium },
45 // .{ "ARM C1-Premium", &std.Target.aarch64.cpu.c1_premium },
46 .{ "ARM Cortex-A320", &std.Target.aarch64.cpu.cortex_a320 },45 .{ "ARM Cortex-A320", &std.Target.aarch64.cpu.cortex_a320 },
47 .{ "ARM Cortex-A34", &std.Target.aarch64.cpu.cortex_a34 },46 .{ "ARM Cortex-A34", &std.Target.aarch64.cpu.cortex_a34 },
48 .{ "ARM Cortex-A35", &std.Target.aarch64.cpu.cortex_a35 },47 .{ "ARM Cortex-A35", &std.Target.aarch64.cpu.cortex_a35 },
lib/std/zig/system/x86.zig+23-1
...@@ -74,6 +74,7 @@ pub fn detectNativeCpuAndFeatures(arch: Target.Cpu.Arch) Target.Cpu {...@@ -74,6 +74,7 @@ pub fn detectNativeCpuAndFeatures(arch: Target.Cpu.Arch) Target.Cpu {
74 if (switch (vendor) {74 if (switch (vendor) {
75 0x756e6547 => detectIntelProcessor(&cpu, family, model, brand_id),75 0x756e6547 => detectIntelProcessor(&cpu, family, model, brand_id),
76 0x68747541 => detectAmdProcessor(&cpu, family, model),76 0x68747541 => detectAmdProcessor(&cpu, family, model),
77 0x6f677948 => detectHygonProcessor(family, model),
77 else => null,78 else => null,
78 }) |m| b: {79 }) |m| b: {
79 // Some hypervisors are evil liars and will operate in long mode while identifying as a80 // Some hypervisors are evil liars and will operate in long mode while identifying as a
...@@ -209,7 +210,23 @@ fn detectAmdProcessor(cpu: *const Target.Cpu, family: u32, model: u32) ?*const T...@@ -209,7 +210,23 @@ fn detectAmdProcessor(cpu: *const Target.Cpu, family: u32, model: u32) ?*const T
209 0x10...0x1f, 0x60...0x6f, 0x70...0x7f, 0xa0...0xaf => &Target.x86.cpu.znver4,210 0x10...0x1f, 0x60...0x6f, 0x70...0x7f, 0xa0...0xaf => &Target.x86.cpu.znver4,
210 else => &Target.x86.cpu.znver3,211 else => &Target.x86.cpu.znver3,
211 },212 },
212 26 => &Target.x86.cpu.znver5,213 26 => switch (model) {
214 0x50...0x5f, 0x80...0xcf, 0xd8...0xe7 => &Target.x86.cpu.znver6,
215 else => &Target.x86.cpu.znver5,
216 },
217 else => null,
218 };
219}
220
221fn detectHygonProcessor(family: u32, model: u32) ?*const Target.Cpu.Model {
222 return switch (family) {
223 24 => switch (model) {
224 4 => &Target.x86.cpu.c86_4g_m4,
225 6 => &Target.x86.cpu.c86_4g_m6,
226 7 => &Target.x86.cpu.c86_4g_m7,
227 8 => &Target.x86.cpu.c86_4g_m8,
228 else => null,
229 },
213 else => null,230 else => null,
214 };231 };
215}232}
...@@ -340,9 +357,11 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {...@@ -340,9 +357,11 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {
340357
341 // AMD uses a different bit for prefetchi.358 // AMD uses a different bit for prefetchi.
342 setFeature(cpu, .prefetchi, bit(leaf.eax, 20));359 setFeature(cpu, .prefetchi, bit(leaf.eax, 20));
360 setFeature(cpu, .avx512bmm, bit(leaf.eax, 23) and has_avx512_save);
343 } else {361 } else {
344 for ([_]Target.x86.Feature{362 for ([_]Target.x86.Feature{
345 .prefetchi,363 .prefetchi,
364 .avx512bmm,
346 }) |feat| {365 }) |feat| {
347 setFeature(cpu, feat, false);366 setFeature(cpu, feat, false);
348 }367 }
...@@ -445,6 +464,7 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {...@@ -445,6 +464,7 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {
445 setFeature(cpu, .nf, bit(leaf.edx, 21) and has_apx_save);464 setFeature(cpu, .nf, bit(leaf.edx, 21) and has_apx_save);
446 setFeature(cpu, .cf, bit(leaf.edx, 21) and has_apx_save);465 setFeature(cpu, .cf, bit(leaf.edx, 21) and has_apx_save);
447 setFeature(cpu, .zu, bit(leaf.edx, 21) and has_apx_save);466 setFeature(cpu, .zu, bit(leaf.edx, 21) and has_apx_save);
467 setFeature(cpu, .jmpabs, bit(leaf.edx, 21) and has_apx_save);
448468
449 break :has_avx10 bit(leaf.edx, 19);469 break :has_avx10 bit(leaf.edx, 19);
450 } else {470 } else {
...@@ -474,6 +494,7 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {...@@ -474,6 +494,7 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {
474 .nf,494 .nf,
475 .cf,495 .cf,
476 .zu,496 .zu,
497 .jmpabs,
477 }) |feat| {498 }) |feat| {
478 setFeature(cpu, feat, false);499 setFeature(cpu, feat, false);
479 }500 }
...@@ -559,6 +580,7 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {...@@ -559,6 +580,7 @@ fn detectNativeFeatures(cpu: *Target.Cpu) void {
559 .nf,580 .nf,
560 .cf,581 .cf,
561 .zu,582 .zu,
583 .jmpabs,
562 }) |feat| {584 }) |feat| {
563 setFeature(cpu, feat, false);585 setFeature(cpu, feat, false);
564 }586 }
lib/zig.h-25
...@@ -5880,27 +5880,12 @@ typedef __float128 zig_f128;...@@ -5880,27 +5880,12 @@ typedef __float128 zig_f128;
5880#define zig_make_special_f128(sign, name, arg, repr) sign __builtin_##name##f128(arg)5880#define zig_make_special_f128(sign, name, arg, repr) sign __builtin_##name##f128(arg)
5881#else5881#else
5882#undef zig_has_f1285882#undef zig_has_f128
5883#if defined(zig_x86_64) && defined(ZIG_TARGET_ABI_MSVC)
5884#if defined(zig_msvc) && !defined(__clang__)
5885#include <emmintrin.h>
5886typedef __m128i zig_f128;
5887#define zig_init_repr_f128(hi, lo) { .m128i_u64 = { lo, hi } }
5888#define zig_lo_repr_f128(arg) (arg).m128i_u64[0]
5889#define zig_hi_repr_f128(arg) (arg).m128i_u64[1]
5890#else
5891typedef __attribute__((__vector_size__(2 * sizeof(uint64_t)))) uint64_t zig_f128;
5892#define zig_init_repr_f128(hi, lo) { lo, hi }
5893#define zig_lo_repr_f128(arg) (arg)[0]
5894#define zig_hi_repr_f128(arg) (arg)[1]
5895#endif
5896#else
5897typedef zig_u128 zig_f128;5883typedef zig_u128 zig_f128;
5898#define zig_init_repr_f128(hi, lo) zig_init_u128(hi, lo)5884#define zig_init_repr_f128(hi, lo) zig_init_u128(hi, lo)
5899#define zig_make_repr_f128(hi, lo) zig_make_u128(hi, lo)5885#define zig_make_repr_f128(hi, lo) zig_make_u128(hi, lo)
5900#define zig_lo_repr_f128(arg) zig_lo_u128(arg)5886#define zig_lo_repr_f128(arg) zig_lo_u128(arg)
5901#define zig_hi_repr_f128(arg) zig_hi_u128(arg)5887#define zig_hi_repr_f128(arg) zig_hi_u128(arg)
5902#endif5888#endif
5903#endif
5904#ifndef zig_has_f1285889#ifndef zig_has_f128
5905#define zig_has_f128 05890#define zig_has_f128 0
5906#define zig_make_f128(fp, repr) repr5891#define zig_make_f128(fp, repr) repr
...@@ -6188,16 +6173,6 @@ static inline zig_f128 zig_floatuntitf(zig_u128 arg) {...@@ -6188,16 +6173,6 @@ static inline zig_f128 zig_floatuntitf(zig_u128 arg) {
6188 extern zig_f128 __floatuntitf(zig_f128 arg);6173 extern zig_f128 __floatuntitf(zig_f128 arg);
6189 return __floatuntitf(zig_f128_bitCast_u128(arg));6174 return __floatuntitf(zig_f128_bitCast_u128(arg));
6190}6175}
6191#elif defined(zig_x86_64) && defined(zig_windows)
6192zig_common_float_builtins(128)
6193static inline zig_f128 zig_floattitf(zig_i128 arg) {
6194 extern zig_f128 __floattitf(zig_i128 arg);
6195 return __floattitf(arg);
6196}
6197static inline zig_f128 zig_floatuntitf(zig_u128 arg) {
6198 extern zig_f128 __floatuntitf(uint64_t arg_lo, uint64_t arg_hi);
6199 return __floatuntitf(zig_lo_u128(arg), zig_hi_u128(arg));
6200}
6201#else6176#else
6202zig_float_builtins(128)6177zig_float_builtins(128)
6203#endif6178#endif
src/Compilation.zig-2
...@@ -6358,8 +6358,6 @@ fn addCommonCCArgs(...@@ -6358,8 +6358,6 @@ fn addCommonCCArgs(
6358 // LLVM doesn't distinguish between Solaris and illumos, but the illumos GCC fork6358 // LLVM doesn't distinguish between Solaris and illumos, but the illumos GCC fork
6359 // defines this macro.6359 // defines this macro.
6360 .illumos => try argv.append("-D__illumos__"),6360 .illumos => try argv.append("-D__illumos__"),
6361 // This macro has not yet been upstreamed by SerenityOS to Clang.
6362 .serenity => try argv.append("-D__serenity__"),
6363 // Homebrew targets without LLVM support; use communities's preferred macros.6361 // Homebrew targets without LLVM support; use communities's preferred macros.
6364 .@"3ds" => try argv.append("-D__3DS__"),6362 .@"3ds" => try argv.append("-D__3DS__"),
6365 .wiiu => try argv.append("-D__WIIU__"),6363 .wiiu => try argv.append("-D__WIIU__"),
src/Zcu.zig+2
...@@ -4711,6 +4711,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum)...@@ -4711,6 +4711,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum)
4711 .avr_interrupt,4711 .avr_interrupt,
4712 .avr_signal,4712 .avr_signal,
4713 .ez80_tiflags,4713 .ez80_tiflags,
4714 .loongarch32_preserve_none,
4715 .loongarch64_preserve_none,
4714 .naked,4716 .naked,
4715 => true, // incoming stack alignment supported4717 => true, // incoming stack alignment supported
47164718
src/clang_options.zon+246-19
...@@ -218,11 +218,16 @@...@@ -218,11 +218,16 @@
218 .psl = true,218 .psl = true,
219},219},
220.{ .name = "d1PP", .psl = true },220.{ .name = "d1PP", .psl = true },
221.{ .name = "d1nodatetime", .psl = true },
222.{ .name = "d1nodatetime-", .psl = true },
221.{ .name = "d1reportAllClassLayout", .psl = true },223.{ .name = "d1reportAllClassLayout", .psl = true },
222.{ .name = "d2FastFail", .psl = true },224.{ .name = "d2FastFail", .psl = true },
223.{ .name = "d2Zi+", .psl = true },225.{ .name = "d2Zi+", .psl = true },
224.{ .name = "d2epilogunwind", .psl = true },226.{ .name = "d2epilogunwind", .psl = true },
225.{ .name = "d2epilogunwindrequirev2", .psl = true },227.{ .name = "d2epilogunwindrequirev2", .psl = true },
228.{ .name = "d2guardcfgdispatch", .psl = true },
229.{ .name = "d2guardcfgdispatch-", .psl = true },
230.{ .name = "d2guardnochecks", .psl = true },
226.{ .name = "diagnostics:caret", .psl = true },231.{ .name = "diagnostics:caret", .psl = true },
227.{ .name = "diagnostics:classic", .psl = true },232.{ .name = "diagnostics:classic", .psl = true },
228.{ .name = "diagnostics:column", .psl = true },233.{ .name = "diagnostics:column", .psl = true },
...@@ -343,6 +348,12 @@...@@ -343,6 +348,12 @@
343 .pd1 = false,348 .pd1 = false,
344 .pd2 = true,349 .pd2 = true,
345},350},
351.{
352 .name = "cstdlib",
353 .syntax = .separate,
354 .pd1 = false,
355 .pd2 = true,
356},
346.{357.{
347 .name = "debug",358 .name = "debug",
348 .ze = .debug,359 .ze = .debug,
...@@ -523,6 +534,11 @@...@@ -523,6 +534,11 @@
523 .pd1 = false,534 .pd1 = false,
524 .pd2 = true,535 .pd2 = true,
525},536},
537.{
538 .name = "precompile-reduced-bmi",
539 .pd1 = false,
540 .pd2 = true,
541},
526.{542.{
527 .name = "prefix",543 .name = "prefix",
528 .syntax = .separate,544 .syntax = .separate,
...@@ -586,6 +602,21 @@...@@ -586,6 +602,21 @@
586 .pd1 = false,602 .pd1 = false,
587 .pd2 = true,603 .pd2 = true,
588},604},
605.{
606 .name = "ssaf-include-local-entities",
607 .pd1 = false,
608 .pd2 = true,
609},
610.{
611 .name = "ssaf-list-extractors",
612 .pd1 = false,
613 .pd2 = true,
614},
615.{
616 .name = "ssaf-list-formats",
617 .pd1 = false,
618 .pd2 = true,
619},
589.{620.{
590 .name = "std",621 .name = "std",
591 .syntax = .separate,622 .syntax = .separate,
...@@ -845,6 +876,8 @@...@@ -845,6 +876,8 @@
845.{ .name = "cl-unsafe-math-optimizations" },876.{ .name = "cl-unsafe-math-optimizations" },
846.{ .name = "clangir-disable-passes" },877.{ .name = "clangir-disable-passes" },
847.{ .name = "clangir-disable-verifier" },878.{ .name = "clangir-disable-verifier" },
879.{ .name = "clangir-enable-idiom-recognizer" },
880.{ .name = "clangir-lib-opt" },
848.{ .name = "clear-ast-before-backend" },881.{ .name = "clear-ast-before-backend" },
849.{ .name = "code-completion-at", .syntax = .separate },882.{ .name = "code-completion-at", .syntax = .separate },
850.{ .name = "code-completion-brief-comments" },883.{ .name = "code-completion-brief-comments" },
...@@ -938,11 +971,15 @@...@@ -938,11 +971,15 @@
938.{ .name = "dwarf-debug-producer", .syntax = .separate },971.{ .name = "dwarf-debug-producer", .syntax = .separate },
939.{ .name = "dwarf-explicit-import" },972.{ .name = "dwarf-explicit-import" },
940.{ .name = "dwarf-ext-refs" },973.{ .name = "dwarf-ext-refs" },
974.{ .name = "Zsb", .psl = true },
975.{ .name = "Zss", .psl = true },
941.{ .name = "all-resources-bound", .psl = true },976.{ .name = "all-resources-bound", .psl = true },
942.{ .name = "Zpc", .psl = true },977.{ .name = "Zpc", .psl = true },
943.{ .name = "Vd", .psl = true },978.{ .name = "Vd", .psl = true },
944.{ .name = "Gis", .psl = true },979.{ .name = "Gis", .psl = true },
980.{ .name = "fdx-no-source-metadata" },
945.{ .name = "hlsl-no-stdinc", .psl = true },981.{ .name = "hlsl-no-stdinc", .psl = true },
982.{ .name = "fdx-record-command-line", .syntax = .separate },
946.{ .name = "rootsig-define", .syntax = .separate },983.{ .name = "rootsig-define", .syntax = .separate },
947.{984.{
948 .name = "force-rootsig-ver",985 .name = "force-rootsig-ver",
...@@ -1107,6 +1144,9 @@...@@ -1107,6 +1144,9 @@
1107.{ .name = "fcomplete-member-pointers" },1144.{ .name = "fcomplete-member-pointers" },
1108.{ .name = "fconst-strings" },1145.{ .name = "fconst-strings" },
1109.{ .name = "fconstant-cfstrings" },1146.{ .name = "fconstant-cfstrings" },
1147.{ .name = "fconstant-nsarray-literals" },
1148.{ .name = "fconstant-nsdictionary-literals" },
1149.{ .name = "fconstant-nsnumber-literals" },
1110.{ .name = "fconstant-string-class", .syntax = .separate },1150.{ .name = "fconstant-string-class", .syntax = .separate },
1111.{ .name = "fconvergent-functions" },1151.{ .name = "fconvergent-functions" },
1112.{ .name = "fcoro-aligned-allocation" },1152.{ .name = "fcoro-aligned-allocation" },
...@@ -1146,6 +1186,8 @@...@@ -1146,6 +1186,8 @@
1146.{ .name = "fdebug-pass-structure" },1186.{ .name = "fdebug-pass-structure" },
1147.{ .name = "fdebug-pre-fir-tree" },1187.{ .name = "fdebug-pre-fir-tree" },
1148.{ .name = "fdebug-ranges-base-address" },1188.{ .name = "fdebug-ranges-base-address" },
1189.{ .name = "fdebug-record-sysroot" },
1190.{ .name = "fdebug-run-lifetime-safety" },
1149.{ .name = "fdebug-types-section" },1191.{ .name = "fdebug-types-section" },
1150.{ .name = "fdebug-unparse" },1192.{ .name = "fdebug-unparse" },
1151.{ .name = "fdebug-unparse-no-sema" },1193.{ .name = "fdebug-unparse-no-sema" },
...@@ -1176,6 +1218,7 @@...@@ -1176,6 +1218,7 @@
1176.{ .name = "fdiagnostics-print-source-range-info" },1218.{ .name = "fdiagnostics-print-source-range-info" },
1177.{ .name = "fdiagnostics-show-category", .syntax = .separate },1219.{ .name = "fdiagnostics-show-category", .syntax = .separate },
1178.{ .name = "fdiagnostics-show-hotness" },1220.{ .name = "fdiagnostics-show-hotness" },
1221.{ .name = "fdiagnostics-show-inlining-chain" },
1179.{ .name = "fdiagnostics-show-line-numbers" },1222.{ .name = "fdiagnostics-show-line-numbers" },
1180.{ .name = "fdiagnostics-show-note-include-stack" },1223.{ .name = "fdiagnostics-show-note-include-stack" },
1181.{ .name = "fdiagnostics-show-option" },1224.{ .name = "fdiagnostics-show-option" },
...@@ -1214,17 +1257,27 @@...@@ -1214,17 +1257,27 @@
1214.{ .name = "femit-compact-unwind-non-canonical" },1257.{ .name = "femit-compact-unwind-non-canonical" },
1215.{ .name = "femulated-tls" },1258.{ .name = "femulated-tls" },
1216.{ .name = "fenable-matrix" },1259.{ .name = "fenable-matrix" },
1260.{ .name = "fenable-new-pm-codegen" },
1217.{ .name = "fencode-extended-block-signature" },1261.{ .name = "fencode-extended-block-signature" },
1262.{ .name = "fenumeration-type" },
1218.{ .name = "ferror-limit", .syntax = .separate },1263.{ .name = "ferror-limit", .syntax = .separate },
1219.{ .name = "fescaping-block-tail-calls" },1264.{ .name = "fescaping-block-tail-calls" },
1220.{ .name = "fexceptions" },1265.{ .name = "fexceptions" },
1266.{ .name = "fexec-charset", .syntax = .separate },
1267.{ .name = "fexperimental-abi-lowering" },
1268.{ .name = "fexperimental-allow-pointer-field-protection-attr" },
1221.{ .name = "fexperimental-call-graph-section" },1269.{ .name = "fexperimental-call-graph-section" },
1222.{ .name = "fexperimental-isel" },1270.{ .name = "fexperimental-isel" },
1223.{ .name = "fexperimental-late-parse-attributes" },1271.{ .name = "fexperimental-late-parse-attributes" },
1224.{ .name = "fexperimental-library" },1272.{ .name = "fexperimental-library" },
1273.{ .name = "fexperimental-lifetime-safety-c" },
1274.{ .name = "fexperimental-logical-pointer" },
1225.{ .name = "fexperimental-loop-fusion" },1275.{ .name = "fexperimental-loop-fusion" },
1226.{ .name = "fexperimental-new-constant-interpreter" },1276.{ .name = "fexperimental-new-constant-interpreter" },
1227.{ .name = "fexperimental-omit-vtable-rtti" },1277.{ .name = "fexperimental-omit-vtable-rtti" },
1278.{ .name = "fexperimental-overflow-behavior-types" },
1279.{ .name = "fexperimental-pointer-field-protection-abi" },
1280.{ .name = "fexperimental-pointer-field-protection-tagged" },
1228.{ .name = "fexperimental-relative-c++-abi-vtables" },1281.{ .name = "fexperimental-relative-c++-abi-vtables" },
1229.{ .name = "fexperimental-sanitize-metadata=atomics" },1282.{ .name = "fexperimental-sanitize-metadata=atomics" },
1230.{ .name = "fexperimental-sanitize-metadata=covered" },1283.{ .name = "fexperimental-sanitize-metadata=covered" },
...@@ -1259,6 +1312,7 @@...@@ -1259,6 +1312,7 @@
1259.{ .name = "ffixed-d5" },1312.{ .name = "ffixed-d5" },
1260.{ .name = "ffixed-d6" },1313.{ .name = "ffixed-d6" },
1261.{ .name = "ffixed-d7" },1314.{ .name = "ffixed-d7" },
1315.{ .name = "ffixed-edi" },
1262.{ .name = "ffixed-form" },1316.{ .name = "ffixed-form" },
1263.{ .name = "ffixed-g1" },1317.{ .name = "ffixed-g1" },
1264.{ .name = "ffixed-g2" },1318.{ .name = "ffixed-g2" },
...@@ -1288,7 +1342,31 @@...@@ -1288,7 +1342,31 @@
1288.{ .name = "ffixed-o4" },1342.{ .name = "ffixed-o4" },
1289.{ .name = "ffixed-o5" },1343.{ .name = "ffixed-o5" },
1290.{ .name = "ffixed-point" },1344.{ .name = "ffixed-point" },
1345.{ .name = "ffixed-r10" },
1346.{ .name = "ffixed-r11" },
1347.{ .name = "ffixed-r12" },
1348.{ .name = "ffixed-r13" },
1349.{ .name = "ffixed-r14" },
1350.{ .name = "ffixed-r15" },
1351.{ .name = "ffixed-r16" },
1352.{ .name = "ffixed-r17" },
1353.{ .name = "ffixed-r18" },
1291.{ .name = "ffixed-r19" },1354.{ .name = "ffixed-r19" },
1355.{ .name = "ffixed-r20" },
1356.{ .name = "ffixed-r21" },
1357.{ .name = "ffixed-r22" },
1358.{ .name = "ffixed-r23" },
1359.{ .name = "ffixed-r24" },
1360.{ .name = "ffixed-r25" },
1361.{ .name = "ffixed-r26" },
1362.{ .name = "ffixed-r27" },
1363.{ .name = "ffixed-r28" },
1364.{ .name = "ffixed-r29" },
1365.{ .name = "ffixed-r30" },
1366.{ .name = "ffixed-r31" },
1367.{ .name = "ffixed-r6" },
1368.{ .name = "ffixed-r7" },
1369.{ .name = "ffixed-r8" },
1292.{ .name = "ffixed-r9" },1370.{ .name = "ffixed-r9" },
1293.{ .name = "ffixed-x1" },1371.{ .name = "ffixed-x1" },
1294.{ .name = "ffixed-x10" },1372.{ .name = "ffixed-x10" },
...@@ -1362,6 +1440,7 @@...@@ -1362,6 +1440,7 @@
1362.{ .name = "fhip-kernel-arg-name" },1440.{ .name = "fhip-kernel-arg-name" },
1363.{ .name = "fhip-new-launch-api" },1441.{ .name = "fhip-new-launch-api" },
1364.{ .name = "fspv-enable-maximal-reconvergence" },1442.{ .name = "fspv-enable-maximal-reconvergence" },
1443.{ .name = "fspv-preserve-interface" },
1365.{ .name = "fspv-use-unknown-image-format" },1444.{ .name = "fspv-use-unknown-image-format" },
1366.{ .name = "fhlsl-strict-availability" },1445.{ .name = "fhlsl-strict-availability" },
1367.{ .name = "fhonor-infinities" },1446.{ .name = "fhonor-infinities" },
...@@ -1405,13 +1484,12 @@...@@ -1405,13 +1484,12 @@
1405.{ .name = "fkeep-persistent-storage-variables" },1484.{ .name = "fkeep-persistent-storage-variables" },
1406.{ .name = "fkeep-static-consts" },1485.{ .name = "fkeep-static-consts" },
1407.{ .name = "fkeep-system-includes" },1486.{ .name = "fkeep-system-includes" },
1408.{ .name = "flang-deprecated-no-hlfir" },
1409.{ .name = "flang-experimental-hlfir" },
1410.{ .name = "flarge-sizes" },1487.{ .name = "flarge-sizes" },
1411.{ .name = "flat_namespace" },1488.{ .name = "flat_namespace" },
1412.{ .name = "flax-vector-conversions" },1489.{ .name = "flax-vector-conversions" },
1413.{ .name = "fexperimental-lifetime-safety" },1490.{ .name = "flifetime-dse" },
1414.{ .name = "fexperimental-lifetime-safety-inference" },1491.{ .name = "flifetime-safety-inference" },
1492.{ .name = "fexperimental-lifetime-safety-tu-analysis" },
1415.{ .name = "flimit-debug-info" },1493.{ .name = "flimit-debug-info" },
1416.{ .name = "flogical-abbreviations" },1494.{ .name = "flogical-abbreviations" },
1417.{ .name = "floop-interchange" },1495.{ .name = "floop-interchange" },
...@@ -1444,8 +1522,10 @@...@@ -1444,8 +1522,10 @@
1444.{ .name = "fmodules-debuginfo" },1522.{ .name = "fmodules-debuginfo" },
1445.{ .name = "fmodules-decluse" },1523.{ .name = "fmodules-decluse" },
1446.{ .name = "fmodules-disable-diagnostic-validation" },1524.{ .name = "fmodules-disable-diagnostic-validation" },
1525.{ .name = "fmodules-driver" },
1447.{ .name = "fmodules-force-validate-user-headers" },1526.{ .name = "fmodules-force-validate-user-headers" },
1448.{ .name = "fmodules-hash-content" },1527.{ .name = "fmodules-hash-content" },
1528.{ .name = "fmodules-lazy-load-module-maps" },
1449.{ .name = "fmodules-local-submodule-visibility" },1529.{ .name = "fmodules-local-submodule-visibility" },
1450.{ .name = "fmodules-reduced-bmi" },1530.{ .name = "fmodules-reduced-bmi" },
1451.{ .name = "fmodules-search-all" },1531.{ .name = "fmodules-search-all" },
...@@ -1460,6 +1540,7 @@...@@ -1460,6 +1540,7 @@
1460.{ .name = "fmodules-validate-system-headers" },1540.{ .name = "fmodules-validate-system-headers" },
1461.{ .name = "fmodulo-sched" },1541.{ .name = "fmodulo-sched" },
1462.{ .name = "fmodulo-sched-allow-regmoves" },1542.{ .name = "fmodulo-sched-allow-regmoves" },
1543.{ .name = "fms-anonymous-structs" },
1463.{ .name = "fms-compatibility" },1544.{ .name = "fms-compatibility" },
1464.{ .name = "fms-define-stdc" },1545.{ .name = "fms-define-stdc" },
1465.{ .name = "fms-extensions" },1546.{ .name = "fms-extensions" },
...@@ -1539,6 +1620,9 @@...@@ -1539,6 +1620,9 @@
1539.{ .name = "fno-complete-member-pointers" },1620.{ .name = "fno-complete-member-pointers" },
1540.{ .name = "fno-const-strings" },1621.{ .name = "fno-const-strings" },
1541.{ .name = "fno-constant-cfstrings" },1622.{ .name = "fno-constant-cfstrings" },
1623.{ .name = "fno-constant-nsarray-literals" },
1624.{ .name = "fno-constant-nsdictionary-literals" },
1625.{ .name = "fno-constant-nsnumber-literals" },
1542.{ .name = "fno-convergent-functions" },1626.{ .name = "fno-convergent-functions" },
1543.{ .name = "fno-coro-aligned-allocation" },1627.{ .name = "fno-coro-aligned-allocation" },
1544.{ .name = "fno-coroutines" },1628.{ .name = "fno-coroutines" },
...@@ -1559,6 +1643,8 @@...@@ -1559,6 +1643,8 @@
1559.{ .name = "fno-debug-macro" },1643.{ .name = "fno-debug-macro" },
1560.{ .name = "fno-debug-pass-manager" },1644.{ .name = "fno-debug-pass-manager" },
1561.{ .name = "fno-debug-ranges-base-address" },1645.{ .name = "fno-debug-ranges-base-address" },
1646.{ .name = "fno-debug-record-sysroot" },
1647.{ .name = "fno-debug-run-lifetime-safety" },
1562.{ .name = "fno-debug-types-section" },1648.{ .name = "fno-debug-types-section" },
1563.{ .name = "fno-declspec" },1649.{ .name = "fno-declspec" },
1564.{ .name = "fno-default-inline" },1650.{ .name = "fno-default-inline" },
...@@ -1571,6 +1657,7 @@...@@ -1571,6 +1657,7 @@
1571.{ .name = "fno-devirtualize-speculatively" },1657.{ .name = "fno-devirtualize-speculatively" },
1572.{ .name = "fno-diagnostics-fixit-info" },1658.{ .name = "fno-diagnostics-fixit-info" },
1573.{ .name = "fno-diagnostics-show-hotness" },1659.{ .name = "fno-diagnostics-show-hotness" },
1660.{ .name = "fno-diagnostics-show-inlining-chain" },
1574.{ .name = "fno-diagnostics-show-line-numbers" },1661.{ .name = "fno-diagnostics-show-line-numbers" },
1575.{ .name = "fno-diagnostics-show-note-include-stack" },1662.{ .name = "fno-diagnostics-show-note-include-stack" },
1576.{ .name = "fno-diagnostics-show-option" },1663.{ .name = "fno-diagnostics-show-option" },
...@@ -1595,14 +1682,22 @@...@@ -1595,14 +1682,22 @@
1595.{ .name = "fno-eliminate-unused-debug-types" },1682.{ .name = "fno-eliminate-unused-debug-types" },
1596.{ .name = "fno-emit-compact-unwind-non-canonical" },1683.{ .name = "fno-emit-compact-unwind-non-canonical" },
1597.{ .name = "fno-emulated-tls" },1684.{ .name = "fno-emulated-tls" },
1685.{ .name = "fno-enable-new-pm-codegen" },
1686.{ .name = "fno-enumeration-type" },
1598.{ .name = "fno-escaping-block-tail-calls" },1687.{ .name = "fno-escaping-block-tail-calls" },
1599.{ .name = "fno-exceptions" },1688.{ .name = "fno-exceptions" },
1689.{ .name = "fno-experimental-allow-pointer-field-protection-attr" },
1600.{ .name = "fno-experimental-call-graph-section" },1690.{ .name = "fno-experimental-call-graph-section" },
1601.{ .name = "fno-experimental-isel" },1691.{ .name = "fno-experimental-isel" },
1602.{ .name = "fno-experimental-late-parse-attributes" },1692.{ .name = "fno-experimental-late-parse-attributes" },
1603.{ .name = "fno-experimental-library" },1693.{ .name = "fno-experimental-library" },
1694.{ .name = "fno-experimental-lifetime-safety-c" },
1604.{ .name = "fno-experimental-loop-fusion" },1695.{ .name = "fno-experimental-loop-fusion" },
1696.{ .name = "fno-experimental-new-constant-interpreter" },
1605.{ .name = "fno-experimental-omit-vtable-rtti" },1697.{ .name = "fno-experimental-omit-vtable-rtti" },
1698.{ .name = "fno-experimental-overflow-behavior-types" },
1699.{ .name = "fno-experimental-pointer-field-protection-abi" },
1700.{ .name = "fno-experimental-pointer-field-protection-tagged" },
1606.{ .name = "fno-experimental-relative-c++-abi-vtables" },1701.{ .name = "fno-experimental-relative-c++-abi-vtables" },
1607.{ .name = "fno-external-blas" },1702.{ .name = "fno-external-blas" },
1608.{ .name = "fno-f2c" },1703.{ .name = "fno-f2c" },
...@@ -1672,8 +1767,9 @@...@@ -1672,8 +1767,9 @@
1672.{ .name = "fno-keep-system-includes" },1767.{ .name = "fno-keep-system-includes" },
1673.{ .name = "fno-knr-functions" },1768.{ .name = "fno-knr-functions" },
1674.{ .name = "fno-lax-vector-conversions" },1769.{ .name = "fno-lax-vector-conversions" },
1675.{ .name = "fno-experimental-lifetime-safety" },1770.{ .name = "fno-lifetime-dse" },
1676.{ .name = "fno-experimental-lifetime-safety-inference" },1771.{ .name = "fno-lifetime-safety-inference" },
1772.{ .name = "fno-experimental-lifetime-safety-tu-analysis" },
1677.{ .name = "fno-limit-debug-info" },1773.{ .name = "fno-limit-debug-info" },
1678.{ .name = "fno-logical-abbreviations" },1774.{ .name = "fno-logical-abbreviations" },
1679.{ .name = "fno-loop-interchange" },1775.{ .name = "fno-loop-interchange" },
...@@ -1695,6 +1791,7 @@...@@ -1695,6 +1791,7 @@
1695.{ .name = "fno-modulemap-allow-subdirectory-search" },1791.{ .name = "fno-modulemap-allow-subdirectory-search" },
1696.{ .name = "fno-modules" },1792.{ .name = "fno-modules" },
1697.{ .name = "fno-modules-decluse" },1793.{ .name = "fno-modules-decluse" },
1794.{ .name = "fno-modules-driver" },
1698.{ .name = "fno-modules-error-recovery" },1795.{ .name = "fno-modules-error-recovery" },
1699.{ .name = "fno-modules-force-validate-user-headers" },1796.{ .name = "fno-modules-force-validate-user-headers" },
1700.{ .name = "fno-modules-global-index" },1797.{ .name = "fno-modules-global-index" },
...@@ -1710,6 +1807,7 @@...@@ -1710,6 +1807,7 @@
1710.{ .name = "fno-modules-validate-textual-header-includes" },1807.{ .name = "fno-modules-validate-textual-header-includes" },
1711.{ .name = "fno-modulo-sched" },1808.{ .name = "fno-modulo-sched" },
1712.{ .name = "fno-modulo-sched-allow-regmoves" },1809.{ .name = "fno-modulo-sched-allow-regmoves" },
1810.{ .name = "fno-ms-anonymous-structs" },
1713.{ .name = "fno-ms-compatibility" },1811.{ .name = "fno-ms-compatibility" },
1714.{ .name = "fno-ms-extensions" },1812.{ .name = "fno-ms-extensions" },
1715.{ .name = "fno-ms-tls-guards" },1813.{ .name = "fno-ms-tls-guards" },
...@@ -1720,12 +1818,15 @@...@@ -1720,12 +1818,15 @@
1720.{ .name = "fno-objc-arc" },1818.{ .name = "fno-objc-arc" },
1721.{ .name = "fno-objc-arc-exceptions" },1819.{ .name = "fno-objc-arc-exceptions" },
1722.{ .name = "fno-objc-avoid-heapify-local-blocks" },1820.{ .name = "fno-objc-avoid-heapify-local-blocks" },
1821.{ .name = "fno-objc-constant-literals" },
1723.{ .name = "fno-objc-convert-messages-to-runtime-calls" },1822.{ .name = "fno-objc-convert-messages-to-runtime-calls" },
1724.{ .name = "fno-objc-direct-precondition-thunk" },1823.{ .name = "fno-objc-direct-precondition-thunk" },
1725.{ .name = "fno-objc-encode-cxx-class-template-spec" },1824.{ .name = "fno-objc-encode-cxx-class-template-spec" },
1726.{ .name = "fno-objc-exceptions" },1825.{ .name = "fno-objc-exceptions" },
1727.{ .name = "fno-objc-infer-related-result-type" },1826.{ .name = "fno-objc-infer-related-result-type" },
1728.{ .name = "fno-objc-legacy-dispatch" },1827.{ .name = "fno-objc-legacy-dispatch" },
1828.{ .name = "fno-objc-msgsend-class-selector-stubs" },
1829.{ .name = "fno-objc-msgsend-selector-stubs" },
1729.{ .name = "fno-objc-nonfragile-abi" },1830.{ .name = "fno-objc-nonfragile-abi" },
1730.{ .name = "fno-objc-weak" },1831.{ .name = "fno-objc-weak" },
1731.{ .name = "fno-offload-implicit-host-device-templates" },1832.{ .name = "fno-offload-implicit-host-device-templates" },
...@@ -1733,7 +1834,11 @@...@@ -1733,7 +1834,11 @@
1733.{ .name = "fno-offload-uniform-block" },1834.{ .name = "fno-offload-uniform-block" },
1734.{ .name = "fno-offload-via-llvm" },1835.{ .name = "fno-offload-via-llvm" },
1735.{ .name = "fno-omit-frame-pointer", .ze = .no_omit_frame_pointer },1836.{ .name = "fno-omit-frame-pointer", .ze = .no_omit_frame_pointer },
1837.{ .name = "fno-openacc-default-none-scalars-strict" },
1838.{ .name = "fno-openacc-multiple-names-in-routine" },
1736.{ .name = "fno-openmp" },1839.{ .name = "fno-openmp" },
1840.{ .name = "fno-openmp-assume-no-nested-parallelism" },
1841.{ .name = "fno-openmp-assume-no-thread-state" },
1737.{ .name = "fno-openmp-assume-teams-oversubscription" },1842.{ .name = "fno-openmp-assume-teams-oversubscription" },
1738.{ .name = "fno-openmp-assume-threads-oversubscription" },1843.{ .name = "fno-openmp-assume-threads-oversubscription" },
1739.{ .name = "fno-openmp-cuda-mode" },1844.{ .name = "fno-openmp-cuda-mode" },
...@@ -1742,6 +1847,7 @@...@@ -1742,6 +1847,7 @@
1742.{ .name = "fno-openmp-optimistic-collapse" },1847.{ .name = "fno-openmp-optimistic-collapse" },
1743.{ .name = "fno-openmp-simd" },1848.{ .name = "fno-openmp-simd" },
1744.{ .name = "fno-openmp-target-debug" },1849.{ .name = "fno-openmp-target-debug" },
1850.{ .name = "fno-openmp-target-fast" },
1745.{ .name = "fno-openmp-target-jit" },1851.{ .name = "fno-openmp-target-jit" },
1746.{ .name = "fno-openmp-target-new-runtime" },1852.{ .name = "fno-openmp-target-new-runtime" },
1747.{ .name = "fno-operator-names" },1853.{ .name = "fno-operator-names" },
...@@ -1805,12 +1911,14 @@...@@ -1805,12 +1911,14 @@
1805.{ .name = "fno-real-8-real-10" },1911.{ .name = "fno-real-8-real-10" },
1806.{ .name = "fno-real-8-real-16" },1912.{ .name = "fno-real-8-real-16" },
1807.{ .name = "fno-real-8-real-4" },1913.{ .name = "fno-real-8-real-4" },
1914.{ .name = "fno-real-sum-reassociation" },
1808.{ .name = "fno-realloc-lhs" },1915.{ .name = "fno-realloc-lhs" },
1809.{ .name = "fno-reciprocal-math" },1916.{ .name = "fno-reciprocal-math" },
1810.{ .name = "fno-record-command-line" },1917.{ .name = "fno-record-command-line" },
1811.{ .name = "fno-recovery-ast" },1918.{ .name = "fno-recovery-ast" },
1812.{ .name = "fno-recovery-ast-type" },1919.{ .name = "fno-recovery-ast-type" },
1813.{ .name = "fno-recursive" },1920.{ .name = "fno-recursive" },
1921.{ .name = "fno-reflection" },
1814.{ .name = "fno-reformat" },1922.{ .name = "fno-reformat" },
1815.{ .name = "fno-register-global-dtors-with-atexit" },1923.{ .name = "fno-register-global-dtors-with-atexit" },
1816.{ .name = "fno-regs-graph" },1924.{ .name = "fno-regs-graph" },
...@@ -1828,6 +1936,7 @@...@@ -1828,6 +1936,7 @@
1828.{ .name = "fno-rtti-data" },1936.{ .name = "fno-rtti-data" },
1829.{ .name = "fno-rwpi" },1937.{ .name = "fno-rwpi" },
1830.{ .name = "fno-safe-buffer-usage-suggestions" },1938.{ .name = "fno-safe-buffer-usage-suggestions" },
1939.{ .name = "fno-safe-trampoline" },
1831.{ .name = "fno-sample-profile-use-profi" },1940.{ .name = "fno-sample-profile-use-profi" },
1832.{ .name = "fno-sanitize-address-globals-dead-stripping" },1941.{ .name = "fno-sanitize-address-globals-dead-stripping" },
1833.{ .name = "fno-sanitize-address-outline-instrumentation" },1942.{ .name = "fno-sanitize-address-outline-instrumentation" },
...@@ -1857,6 +1966,7 @@...@@ -1857,6 +1966,7 @@
1857.{ .name = "fno-sanitize-thread-func-entry-exit" },1966.{ .name = "fno-sanitize-thread-func-entry-exit" },
1858.{ .name = "fno-sanitize-thread-memory-access" },1967.{ .name = "fno-sanitize-thread-memory-access" },
1859.{ .name = "fno-sanitize-trap", .ze = .no_sanitize_trap },1968.{ .name = "fno-sanitize-trap", .ze = .no_sanitize_trap },
1969.{ .name = "fno-sanitize-trap-loop" },
1860.{ .name = "fno-sanitize-type-outline-instrumentation" },1970.{ .name = "fno-sanitize-type-outline-instrumentation" },
1861.{ .name = "fno-sanitize-undefined-trap-on-error" },1971.{ .name = "fno-sanitize-undefined-trap-on-error" },
1862.{ .name = "fno-save-main-program" },1972.{ .name = "fno-save-main-program" },
...@@ -1896,6 +2006,7 @@...@@ -1896,6 +2006,7 @@
1896.{ .name = "fno-standalone-debug" },2006.{ .name = "fno-standalone-debug" },
1897.{ .name = "fno-strength-reduce" },2007.{ .name = "fno-strength-reduce" },
1898.{ .name = "fno-strict-aliasing" },2008.{ .name = "fno-strict-aliasing" },
2009.{ .name = "fno-strict-bool" },
1899.{ .name = "fno-strict-enums" },2010.{ .name = "fno-strict-enums" },
1900.{ .name = "fno-strict-float-cast-overflow" },2011.{ .name = "fno-strict-float-cast-overflow" },
1901.{ .name = "fno-strict-overflow" },2012.{ .name = "fno-strict-overflow" },
...@@ -1975,6 +2086,7 @@...@@ -1975,6 +2086,7 @@
1975.{ .name = "fobjc-atdefs" },2086.{ .name = "fobjc-atdefs" },
1976.{ .name = "fobjc-avoid-heapify-local-blocks" },2087.{ .name = "fobjc-avoid-heapify-local-blocks" },
1977.{ .name = "fobjc-call-cxx-cdtors" },2088.{ .name = "fobjc-call-cxx-cdtors" },
2089.{ .name = "fobjc-constant-literals" },
1978.{ .name = "fobjc-convert-messages-to-runtime-calls" },2090.{ .name = "fobjc-convert-messages-to-runtime-calls" },
1979.{ .name = "fobjc-direct-precondition-thunk" },2091.{ .name = "fobjc-direct-precondition-thunk" },
1980.{ .name = "fobjc-disable-direct-methods-for-testing" },2092.{ .name = "fobjc-disable-direct-methods-for-testing" },
...@@ -1985,18 +2097,23 @@...@@ -1985,18 +2097,23 @@
1985.{ .name = "fobjc-infer-related-result-type" },2097.{ .name = "fobjc-infer-related-result-type" },
1986.{ .name = "fobjc-legacy-dispatch" },2098.{ .name = "fobjc-legacy-dispatch" },
1987.{ .name = "fobjc-link-runtime" },2099.{ .name = "fobjc-link-runtime" },
2100.{ .name = "fobjc-msgsend-class-selector-stubs" },
2101.{ .name = "fobjc-msgsend-selector-stubs" },
1988.{ .name = "fobjc-new-property" },2102.{ .name = "fobjc-new-property" },
1989.{ .name = "fobjc-nonfragile-abi" },2103.{ .name = "fobjc-nonfragile-abi" },
1990.{ .name = "fobjc-runtime-has-weak" },2104.{ .name = "fobjc-runtime-has-weak" },
1991.{ .name = "fobjc-sender-dependent-dispatch" },2105.{ .name = "fobjc-sender-dependent-dispatch" },
1992.{ .name = "fobjc-subscripting-legacy-runtime" },2106.{ .name = "fobjc-subscripting-legacy-runtime" },
1993.{ .name = "fobjc-weak" },2107.{ .name = "fobjc-weak" },
2108.{ .name = "foffload-device" },
1994.{ .name = "foffload-implicit-host-device-templates" },2109.{ .name = "foffload-implicit-host-device-templates" },
1995.{ .name = "foffload-lto" },2110.{ .name = "foffload-lto" },
1996.{ .name = "foffload-uniform-block" },2111.{ .name = "foffload-uniform-block" },
1997.{ .name = "foffload-via-llvm" },2112.{ .name = "foffload-via-llvm" },
1998.{ .name = "fomit-frame-pointer", .ze = .omit_frame_pointer },2113.{ .name = "fomit-frame-pointer", .ze = .omit_frame_pointer },
1999.{ .name = "fopenacc" },2114.{ .name = "fopenacc" },
2115.{ .name = "fopenacc-default-none-scalars-strict" },
2116.{ .name = "fopenacc-multiple-names-in-routine" },
2000.{ .name = "fopenmp" },2117.{ .name = "fopenmp" },
2001.{ .name = "fopenmp-assume-no-nested-parallelism" },2118.{ .name = "fopenmp-assume-no-nested-parallelism" },
2002.{ .name = "fopenmp-assume-no-thread-state" },2119.{ .name = "fopenmp-assume-no-thread-state" },
...@@ -2014,6 +2131,7 @@...@@ -2014,6 +2131,7 @@
2014.{ .name = "fopenmp-relocatable-target" },2131.{ .name = "fopenmp-relocatable-target" },
2015.{ .name = "fopenmp-simd" },2132.{ .name = "fopenmp-simd" },
2016.{ .name = "fopenmp-target-debug" },2133.{ .name = "fopenmp-target-debug" },
2134.{ .name = "fopenmp-target-fast" },
2017.{ .name = "fopenmp-target-jit" },2135.{ .name = "fopenmp-target-jit" },
2018.{ .name = "fopenmp-target-new-runtime" },2136.{ .name = "fopenmp-target-new-runtime" },
2019.{ .name = "fopenmp-use-tls" },2137.{ .name = "fopenmp-use-tls" },
...@@ -2091,12 +2209,14 @@...@@ -2091,12 +2209,14 @@
2091.{ .name = "freal-8-real-10" },2209.{ .name = "freal-8-real-10" },
2092.{ .name = "freal-8-real-16" },2210.{ .name = "freal-8-real-16" },
2093.{ .name = "freal-8-real-4" },2211.{ .name = "freal-8-real-4" },
2212.{ .name = "freal-sum-reassociation" },
2094.{ .name = "frealloc-lhs" },2213.{ .name = "frealloc-lhs" },
2095.{ .name = "freciprocal-math" },2214.{ .name = "freciprocal-math" },
2096.{ .name = "frecord-command-line" },2215.{ .name = "frecord-command-line" },
2097.{ .name = "frecovery-ast" },2216.{ .name = "frecovery-ast" },
2098.{ .name = "frecovery-ast-type" },2217.{ .name = "frecovery-ast-type" },
2099.{ .name = "frecursive" },2218.{ .name = "frecursive" },
2219.{ .name = "freflection" },
2100.{ .name = "freg-struct-return" },2220.{ .name = "freg-struct-return" },
2101.{ .name = "fregister-global-dtors-with-atexit" },2221.{ .name = "fregister-global-dtors-with-atexit" },
2102.{ .name = "fregs-graph" },2222.{ .name = "fregs-graph" },
...@@ -2115,6 +2235,7 @@...@@ -2115,6 +2235,7 @@
2115.{ .name = "frtti-data" },2235.{ .name = "frtti-data" },
2116.{ .name = "frwpi" },2236.{ .name = "frwpi" },
2117.{ .name = "fsafe-buffer-usage-suggestions" },2237.{ .name = "fsafe-buffer-usage-suggestions" },
2238.{ .name = "fsafe-trampoline" },
2118.{ .name = "fsample-profile-use-profi" },2239.{ .name = "fsample-profile-use-profi" },
2119.{ .name = "fsanitize-address-globals-dead-stripping" },2240.{ .name = "fsanitize-address-globals-dead-stripping" },
2120.{ .name = "fsanitize-address-outline-instrumentation" },2241.{ .name = "fsanitize-address-outline-instrumentation" },
...@@ -2142,6 +2263,7 @@...@@ -2142,6 +2263,7 @@
2142.{ .name = "fsanitize-coverage-trace-gep" },2263.{ .name = "fsanitize-coverage-trace-gep" },
2143.{ .name = "fsanitize-coverage-trace-loads" },2264.{ .name = "fsanitize-coverage-trace-loads" },
2144.{ .name = "fsanitize-coverage-trace-pc" },2265.{ .name = "fsanitize-coverage-trace-pc" },
2266.{ .name = "fsanitize-coverage-trace-pc-entry-exit" },
2145.{ .name = "fsanitize-coverage-trace-pc-guard", .ze = .san_cov_trace_pc_guard },2267.{ .name = "fsanitize-coverage-trace-pc-guard", .ze = .san_cov_trace_pc_guard },
2146.{ .name = "fsanitize-coverage-trace-stores" },2268.{ .name = "fsanitize-coverage-trace-stores" },
2147.{ .name = "fsanitize-debug-trap-reasons" },2269.{ .name = "fsanitize-debug-trap-reasons" },
...@@ -2162,6 +2284,7 @@...@@ -2162,6 +2284,7 @@
2162.{ .name = "fsanitize-thread-func-entry-exit" },2284.{ .name = "fsanitize-thread-func-entry-exit" },
2163.{ .name = "fsanitize-thread-memory-access" },2285.{ .name = "fsanitize-thread-memory-access" },
2164.{ .name = "fsanitize-trap", .ze = .sanitize_trap },2286.{ .name = "fsanitize-trap", .ze = .sanitize_trap },
2287.{ .name = "fsanitize-trap-loop" },
2165.{ .name = "fsanitize-type-outline-instrumentation" },2288.{ .name = "fsanitize-type-outline-instrumentation" },
2166.{ .name = "fsanitize-undefined-trap-on-error" },2289.{ .name = "fsanitize-undefined-trap-on-error" },
2167.{ .name = "fsave-main-program" },2290.{ .name = "fsave-main-program" },
...@@ -2208,6 +2331,7 @@...@@ -2208,6 +2331,7 @@
2208.{ .name = "fstandalone-debug" },2331.{ .name = "fstandalone-debug" },
2209.{ .name = "fstrength-reduce" },2332.{ .name = "fstrength-reduce" },
2210.{ .name = "fstrict-aliasing" },2333.{ .name = "fstrict-aliasing" },
2334.{ .name = "fstrict-bool" },
2211.{ .name = "fstrict-enums" },2335.{ .name = "fstrict-enums" },
2212.{ .name = "fstrict-float-cast-overflow" },2336.{ .name = "fstrict-float-cast-overflow" },
2213.{ .name = "fstrict-overflow" },2337.{ .name = "fstrict-overflow" },
...@@ -2216,6 +2340,7 @@...@@ -2216,6 +2340,7 @@
2216.{ .name = "fstruct-path-tbaa" },2340.{ .name = "fstruct-path-tbaa" },
2217.{ .name = "fswift-version-independent-apinotes" },2341.{ .name = "fswift-version-independent-apinotes" },
2218.{ .name = "fsycl" },2342.{ .name = "fsycl" },
2343.{ .name = "fsycl-device-image-split" },
2219.{ .name = "fsycl-device-only" },2344.{ .name = "fsycl-device-only" },
2220.{ .name = "fsycl-host-only" },2345.{ .name = "fsycl-host-only" },
2221.{ .name = "fsycl-is-device" },2346.{ .name = "fsycl-is-device" },
...@@ -2452,6 +2577,7 @@...@@ -2452,6 +2577,7 @@
2452.{ .name = "maix-small-local-dynamic-tls" },2577.{ .name = "maix-small-local-dynamic-tls" },
2453.{ .name = "maix-small-local-exec-tls" },2578.{ .name = "maix-small-local-exec-tls" },
2454.{ .name = "maix-struct-return" },2579.{ .name = "maix-struct-return" },
2580.{ .name = "maix-use-ptrgl" },
2455.{ .name = "malign-double" },2581.{ .name = "malign-double" },
2456.{ .name = "maltivec", .ze = .m },2582.{ .name = "maltivec", .ze = .m },
2457.{ .name = "mamdgpu-expand-waitcnt-profiling" },2583.{ .name = "mamdgpu-expand-waitcnt-profiling" },
...@@ -2464,7 +2590,6 @@...@@ -2464,7 +2590,6 @@
2464.{ .name = "mamx-fp8", .ze = .m },2590.{ .name = "mamx-fp8", .ze = .m },
2465.{ .name = "mamx-int8", .ze = .m },2591.{ .name = "mamx-int8", .ze = .m },
2466.{ .name = "mamx-movrs", .ze = .m },2592.{ .name = "mamx-movrs", .ze = .m },
2467.{ .name = "mamx-tf32", .ze = .m },
2468.{ .name = "mamx-tile", .ze = .m },2593.{ .name = "mamx-tile", .ze = .m },
2469.{ .name = "mannotate-tablejump" },2594.{ .name = "mannotate-tablejump" },
2470.{ .name = "mapx-inline-asm-use-gpr32" },2595.{ .name = "mapx-inline-asm-use-gpr32" },
...@@ -2474,11 +2599,12 @@...@@ -2474,11 +2599,12 @@
2474.{ .name = "massembler-no-warn" },2599.{ .name = "massembler-no-warn" },
2475.{ .name = "matomics", .ze = .m },2600.{ .name = "matomics", .ze = .m },
2476.{ .name = "mavx", .ze = .m },2601.{ .name = "mavx", .ze = .m },
2477.{ .name = "mavx10.1" },2602.{ .name = "mavx10.1", .ze = .m },
2478.{ .name = "mavx10.2" },2603.{ .name = "mavx10.2", .ze = .m },
2479.{ .name = "mavx2", .ze = .m },2604.{ .name = "mavx2", .ze = .m },
2480.{ .name = "mavx512bf16", .ze = .m },2605.{ .name = "mavx512bf16", .ze = .m },
2481.{ .name = "mavx512bitalg", .ze = .m },2606.{ .name = "mavx512bitalg", .ze = .m },
2607.{ .name = "mavx512bmm", .ze = .m },
2482.{ .name = "mavx512bw", .ze = .m },2608.{ .name = "mavx512bw", .ze = .m },
2483.{ .name = "mavx512cd", .ze = .m },2609.{ .name = "mavx512cd", .ze = .m },
2484.{ .name = "mavx512dq", .ze = .m },2610.{ .name = "mavx512dq", .ze = .m },
...@@ -2516,6 +2642,7 @@...@@ -2516,6 +2642,7 @@
2516.{ .name = "mcmpb", .ze = .m },2642.{ .name = "mcmpb", .ze = .m },
2517.{ .name = "mcmpccxadd", .ze = .m },2643.{ .name = "mcmpccxadd", .ze = .m },
2518.{ .name = "mcmse" },2644.{ .name = "mcmse" },
2645.{ .name = "mcompact-imports" },
2519.{ .name = "mconstant-cfstrings" },2646.{ .name = "mconstant-cfstrings" },
2520.{ .name = "mconstructor-aliases" },2647.{ .name = "mconstructor-aliases" },
2521.{ .name = "mcrbits", .ze = .m },2648.{ .name = "mcrbits", .ze = .m },
...@@ -2540,6 +2667,7 @@...@@ -2540,6 +2667,7 @@
2540.{ .name = "metal", .psl = true },2667.{ .name = "metal", .psl = true },
2541.{ .name = "mexception-handling", .ze = .m },2668.{ .name = "mexception-handling", .ze = .m },
2542.{ .name = "mexecute-only", .ze = .m },2669.{ .name = "mexecute-only", .ze = .m },
2670.{ .name = "mexperimental-mtune-syntax" },
2543.{ .name = "mextended-const", .ze = .m },2671.{ .name = "mextended-const", .ze = .m },
2544.{ .name = "mextern-sdata" },2672.{ .name = "mextern-sdata" },
2545.{ .name = "mf16c", .ze = .m },2673.{ .name = "mf16c", .ze = .m },
...@@ -2553,6 +2681,7 @@...@@ -2553,6 +2681,7 @@
2553.{ .name = "mfix-cortex-a57-aes-1742098", .ze = .m },2681.{ .name = "mfix-cortex-a57-aes-1742098", .ze = .m },
2554.{ .name = "mfix-cortex-a72-aes-1655431" },2682.{ .name = "mfix-cortex-a72-aes-1655431" },
2555.{ .name = "mfix-gr712rc" },2683.{ .name = "mfix-gr712rc" },
2684.{ .name = "mfix-r5900", .ze = .m },
2556.{ .name = "mfix-ut700" },2685.{ .name = "mfix-ut700" },
2557.{ .name = "mfloat128", .ze = .m },2686.{ .name = "mfloat128", .ze = .m },
2558.{ .name = "mfloat-abi", .syntax = .separate },2687.{ .name = "mfloat-abi", .syntax = .separate },
...@@ -2569,7 +2698,7 @@...@@ -2569,7 +2698,7 @@
2569.{ .name = "mfsgsbase", .ze = .m },2698.{ .name = "mfsgsbase", .ze = .m },
2570.{ .name = "mfsmuld" },2699.{ .name = "mfsmuld" },
2571.{ .name = "mfxsr", .ze = .m },2700.{ .name = "mfxsr", .ze = .m },
2572.{ .name = "mgc" },2701.{ .name = "mgc", .ze = .m },
2573.{ .name = "mgeneral-regs-only" },2702.{ .name = "mgeneral-regs-only" },
2574.{ .name = "mgfni", .ze = .m },2703.{ .name = "mgfni", .ze = .m },
2575.{ .name = "mginv", .ze = .m },2704.{ .name = "mginv", .ze = .m },
...@@ -2677,17 +2806,17 @@...@@ -2677,17 +2806,17 @@
2677.{ .name = "mno-amx-fp8", .ze = .m },2806.{ .name = "mno-amx-fp8", .ze = .m },
2678.{ .name = "mno-amx-int8", .ze = .m },2807.{ .name = "mno-amx-int8", .ze = .m },
2679.{ .name = "mno-amx-movrs", .ze = .m },2808.{ .name = "mno-amx-movrs", .ze = .m },
2680.{ .name = "mno-amx-tf32", .ze = .m },
2681.{ .name = "mno-amx-tile", .ze = .m },2809.{ .name = "mno-amx-tile", .ze = .m },
2682.{ .name = "mno-annotate-tablejump" },2810.{ .name = "mno-annotate-tablejump" },
2683.{ .name = "mno-apxf" },2811.{ .name = "mno-apxf" },
2684.{ .name = "mno-atomics", .ze = .m },2812.{ .name = "mno-atomics", .ze = .m },
2685.{ .name = "mno-avx", .ze = .m },2813.{ .name = "mno-avx", .ze = .m },
2686.{ .name = "mno-avx10.1" },2814.{ .name = "mno-avx10.1", .ze = .m },
2687.{ .name = "mno-avx10.2" },2815.{ .name = "mno-avx10.2", .ze = .m },
2688.{ .name = "mno-avx2", .ze = .m },2816.{ .name = "mno-avx2", .ze = .m },
2689.{ .name = "mno-avx512bf16", .ze = .m },2817.{ .name = "mno-avx512bf16", .ze = .m },
2690.{ .name = "mno-avx512bitalg", .ze = .m },2818.{ .name = "mno-avx512bitalg", .ze = .m },
2819.{ .name = "mno-avx512bmm", .ze = .m },
2691.{ .name = "mno-avx512bw", .ze = .m },2820.{ .name = "mno-avx512bw", .ze = .m },
2692.{ .name = "mno-avx512cd", .ze = .m },2821.{ .name = "mno-avx512cd", .ze = .m },
2693.{ .name = "mno-avx512dq", .ze = .m },2822.{ .name = "mno-avx512dq", .ze = .m },
...@@ -2720,6 +2849,7 @@...@@ -2720,6 +2849,7 @@
2720.{ .name = "mno-clzero", .ze = .m },2849.{ .name = "mno-clzero", .ze = .m },
2721.{ .name = "mno-cmpb", .ze = .m },2850.{ .name = "mno-cmpb", .ze = .m },
2722.{ .name = "mno-cmpccxadd", .ze = .m },2851.{ .name = "mno-cmpccxadd", .ze = .m },
2852.{ .name = "mno-compact-imports" },
2723.{ .name = "mno-constant-cfstrings" },2853.{ .name = "mno-constant-cfstrings" },
2724.{ .name = "mno-constructor-aliases" },2854.{ .name = "mno-constructor-aliases" },
2725.{ .name = "mno-crbits", .ze = .m },2855.{ .name = "mno-crbits", .ze = .m },
...@@ -2736,6 +2866,7 @@...@@ -2736,6 +2866,7 @@
2736.{ .name = "mno-exception-handling", .ze = .m },2866.{ .name = "mno-exception-handling", .ze = .m },
2737.{ .name = "mnoexecstack" },2867.{ .name = "mnoexecstack" },
2738.{ .name = "mno-execute-only", .ze = .m },2868.{ .name = "mno-execute-only", .ze = .m },
2869.{ .name = "mno-experimental-mtune-syntax" },
2739.{ .name = "mno-extended-const", .ze = .m },2870.{ .name = "mno-extended-const", .ze = .m },
2740.{ .name = "mno-extern-sdata" },2871.{ .name = "mno-extern-sdata" },
2741.{ .name = "mno-f16c", .ze = .m },2872.{ .name = "mno-f16c", .ze = .m },
...@@ -2744,6 +2875,7 @@...@@ -2744,6 +2875,7 @@
2744.{ .name = "mno-fix-cortex-a53-843419" },2875.{ .name = "mno-fix-cortex-a53-843419" },
2745.{ .name = "mno-fix-cortex-a57-aes-1742098", .ze = .m },2876.{ .name = "mno-fix-cortex-a57-aes-1742098", .ze = .m },
2746.{ .name = "mno-fix-cortex-a72-aes-1655431" },2877.{ .name = "mno-fix-cortex-a72-aes-1655431" },
2878.{ .name = "mno-fix-r5900", .ze = .m },
2747.{ .name = "mno-float128", .ze = .m },2879.{ .name = "mno-float128", .ze = .m },
2748.{ .name = "mno-fma", .ze = .m },2880.{ .name = "mno-fma", .ze = .m },
2749.{ .name = "mno-fma4", .ze = .m },2881.{ .name = "mno-fma4", .ze = .m },
...@@ -2757,7 +2889,7 @@...@@ -2757,7 +2889,7 @@
2757.{ .name = "mno-fsmuld", .ze = .m },2889.{ .name = "mno-fsmuld", .ze = .m },
2758.{ .name = "mno-fxsr", .ze = .m },2890.{ .name = "mno-fxsr", .ze = .m },
2759.{ .name = "mno-gather" },2891.{ .name = "mno-gather" },
2760.{ .name = "mno-gc" },2892.{ .name = "mno-gc", .ze = .m },
2761.{ .name = "mno-gfni", .ze = .m },2893.{ .name = "mno-gfni", .ze = .m },
2762.{ .name = "mno-ginv", .ze = .m },2894.{ .name = "mno-ginv", .ze = .m },
2763.{ .name = "mno-global-merge" },2895.{ .name = "mno-global-merge" },
...@@ -2848,6 +2980,7 @@...@@ -2848,6 +2980,7 @@
2848.{ .name = "mno-relax", .ze = .m },2980.{ .name = "mno-relax", .ze = .m },
2849.{ .name = "mno-relax-all" },2981.{ .name = "mno-relax-all" },
2850.{ .name = "mno-relax-pic-calls" },2982.{ .name = "mno-relax-pic-calls" },
2983.{ .name = "mno-relaxed-atomics", .ze = .m },
2851.{ .name = "mno-relaxed-simd", .ze = .m },2984.{ .name = "mno-relaxed-simd", .ze = .m },
2852.{ .name = "mno-reserve-frame-pointer-reg" },2985.{ .name = "mno-reserve-frame-pointer-reg" },
2853.{ .name = "mno-restrict-it" },2986.{ .name = "mno-restrict-it" },
...@@ -2874,6 +3007,7 @@...@@ -2874,6 +3007,7 @@
2874.{ .name = "mno-soft-float", .ze = .m },3007.{ .name = "mno-soft-float", .ze = .m },
2875.{ .name = "mno-spe", .ze = .m },3008.{ .name = "mno-spe", .ze = .m },
2876.{ .name = "mno-speculative-load-hardening" },3009.{ .name = "mno-speculative-load-hardening" },
3010.{ .name = "mno-sramecc", .ze = .m },
2877.{ .name = "mno-sse", .ze = .m },3011.{ .name = "mno-sse", .ze = .m },
2878.{ .name = "mno-sse2", .ze = .m },3012.{ .name = "mno-sse2", .ze = .m },
2879.{ .name = "mno-sse3", .ze = .m },3013.{ .name = "mno-sse3", .ze = .m },
...@@ -2887,7 +3021,7 @@...@@ -2887,7 +3021,7 @@
2887.{ .name = "mno-strict-align", .ze = .m },3021.{ .name = "mno-strict-align", .ze = .m },
2888.{ .name = "mno-tail-call", .ze = .m },3022.{ .name = "mno-tail-call", .ze = .m },
2889.{ .name = "mno-tbm", .ze = .m },3023.{ .name = "mno-tbm", .ze = .m },
2890.{ .name = "mno-tgsplit", .ze = .m },3024.{ .name = "mno-tgsplit" },
2891.{ .name = "mno-thumb" },3025.{ .name = "mno-thumb" },
2892.{ .name = "mno-tls-direct-seg-refs" },3026.{ .name = "mno-tls-direct-seg-refs" },
2893.{ .name = "mno-tocdata" },3027.{ .name = "mno-tocdata" },
...@@ -2919,12 +3053,15 @@...@@ -2919,12 +3053,15 @@
2919.{ .name = "mno-x87", .ze = .m },3053.{ .name = "mno-x87", .ze = .m },
2920.{ .name = "mno-xcoff-roptr" },3054.{ .name = "mno-xcoff-roptr" },
2921.{ .name = "mno-xgot", .ze = .m },3055.{ .name = "mno-xgot", .ze = .m },
3056.{ .name = "mno-xnack", .ze = .m },
2922.{ .name = "mno-xop", .ze = .m },3057.{ .name = "mno-xop", .ze = .m },
2923.{ .name = "mno-xsave", .ze = .m },3058.{ .name = "mno-xsave", .ze = .m },
2924.{ .name = "mno-xsavec", .ze = .m },3059.{ .name = "mno-xsavec", .ze = .m },
2925.{ .name = "mno-xsaveopt", .ze = .m },3060.{ .name = "mno-xsaveopt", .ze = .m },
2926.{ .name = "mno-xsaves", .ze = .m },3061.{ .name = "mno-xsaves", .ze = .m },
3062.{ .name = "mno-zos-ppa1-name" },
2927.{ .name = "mno-zvector" },3063.{ .name = "mno-zvector" },
3064.{ .name = "mno-aix-use-ptrgl" },
2928.{ .name = "mnocrc" },3065.{ .name = "mnocrc" },
2929.{ .name = "mno-direct-move", .ze = .m },3066.{ .name = "mno-direct-move", .ze = .m },
2930.{ .name = "mnontrapping-fptoint", .ze = .m },3067.{ .name = "mnontrapping-fptoint", .ze = .m },
...@@ -2935,7 +3072,6 @@...@@ -2935,7 +3072,6 @@
2935.{ .name = "mnvs", .ze = .m },3072.{ .name = "mnvs", .ze = .m },
2936.{ .name = "modd-spreg" },3073.{ .name = "modd-spreg" },
2937.{ .name = "module-dependency-dir", .syntax = .separate },3074.{ .name = "module-dependency-dir", .syntax = .separate },
2938.{ .name = "module-file-deps" },
2939.{ .name = "module-file-info" },3075.{ .name = "module-file-info" },
2940.{ .name = "module-suffix", .syntax = .separate },3076.{ .name = "module-suffix", .syntax = .separate },
2941.{ .name = "momit-leaf-frame-pointer" },3077.{ .name = "momit-leaf-frame-pointer" },
...@@ -2980,6 +3116,7 @@...@@ -2980,6 +3116,7 @@
2980.{ .name = "mrelax-all" },3116.{ .name = "mrelax-all" },
2981.{ .name = "mrelax-pic-calls" },3117.{ .name = "mrelax-pic-calls" },
2982.{ .name = "mrelax-relocations=no" },3118.{ .name = "mrelax-relocations=no" },
3119.{ .name = "mrelaxed-atomics", .ze = .m },
2983.{ .name = "mrelaxed-simd", .ze = .m },3120.{ .name = "mrelaxed-simd", .ze = .m },
2984.{ .name = "mrelocation-model", .syntax = .separate },3121.{ .name = "mrelocation-model", .syntax = .separate },
2985.{ .name = "mreserve-frame-pointer-reg" },3122.{ .name = "mreserve-frame-pointer-reg" },
...@@ -3013,6 +3150,7 @@...@@ -3013,6 +3150,7 @@
3013.{ .name = "msoft-quad-float" },3150.{ .name = "msoft-quad-float" },
3014.{ .name = "mspe", .ze = .m },3151.{ .name = "mspe", .ze = .m },
3015.{ .name = "mspeculative-load-hardening" },3152.{ .name = "mspeculative-load-hardening" },
3153.{ .name = "msramecc", .ze = .m },
3016.{ .name = "msse", .ze = .m },3154.{ .name = "msse", .ze = .m },
3017.{ .name = "msse2", .ze = .m },3155.{ .name = "msse2", .ze = .m },
3018.{ .name = "msse2avx" },3156.{ .name = "msse2avx" },
...@@ -3023,12 +3161,13 @@...@@ -3023,12 +3161,13 @@
3023.{ .name = "msse4a", .ze = .m },3161.{ .name = "msse4a", .ze = .m },
3024.{ .name = "mssse3", .ze = .m },3162.{ .name = "mssse3", .ze = .m },
3025.{ .name = "mstack-arg-probe" },3163.{ .name = "mstack-arg-probe" },
3164.{ .name = "mstack-protector-guard-record" },
3026.{ .name = "mstackrealign" },3165.{ .name = "mstackrealign" },
3027.{ .name = "mstrict-align", .ze = .m },3166.{ .name = "mstrict-align", .ze = .m },
3028.{ .name = "msvr4-struct-return" },3167.{ .name = "msvr4-struct-return" },
3029.{ .name = "mtail-call", .ze = .m },3168.{ .name = "mtail-call", .ze = .m },
3030.{ .name = "mtbm", .ze = .m },3169.{ .name = "mtbm", .ze = .m },
3031.{ .name = "mtgsplit", .ze = .m },3170.{ .name = "mtgsplit" },
3032.{ .name = "mthread-model", .syntax = .separate },3171.{ .name = "mthread-model", .syntax = .separate },
3033.{ .name = "mthumb" },3172.{ .name = "mthumb" },
3034.{ .name = "mtls-direct-seg-refs" },3173.{ .name = "mtls-direct-seg-refs" },
...@@ -3059,7 +3198,7 @@...@@ -3059,7 +3198,7 @@
3059.{ .name = "mv73", .ze = .m },3198.{ .name = "mv73", .ze = .m },
3060.{ .name = "mv75", .ze = .m },3199.{ .name = "mv75", .ze = .m },
3061.{ .name = "mv79", .ze = .m },3200.{ .name = "mv79", .ze = .m },
3062.{ .name = "mv81" },3201.{ .name = "mv81", .ze = .m },
3063.{ .name = "mv8plus", .ze = .m },3202.{ .name = "mv8plus", .ze = .m },
3064.{ .name = "mvaes", .ze = .m },3203.{ .name = "mvaes", .ze = .m },
3065.{ .name = "mvector-strict-align" },3204.{ .name = "mvector-strict-align" },
...@@ -3078,15 +3217,19 @@...@@ -3078,15 +3217,19 @@
3078.{ .name = "mwbnoinvd", .ze = .m },3217.{ .name = "mwbnoinvd", .ze = .m },
3079.{ .name = "mwide-arithmetic", .ze = .m },3218.{ .name = "mwide-arithmetic", .ze = .m },
3080.{ .name = "mwidekl", .ze = .m },3219.{ .name = "mwidekl", .ze = .m },
3081.{ .name = "mx32" },3220.{ .name = "mx32", .ze = .m },
3082.{ .name = "mx87", .ze = .m },3221.{ .name = "mx87", .ze = .m },
3083.{ .name = "mxcoff-roptr" },3222.{ .name = "mxcoff-roptr" },
3084.{ .name = "mxgot", .ze = .m },3223.{ .name = "mxgot", .ze = .m },
3224.{ .name = "mxnack", .ze = .m },
3085.{ .name = "mxop", .ze = .m },3225.{ .name = "mxop", .ze = .m },
3086.{ .name = "mxsave", .ze = .m },3226.{ .name = "mxsave", .ze = .m },
3087.{ .name = "mxsavec", .ze = .m },3227.{ .name = "mxsavec", .ze = .m },
3088.{ .name = "mxsaveopt", .ze = .m },3228.{ .name = "mxsaveopt", .ze = .m },
3089.{ .name = "mxsaves", .ze = .m },3229.{ .name = "mxsaves", .ze = .m },
3230.{ .name = "mzilsd-strict-align" },
3231.{ .name = "mzilsd-word-align", .ze = .m },
3232.{ .name = "mzos-ppa1-name" },
3090.{ .name = "mzvector" },3233.{ .name = "mzvector" },
3091.{ .name = "n" },3234.{ .name = "n" },
3092.{ .name = "new-struct-path-tbaa" },3235.{ .name = "new-struct-path-tbaa" },
...@@ -3160,6 +3303,11 @@...@@ -3160,6 +3303,11 @@
3160 .pd1 = false,3303 .pd1 = false,
3161 .pd2 = true,3304 .pd2 = true,
3162},3305},
3306.{
3307 .name = "no-xcselect",
3308 .pd1 = false,
3309 .pd2 = true,
3310},
3163.{ .name = "nobuiltininc" },3311.{ .name = "nobuiltininc" },
3164.{ .name = "nocpp" },3312.{ .name = "nocpp" },
3165.{ .name = "nodefaultlibs" },3313.{ .name = "nodefaultlibs" },
...@@ -3168,6 +3316,7 @@...@@ -3168,6 +3316,7 @@
3168.{ .name = "nogpulibc" },3316.{ .name = "nogpulibc" },
3169.{ .name = "nohipwrapperinc" },3317.{ .name = "nohipwrapperinc" },
3170.{ .name = "nolibc", .ze = .nostdlib },3318.{ .name = "nolibc", .ze = .nostdlib },
3319.{ .name = "nolibsycl" },
3171.{ .name = "nomultidefs" },3320.{ .name = "nomultidefs" },
3172.{ .name = "nopie", .ze = .no_pie },3321.{ .name = "nopie", .ze = .no_pie },
3173.{ .name = "noprebind" },3322.{ .name = "noprebind" },
...@@ -3284,6 +3433,7 @@...@@ -3284,6 +3433,7 @@
3284.{ .name = "reexport_framework", .syntax = .separate },3433.{ .name = "reexport_framework", .syntax = .separate },
3285.{ .name = "regcall4" },3434.{ .name = "regcall4" },
3286.{ .name = "relaxed-aliasing" },3435.{ .name = "relaxed-aliasing" },
3436.{ .name = "frelaxed-c-loc-checks" },
3287.{ .name = "relocatable-pch", .pd2 = true },3437.{ .name = "relocatable-pch", .pd2 = true },
3288.{ .name = "remap" },3438.{ .name = "remap" },
3289.{ .name = "remap-file", .syntax = .separate },3439.{ .name = "remap-file", .syntax = .separate },
...@@ -3433,6 +3583,7 @@...@@ -3433,6 +3583,7 @@
3433 .pd1 = false,3583 .pd1 = false,
3434 .pd2 = true,3584 .pd2 = true,
3435},3585},
3586.{ .name = "verify-directives" },
3436.{ .name = "verify-ignore-unexpected" },3587.{ .name = "verify-ignore-unexpected" },
3437.{ .name = "verify-pch" },3588.{ .name = "verify-pch" },
3438.{ .name = "version", .ze = .version },3589.{ .name = "version", .ze = .version },
...@@ -3472,11 +3623,14 @@...@@ -3472,11 +3623,14 @@
3472.{ .name = "fvisibility-externs-nodllstorageclass=", .syntax = .joined },3623.{ .name = "fvisibility-externs-nodllstorageclass=", .syntax = .joined },
3473.{ .name = "fallow-runtime-check-skip-hot-cutoff=", .syntax = .joined },3624.{ .name = "fallow-runtime-check-skip-hot-cutoff=", .syntax = .joined },
3474.{ .name = "fexperimental-openacc-macro-override=", .syntax = .joined },3625.{ .name = "fexperimental-openacc-macro-override=", .syntax = .joined },
3626.{ .name = "lifetime-safety-lifetimebound-macro=", .syntax = .joined },
3475.{ .name = "analyzer-config-compatibility-mode=", .syntax = .joined },3627.{ .name = "analyzer-config-compatibility-mode=", .syntax = .joined },
3476.{ .name = "fms-secure-hotpatch-functions-file=", .syntax = .joined },3628.{ .name = "fms-secure-hotpatch-functions-file=", .syntax = .joined },
3477.{ .name = "fms-secure-hotpatch-functions-list=", .syntax = .comma_joined },3629.{ .name = "fms-secure-hotpatch-functions-list=", .syntax = .comma_joined },
3478.{ .name = "fno-experimental-sanitize-metadata=", .syntax = .comma_joined },3630.{ .name = "fno-experimental-sanitize-metadata=", .syntax = .comma_joined },
3631.{ .name = "fsanitize-ignore-for-ubsan-feature=", .syntax = .comma_joined },
3479.{ .name = "mdefault-visibility-export-mapping=", .syntax = .joined },3632.{ .name = "mdefault-visibility-export-mapping=", .syntax = .joined },
3633.{ .name = "mstack-protector-guard-value-width=", .syntax = .joined },
3480.{ .name = "fsanitize-address-use-after-return=", .syntax = .joined },3634.{ .name = "fsanitize-address-use-after-return=", .syntax = .joined },
3481.{3635.{
3482 .name = "fsanitize-address-use-after-return",3636 .name = "fsanitize-address-use-after-return",
...@@ -3501,11 +3655,16 @@...@@ -3501,11 +3655,16 @@
3501 .syntax = .joined,3655 .syntax = .joined,
3502 .psl = true,3656 .psl = true,
3503},3657},
3658.{ .name = "fconstant-integer-number-class=", .syntax = .joined },
3504.{ .name = "fdiagnostics-hotness-threshold=", .syntax = .joined },3659.{ .name = "fdiagnostics-hotness-threshold=", .syntax = .joined },
3505.{ .name = "fexperimental-max-bitint-width=", .syntax = .joined },3660.{ .name = "fexperimental-max-bitint-width=", .syntax = .joined },
3661.{ .name = "fimplicit-modules-lock-timeout=", .syntax = .joined },
3506.{ .name = "fsanitize-memory-track-origins=", .syntax = .joined },3662.{ .name = "fsanitize-memory-track-origins=", .syntax = .joined },
3663.{ .name = "lifetime-safety-max-cfg-blocks=", .syntax = .joined },
3507.{ .name = "mwatchos-simulator-version-min=", .syntax = .joined },3664.{ .name = "mwatchos-simulator-version-min=", .syntax = .joined },
3508.{ .name = "funique-source-file-identifier=", .syntax = .joined },3665.{ .name = "funique-source-file-identifier=", .syntax = .joined },
3666.{ .name = "fconstant-double-number-class=", .syntax = .joined },
3667.{ .name = "fpreferred-function-alignment=", .syntax = .joined },
3509.{ .name = "fsanitize-annotate-debug-info=", .syntax = .comma_joined },3668.{ .name = "fsanitize-annotate-debug-info=", .syntax = .comma_joined },
3510.{ .name = "fsanitize-coverage-ignorelist=", .syntax = .joined },3669.{ .name = "fsanitize-coverage-ignorelist=", .syntax = .joined },
3511.{ .name = "fvisibility-externs-dllimport=", .syntax = .joined },3670.{ .name = "fvisibility-externs-dllimport=", .syntax = .joined },
...@@ -3522,6 +3681,7 @@...@@ -3522,6 +3681,7 @@
3522},3681},
3523.{ .name = "miphonesimulator-version-min=", .syntax = .joined },3682.{ .name = "miphonesimulator-version-min=", .syntax = .joined },
3524.{ .name = "fcaret-diagnostics-max-lines=", .syntax = .joined },3683.{ .name = "fcaret-diagnostics-max-lines=", .syntax = .joined },
3684.{ .name = "fconstant-float-number-class=", .syntax = .joined },
3525.{ .name = "fobjc-nonfragile-abi-version=", .syntax = .joined },3685.{ .name = "fobjc-nonfragile-abi-version=", .syntax = .joined },
3526.{ .name = "fprofile-instrument-use-path=", .syntax = .joined },3686.{ .name = "fprofile-instrument-use-path=", .syntax = .joined },
3527.{ .name = "fsanitize-coverage-allowlist=", .syntax = .joined },3687.{ .name = "fsanitize-coverage-allowlist=", .syntax = .joined },
...@@ -3564,6 +3724,7 @@...@@ -3564,6 +3724,7 @@
3564},3724},
3565.{ .name = "error-on-deserialized-decl=", .syntax = .joined },3725.{ .name = "error-on-deserialized-decl=", .syntax = .joined },
3566.{ .name = "fbfloat16-excess-precision=", .syntax = .joined },3726.{ .name = "fbfloat16-excess-precision=", .syntax = .joined },
3727.{ .name = "fconstant-dictionary-class=", .syntax = .joined },
3567.{ .name = "fconstexpr-backtrace-limit=", .syntax = .joined },3728.{ .name = "fconstexpr-backtrace-limit=", .syntax = .joined },
3568.{ .name = "fdiagnostics-show-category=", .syntax = .joined },3729.{ .name = "fdiagnostics-show-category=", .syntax = .joined },
3569.{ .name = "fdiagnostics-show-location=", .syntax = .joined },3730.{ .name = "fdiagnostics-show-location=", .syntax = .joined },
...@@ -3590,6 +3751,11 @@...@@ -3590,6 +3751,11 @@
3590.{ .name = "mstack-protector-guard-reg=", .syntax = .joined },3751.{ .name = "mstack-protector-guard-reg=", .syntax = .joined },
3591.{ .name = "msve-streaming-vector-bits=", .syntax = .joined },3752.{ .name = "msve-streaming-vector-bits=", .syntax = .joined },
3592.{ .name = "Wsystem-headers-in-module=", .syntax = .joined },3753.{ .name = "Wsystem-headers-in-module=", .syntax = .joined },
3754.{
3755 .name = "experimental:deterministic",
3756 .syntax = .joined,
3757 .psl = true,
3758},
3593.{3759.{
3594 .name = "include-with-prefix-after=",3760 .name = "include-with-prefix-after=",
3595 .syntax = .joined,3761 .syntax = .joined,
...@@ -3625,6 +3791,12 @@...@@ -3625,6 +3791,12 @@
3625 .pd2 = true,3791 .pd2 = true,
3626},3792},
3627.{ .name = "Wno-nonportable-cfstrings", .syntax = .joined },3793.{ .name = "Wno-nonportable-cfstrings", .syntax = .joined },
3794.{
3795 .name = "ssaf-compilation-unit-id=",
3796 .syntax = .joined,
3797 .pd1 = false,
3798 .pd2 = true,
3799},
3628.{ .name = "analyzer-disable-checker=", .syntax = .joined },3800.{ .name = "analyzer-disable-checker=", .syntax = .joined },
3629.{ .name = "fbuild-session-timestamp=", .syntax = .joined },3801.{ .name = "fbuild-session-timestamp=", .syntax = .joined },
3630.{ .name = "fdo-concurrent-to-openmp=", .syntax = .joined },3802.{ .name = "fdo-concurrent-to-openmp=", .syntax = .joined },
...@@ -3632,6 +3804,7 @@...@@ -3632,6 +3804,7 @@
3632.{ .name = "fms-layout-compatibility=", .syntax = .joined },3804.{ .name = "fms-layout-compatibility=", .syntax = .joined },
3633.{ .name = "fprofile-function-groups=", .syntax = .joined },3805.{ .name = "fprofile-function-groups=", .syntax = .joined },
3634.{ .name = "fprofile-instrument-path=", .syntax = .joined },3806.{ .name = "fprofile-instrument-path=", .syntax = .joined },
3807.{ .name = "fsycl-device-image-split=", .syntax = .joined },
3635.{ .name = "header-include-filtering=", .syntax = .joined },3808.{ .name = "header-include-filtering=", .syntax = .joined },
3636.{ .name = "mdefault-build-attributes", .syntax = .joined },3809.{ .name = "mdefault-build-attributes", .syntax = .joined },
3637.{ .name = "msign-return-address-key=", .syntax = .joined },3810.{ .name = "msign-return-address-key=", .syntax = .joined },
...@@ -3677,10 +3850,17 @@...@@ -3677,10 +3850,17 @@
3677 .pd1 = false,3850 .pd1 = false,
3678 .pd2 = true,3851 .pd2 = true,
3679},3852},
3853.{
3854 .name = "ssaf-extract-summaries=",
3855 .syntax = .comma_joined,
3856 .pd1 = false,
3857 .pd2 = true,
3858},
3680.{ .name = "analyzer-inlining-mode=", .syntax = .joined },3859.{ .name = "analyzer-inlining-mode=", .syntax = .joined },
3681.{ .name = "fcodegen-data-generate=", .syntax = .joined },3860.{ .name = "fcodegen-data-generate=", .syntax = .joined },
3682.{ .name = "fconstant-string-class=", .syntax = .joined },3861.{ .name = "fconstant-string-class=", .syntax = .joined },
3683.{ .name = "fcrash-diagnostics-dir=", .syntax = .joined },3862.{ .name = "fcrash-diagnostics-dir=", .syntax = .joined },
3863.{ .name = "fcrash-diagnostics-tar=", .syntax = .joined },
3684.{ .name = "fdebug-compilation-dir=", .syntax = .joined },3864.{ .name = "fdebug-compilation-dir=", .syntax = .joined },
3685.{ .name = "fdebug-default-version=", .syntax = .joined },3865.{ .name = "fdebug-default-version=", .syntax = .joined },
3686.{ .name = "ffp-exception-behavior=", .syntax = .joined },3866.{ .name = "ffp-exception-behavior=", .syntax = .joined },
...@@ -3700,6 +3880,7 @@...@@ -3700,6 +3880,7 @@
3700.{ .name = "Wnonportable-cfstrings", .syntax = .joined },3880.{ .name = "Wnonportable-cfstrings", .syntax = .joined },
3701.{ .name = "miphoneos-version-min=", .syntax = .joined },3881.{ .name = "miphoneos-version-min=", .syntax = .joined },
3702.{ .name = "fbasic-block-sections=", .syntax = .joined },3882.{ .name = "fbasic-block-sections=", .syntax = .joined },
3883.{ .name = "fconstant-array-class=", .syntax = .joined },
3703.{ .name = "fdefault-calling-conv=", .syntax = .joined },3884.{ .name = "fdefault-calling-conv=", .syntax = .joined },
3704.{ .name = "fdenormal-fp-math-f32=", .syntax = .joined },3885.{ .name = "fdenormal-fp-math-f32=", .syntax = .joined },
3705.{ .name = "fembed-offload-object=", .syntax = .joined },3886.{ .name = "fembed-offload-object=", .syntax = .joined },
...@@ -3735,6 +3916,12 @@...@@ -3735,6 +3916,12 @@
3735.{ .name = "mvscale-streaming-min=", .syntax = .joined },3916.{ .name = "mvscale-streaming-min=", .syntax = .joined },
3736.{ .name = "Wlarge-by-value-copy=", .syntax = .joined },3917.{ .name = "Wlarge-by-value-copy=", .syntax = .joined },
3737.{ .name = "Xthinlto-distributor=", .syntax = .comma_joined },3918.{ .name = "Xthinlto-distributor=", .syntax = .comma_joined },
3919.{
3920 .name = "ssaf-tu-summary-file=",
3921 .syntax = .joined,
3922 .pd1 = false,
3923 .pd2 = true,
3924},
3738.{ .name = "analyzer-constraints=", .syntax = .joined },3925.{ .name = "analyzer-constraints=", .syntax = .joined },
3739.{ .name = "analyzer-dump-egraph=", .syntax = .joined },3926.{ .name = "analyzer-dump-egraph=", .syntax = .joined },
3740.{ .name = "compatibility_version", .syntax = .joined_or_separate },3927.{ .name = "compatibility_version", .syntax = .joined_or_separate },
...@@ -3749,6 +3936,7 @@...@@ -3749,6 +3936,7 @@
3749.{ .name = "fthinlto-distributor=", .syntax = .joined },3936.{ .name = "fthinlto-distributor=", .syntax = .joined },
3750.{ .name = "fzero-call-used-regs=", .syntax = .joined },3937.{ .name = "fzero-call-used-regs=", .syntax = .joined },
3751.{ .name = "iframeworkwithsysroot", .syntax = .joined_or_separate },3938.{ .name = "iframeworkwithsysroot", .syntax = .joined_or_separate },
3939.{ .name = "init-datetime-macros=", .syntax = .joined },
3752.{ .name = "mcode-object-version=", .syntax = .joined },3940.{ .name = "mcode-object-version=", .syntax = .joined },
3753.{ .name = "mpad-max-prefix-size=", .syntax = .joined },3941.{ .name = "mpad-max-prefix-size=", .syntax = .joined },
3754.{ .name = "mprefer-vector-width=", .syntax = .joined },3942.{ .name = "mprefer-vector-width=", .syntax = .joined },
...@@ -3791,6 +3979,7 @@...@@ -3791,6 +3979,7 @@
3791.{ .name = "fbuild-session-file=", .syntax = .joined },3979.{ .name = "fbuild-session-file=", .syntax = .joined },
3792.{ .name = "fcomplex-arithmetic=", .syntax = .joined },3980.{ .name = "fcomplex-arithmetic=", .syntax = .joined },
3793.{ .name = "fdiagnostics-format=", .syntax = .joined },3981.{ .name = "fdiagnostics-format=", .syntax = .joined },
3982.{ .name = "ffp-maxmin-behavior=", .syntax = .joined },
3794.{ .name = "fgpu-default-stream=", .syntax = .joined },3983.{ .name = "fgpu-default-stream=", .syntax = .joined },
3795.{ .name = "fmax-stack-var-size=", .syntax = .joined },3984.{ .name = "fmax-stack-var-size=", .syntax = .joined },
3796.{ .name = "fmemory-profile-use=", .syntax = .joined },3985.{ .name = "fmemory-profile-use=", .syntax = .joined },
...@@ -3846,6 +4035,7 @@...@@ -3846,6 +4035,7 @@
3846 .pd1 = false,4035 .pd1 = false,
3847 .pd2 = true,4036 .pd2 = true,
3848},4037},
4038.{ .name = "load-bool-from-mem=", .syntax = .joined },
3849.{ .name = "mbranch-protection=", .syntax = .joined },4039.{ .name = "mbranch-protection=", .syntax = .joined },
3850.{ .name = "mmacos-version-min=", .syntax = .joined },4040.{ .name = "mmacos-version-min=", .syntax = .joined },
3851.{4041.{
...@@ -3856,6 +4046,7 @@...@@ -3856,6 +4046,7 @@
3856},4046},
3857.{ .name = "pch-through-header=", .syntax = .joined },4047.{ .name = "pch-through-header=", .syntax = .joined },
3858.{ .name = "target-sdk-version=", .syntax = .joined },4048.{ .name = "target-sdk-version=", .syntax = .joined },
4049.{ .name = "fwin-cfg-mechanism=", .syntax = .joined },
3859.{4050.{
3860 .name = "execution-charset:",4051 .name = "execution-charset:",
3861 .syntax = .joined,4052 .syntax = .joined,
...@@ -3896,6 +4087,7 @@...@@ -3896,6 +4087,7 @@
3896.{ .name = "fextend-arguments=", .syntax = .joined },4087.{ .name = "fextend-arguments=", .syntax = .joined },
3897.{ .name = "ffree-line-length-", .syntax = .joined },4088.{ .name = "ffree-line-length-", .syntax = .joined },
3898.{ .name = "fmacro-prefix-map=", .syntax = .joined },4089.{ .name = "fmacro-prefix-map=", .syntax = .joined },
4090.{ .name = "fmodule-file-deps=", .syntax = .joined },
3899.{4091.{
3900 .name = "fno-sanitize-trap=",4092 .name = "fno-sanitize-trap=",
3901 .ze = .no_sanitize_trap,4093 .ze = .no_sanitize_trap,
...@@ -3917,7 +4109,15 @@...@@ -3917,7 +4109,15 @@
3917 .pd1 = false,4109 .pd1 = false,
3918 .pd2 = true,4110 .pd2 = true,
3919},4111},
4112.{
4113 .name = "reloc-section-sym=",
4114 .syntax = .joined,
4115 .pd1 = false,
4116 .pd2 = true,
4117},
4118.{ .name = "fwinx64-eh-unwind=", .syntax = .joined },
3920.{ .name = "working-directory=", .syntax = .joined },4119.{ .name = "working-directory=", .syntax = .joined },
4120.{ .name = "Xoffload-compiler", .syntax = .joined_and_separate },
3921.{4121.{
3922 .name = "amdgpu-arch-tool=",4122 .name = "amdgpu-arch-tool=",
3923 .syntax = .joined,4123 .syntax = .joined,
...@@ -3949,6 +4149,7 @@...@@ -3949,6 +4149,7 @@
3949.{ .name = "mfunction-return=", .syntax = .joined },4149.{ .name = "mfunction-return=", .syntax = .joined },
3950.{ .name = "mios-version-min=", .syntax = .joined },4150.{ .name = "mios-version-min=", .syntax = .joined },
3951.{ .name = "mno-apx-features=", .syntax = .comma_joined },4151.{ .name = "mno-apx-features=", .syntax = .comma_joined },
4152.{ .name = "module-file-deps=", .syntax = .joined },
3952.{ .name = "mrvv-vector-bits=", .syntax = .joined },4153.{ .name = "mrvv-vector-bits=", .syntax = .joined },
3953.{ .name = "mstack-alignment=", .syntax = .joined },4154.{ .name = "mstack-alignment=", .syntax = .joined },
3954.{ .name = "msve-vector-bits=", .syntax = .joined },4155.{ .name = "msve-vector-bits=", .syntax = .joined },
...@@ -3984,6 +4185,7 @@...@@ -3984,6 +4185,7 @@
3984.{ .name = "analyzer-output=", .syntax = .joined },4185.{ .name = "analyzer-output=", .syntax = .joined },
3985.{ .name = "ftemplate-depth-", .syntax = .joined },4186.{ .name = "ftemplate-depth-", .syntax = .joined },
3986.{ .name = "ast-dump-filter=", .syntax = .joined },4187.{ .name = "ast-dump-filter=", .syntax = .joined },
4188.{ .name = "clangir-lib-opt=", .syntax = .joined },
3987.{4189.{
3988 .name = "config-user-dir=",4190 .name = "config-user-dir=",
3989 .syntax = .joined,4191 .syntax = .joined,
...@@ -4001,6 +4203,7 @@...@@ -4001,6 +4203,7 @@
4001.{ .name = "fmemory-profile=", .syntax = .joined },4203.{ .name = "fmemory-profile=", .syntax = .joined },
4002.{ .name = "fmessage-length=", .syntax = .joined },4204.{ .name = "fmessage-length=", .syntax = .joined },
4003.{ .name = "fms-runtime-lib=", .syntax = .joined },4205.{ .name = "fms-runtime-lib=", .syntax = .joined },
4206.{ .name = "fno-strict-bool=", .syntax = .joined },
4004.{ .name = "fopenmp-targets=", .syntax = .comma_joined },4207.{ .name = "fopenmp-targets=", .syntax = .comma_joined },
4005.{ .name = "fopenmp-version=", .syntax = .joined },4208.{ .name = "fopenmp-version=", .syntax = .joined },
4006.{ .name = "fprofile-update=", .syntax = .joined },4209.{ .name = "fprofile-update=", .syntax = .joined },
...@@ -4126,6 +4329,12 @@...@@ -4126,6 +4329,12 @@
4126.{ .name = "mindirect-jump=", .syntax = .joined },4329.{ .name = "mindirect-jump=", .syntax = .joined },
4127.{ .name = "mzos-hlq-clang=", .syntax = .joined },4330.{ .name = "mzos-hlq-clang=", .syntax = .joined },
4128.{ .name = "preamble-bytes=", .syntax = .joined },4331.{ .name = "preamble-bytes=", .syntax = .joined },
4332.{
4333 .name = "spirv-val-path=",
4334 .syntax = .joined,
4335 .pd1 = false,
4336 .pd2 = true,
4337},
4129.{ .name = "Wundef-prefix=", .syntax = .comma_joined },4338.{ .name = "Wundef-prefix=", .syntax = .comma_joined },
4130.{4339.{
4131 .name = "vctoolsversion",4340 .name = "vctoolsversion",
...@@ -4305,6 +4514,7 @@...@@ -4305,6 +4514,7 @@
4305},4514},
4306.{ .name = "mharden-sls=", .syntax = .joined },4515.{ .name = "mharden-sls=", .syntax = .joined },
4307.{ .name = "mhvx-length=", .syntax = .joined },4516.{ .name = "mhvx-length=", .syntax = .joined },
4517.{ .name = "mhvx-qfloat=", .syntax = .joined },
4308.{ .name = "mno-tocdata=", .syntax = .comma_joined },4518.{ .name = "mno-tocdata=", .syntax = .comma_joined },
4309.{ .name = "mvscale-max=", .syntax = .joined },4519.{ .name = "mvscale-max=", .syntax = .joined },
4310.{ .name = "mvscale-min=", .syntax = .joined },4520.{ .name = "mvscale-min=", .syntax = .joined },
...@@ -4544,6 +4754,7 @@...@@ -4544,6 +4754,7 @@
4544 .pd2 = true,4754 .pd2 = true,
4545},4755},
4546.{ .name = "idirafter", .syntax = .joined_or_separate },4756.{ .name = "idirafter", .syntax = .joined_or_separate },
4757.{ .name = "mscs-reg=", .syntax = .joined },
4547.{ .name = "mregparm=", .syntax = .joined },4758.{ .name = "mregparm=", .syntax = .joined },
4548.{ .name = "mtocdata=", .syntax = .comma_joined },4759.{ .name = "mtocdata=", .syntax = .comma_joined },
4549.{ .name = "sycl-std=", .syntax = .joined },4760.{ .name = "sycl-std=", .syntax = .joined },
...@@ -4552,6 +4763,11 @@...@@ -4552,6 +4763,11 @@
4552 .ze = .undefined,4763 .ze = .undefined,
4553 .syntax = .joined_or_separate,4764 .syntax = .joined_or_separate,
4554},4765},
4766.{
4767 .name = "pathmap:",
4768 .syntax = .joined,
4769 .psl = true,
4770},
4555.{4771.{
4556 .name = "extdirs=",4772 .name = "extdirs=",
4557 .syntax = .joined,4773 .syntax = .joined,
...@@ -4577,6 +4793,12 @@...@@ -4577,6 +4793,12 @@
4577 .pd1 = false,4793 .pd1 = false,
4578 .pd2 = true,4794 .pd2 = true,
4579},4795},
4796.{
4797 .name = "cstdlib=",
4798 .syntax = .joined,
4799 .pd1 = false,
4800 .pd2 = true,
4801},
4580.{ .name = "dsym-dir", .syntax = .joined_or_separate },4802.{ .name = "dsym-dir", .syntax = .joined_or_separate },
4581.{ .name = "fopenmp=", .syntax = .joined },4803.{ .name = "fopenmp=", .syntax = .joined },
4582.{ .name = "fplugin=", .syntax = .joined },4804.{ .name = "fplugin=", .syntax = .joined },
...@@ -4857,6 +5079,11 @@...@@ -4857,6 +5079,11 @@
4857 .syntax = .joined,5079 .syntax = .joined,
4858 .psl = true,5080 .psl = true,
4859},5081},
5082.{
5083 .name = "Fre",
5084 .syntax = .joined_or_separate,
5085 .psl = true,
5086},
4860.{5087.{
4861 .name = "Frs",5088 .name = "Frs",
4862 .syntax = .joined_or_separate,5089 .syntax = .joined_or_separate,
src/codegen/c/type.zig+2
...@@ -142,6 +142,8 @@ pub const CType = union(enum) {...@@ -142,6 +142,8 @@ pub const CType = union(enum) {
142142
143 .x86_64_preserve_none,143 .x86_64_preserve_none,
144 .aarch64_preserve_none,144 .aarch64_preserve_none,
145 .loongarch32_preserve_none,
146 .loongarch64_preserve_none,
145 => .preserve_none,147 => .preserve_none,
146148
147 .aarch64_vfabi => .aarch64_vector_pcs,149 .aarch64_vfabi => .aarch64_vector_pcs,
src/codegen/llvm.zig+36-83
...@@ -1000,11 +1000,6 @@ pub const Object = struct {...@@ -1000,11 +1000,6 @@ pub const Object = struct {
1000 try o.flushTypePool(pt);1000 try o.flushTypePool(pt);
1001 }1001 }
10021002
1003 fn workaroundPrivateSymbolBugs(target: *const std.Target, resolved: *const InternPool.Nav.Resolved) bool {
1004 // https://codeberg.org/ziglang/zig/issues/31865
1005 return target.cpu.arch.isAARCH64() and target.ofmt == .coff and resolved.@"threadlocal";
1006 }
1007
1008 pub fn updateNav(o: *Object, pt: Zcu.PerThread, nav_id: InternPool.Nav.Index) !void {1003 pub fn updateNav(o: *Object, pt: Zcu.PerThread, nav_id: InternPool.Nav.Index) !void {
1009 const zcu = o.zcu;1004 const zcu = o.zcu;
1010 const ip = &zcu.intern_pool;1005 const ip = &zcu.intern_pool;
...@@ -1082,7 +1077,7 @@ pub const Object = struct {...@@ -1082,7 +1077,7 @@ pub const Object = struct {
1082 };1077 };
1083 llvm_global.ptr(&o.builder).visibility = .fromSymbolVisibility(@"extern".visibility);1078 llvm_global.ptr(&o.builder).visibility = .fromSymbolVisibility(@"extern".visibility);
1084 } else {1079 } else {
1085 llvm_global.ptr(&o.builder).linkage = if (o.builder.strip and !workaroundPrivateSymbolBugs(zcu.getTarget(), &resolved)) .private else .internal;1080 llvm_global.ptr(&o.builder).linkage = if (o.builder.strip) .private else .internal;
1086 llvm_global.ptr(&o.builder).visibility = .default;1081 llvm_global.ptr(&o.builder).visibility = .default;
1087 llvm_global.ptr(&o.builder).dll_storage_class = .default;1082 llvm_global.ptr(&o.builder).dll_storage_class = .default;
1088 llvm_global.ptr(&o.builder).unnamed_addr = .unnamed_addr;1083 llvm_global.ptr(&o.builder).unnamed_addr = .unnamed_addr;
...@@ -4346,6 +4341,8 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const...@@ -4346,6 +4341,8 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const
4346 .amdgcn_cs => .amdgpu_cs,4341 .amdgcn_cs => .amdgpu_cs,
4347 .nvptx_device => .ptx_device,4342 .nvptx_device => .ptx_device,
4348 .nvptx_kernel => .ptx_kernel,4343 .nvptx_kernel => .ptx_kernel,
4344 .loongarch32_preserve_none => .preserve_nonecc,
4345 .loongarch64_preserve_none => .preserve_nonecc,
43494346
4350 // Calling conventions which LLVM uses function attributes for.4347 // Calling conventions which LLVM uses function attributes for.
4351 .riscv64_interrupt,4348 .riscv64_interrupt,
...@@ -4434,88 +4431,44 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const...@@ -4434,88 +4431,44 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const
44344431
4435/// Convert a zig-address space to an llvm address space.4432/// Convert a zig-address space to an llvm address space.
4436pub fn toLlvmAddressSpace(address_space: std.lang.AddressSpace, target: *const std.Target) Builder.AddrSpace {4433pub fn toLlvmAddressSpace(address_space: std.lang.AddressSpace, target: *const std.Target) Builder.AddrSpace {
4437 for (llvmAddrSpaceInfo(target)) |info| if (info.zig == address_space) return info.llvm;
4438 unreachable;
4439}
4440
4441const AddrSpaceInfo = struct {
4442 zig: ?std.lang.AddressSpace,
4443 llvm: Builder.AddrSpace,
4444 non_integral: bool = false,
4445 size: ?u16 = null,
4446 abi: ?u16 = null,
4447 pref: ?u16 = null,
4448 idx: ?u16 = null,
4449 force_in_data_layout: bool = false,
4450};
4451fn llvmAddrSpaceInfo(target: *const std.Target) []const AddrSpaceInfo {
4452 return switch (target.cpu.arch) {4434 return switch (target.cpu.arch) {
4453 .x86, .x86_64 => &.{4435 .amdgcn => switch (address_space) {
4454 .{ .zig = .generic, .llvm = .default },4436 .generic => Builder.AddrSpace.amdgpu.flat,
4455 .{ .zig = .gs, .llvm = Builder.AddrSpace.x86.gs },4437 .global => Builder.AddrSpace.amdgpu.global,
4456 .{ .zig = .fs, .llvm = Builder.AddrSpace.x86.fs },4438 .shared => Builder.AddrSpace.amdgpu.local,
4457 .{ .zig = .ss, .llvm = Builder.AddrSpace.x86.ss },4439 .constant => Builder.AddrSpace.amdgpu.constant,
4458 .{ .zig = null, .llvm = Builder.AddrSpace.x86.ptr32_sptr, .size = 32, .abi = 32, .force_in_data_layout = true },4440 .local => Builder.AddrSpace.amdgpu.private,
4459 .{ .zig = null, .llvm = Builder.AddrSpace.x86.ptr32_uptr, .size = 32, .abi = 32, .force_in_data_layout = true },4441 else => unreachable,
4460 .{ .zig = null, .llvm = Builder.AddrSpace.x86.ptr64, .size = 64, .abi = 64, .force_in_data_layout = true },
4461 },
4462 .nvptx, .nvptx64 => &.{
4463 .{ .zig = .generic, .llvm = Builder.AddrSpace.nvptx.generic },
4464 .{ .zig = .global, .llvm = Builder.AddrSpace.nvptx.global },
4465 .{ .zig = .constant, .llvm = Builder.AddrSpace.nvptx.constant },
4466 .{ .zig = .param, .llvm = Builder.AddrSpace.nvptx.param },
4467 .{ .zig = .shared, .llvm = Builder.AddrSpace.nvptx.shared },
4468 .{ .zig = .local, .llvm = Builder.AddrSpace.nvptx.local },
4469 },
4470 .amdgcn => &.{
4471 .{ .zig = .generic, .llvm = Builder.AddrSpace.amdgpu.flat, .force_in_data_layout = true },
4472 .{ .zig = .global, .llvm = Builder.AddrSpace.amdgpu.global, .force_in_data_layout = true },
4473 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.region, .size = 32, .abi = 32 },
4474 .{ .zig = .shared, .llvm = Builder.AddrSpace.amdgpu.local, .size = 32, .abi = 32 },
4475 .{ .zig = .constant, .llvm = Builder.AddrSpace.amdgpu.constant, .force_in_data_layout = true },
4476 .{ .zig = .local, .llvm = Builder.AddrSpace.amdgpu.private, .size = 32, .abi = 32 },
4477 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_32bit, .size = 32, .abi = 32 },
4478 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.buffer_fat_pointer, .non_integral = true, .size = 160, .abi = 256, .idx = 32 },
4479 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.buffer_resource, .non_integral = true, .size = 128, .abi = 128 },
4480 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.buffer_strided_pointer, .non_integral = true, .size = 192, .abi = 256, .idx = 32 },
4481 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_0 },
4482 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_1 },
4483 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_2 },
4484 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_3 },
4485 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_4 },
4486 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_5 },
4487 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_6 },
4488 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_7 },
4489 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_8 },
4490 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_9 },
4491 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_10 },
4492 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_11 },
4493 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_12 },
4494 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_13 },
4495 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_14 },
4496 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.constant_buffer_15 },
4497 .{ .zig = null, .llvm = Builder.AddrSpace.amdgpu.streamout_register },
4498 },4442 },
4499 .avr => &.{4443 .avr => switch (address_space) {
4500 .{ .zig = .generic, .llvm = Builder.AddrSpace.avr.data, .abi = 8 },4444 .generic => Builder.AddrSpace.avr.data,
4501 .{ .zig = .flash, .llvm = Builder.AddrSpace.avr.program, .abi = 8 },4445 .flash => Builder.AddrSpace.avr.program,
4502 .{ .zig = .flash1, .llvm = Builder.AddrSpace.avr.program1, .abi = 8 },4446 .flash1 => Builder.AddrSpace.avr.program1,
4503 .{ .zig = .flash2, .llvm = Builder.AddrSpace.avr.program2, .abi = 8 },4447 .flash2 => Builder.AddrSpace.avr.program2,
4504 .{ .zig = .flash3, .llvm = Builder.AddrSpace.avr.program3, .abi = 8 },4448 .flash3 => Builder.AddrSpace.avr.program3,
4505 .{ .zig = .flash4, .llvm = Builder.AddrSpace.avr.program4, .abi = 8 },4449 .flash4 => Builder.AddrSpace.avr.program4,
4506 .{ .zig = .flash5, .llvm = Builder.AddrSpace.avr.program5, .abi = 8 },4450 .flash5 => Builder.AddrSpace.avr.program5,
4451 else => unreachable,
4507 },4452 },
4508 .wasm32, .wasm64 => &.{4453 .nvptx, .nvptx64 => switch (address_space) {
4509 .{ .zig = .generic, .llvm = Builder.AddrSpace.wasm.default, .force_in_data_layout = true },4454 .generic => Builder.AddrSpace.nvptx.generic,
4510 .{ .zig = null, .llvm = Builder.AddrSpace.wasm.variable, .non_integral = true },4455 .global => Builder.AddrSpace.nvptx.global,
4511 .{ .zig = .externref, .llvm = Builder.AddrSpace.wasm.externref, .non_integral = true, .size = 8, .abi = 8 },4456 .constant => Builder.AddrSpace.nvptx.constant,
4512 .{ .zig = .funcref, .llvm = Builder.AddrSpace.wasm.funcref, .non_integral = true, .size = 8, .abi = 8 },4457 .param => Builder.AddrSpace.nvptx.entry_param,
4458 .shared => Builder.AddrSpace.nvptx.shared,
4459 .local => Builder.AddrSpace.nvptx.local,
4460 else => unreachable,
4513 },4461 },
4514 .m68k => &.{4462 .x86, .x86_64 => switch (address_space) {
4515 .{ .zig = .generic, .llvm = .default, .abi = 16, .pref = 32 },4463 .generic => .default,
4464 .gs => Builder.AddrSpace.x86.gs,
4465 .fs => Builder.AddrSpace.x86.fs,
4466 .ss => Builder.AddrSpace.x86.ss,
4467 else => unreachable,
4516 },4468 },
4517 else => &.{4469 else => switch (address_space) {
4518 .{ .zig = .generic, .llvm = .default },4470 .generic => .default,
4471 else => unreachable,
4519 },4472 },
4520 };4473 };
4521}4474}
src/codegen/llvm/FuncGen.zig+6-50
...@@ -1071,7 +1071,7 @@ fn airRet(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!vo...@@ -1071,7 +1071,7 @@ fn airRet(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!vo
1071 const val_is_undef = if (un_op.toInterned()) |i| Value.fromInterned(i).isUndef(zcu) else false;1071 const val_is_undef = if (un_op.toInterned()) |i| Value.fromInterned(i).isUndef(zcu) else false;
1072 const ret_ty_align = ret_ty.abiAlignment(zcu);1072 const ret_ty_align = ret_ty.abiAlignment(zcu);
10731073
1074 if (val_is_undef and safety and !self.needMemsetWorkaround(ret_ty.abiSize(zcu))) {1074 if (val_is_undef and safety) {
1075 const rp = switch (self.ret_ptr) {1075 const rp = switch (self.ret_ptr) {
1076 .none => try self.buildZigAlloca(ret_ty, .none),1076 .none => try self.buildZigAlloca(ret_ty, .none),
1077 else => |rp| rp,1077 else => |rp| rp,
...@@ -5069,7 +5069,7 @@ fn airStore(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!Bu...@@ -5069,7 +5069,7 @@ fn airStore(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!Bu
5069 };5069 };
50705070
5071 const val_is_undef = if (bin_op.rhs.toInterned()) |i| Value.fromInterned(i).isUndef(zcu) else false;5071 const val_is_undef = if (bin_op.rhs.toInterned()) |i| Value.fromInterned(i).isUndef(zcu) else false;
5072 if (val_is_undef and !fg.needMemsetWorkaround(elem_ty.abiSize(zcu))) {5072 if (val_is_undef) {
5073 const owner_mod = fg.ownerModule();5073 const owner_mod = fg.ownerModule();
50745074
5075 // Even if safety is disabled, we still emit a memset to undefined since it conveys5075 // Even if safety is disabled, we still emit a memset to undefined since it conveys
...@@ -5585,11 +5585,6 @@ fn airMemset(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error...@@ -5585,11 +5585,6 @@ fn airMemset(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error
55855585
5586 self.maybeMarkAllowZeroAccess(ptr_ty.ptrInfo(zcu));5586 self.maybeMarkAllowZeroAccess(ptr_ty.ptrInfo(zcu));
55875587
5588 const allow_byte_memset = !self.needMemsetWorkaround(switch (ptr_ty.ptrSize(zcu)) {
5589 .one => ptr_ty.childType(zcu).abiSize(zcu),
5590 .slice => null,
5591 .many, .c => unreachable,
5592 });
5593 const len_bytes = try self.sliceOrArrayLenInBytes(dest_slice, ptr_ty);5588 const len_bytes = try self.sliceOrArrayLenInBytes(dest_slice, ptr_ty);
55945589
5595 try self.lowerMemset(5590 try self.lowerMemset(
...@@ -5600,7 +5595,6 @@ fn airMemset(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error...@@ -5600,7 +5595,6 @@ fn airMemset(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error
5600 len_bytes,5595 len_bytes,
5601 access_kind,5596 access_kind,
5602 safety,5597 safety,
5603 allow_byte_memset,
5604 );5598 );
5605 return .none;5599 return .none;
5606}5600}
...@@ -5614,12 +5608,11 @@ fn lowerMemset(...@@ -5614,12 +5608,11 @@ fn lowerMemset(
5614 len_bytes: Builder.Value,5608 len_bytes: Builder.Value,
5615 access_kind: Builder.MemoryAccessKind,5609 access_kind: Builder.MemoryAccessKind,
5616 safety: bool,5610 safety: bool,
5617 allow_byte_memset: bool,
5618) Allocator.Error!void {5611) Allocator.Error!void {
5619 const o = self.object;5612 const o = self.object;
5620 const zcu = o.zcu;5613 const zcu = o.zcu;
56215614
5622 if (allow_byte_memset) if (elem_ref.toInterned()) |elem_ip_index| {5615 if (elem_ref.toInterned()) |elem_ip_index| {
5623 const elem_val: Value = .fromInterned(elem_ip_index);5616 const elem_val: Value = .fromInterned(elem_ip_index);
5624 if (elem_val.isUndef(zcu)) {5617 if (elem_val.isUndef(zcu)) {
5625 // Even if safety is disabled, we still emit a memset to undefined since it conveys5618 // Even if safety is disabled, we still emit a memset to undefined since it conveys
...@@ -5660,13 +5653,12 @@ fn lowerMemset(...@@ -5660,13 +5653,12 @@ fn lowerMemset(
5660 );5653 );
5661 return;5654 return;
5662 }5655 }
5663 };5656 }
56645657
5665 const value = try self.resolveInst(elem_ref);5658 const value = try self.resolveInst(elem_ref);
5666 const elem_abi_size = elem_ty.abiSize(zcu);5659 const elem_abi_size = elem_ty.abiSize(zcu);
56675660
5668 intrinsic: {5661 intrinsic: {
5669 if (!allow_byte_memset) break :intrinsic;
5670 if (elem_abi_size != 1) break :intrinsic;5662 if (elem_abi_size != 1) break :intrinsic;
5671 // To use LLVM's intrinsic, we need to convert the operand to a raw 8-bit integer value.5663 // To use LLVM's intrinsic, we need to convert the operand to a raw 8-bit integer value.
5672 const fill_byte: Builder.Value = byte: {5664 const fill_byte: Builder.Value = byte: {
...@@ -6023,7 +6015,6 @@ fn airSplat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value...@@ -6023,7 +6015,6 @@ fn airSplat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
6023 len_bytes_llvm,6015 len_bytes_llvm,
6024 .normal,6016 .normal,
6025 false,6017 false,
6026 !self.needMemsetWorkaround(len_bytes),
6027 );6018 );
60286019
6029 if (array_info.sentinel) |sent_val| {6020 if (array_info.sentinel) |sent_val| {
...@@ -6551,28 +6542,19 @@ fn airPrefetch(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val...@@ -6551,28 +6542,19 @@ fn airPrefetch(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
6551 comptime assert(@backingInt(std.lang.PrefetchOptions.Cache.instruction) == 0);6542 comptime assert(@backingInt(std.lang.PrefetchOptions.Cache.instruction) == 0);
6552 comptime assert(@backingInt(std.lang.PrefetchOptions.Cache.data) == 1);6543 comptime assert(@backingInt(std.lang.PrefetchOptions.Cache.data) == 1);
65536544
6554 // LLVM fails during codegen of instruction cache prefetchs for these architectures.
6555 // This is an LLVM bug as the prefetch intrinsic should be a noop if not supported
6556 // by the target.
6557 // To work around this, don't emit llvm.prefetch in this case.
6558 // See https://bugs.llvm.org/show_bug.cgi?id=21037
6559 const zcu = self.object.zcu;6545 const zcu = self.object.zcu;
6560 const target = zcu.getTarget();6546 const target = zcu.getTarget();
6561 switch (prefetch.cache) {6547 switch (prefetch.cache) {
6562 .instruction => switch (target.cpu.arch) {6548 .instruction => switch (target.cpu.arch) {
6549 // https://github.com/llvm/llvm-project/issues/218236
6563 .x86_64,6550 .x86_64,
6564 .x86,6551 .x86,
6552 // https://github.com/llvm/llvm-project/issues/218239
6565 .powerpc,6553 .powerpc,
6566 .powerpcle,6554 .powerpcle,
6567 .powerpc64,6555 .powerpc64,
6568 .powerpc64le,6556 .powerpc64le,
6569 => return .none,6557 => return .none,
6570 .arm, .armeb, .thumb, .thumbeb => {
6571 switch (prefetch.rw) {
6572 .write => return .none,
6573 else => {},
6574 }
6575 },
6576 else => {},6558 else => {},
6577 },6559 },
6578 .data => {},6560 .data => {},
...@@ -8144,32 +8126,6 @@ fn llvmAllocaAddressSpace(target: *const std.Target) Builder.AddrSpace {...@@ -8144,32 +8126,6 @@ fn llvmAllocaAddressSpace(target: *const std.Target) Builder.AddrSpace {
8144 };8126 };
8145}8127}
81468128
8147/// Due to an LLVM bug, calls to `@llvm.memset.inline.*` with large constant length arguments cause
8148/// LLVM to crash. As a mitigation, this function returns `true` if we should avoid emitting a
8149/// memset call of the given length.
8150///
8151/// Most of our call sites are just setting memory to `undefined`, so can simply skip the memset
8152/// call if we return `true`.
8153///
8154/// Upstream issue: https://github.com/llvm/llvm-project/issues/189161
8155/// Zig issue: https://codeberg.org/ziglang/zig/issues/31701
8156fn needMemsetWorkaround(fg: *const FuncGen, maybe_len: ?u64) bool {
8157 if (!fg.disable_intrinsics) {
8158 // The bug is limited to `@llvm.memset.inline.*`: normal memset calls are fine.
8159 return false;
8160 }
8161 const len = maybe_len orelse {
8162 // We don't think the length is constant, but a trivial optimization on LLVM's side could
8163 // turn it into one and potentially trigger the bug. Therefore, always apply the workaround
8164 // if the length is not a known constant.
8165 return true;
8166 };
8167 // Empirically, the crash first happens at 1048561 bytes, which is 1 MiB less 15 bytes. To be
8168 // safe (just in case the limit is target-specific or something like that), let's just set the
8169 // cap at half of that, i.e. 512 KiB.
8170 return len > 1024 * 512;
8171}
8172
8173const mips_clobber_overrides = std.StaticStringMap(enum {8129const mips_clobber_overrides = std.StaticStringMap(enum {
8174 @"$msair",8130 @"$msair",
8175 @"$msacsr",8131 @"$msacsr",
src/codegen/spirv/CodeGen.zig-2
...@@ -845,8 +845,6 @@ pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageC...@@ -845,8 +845,6 @@ pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageC
845 .cog,845 .cog,
846 .lut,846 .lut,
847 .hub,847 .hub,
848 .externref,
849 .funcref,
850 => unreachable,848 => unreachable,
851 };849 };
852}850}
src/codegen/x86_64/CodeGen.zig+1763-2683
...@@ -4287,7 +4287,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -4287,7 +4287,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
4287 } },4287 } },
4288 }, .{4288 }, .{
4289 .required_cc_abi = .win64,4289 .required_cc_abi = .win64,
4290 .required_features = .{ .sse, null, null, null },
4291 .src_constraints = .{4290 .src_constraints = .{
4292 .{ .scalar_float = .{ .of = .xword, .is = .xword } },4291 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
4293 .{ .scalar_float = .{ .of = .xword, .is = .xword } },4292 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -4300,6 +4299,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -4300,6 +4299,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
4300 .extra_temps = .{4299 .extra_temps = .{
4301 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },4300 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4302 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },4301 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
4302 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
4303 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },4303 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
4304 .unused,4304 .unused,
4305 .unused,4305 .unused,
...@@ -4308,14 +4308,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -4308,14 +4308,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
4308 .unused,4308 .unused,
4309 .unused,4309 .unused,
4310 .unused,4310 .unused,
4311 .unused,
4312 },4311 },
4313 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },4312 .dst_temps = .{ .mem, .unused },
4314 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },4313 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
4315 .each = .{ .once = &.{4314 .each = .{ .once = &.{
4316 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },4315 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
4317 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },4316 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
4318 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },4317 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
4318 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
4319 } },4319 } },
4320 }, .{4320 }, .{
4321 .required_cc_abi = .sysv64,4321 .required_cc_abi = .sysv64,
...@@ -4427,79 +4427,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -4427,79 +4427,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
4427 } },4427 } },
4428 }, .{4428 }, .{
4429 .required_cc_abi = .win64,4429 .required_cc_abi = .win64,
4430 .required_features = .{ .avx, null, null, null },
4431 .src_constraints = .{
4432 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
4433 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
4434 .any,
4435 },
4436 .patterns = &.{
4437 .{ .src = .{ .to_mem, .to_mem, .none } },
4438 },
4439 .call_frame = .{ .alignment = .@"16" },
4440 .extra_temps = .{
4441 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
4442 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4443 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
4444 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
4445 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4446 .unused,
4447 .unused,
4448 .unused,
4449 .unused,
4450 .unused,
4451 .unused,
4452 },
4453 .dst_temps = .{ .mem, .unused },
4454 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
4455 .each = .{ .once = &.{
4456 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
4457 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
4458 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
4459 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
4460 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
4461 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
4462 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
4463 } },
4464 }, .{
4465 .required_cc_abi = .win64,
4466 .required_features = .{ .sse2, null, null, null },
4467 .src_constraints = .{
4468 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
4469 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
4470 .any,
4471 },
4472 .patterns = &.{
4473 .{ .src = .{ .to_mem, .to_mem, .none } },
4474 },
4475 .call_frame = .{ .alignment = .@"16" },
4476 .extra_temps = .{
4477 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
4478 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4479 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
4480 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
4481 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4482 .unused,
4483 .unused,
4484 .unused,
4485 .unused,
4486 .unused,
4487 .unused,
4488 },
4489 .dst_temps = .{ .mem, .unused },
4490 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
4491 .each = .{ .once = &.{
4492 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
4493 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
4494 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
4495 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
4496 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
4497 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
4498 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
4499 } },
4500 }, .{
4501 .required_cc_abi = .win64,
4502 .required_features = .{ .sse, null, null, null },
4503 .src_constraints = .{4430 .src_constraints = .{
4504 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },4431 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
4505 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },4432 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -4513,8 +4440,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -4513,8 +4440,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
4513 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },4440 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
4514 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },4441 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4515 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },4442 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
4443 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
4516 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },4444 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
4517 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
4518 .unused,4445 .unused,
4519 .unused,4446 .unused,
4520 .unused,4447 .unused,
...@@ -4526,10 +4453,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -4526,10 +4453,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
4526 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },4453 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
4527 .each = .{ .once = &.{4454 .each = .{ .once = &.{
4528 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },4455 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
4529 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },4456 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
4530 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },4457 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
4531 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },4458 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
4532 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },4459 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
4533 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },4460 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
4534 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },4461 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
4535 } },4462 } },
...@@ -15038,7 +14965,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -15038,7 +14965,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
15038 } },14965 } },
15039 }, .{14966 }, .{
15040 .required_cc_abi = .win64,14967 .required_cc_abi = .win64,
15041 .required_features = .{ .sse, null, null, null },
15042 .src_constraints = .{14968 .src_constraints = .{
15043 .{ .scalar_float = .{ .of = .xword, .is = .xword } },14969 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
15044 .{ .scalar_float = .{ .of = .xword, .is = .xword } },14970 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -15051,6 +14977,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -15051,6 +14977,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
15051 .extra_temps = .{14977 .extra_temps = .{
15052 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },14978 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15053 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },14979 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
14980 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
15054 .{ .type = .usize, .kind = .{ .extern_func = "__subtf3" } },14981 .{ .type = .usize, .kind = .{ .extern_func = "__subtf3" } },
15055 .unused,14982 .unused,
15056 .unused,14983 .unused,
...@@ -15059,14 +14986,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -15059,14 +14986,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
15059 .unused,14986 .unused,
15060 .unused,14987 .unused,
15061 .unused,14988 .unused,
15062 .unused,
15063 },14989 },
15064 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },14990 .dst_temps = .{ .mem, .unused },
15065 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },14991 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
15066 .each = .{ .once = &.{14992 .each = .{ .once = &.{
15067 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },14993 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
15068 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },14994 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
15069 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },14995 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
14996 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
15070 } },14997 } },
15071 }, .{14998 }, .{
15072 .required_cc_abi = .sysv64,14999 .required_cc_abi = .sysv64,
...@@ -15178,79 +15105,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -15178,79 +15105,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
15178 } },15105 } },
15179 }, .{15106 }, .{
15180 .required_cc_abi = .win64,15107 .required_cc_abi = .win64,
15181 .required_features = .{ .avx, null, null, null },
15182 .src_constraints = .{
15183 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
15184 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
15185 .any,
15186 },
15187 .patterns = &.{
15188 .{ .src = .{ .to_mem, .to_mem, .none } },
15189 },
15190 .call_frame = .{ .alignment = .@"16" },
15191 .extra_temps = .{
15192 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
15193 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15194 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
15195 .{ .type = .usize, .kind = .{ .extern_func = "__subtf3" } },
15196 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15197 .unused,
15198 .unused,
15199 .unused,
15200 .unused,
15201 .unused,
15202 .unused,
15203 },
15204 .dst_temps = .{ .mem, .unused },
15205 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
15206 .each = .{ .once = &.{
15207 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
15208 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
15209 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
15210 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
15211 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
15212 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
15213 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
15214 } },
15215 }, .{
15216 .required_cc_abi = .win64,
15217 .required_features = .{ .sse2, null, null, null },
15218 .src_constraints = .{
15219 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
15220 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
15221 .any,
15222 },
15223 .patterns = &.{
15224 .{ .src = .{ .to_mem, .to_mem, .none } },
15225 },
15226 .call_frame = .{ .alignment = .@"16" },
15227 .extra_temps = .{
15228 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
15229 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15230 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
15231 .{ .type = .usize, .kind = .{ .extern_func = "__subtf3" } },
15232 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15233 .unused,
15234 .unused,
15235 .unused,
15236 .unused,
15237 .unused,
15238 .unused,
15239 },
15240 .dst_temps = .{ .mem, .unused },
15241 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
15242 .each = .{ .once = &.{
15243 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
15244 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
15245 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
15246 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
15247 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
15248 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
15249 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
15250 } },
15251 }, .{
15252 .required_cc_abi = .win64,
15253 .required_features = .{ .sse, null, null, null },
15254 .src_constraints = .{15108 .src_constraints = .{
15255 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },15109 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
15256 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },15110 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -15264,8 +15118,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -15264,8 +15118,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
15264 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },15118 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
15265 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },15119 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15266 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },15120 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
15121 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
15267 .{ .type = .usize, .kind = .{ .extern_func = "__subtf3" } },15122 .{ .type = .usize, .kind = .{ .extern_func = "__subtf3" } },
15268 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
15269 .unused,15123 .unused,
15270 .unused,15124 .unused,
15271 .unused,15125 .unused,
...@@ -15277,10 +15131,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -15277,10 +15131,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
15277 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },15131 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
15278 .each = .{ .once = &.{15132 .each = .{ .once = &.{
15279 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },15133 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
15280 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },15134 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
15281 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },15135 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
15282 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },15136 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
15283 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },15137 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
15284 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },15138 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
15285 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },15139 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
15286 } },15140 } },
...@@ -24822,7 +24676,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -24822,7 +24676,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
24822 } },24676 } },
24823 }, .{24677 }, .{
24824 .required_cc_abi = .win64,24678 .required_cc_abi = .win64,
24825 .required_features = .{ .sse, null, null, null },
24826 .src_constraints = .{24679 .src_constraints = .{
24827 .{ .scalar_float = .{ .of = .xword, .is = .xword } },24680 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
24828 .{ .scalar_float = .{ .of = .xword, .is = .xword } },24681 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -24835,6 +24688,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -24835,6 +24688,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
24835 .extra_temps = .{24688 .extra_temps = .{
24836 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },24689 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
24837 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },24690 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
24691 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
24838 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },24692 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
24839 .unused,24693 .unused,
24840 .unused,24694 .unused,
...@@ -24843,14 +24697,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -24843,14 +24697,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
24843 .unused,24697 .unused,
24844 .unused,24698 .unused,
24845 .unused,24699 .unused,
24846 .unused,
24847 },24700 },
24848 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },24701 .dst_temps = .{ .mem, .unused },
24849 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },24702 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
24850 .each = .{ .once = &.{24703 .each = .{ .once = &.{
24851 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },24704 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
24852 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },24705 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
24853 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },24706 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
24707 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
24854 } },24708 } },
24855 }, .{24709 }, .{
24856 .required_cc_abi = .sysv64,24710 .required_cc_abi = .sysv64,
...@@ -24962,79 +24816,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -24962,79 +24816,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
24962 } },24816 } },
24963 }, .{24817 }, .{
24964 .required_cc_abi = .win64,24818 .required_cc_abi = .win64,
24965 .required_features = .{ .avx, null, null, null },
24966 .src_constraints = .{
24967 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
24968 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
24969 .any,
24970 },
24971 .patterns = &.{
24972 .{ .src = .{ .to_mem, .to_mem, .none } },
24973 },
24974 .call_frame = .{ .alignment = .@"16" },
24975 .extra_temps = .{
24976 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
24977 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
24978 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
24979 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
24980 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
24981 .unused,
24982 .unused,
24983 .unused,
24984 .unused,
24985 .unused,
24986 .unused,
24987 },
24988 .dst_temps = .{ .mem, .unused },
24989 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
24990 .each = .{ .once = &.{
24991 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
24992 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
24993 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
24994 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
24995 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
24996 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
24997 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
24998 } },
24999 }, .{
25000 .required_cc_abi = .win64,
25001 .required_features = .{ .sse2, null, null, null },
25002 .src_constraints = .{
25003 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
25004 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
25005 .any,
25006 },
25007 .patterns = &.{
25008 .{ .src = .{ .to_mem, .to_mem, .none } },
25009 },
25010 .call_frame = .{ .alignment = .@"16" },
25011 .extra_temps = .{
25012 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
25013 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
25014 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
25015 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
25016 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
25017 .unused,
25018 .unused,
25019 .unused,
25020 .unused,
25021 .unused,
25022 .unused,
25023 },
25024 .dst_temps = .{ .mem, .unused },
25025 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
25026 .each = .{ .once = &.{
25027 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
25028 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
25029 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
25030 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
25031 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
25032 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
25033 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
25034 } },
25035 }, .{
25036 .required_cc_abi = .win64,
25037 .required_features = .{ .sse, null, null, null },
25038 .src_constraints = .{24819 .src_constraints = .{
25039 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },24820 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
25040 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },24821 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -25048,8 +24829,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -25048,8 +24829,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
25048 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },24829 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
25049 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },24830 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
25050 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },24831 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
24832 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
25051 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },24833 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
25052 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
25053 .unused,24834 .unused,
25054 .unused,24835 .unused,
25055 .unused,24836 .unused,
...@@ -25061,10 +24842,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -25061,10 +24842,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
25061 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },24842 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
25062 .each = .{ .once = &.{24843 .each = .{ .once = &.{
25063 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },24844 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
25064 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },24845 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
25065 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },24846 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
25066 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },24847 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
25067 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },24848 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
25068 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },24849 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
25069 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },24850 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
25070 } },24851 } },
...@@ -27770,10 +27551,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -27770,10 +27551,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
27770 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },27551 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
27771 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },27552 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
27772 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },27553 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
27773 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },27554 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
27774 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },27555 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
27775 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },27556 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
27776 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },27557 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
27777 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },27558 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
27778 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },27559 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
27779 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },27560 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -27890,10 +27671,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -27890,10 +27671,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
27890 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },27671 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
27891 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },27672 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
27892 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },27673 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
27893 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },27674 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
27894 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },27675 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
27895 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },27676 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
27896 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },27677 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
27897 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },27678 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
27898 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },27679 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
27899 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },27680 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28010,10 +27791,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28010,10 +27791,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28010 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },27791 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28011 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },27792 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28012 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },27793 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28013 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },27794 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28014 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },27795 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28015 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },27796 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
28016 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },27797 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
28017 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },27798 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28018 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },27799 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28019 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },27800 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28130,10 +27911,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28130,10 +27911,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28130 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },27911 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28131 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },27912 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28132 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },27913 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28133 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },27914 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28134 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },27915 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28135 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },27916 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
28136 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },27917 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
28137 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },27918 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28138 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },27919 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28139 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },27920 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28248,10 +28029,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28248,10 +28029,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28248 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28029 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28249 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28030 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28250 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28031 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28251 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28032 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28252 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },28033 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
28253 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28034 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28254 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },28035 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
28255 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28036 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28256 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28037 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28257 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28038 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28373,10 +28154,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28373,10 +28154,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28373 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28154 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28374 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28155 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28375 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28156 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28376 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28157 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28377 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },28158 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
28378 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28159 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28379 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },28160 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
28380 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28161 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28381 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28162 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28382 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28163 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28498,10 +28279,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28498,10 +28279,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28498 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28279 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28499 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28280 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28500 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28281 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28501 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28282 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28502 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28283 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28503 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },28284 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
28504 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },28285 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
28505 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28286 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28506 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28287 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28507 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28288 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28623,10 +28404,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28623,10 +28404,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28623 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28404 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28624 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28405 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28625 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28406 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28626 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28407 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28627 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28408 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28628 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },28409 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
28629 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },28410 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
28630 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28411 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28631 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28412 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28632 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28413 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28748,10 +28529,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28748,10 +28529,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28748 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28529 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28749 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28530 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28750 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28531 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28751 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28532 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28752 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },28533 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
28753 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28534 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28754 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },28535 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
28755 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28536 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28756 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28537 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28757 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28538 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -28878,10 +28659,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28878,10 +28659,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28878 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28659 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
28879 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28660 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
28880 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28661 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
28881 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28662 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
28882 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },28663 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
28883 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28664 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
28884 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },28665 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
28885 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28666 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
28886 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28667 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
28887 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28668 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29008,10 +28789,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29008,10 +28789,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29008 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28789 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29009 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28790 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29010 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28791 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29011 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28792 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29012 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28793 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29013 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },28794 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
29014 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },28795 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
29015 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28796 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29016 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28797 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29017 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28798 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29138,10 +28919,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29138,10 +28919,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29138 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },28919 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29139 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },28920 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29140 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },28921 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29141 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },28922 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29142 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },28923 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29143 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },28924 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
29144 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },28925 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
29145 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },28926 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29146 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },28927 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29147 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },28928 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29268,10 +29049,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29268,10 +29049,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29268 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29049 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29269 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29050 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29270 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29051 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29271 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29052 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29272 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },29053 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
29273 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29054 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29274 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },29055 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
29275 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29056 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29276 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29057 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29277 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29058 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29399,10 +29180,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29399,10 +29180,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29399 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29180 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29400 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29181 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29401 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29182 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29402 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29183 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29403 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },29184 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
29404 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29185 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29405 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },29186 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
29406 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29187 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29407 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29188 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29408 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29189 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29530,10 +29311,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29530,10 +29311,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29530 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29311 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29531 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29312 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29532 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29313 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29533 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29314 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29534 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29315 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29535 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },29316 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
29536 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },29317 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
29537 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29318 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29538 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29319 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29539 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29320 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29661,10 +29442,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29661,10 +29442,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29661 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29442 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29662 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29443 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29663 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29444 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29664 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29445 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29665 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29446 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29666 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },29447 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
29667 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },29448 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
29668 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29449 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29669 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29450 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29670 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29451 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29794,10 +29575,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29794,10 +29575,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29794 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29575 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29795 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29576 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29796 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29577 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29797 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29578 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29798 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },29579 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
29799 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29580 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29800 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },29581 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
29801 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29582 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29802 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29583 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29803 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29584 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -29920,10 +29701,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -29920,10 +29701,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
29920 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29701 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
29921 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29702 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
29922 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29703 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
29923 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29704 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
29924 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },29705 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
29925 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29706 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
29926 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },29707 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
29927 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29708 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
29928 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29709 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
29929 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29710 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -30046,10 +29827,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -30046,10 +29827,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
30046 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29827 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
30047 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29828 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
30048 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29829 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
30049 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29830 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
30050 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29831 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
30051 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },29832 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
30052 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },29833 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
30053 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29834 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
30054 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29835 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
30055 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29836 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -30172,10 +29953,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -30172,10 +29953,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
30172 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },29953 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
30173 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },29954 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
30174 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },29955 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
30175 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },29956 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
30176 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },29957 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
30177 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },29958 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
30178 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },29959 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
30179 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },29960 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
30180 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },29961 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
30181 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },29962 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -30298,10 +30079,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -30298,10 +30079,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
30298 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },30079 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
30299 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },30080 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
30300 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },30081 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
30301 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },30082 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
30302 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },30083 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
30303 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },30084 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
30304 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },30085 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
30305 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },30086 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
30306 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },30087 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
30307 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },30088 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -30425,10 +30206,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -30425,10 +30206,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
30425 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },30206 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
30426 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },30207 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
30427 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },30208 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
30428 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },30209 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
30429 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },30210 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
30430 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },30211 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
30431 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },30212 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
30432 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },30213 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
30433 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },30214 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
30434 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },30215 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -30552,10 +30333,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -30552,10 +30333,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
30552 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },30333 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
30553 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },30334 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
30554 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },30335 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
30555 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },30336 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
30556 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },30337 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
30557 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },30338 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
30558 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },30339 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
30559 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },30340 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
30560 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },30341 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
30561 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },30342 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -30679,10 +30460,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -30679,10 +30460,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
30679 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },30460 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
30680 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },30461 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
30681 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },30462 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
30682 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },30463 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
30683 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },30464 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
30684 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },30465 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
30685 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },30466 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
30686 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },30467 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
30687 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },30468 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
30688 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },30469 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -33080,7 +32861,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -33080,7 +32861,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
33080 } },32861 } },
33081 }, .{32862 }, .{
33082 .required_cc_abi = .win64,32863 .required_cc_abi = .win64,
33083 .required_features = .{ .sse, null, null, null },
33084 .src_constraints = .{32864 .src_constraints = .{
33085 .{ .scalar_float = .{ .of = .xword, .is = .xword } },32865 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
33086 .{ .scalar_float = .{ .of = .xword, .is = .xword } },32866 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -33093,6 +32873,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -33093,6 +32873,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
33093 .extra_temps = .{32873 .extra_temps = .{
33094 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },32874 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33095 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },32875 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
32876 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
33096 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },32877 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
33097 .unused,32878 .unused,
33098 .unused,32879 .unused,
...@@ -33101,14 +32882,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -33101,14 +32882,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
33101 .unused,32882 .unused,
33102 .unused,32883 .unused,
33103 .unused,32884 .unused,
33104 .unused,
33105 },32885 },
33106 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },32886 .dst_temps = .{ .mem, .unused },
33107 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },32887 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
33108 .each = .{ .once = &.{32888 .each = .{ .once = &.{
33109 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },32889 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
33110 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },32890 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
33111 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },32891 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
32892 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
33112 } },32893 } },
33113 }, .{32894 }, .{
33114 .required_cc_abi = .sysv64,32895 .required_cc_abi = .sysv64,
...@@ -33220,79 +33001,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -33220,79 +33001,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
33220 } },33001 } },
33221 }, .{33002 }, .{
33222 .required_cc_abi = .win64,33003 .required_cc_abi = .win64,
33223 .required_features = .{ .avx, null, null, null },
33224 .src_constraints = .{
33225 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
33226 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
33227 .any,
33228 },
33229 .patterns = &.{
33230 .{ .src = .{ .to_mem, .to_mem, .none } },
33231 },
33232 .call_frame = .{ .alignment = .@"16" },
33233 .extra_temps = .{
33234 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
33235 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33236 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
33237 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
33238 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33239 .unused,
33240 .unused,
33241 .unused,
33242 .unused,
33243 .unused,
33244 .unused,
33245 },
33246 .dst_temps = .{ .mem, .unused },
33247 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
33248 .each = .{ .once = &.{
33249 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
33250 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
33251 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
33252 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
33253 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
33254 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
33255 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
33256 } },
33257 }, .{
33258 .required_cc_abi = .win64,
33259 .required_features = .{ .sse2, null, null, null },
33260 .src_constraints = .{
33261 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
33262 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
33263 .any,
33264 },
33265 .patterns = &.{
33266 .{ .src = .{ .to_mem, .to_mem, .none } },
33267 },
33268 .call_frame = .{ .alignment = .@"16" },
33269 .extra_temps = .{
33270 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
33271 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33272 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
33273 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
33274 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33275 .unused,
33276 .unused,
33277 .unused,
33278 .unused,
33279 .unused,
33280 .unused,
33281 },
33282 .dst_temps = .{ .mem, .unused },
33283 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
33284 .each = .{ .once = &.{
33285 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
33286 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
33287 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
33288 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
33289 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
33290 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
33291 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
33292 } },
33293 }, .{
33294 .required_cc_abi = .win64,
33295 .required_features = .{ .sse, null, null, null },
33296 .src_constraints = .{33004 .src_constraints = .{
33297 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },33005 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
33298 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },33006 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -33306,8 +33014,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -33306,8 +33014,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
33306 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },33014 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
33307 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },33015 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33308 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },33016 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
33017 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
33309 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },33018 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
33310 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
33311 .unused,33019 .unused,
33312 .unused,33020 .unused,
33313 .unused,33021 .unused,
...@@ -33319,10 +33027,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -33319,10 +33027,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
33319 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },33027 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
33320 .each = .{ .once = &.{33028 .each = .{ .once = &.{
33321 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },33029 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
33322 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },33030 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
33323 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },33031 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
33324 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },33032 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
33325 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },33033 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
33326 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },33034 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
33327 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },33035 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
33328 } },33036 } },
...@@ -34453,7 +34161,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -34453,7 +34161,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
34453 } },34161 } },
34454 }, .{34162 }, .{
34455 .required_cc_abi = .win64,34163 .required_cc_abi = .win64,
34456 .required_features = .{ .avx, null, null, null },
34457 .src_constraints = .{34164 .src_constraints = .{
34458 .{ .scalar_float = .{ .of = .xword, .is = .xword } },34165 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
34459 .{ .scalar_float = .{ .of = .xword, .is = .xword } },34166 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -34464,97 +34171,28 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -34464,97 +34171,28 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
34464 },34171 },
34465 .call_frame = .{ .alignment = .@"16" },34172 .call_frame = .{ .alignment = .@"16" },
34466 .extra_temps = .{34173 .extra_temps = .{
34467 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34468 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
34469 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
34470 .{ .type = .f128, .kind = .mem },34174 .{ .type = .f128, .kind = .mem },
34471 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },
34472 .unused,
34473 .unused,
34474 .unused,
34475 .unused,
34476 .unused,
34477 .unused,
34478 },
34479 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
34480 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
34481 .each = .{ .once = &.{
34482 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
34483 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
34484 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
34485 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
34486 .{ ._, .v_dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
34487 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
34488 } },
34489 }, .{
34490 .required_cc_abi = .win64,
34491 .required_features = .{ .sse2, null, null, null },
34492 .src_constraints = .{
34493 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
34494 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
34495 .any,
34496 },
34497 .patterns = &.{
34498 .{ .src = .{ .to_mem, .to_mem, .none } },
34499 },
34500 .call_frame = .{ .alignment = .@"16" },
34501 .extra_temps = .{
34502 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34503 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
34504 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
34505 .{ .type = .f128, .kind = .mem },
34506 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },
34507 .unused,
34508 .unused,
34509 .unused,
34510 .unused,
34511 .unused,
34512 .unused,
34513 },
34514 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
34515 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
34516 .each = .{ .once = &.{
34517 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
34518 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
34519 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
34520 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
34521 .{ ._, ._dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
34522 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
34523 } },
34524 }, .{
34525 .required_cc_abi = .win64,
34526 .required_features = .{ .sse, null, null, null },
34527 .src_constraints = .{
34528 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
34529 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
34530 .any,
34531 },
34532 .patterns = &.{
34533 .{ .src = .{ .to_mem, .to_mem, .none } },
34534 },
34535 .call_frame = .{ .alignment = .@"16" },
34536 .extra_temps = .{
34537 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },34175 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34538 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },34176 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
34177 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
34539 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },34178 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
34540 .{ .type = .f128, .kind = .mem },
34541 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },34179 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },
34542 .unused,34180 .unused,
34543 .unused,34181 .unused,
34544 .unused,34182 .unused,
34545 .unused,34183 .unused,
34546 .unused,34184 .unused,
34547 .unused,
34548 },34185 },
34549 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },34186 .dst_temps = .{ .mem, .unused },
34550 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },34187 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
34551 .each = .{ .once = &.{34188 .each = .{ .once = &.{
34552 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },34189 .{ ._, ._, .lea, .tmp1p, .mem(.tmp0), ._, ._ },
34553 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },34190 .{ ._, ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
34554 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },34191 .{ ._, ._, .lea, .tmp3p, .mem(.src1), ._, ._ },
34555 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
34556 .{ ._, ._ps, .mova, .lea(.tmp0x), .dst0x, ._, ._ },
34557 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },34192 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
34193 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
34194 .{ ._, ._, .lea, .tmp2p, .mem(.tmp0), ._, ._ },
34195 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
34558 } },34196 } },
34559 }, .{34197 }, .{
34560 .required_cc_abi = .sysv64,34198 .required_cc_abi = .sysv64,
...@@ -34669,7 +34307,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -34669,7 +34307,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
34669 } },34307 } },
34670 }, .{34308 }, .{
34671 .required_cc_abi = .win64,34309 .required_cc_abi = .win64,
34672 .required_features = .{ .avx, null, null, null },
34673 .src_constraints = .{34310 .src_constraints = .{
34674 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },34311 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
34675 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },34312 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -34681,89 +34318,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -34681,89 +34318,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
34681 .call_frame = .{ .alignment = .@"16" },34318 .call_frame = .{ .alignment = .@"16" },
34682 .extra_temps = .{34319 .extra_temps = .{
34683 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },34320 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
34684 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34685 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
34686 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
34687 .{ .type = .f128, .kind = .mem },34321 .{ .type = .f128, .kind = .mem },
34688 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34689 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },
34690 .unused,
34691 .unused,
34692 .unused,
34693 .unused,
34694 },
34695 .dst_temps = .{ .mem, .unused },
34696 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
34697 .each = .{ .once = &.{
34698 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
34699 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },
34700 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },
34701 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
34702 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
34703 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp5x, ._, ._ },
34704 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
34705 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
34706 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
34707 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
34708 } },
34709 }, .{
34710 .required_cc_abi = .win64,
34711 .required_features = .{ .sse2, null, null, null },
34712 .src_constraints = .{
34713 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
34714 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
34715 .any,
34716 },
34717 .patterns = &.{
34718 .{ .src = .{ .to_mem, .to_mem, .none } },
34719 },
34720 .call_frame = .{ .alignment = .@"16" },
34721 .extra_temps = .{
34722 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
34723 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34724 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
34725 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
34726 .{ .type = .f128, .kind = .mem },
34727 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34728 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },
34729 .unused,
34730 .unused,
34731 .unused,
34732 .unused,
34733 },
34734 .dst_temps = .{ .mem, .unused },
34735 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
34736 .each = .{ .once = &.{
34737 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
34738 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },
34739 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },
34740 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
34741 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
34742 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp5x, ._, ._ },
34743 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
34744 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
34745 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
34746 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
34747 } },
34748 }, .{
34749 .required_cc_abi = .win64,
34750 .required_features = .{ .sse, null, null, null },
34751 .src_constraints = .{
34752 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
34753 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
34754 .any,
34755 },
34756 .patterns = &.{
34757 .{ .src = .{ .to_mem, .to_mem, .none } },
34758 },
34759 .call_frame = .{ .alignment = .@"16" },
34760 .extra_temps = .{
34761 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
34762 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },34322 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34763 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },34323 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
34324 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
34764 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },34325 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
34765 .{ .type = .f128, .kind = .mem },
34766 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
34767 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },34326 .{ .type = .usize, .kind = .{ .extern_func = "truncf128" } },
34768 .unused,34327 .unused,
34769 .unused,34328 .unused,
...@@ -34774,13 +34333,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -34774,13 +34333,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
34774 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },34333 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
34775 .each = .{ .once = &.{34334 .each = .{ .once = &.{
34776 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },34335 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
34777 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },34336 .{ .@"0:", ._, .lea, .tmp2p, .mem(.tmp1), ._, ._ },
34778 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },34337 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
34779 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },34338 .{ ._, ._, .lea, .tmp4p, .memi(.src1, .tmp0), ._, ._ },
34780 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },34339 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
34781 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp5x, ._, ._ },34340 .{ ._, ._, .lea, .tmp2p, .memi(.dst0, .tmp0), ._, ._ },
34341 .{ ._, ._, .lea, .tmp3p, .mem(.tmp1), ._, ._ },
34782 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },34342 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
34783 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
34784 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },34343 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
34785 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },34344 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
34786 } },34345 } },
...@@ -35979,7 +35538,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -35979,7 +35538,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
35979 } },35538 } },
35980 }, .{35539 }, .{
35981 .required_cc_abi = .win64,35540 .required_cc_abi = .win64,
35982 .required_features = .{ .avx, null, null, null },
35983 .src_constraints = .{35541 .src_constraints = .{
35984 .{ .scalar_float = .{ .of = .xword, .is = .xword } },35542 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
35985 .{ .scalar_float = .{ .of = .xword, .is = .xword } },35543 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -35990,10 +35548,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -35990,10 +35548,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
35990 },35548 },
35991 .call_frame = .{ .alignment = .@"16" },35549 .call_frame = .{ .alignment = .@"16" },
35992 .extra_temps = .{35550 .extra_temps = .{
35551 .{ .type = .f128, .kind = .mem },
35993 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },35552 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
35994 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },35553 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
35554 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
35995 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },35555 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
35996 .{ .type = .f128, .kind = .mem },
35997 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {35556 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
35998 else => unreachable,35557 else => unreachable,
35999 .zero => "truncf128",35558 .zero => "truncf128",
...@@ -36004,24 +35563,24 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36004,24 +35563,24 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36004 .unused,35563 .unused,
36005 .unused,35564 .unused,
36006 .unused,35565 .unused,
36007 .unused,
36008 },35566 },
36009 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },35567 .dst_temps = .{ .mem, .unused },
36010 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },35568 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36011 .each = .{ .once = &.{35569 .each = .{ .once = &.{
36012 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },35570 .{ ._, ._, .lea, .tmp1p, .mem(.tmp0), ._, ._ },
36013 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },35571 .{ ._, ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
36014 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },35572 .{ ._, ._, .lea, .tmp3p, .mem(.src1), ._, ._ },
36015 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
36016 .{ ._, .v_dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
36017 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },35573 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
35574 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
35575 .{ ._, ._, .lea, .tmp2p, .mem(.tmp0), ._, ._ },
35576 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
36018 } },35577 } },
36019 }, .{35578 }, .{
36020 .required_cc_abi = .win64,35579 .required_cc_abi = .sysv64,
36021 .required_features = .{ .sse2, null, null, null },35580 .required_features = .{ .avx, null, null, null },
36022 .src_constraints = .{35581 .src_constraints = .{
36023 .{ .scalar_float = .{ .of = .xword, .is = .xword } },35582 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36024 .{ .scalar_float = .{ .of = .xword, .is = .xword } },35583 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36025 .any,35584 .any,
36026 },35585 },
36027 .patterns = &.{35586 .patterns = &.{
...@@ -36029,10 +35588,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36029,10 +35588,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36029 },35588 },
36030 .call_frame = .{ .alignment = .@"16" },35589 .call_frame = .{ .alignment = .@"16" },
36031 .extra_temps = .{35590 .extra_temps = .{
36032 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },35591 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36033 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },35592 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
35593 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
36034 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },35594 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36035 .{ .type = .f128, .kind = .mem },
36036 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {35595 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36037 else => unreachable,35596 else => unreachable,
36038 .zero => "truncf128",35597 .zero => "truncf128",
...@@ -36045,22 +35604,24 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36045,22 +35604,24 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36045 .unused,35604 .unused,
36046 .unused,35605 .unused,
36047 },35606 },
36048 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },35607 .dst_temps = .{ .mem, .unused },
36049 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },35608 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36050 .each = .{ .once = &.{35609 .each = .{ .once = &.{
36051 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },35610 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36052 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },35611 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
36053 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },35612 .{ ._, .v_dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
36054 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },35613 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
36055 .{ ._, ._dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
36056 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },35614 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
35615 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
35616 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
35617 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36057 } },35618 } },
36058 }, .{35619 }, .{
36059 .required_cc_abi = .win64,35620 .required_cc_abi = .sysv64,
36060 .required_features = .{ .sse, null, null, null },35621 .required_features = .{ .sse2, null, null, null },
36061 .src_constraints = .{35622 .src_constraints = .{
36062 .{ .scalar_float = .{ .of = .xword, .is = .xword } },35623 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36063 .{ .scalar_float = .{ .of = .xword, .is = .xword } },35624 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36064 .any,35625 .any,
36065 },35626 },
36066 .patterns = &.{35627 .patterns = &.{
...@@ -36068,10 +35629,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36068,10 +35629,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36068 },35629 },
36069 .call_frame = .{ .alignment = .@"16" },35630 .call_frame = .{ .alignment = .@"16" },
36070 .extra_temps = .{35631 .extra_temps = .{
36071 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },35632 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36072 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },35633 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
35634 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
36073 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },35635 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36074 .{ .type = .f128, .kind = .mem },
36075 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {35636 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36076 else => unreachable,35637 else => unreachable,
36077 .zero => "truncf128",35638 .zero => "truncf128",
...@@ -36084,101 +35645,21 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36084,101 +35645,21 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36084 .unused,35645 .unused,
36085 .unused,35646 .unused,
36086 },35647 },
36087 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },35648 .dst_temps = .{ .mem, .unused },
36088 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },35649 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36089 .each = .{ .once = &.{35650 .each = .{ .once = &.{
36090 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },35651 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36091 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },35652 .{ .@"0:", ._dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
36092 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },35653 .{ ._, ._dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
36093 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },35654 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
36094 .{ ._, ._ps, .mova, .lea(.tmp0x), .dst0x, ._, ._ },
36095 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },35655 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
35656 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
35657 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
35658 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36096 } },35659 } },
36097 }, .{35660 }, .{
36098 .required_cc_abi = .sysv64,35661 .required_cc_abi = .sysv64,
36099 .required_features = .{ .avx, null, null, null },35662 .required_features = .{ .sse, null, null, null },
36100 .src_constraints = .{
36101 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36102 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36103 .any,
36104 },
36105 .patterns = &.{
36106 .{ .src = .{ .to_mem, .to_mem, .none } },
36107 },
36108 .call_frame = .{ .alignment = .@"16" },
36109 .extra_temps = .{
36110 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36111 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36112 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
36113 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36114 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36115 else => unreachable,
36116 .zero => "truncf128",
36117 .down => "floorf128",
36118 } } },
36119 .unused,
36120 .unused,
36121 .unused,
36122 .unused,
36123 .unused,
36124 .unused,
36125 },
36126 .dst_temps = .{ .mem, .unused },
36127 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36128 .each = .{ .once = &.{
36129 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36130 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
36131 .{ ._, .v_dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
36132 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
36133 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
36134 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
36135 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
36136 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36137 } },
36138 }, .{
36139 .required_cc_abi = .sysv64,
36140 .required_features = .{ .sse2, null, null, null },
36141 .src_constraints = .{
36142 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36143 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36144 .any,
36145 },
36146 .patterns = &.{
36147 .{ .src = .{ .to_mem, .to_mem, .none } },
36148 },
36149 .call_frame = .{ .alignment = .@"16" },
36150 .extra_temps = .{
36151 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36152 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36153 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
36154 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36155 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36156 else => unreachable,
36157 .zero => "truncf128",
36158 .down => "floorf128",
36159 } } },
36160 .unused,
36161 .unused,
36162 .unused,
36163 .unused,
36164 .unused,
36165 .unused,
36166 },
36167 .dst_temps = .{ .mem, .unused },
36168 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36169 .each = .{ .once = &.{
36170 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36171 .{ .@"0:", ._dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
36172 .{ ._, ._dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
36173 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
36174 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
36175 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
36176 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
36177 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36178 } },
36179 }, .{
36180 .required_cc_abi = .sysv64,
36181 .required_features = .{ .sse, null, null, null },
36182 .src_constraints = .{35663 .src_constraints = .{
36183 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },35664 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36184 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },35665 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -36219,7 +35700,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36219,7 +35700,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36219 } },35700 } },
36220 }, .{35701 }, .{
36221 .required_cc_abi = .win64,35702 .required_cc_abi = .win64,
36222 .required_features = .{ .avx, null, null, null },
36223 .src_constraints = .{35703 .src_constraints = .{
36224 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },35704 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36225 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },35705 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -36231,97 +35711,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36231,97 +35711,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36231 .call_frame = .{ .alignment = .@"16" },35711 .call_frame = .{ .alignment = .@"16" },
36232 .extra_temps = .{35712 .extra_temps = .{
36233 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },35713 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36234 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36235 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
36236 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36237 .{ .type = .f128, .kind = .mem },35714 .{ .type = .f128, .kind = .mem },
36238 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36239 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36240 else => unreachable,
36241 .zero => "truncf128",
36242 .down => "floorf128",
36243 } } },
36244 .unused,
36245 .unused,
36246 .unused,
36247 .unused,
36248 },
36249 .dst_temps = .{ .mem, .unused },
36250 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36251 .each = .{ .once = &.{
36252 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36253 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },
36254 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },
36255 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
36256 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
36257 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp5x, ._, ._ },
36258 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
36259 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
36260 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
36261 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36262 } },
36263 }, .{
36264 .required_cc_abi = .win64,
36265 .required_features = .{ .sse2, null, null, null },
36266 .src_constraints = .{
36267 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36268 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36269 .any,
36270 },
36271 .patterns = &.{
36272 .{ .src = .{ .to_mem, .to_mem, .none } },
36273 },
36274 .call_frame = .{ .alignment = .@"16" },
36275 .extra_temps = .{
36276 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36277 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36278 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
36279 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36280 .{ .type = .f128, .kind = .mem },
36281 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36282 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36283 else => unreachable,
36284 .zero => "truncf128",
36285 .down => "floorf128",
36286 } } },
36287 .unused,
36288 .unused,
36289 .unused,
36290 .unused,
36291 },
36292 .dst_temps = .{ .mem, .unused },
36293 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36294 .each = .{ .once = &.{
36295 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36296 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },
36297 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },
36298 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
36299 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
36300 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp5x, ._, ._ },
36301 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
36302 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
36303 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
36304 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36305 } },
36306 }, .{
36307 .required_cc_abi = .win64,
36308 .required_features = .{ .sse, null, null, null },
36309 .src_constraints = .{
36310 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36311 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
36312 .any,
36313 },
36314 .patterns = &.{
36315 .{ .src = .{ .to_mem, .to_mem, .none } },
36316 },
36317 .call_frame = .{ .alignment = .@"16" },
36318 .extra_temps = .{
36319 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
36320 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },35715 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36321 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },35716 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
35717 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
36322 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },35718 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
36323 .{ .type = .f128, .kind = .mem },
36324 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
36325 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {35719 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
36326 else => unreachable,35720 else => unreachable,
36327 .zero => "truncf128",35721 .zero => "truncf128",
...@@ -36336,13 +35730,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -36336,13 +35730,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
36336 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },35730 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
36337 .each = .{ .once = &.{35731 .each = .{ .once = &.{
36338 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },35732 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
36339 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },35733 .{ .@"0:", ._, .lea, .tmp2p, .mem(.tmp1), ._, ._ },
36340 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },35734 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
36341 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },35735 .{ ._, ._, .lea, .tmp4p, .memi(.src1, .tmp0), ._, ._ },
36342 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },35736 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
36343 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp5x, ._, ._ },35737 .{ ._, ._, .lea, .tmp2p, .memi(.dst0, .tmp0), ._, ._ },
35738 .{ ._, ._, .lea, .tmp3p, .mem(.tmp1), ._, ._ },
36344 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },35739 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
36345 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
36346 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },35740 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
36347 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },35741 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
36348 } },35742 } },
...@@ -37708,7 +37102,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -37708,7 +37102,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
37708 } },37102 } },
37709 }, .{37103 }, .{
37710 .required_cc_abi = .win64,37104 .required_cc_abi = .win64,
37711 .required_features = .{ .avx, null, null, null },
37712 .src_constraints = .{37105 .src_constraints = .{
37713 .{ .scalar_float = .{ .of = .xword, .is = .xword } },37106 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
37714 .{ .scalar_float = .{ .of = .xword, .is = .xword } },37107 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -37719,97 +37112,28 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -37719,97 +37112,28 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
37719 },37112 },
37720 .call_frame = .{ .alignment = .@"16" },37113 .call_frame = .{ .alignment = .@"16" },
37721 .extra_temps = .{37114 .extra_temps = .{
37722 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37723 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
37724 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
37725 .{ .type = .f128, .kind = .mem },37115 .{ .type = .f128, .kind = .mem },
37726 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },
37727 .unused,
37728 .unused,
37729 .unused,
37730 .unused,
37731 .unused,
37732 .unused,
37733 },
37734 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
37735 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
37736 .each = .{ .once = &.{
37737 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
37738 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
37739 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
37740 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
37741 .{ ._, .v_dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
37742 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
37743 } },
37744 }, .{
37745 .required_cc_abi = .win64,
37746 .required_features = .{ .sse2, null, null, null },
37747 .src_constraints = .{
37748 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
37749 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
37750 .any,
37751 },
37752 .patterns = &.{
37753 .{ .src = .{ .to_mem, .to_mem, .none } },
37754 },
37755 .call_frame = .{ .alignment = .@"16" },
37756 .extra_temps = .{
37757 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37758 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
37759 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
37760 .{ .type = .f128, .kind = .mem },
37761 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },
37762 .unused,
37763 .unused,
37764 .unused,
37765 .unused,
37766 .unused,
37767 .unused,
37768 },
37769 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
37770 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
37771 .each = .{ .once = &.{
37772 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
37773 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
37774 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
37775 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
37776 .{ ._, ._dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
37777 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
37778 } },
37779 }, .{
37780 .required_cc_abi = .win64,
37781 .required_features = .{ .sse, null, null, null },
37782 .src_constraints = .{
37783 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
37784 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
37785 .any,
37786 },
37787 .patterns = &.{
37788 .{ .src = .{ .to_mem, .to_mem, .none } },
37789 },
37790 .call_frame = .{ .alignment = .@"16" },
37791 .extra_temps = .{
37792 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },37116 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37793 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },37117 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
37118 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
37794 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },37119 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
37795 .{ .type = .f128, .kind = .mem },
37796 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },37120 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },
37797 .unused,37121 .unused,
37798 .unused,37122 .unused,
37799 .unused,37123 .unused,
37800 .unused,37124 .unused,
37801 .unused,37125 .unused,
37802 .unused,
37803 },37126 },
37804 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },37127 .dst_temps = .{ .mem, .unused },
37805 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },37128 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
37806 .each = .{ .once = &.{37129 .each = .{ .once = &.{
37807 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },37130 .{ ._, ._, .lea, .tmp1p, .mem(.tmp0), ._, ._ },
37808 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },37131 .{ ._, ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
37809 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },37132 .{ ._, ._, .lea, .tmp3p, .mem(.src1), ._, ._ },
37810 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
37811 .{ ._, ._ps, .mova, .lea(.tmp0x), .dst0x, ._, ._ },
37812 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },37133 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
37134 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
37135 .{ ._, ._, .lea, .tmp2p, .mem(.tmp0), ._, ._ },
37136 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
37813 } },37137 } },
37814 }, .{37138 }, .{
37815 .required_cc_abi = .sysv64,37139 .required_cc_abi = .sysv64,
...@@ -37924,7 +37248,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -37924,7 +37248,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
37924 } },37248 } },
37925 }, .{37249 }, .{
37926 .required_cc_abi = .win64,37250 .required_cc_abi = .win64,
37927 .required_features = .{ .avx, null, null, null },
37928 .src_constraints = .{37251 .src_constraints = .{
37929 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },37252 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
37930 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },37253 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -37936,89 +37259,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -37936,89 +37259,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
37936 .call_frame = .{ .alignment = .@"16" },37259 .call_frame = .{ .alignment = .@"16" },
37937 .extra_temps = .{37260 .extra_temps = .{
37938 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },37261 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
37939 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37940 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
37941 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
37942 .{ .type = .f128, .kind = .mem },37262 .{ .type = .f128, .kind = .mem },
37943 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37944 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },
37945 .unused,
37946 .unused,
37947 .unused,
37948 .unused,
37949 },
37950 .dst_temps = .{ .mem, .unused },
37951 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
37952 .each = .{ .once = &.{
37953 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
37954 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },
37955 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },
37956 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
37957 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
37958 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp5x, ._, ._ },
37959 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
37960 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
37961 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
37962 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
37963 } },
37964 }, .{
37965 .required_cc_abi = .win64,
37966 .required_features = .{ .sse2, null, null, null },
37967 .src_constraints = .{
37968 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
37969 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
37970 .any,
37971 },
37972 .patterns = &.{
37973 .{ .src = .{ .to_mem, .to_mem, .none } },
37974 },
37975 .call_frame = .{ .alignment = .@"16" },
37976 .extra_temps = .{
37977 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
37978 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37979 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
37980 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
37981 .{ .type = .f128, .kind = .mem },
37982 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
37983 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },
37984 .unused,
37985 .unused,
37986 .unused,
37987 .unused,
37988 },
37989 .dst_temps = .{ .mem, .unused },
37990 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
37991 .each = .{ .once = &.{
37992 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
37993 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },
37994 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },
37995 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
37996 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
37997 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp5x, ._, ._ },
37998 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
37999 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
38000 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
38001 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
38002 } },
38003 }, .{
38004 .required_cc_abi = .win64,
38005 .required_features = .{ .sse, null, null, null },
38006 .src_constraints = .{
38007 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
38008 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
38009 .any,
38010 },
38011 .patterns = &.{
38012 .{ .src = .{ .to_mem, .to_mem, .none } },
38013 },
38014 .call_frame = .{ .alignment = .@"16" },
38015 .extra_temps = .{
38016 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
38017 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },37263 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
38018 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },37264 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
37265 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
38019 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },37266 .{ .type = .usize, .kind = .{ .extern_func = "__divtf3" } },
38020 .{ .type = .f128, .kind = .mem },
38021 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
38022 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },37267 .{ .type = .usize, .kind = .{ .extern_func = "floorf128" } },
38023 .unused,37268 .unused,
38024 .unused,37269 .unused,
...@@ -38029,13 +37274,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -38029,13 +37274,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
38029 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },37274 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
38030 .each = .{ .once = &.{37275 .each = .{ .once = &.{
38031 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },37276 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
38032 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0x, .tmp0), ._, ._ },37277 .{ .@"0:", ._, .lea, .tmp2p, .mem(.tmp1), ._, ._ },
38033 .{ ._, ._, .lea, .tmp2p, .memi(.src1x, .tmp0), ._, ._ },37278 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
38034 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },37279 .{ ._, ._, .lea, .tmp4p, .memi(.src1, .tmp0), ._, ._ },
38035 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },37280 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
38036 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp5x, ._, ._ },37281 .{ ._, ._, .lea, .tmp2p, .memi(.dst0, .tmp0), ._, ._ },
37282 .{ ._, ._, .lea, .tmp3p, .mem(.tmp1), ._, ._ },
38037 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },37283 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
38038 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
38039 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },37284 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
38040 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },37285 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
38041 } },37286 } },
...@@ -39575,7 +38820,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -39575,7 +38820,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
39575 } },38820 } },
39576 }, .{38821 }, .{
39577 .required_cc_abi = .win64,38822 .required_cc_abi = .win64,
39578 .required_features = .{ .sse, null, null, null },
39579 .src_constraints = .{38823 .src_constraints = .{
39580 .{ .scalar_float = .{ .of = .xword, .is = .xword } },38824 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
39581 .{ .scalar_float = .{ .of = .xword, .is = .xword } },38825 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -39588,6 +38832,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -39588,6 +38832,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
39588 .extra_temps = .{38832 .extra_temps = .{
39589 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },38833 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39590 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },38834 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
38835 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
39591 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },38836 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
39592 .unused,38837 .unused,
39593 .unused,38838 .unused,
...@@ -39596,14 +38841,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -39596,14 +38841,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
39596 .unused,38841 .unused,
39597 .unused,38842 .unused,
39598 .unused,38843 .unused,
39599 .unused,
39600 },38844 },
39601 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },38845 .dst_temps = .{ .mem, .unused },
39602 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },38846 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
39603 .each = .{ .once = &.{38847 .each = .{ .once = &.{
39604 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },38848 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
39605 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },38849 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
39606 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },38850 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
38851 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
39607 } },38852 } },
39608 }, .{38853 }, .{
39609 .required_cc_abi = .sysv64,38854 .required_cc_abi = .sysv64,
...@@ -39715,79 +38960,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -39715,79 +38960,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
39715 } },38960 } },
39716 }, .{38961 }, .{
39717 .required_cc_abi = .win64,38962 .required_cc_abi = .win64,
39718 .required_features = .{ .avx, null, null, null },
39719 .src_constraints = .{
39720 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
39721 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
39722 .any,
39723 },
39724 .patterns = &.{
39725 .{ .src = .{ .to_mem, .to_mem, .none } },
39726 },
39727 .call_frame = .{ .alignment = .@"16" },
39728 .extra_temps = .{
39729 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
39730 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39731 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
39732 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
39733 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39734 .unused,
39735 .unused,
39736 .unused,
39737 .unused,
39738 .unused,
39739 .unused,
39740 },
39741 .dst_temps = .{ .mem, .unused },
39742 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
39743 .each = .{ .once = &.{
39744 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
39745 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
39746 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
39747 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
39748 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
39749 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
39750 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
39751 } },
39752 }, .{
39753 .required_cc_abi = .win64,
39754 .required_features = .{ .sse2, null, null, null },
39755 .src_constraints = .{
39756 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
39757 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
39758 .any,
39759 },
39760 .patterns = &.{
39761 .{ .src = .{ .to_mem, .to_mem, .none } },
39762 },
39763 .call_frame = .{ .alignment = .@"16" },
39764 .extra_temps = .{
39765 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
39766 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39767 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
39768 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
39769 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39770 .unused,
39771 .unused,
39772 .unused,
39773 .unused,
39774 .unused,
39775 .unused,
39776 },
39777 .dst_temps = .{ .mem, .unused },
39778 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
39779 .each = .{ .once = &.{
39780 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
39781 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
39782 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
39783 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
39784 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
39785 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
39786 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
39787 } },
39788 }, .{
39789 .required_cc_abi = .win64,
39790 .required_features = .{ .sse, null, null, null },
39791 .src_constraints = .{38963 .src_constraints = .{
39792 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },38964 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
39793 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },38965 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -39801,8 +38973,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -39801,8 +38973,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
39801 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },38973 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
39802 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },38974 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39803 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },38975 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
38976 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
39804 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },38977 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
39805 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
39806 .unused,38978 .unused,
39807 .unused,38979 .unused,
39808 .unused,38980 .unused,
...@@ -39814,10 +38986,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -39814,10 +38986,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
39814 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },38986 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
39815 .each = .{ .once = &.{38987 .each = .{ .once = &.{
39816 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },38988 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
39817 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },38989 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
39818 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },38990 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
39819 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },38991 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
39820 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },38992 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
39821 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },38993 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
39822 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },38994 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
39823 } },38995 } },
...@@ -40229,8 +39401,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40229,8 +39401,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40229 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39401 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40230 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39402 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40231 .each = .{ .once = &.{39403 .each = .{ .once = &.{
40232 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39404 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40233 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39405 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40234 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39406 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40235 .{ ._, .v_q, .mov, .dst0q0, .tmp1x, ._, ._ },39407 .{ ._, .v_q, .mov, .dst0q0, .tmp1x, ._, ._ },
40236 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },39408 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },
...@@ -40271,8 +39443,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40271,8 +39443,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40271 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39443 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40272 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39444 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40273 .each = .{ .once = &.{39445 .each = .{ .once = &.{
40274 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39446 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40275 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39447 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40276 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39448 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40277 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },39449 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },
40278 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },39450 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },
...@@ -40313,8 +39485,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40313,8 +39485,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40313 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39485 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40314 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39486 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40315 .each = .{ .once = &.{39487 .each = .{ .once = &.{
40316 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39488 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40317 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39489 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40318 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39490 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40319 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },39491 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },
40320 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },39492 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },
...@@ -40356,8 +39528,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40356,8 +39528,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40356 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39528 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40357 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39529 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40358 .each = .{ .once = &.{39530 .each = .{ .once = &.{
40359 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39531 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40360 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39532 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40361 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39533 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40362 .{ ._, ._ps, .mova, .mem(.tmp2x), .tmp1x, ._, ._ },39534 .{ ._, ._ps, .mova, .mem(.tmp2x), .tmp1x, ._, ._ },
40363 .{ ._, ._, .mov, .tmp3q, .memd(.src1q, 8), ._, ._ },39535 .{ ._, ._, .mov, .tmp3q, .memd(.src1q, 8), ._, ._ },
...@@ -40399,8 +39571,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40399,8 +39571,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40399 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39571 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40400 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39572 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40401 .each = .{ .once = &.{39573 .each = .{ .once = &.{
40402 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39574 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40403 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39575 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40404 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39576 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40405 .{ ._, .v_q, .mov, .dst0q0, .tmp1x, ._, ._ },39577 .{ ._, .v_q, .mov, .dst0q0, .tmp1x, ._, ._ },
40406 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },39578 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },
...@@ -40439,8 +39611,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40439,8 +39611,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40439 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39611 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40440 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39612 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40441 .each = .{ .once = &.{39613 .each = .{ .once = &.{
40442 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39614 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40443 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39615 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40444 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39616 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40445 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },39617 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },
40446 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },39618 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },
...@@ -40479,8 +39651,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40479,8 +39651,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40479 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39651 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40480 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39652 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40481 .each = .{ .once = &.{39653 .each = .{ .once = &.{
40482 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39654 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40483 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39655 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40484 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39656 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40485 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },39657 .{ ._, ._q, .mov, .dst0q0, .tmp1x, ._, ._ },
40486 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },39658 .{ ._, ._, .mov, .tmp2q, .memd(.src1q, 8), ._, ._ },
...@@ -40520,8 +39692,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -40520,8 +39692,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
40520 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },39692 .dst_temps = .{ .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
40521 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },39693 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
40522 .each = .{ .once = &.{39694 .each = .{ .once = &.{
40523 .{ ._, ._, .lea, .dst0q0, .mem(.src0), ._, ._ },39695 .{ ._, ._, .lea, .dst0p0, .mem(.src0), ._, ._ },
40524 .{ ._, ._, .lea, .dst0q1, .mem(.src1), ._, ._ },39696 .{ ._, ._, .lea, .dst0p1, .mem(.src1), ._, ._ },
40525 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },39697 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
40526 .{ ._, ._ps, .mova, .mem(.tmp2x), .tmp1x, ._, ._ },39698 .{ ._, ._ps, .mova, .mem(.tmp2x), .tmp1x, ._, ._ },
40527 .{ ._, ._, .mov, .tmp3q, .memd(.src1q, 8), ._, ._ },39699 .{ ._, ._, .mov, .tmp3q, .memd(.src1q, 8), ._, ._ },
...@@ -42969,52 +42141,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -42969,52 +42141,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
42969 } },42141 } },
42970 }, .{42142 }, .{
42971 .required_cc_abi = .win64,42143 .required_cc_abi = .win64,
42972 .required_features = .{ .@"64bit", .avx, null, null },42144 .required_features = .{ .@"64bit", null, null, null },
42973 .src_constraints = .{
42974 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
42975 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
42976 .any,
42977 },
42978 .patterns = &.{
42979 .{ .src = .{ .to_mem, .to_mem, .none } },
42980 },
42981 .call_frame = .{ .alignment = .@"16" },
42982 .extra_temps = .{
42983 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
42984 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
42985 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
42986 .{ .type = .f128, .kind = .mem },
42987 .{ .type = .f128, .kind = .{ .reg = .xmm1 } },
42988 .{ .type = .u64, .kind = .{ .reg = .rax } },
42989 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
42990 .unused,
42991 .unused,
42992 .unused,
42993 .unused,
42994 },
42995 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
42996 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
42997 .each = .{ .once = &.{
42998 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
42999 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
43000 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
43001 .{ ._, ._, .mov, .tmp0q, .ua(.src0, .add_smin), ._, ._ },
43002 .{ ._, .vp_q, .extr, .tmp1q, .dst0x, .ui(1), ._ },
43003 .{ ._, ._, .mov, .tmp5q, .tmp0q, ._, ._ },
43004 .{ ._, ._, .@"and", .tmp5q, .memd(.src1q, 8), ._, ._ },
43005 .{ ._, ._, .xor, .tmp5q, .tmp1q, ._, ._ },
43006 .{ ._, .v_q, .mov, .tmp1q, .dst0x, ._, ._ },
43007 .{ ._, ._, .cmp, .tmp1q, .si(1), ._, ._ },
43008 .{ ._, ._, .sbb, .tmp5q, .tmp0q, ._, ._ },
43009 .{ ._, ._nae, .j, .@"0f", ._, ._, ._ },
43010 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
43011 .{ ._, .v_dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
43012 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
43013 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
43014 } },
43015 }, .{
43016 .required_cc_abi = .win64,
43017 .required_features = .{ .@"64bit", .sse4_1, null, null },
43018 .src_constraints = .{42145 .src_constraints = .{
43019 .{ .scalar_float = .{ .of = .xword, .is = .xword } },42146 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
43020 .{ .scalar_float = .{ .of = .xword, .is = .xword } },42147 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -43027,125 +42154,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -43027,125 +42154,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
43027 .extra_temps = .{42154 .extra_temps = .{
43028 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },42155 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
43029 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },42156 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
42157 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
43030 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },42158 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
43031 .{ .type = .f128, .kind = .mem },
43032 .{ .type = .f128, .kind = .{ .reg = .xmm1 } },
43033 .{ .type = .u64, .kind = .{ .reg = .rax } },42159 .{ .type = .u64, .kind = .{ .reg = .rax } },
43034 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
43035 .unused,
43036 .unused,
43037 .unused,
43038 .unused,
43039 },
43040 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
43041 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
43042 .each = .{ .once = &.{
43043 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
43044 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
43045 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
43046 .{ ._, ._, .mov, .tmp0q, .ua(.src0, .add_smin), ._, ._ },
43047 .{ ._, .p_q, .extr, .tmp1q, .dst0x, .ui(1), ._ },
43048 .{ ._, ._, .mov, .tmp5q, .tmp0q, ._, ._ },
43049 .{ ._, ._, .@"and", .tmp5q, .memd(.src1q, 8), ._, ._ },
43050 .{ ._, ._, .xor, .tmp5q, .tmp1q, ._, ._ },
43051 .{ ._, ._q, .mov, .tmp1q, .dst0x, ._, ._ },
43052 .{ ._, ._, .cmp, .tmp1q, .si(1), ._, ._ },
43053 .{ ._, ._, .sbb, .tmp5q, .tmp0q, ._, ._ },
43054 .{ ._, ._nae, .j, .@"0f", ._, ._, ._ },
43055 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
43056 .{ ._, ._dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },
43057 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
43058 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
43059 } },
43060 }, .{
43061 .required_cc_abi = .win64,
43062 .required_features = .{ .@"64bit", .sse2, null, null },
43063 .src_constraints = .{
43064 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
43065 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
43066 .any,
43067 },
43068 .patterns = &.{
43069 .{ .src = .{ .to_mem, .to_mem, .none } },
43070 },
43071 .call_frame = .{ .alignment = .@"16" },
43072 .extra_temps = .{
43073 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
43074 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
43075 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
43076 .{ .type = .f128, .kind = .mem },42160 .{ .type = .f128, .kind = .mem },
43077 .{ .type = .f128, .kind = .{ .reg = .xmm1 } },
43078 .{ .type = .u64, .kind = .{ .reg = .rax } },
43079 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },42161 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
43080 .unused,42162 .unused,
43081 .unused,42163 .unused,
43082 .unused,42164 .unused,
43083 .unused,42165 .unused,
43084 },42166 },
43085 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },42167 .dst_temps = .{ .mem, .unused },
43086 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },42168 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
43087 .each = .{ .once = &.{42169 .each = .{ .once = &.{
43088 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },42170 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
43089 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },42171 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
43090 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },42172 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
43091 .{ ._, .p_d, .shuf, .tmp4x, .dst0x, .ui(0b11_10_11_10), ._ },42173 .{ ._, ._, .call, .tmp3p, ._, ._, ._ },
43092 .{ ._, ._, .mov, .tmp0q, .ua(.src0, .add_smin), ._, ._ },42174 .{ ._, ._, .mov, .tmp0q, .ua(.src0, .add_smin), ._, ._ },
43093 .{ ._, ._q, .mov, .tmp1q, .tmp4x, ._, ._ },42175 .{ ._, ._, .mov, .tmp1q, .tmp0q, ._, ._ },
43094 .{ ._, ._, .mov, .tmp5q, .tmp0q, ._, ._ },42176 .{ ._, ._, .@"and", .tmp1q, .memd(.src1q, 8), ._, ._ },
43095 .{ ._, ._, .@"and", .tmp5q, .memd(.src1q, 8), ._, ._ },42177 .{ ._, ._, .mov, .tmp2q, .memd(.dst0q, 8), ._, ._ },
43096 .{ ._, ._, .xor, .tmp5q, .tmp1q, ._, ._ },42178 .{ ._, ._, .xor, .tmp1q, .tmp2q, ._, ._ },
43097 .{ ._, ._q, .mov, .tmp1q, .dst0x, ._, ._ },42179 .{ ._, ._, .mov, .tmp4q, .mem(.dst0q), ._, ._ },
43098 .{ ._, ._, .cmp, .tmp1q, .si(1), ._, ._ },42180 .{ ._, ._, .cmp, .tmp4q, .si(1), ._, ._ },
43099 .{ ._, ._, .sbb, .tmp5q, .tmp0q, ._, ._ },42181 .{ ._, ._, .sbb, .tmp1q, .tmp0q, ._, ._ },
43100 .{ ._, ._nae, .j, .@"0f", ._, ._, ._ },42182 .{ ._, ._nae, .j, .@"0f", ._, ._, ._ },
43101 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },42183 .{ ._, ._, .mov, .mem(.tmp5q), .tmp4q, ._, ._ },
43102 .{ ._, ._dqa, .mov, .lea(.tmp0x), .dst0x, ._, ._ },42184 .{ ._, ._, .mov, .memd(.tmp5q, 8), .tmp2q, ._, ._ },
43103 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },42185 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
42186 .{ ._, ._, .lea, .tmp1p, .mem(.tmp5), ._, ._ },
43104 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },42187 .{ ._, ._, .call, .tmp6d, ._, ._, ._ },
43105 } },42188 } },
43106 }, .{
43107 .required_cc_abi = .win64,
43108 .required_features = .{ .@"64bit", .sse, null, null },
43109 .src_constraints = .{
43110 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
43111 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
43112 .any,
43113 },
43114 .patterns = &.{
43115 .{ .src = .{ .to_mem, .to_mem, .none } },
43116 },
43117 .call_frame = .{ .alignment = .@"16" },
43118 .extra_temps = .{
43119 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
43120 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
43121 .{ .type = .usize, .kind = .{ .extern_func = "fmodf128" } },
43122 .{ .type = .f128, .kind = .mem },
43123 .{ .type = .usize, .kind = .{ .reg = .rax } },
43124 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
43125 .unused,
43126 .unused,
43127 .unused,
43128 .unused,
43129 .unused,
43130 },
43131 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
43132 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
43133 .each = .{ .once = &.{
43134 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
43135 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
43136 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
43137 .{ ._, ._, .lea, .tmp0p, .mem(.tmp3), ._, ._ },
43138 .{ ._, ._, .mov, .tmp1q, .ua(.src0, .add_smin), ._, ._ },
43139 .{ ._, ._ps, .mova, .lea(.tmp0x), .dst0x, ._, ._ },
43140 .{ ._, ._, .mov, .tmp4q, .tmp1q, ._, ._ },
43141 .{ ._, ._, .@"and", .tmp4q, .memd(.src1q, 8), ._, ._ },
43142 .{ ._, ._, .xor, .tmp4q, .lead(.tmp0q, 8), ._, ._ },
43143 .{ ._, ._, .cmp, .lea(.tmp0q), .si(1), ._, ._ },
43144 .{ ._, ._, .sbb, .tmp4q, .tmp1q, ._, ._ },
43145 .{ ._, ._nae, .j, .@"0f", ._, ._, ._ },
43146 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
43147 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
43148 } },
43149 }, .{42189 }, .{
43150 .required_cc_abi = .sysv64,42190 .required_cc_abi = .sysv64,
43151 .required_features = .{ .@"64bit", .avx, null, null },42191 .required_features = .{ .@"64bit", .avx, null, null },
...@@ -47640,7 +46680,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47640,7 +46680,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47640 } },46680 } },
47641 }, .{46681 }, .{
47642 .required_cc_abi = .win64,46682 .required_cc_abi = .win64,
47643 .required_features = .{ .sse, null, null, null },
47644 .src_constraints = .{46683 .src_constraints = .{
47645 .{ .scalar_float = .{ .of = .xword, .is = .xword } },46684 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
47646 .{ .scalar_float = .{ .of = .xword, .is = .xword } },46685 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -47653,39 +46692,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47653,39 +46692,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47653 .extra_temps = .{46692 .extra_temps = .{
47654 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },46693 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47655 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },46694 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
47656 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },46695 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
47657 .unused,
47658 .unused,
47659 .unused,
47660 .unused,
47661 .unused,
47662 .unused,
47663 .unused,
47664 .unused,
47665 },
47666 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
47667 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47668 .each = .{ .once = &.{
47669 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },
47670 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },
47671 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
47672 } },
47673 }, .{
47674 .required_cc_abi = .sysv64,
47675 .required_features = .{ .avx, null, null, null },
47676 .src_constraints = .{
47677 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47678 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47679 .any,
47680 },
47681 .patterns = &.{
47682 .{ .src = .{ .to_mem, .to_mem, .none } },
47683 },
47684 .call_frame = .{ .alignment = .@"16" },
47685 .extra_temps = .{
47686 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
47687 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47688 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
47689 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },46696 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
47690 .unused,46697 .unused,
47691 .unused,46698 .unused,
...@@ -47698,17 +46705,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47698,17 +46705,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47698 .dst_temps = .{ .mem, .unused },46705 .dst_temps = .{ .mem, .unused },
47699 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },46706 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47700 .each = .{ .once = &.{46707 .each = .{ .once = &.{
47701 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },46708 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
47702 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },46709 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
47703 .{ ._, .v_dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },46710 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
47704 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },46711 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
47705 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
47706 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
47707 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
47708 } },46712 } },
47709 }, .{46713 }, .{
47710 .required_cc_abi = .sysv64,46714 .required_cc_abi = .sysv64,
47711 .required_features = .{ .sse2, null, null, null },46715 .required_features = .{ .avx, null, null, null },
47712 .src_constraints = .{46716 .src_constraints = .{
47713 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46717 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47714 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46718 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -47735,16 +46739,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47735,16 +46739,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47735 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },46739 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47736 .each = .{ .once = &.{46740 .each = .{ .once = &.{
47737 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },46741 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
47738 .{ .@"0:", ._dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },46742 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
47739 .{ ._, ._dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },46743 .{ ._, .v_dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
47740 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },46744 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
47741 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },46745 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
47742 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },46746 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
47743 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },46747 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
47744 } },46748 } },
47745 }, .{46749 }, .{
47746 .required_cc_abi = .sysv64,46750 .required_cc_abi = .sysv64,
47747 .required_features = .{ .sse, null, null, null },46751 .required_features = .{ .sse2, null, null, null },
47748 .src_constraints = .{46752 .src_constraints = .{
47749 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46753 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47750 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46754 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -47771,16 +46775,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47771,16 +46775,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47771 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },46775 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47772 .each = .{ .once = &.{46776 .each = .{ .once = &.{
47773 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },46777 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
47774 .{ .@"0:", ._ps, .mova, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },46778 .{ .@"0:", ._dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
47775 .{ ._, ._ps, .mova, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },46779 .{ ._, ._dqa, .mov, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
47776 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },46780 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
47777 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },46781 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
47778 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },46782 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
47779 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },46783 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
47780 } },46784 } },
47781 }, .{46785 }, .{
47782 .required_cc_abi = .win64,46786 .required_cc_abi = .sysv64,
47783 .required_features = .{ .avx, null, null, null },46787 .required_features = .{ .sse, null, null, null },
47784 .src_constraints = .{46788 .src_constraints = .{
47785 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46789 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47786 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46790 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -47792,67 +46796,30 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47792,67 +46796,30 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47792 .call_frame = .{ .alignment = .@"16" },46796 .call_frame = .{ .alignment = .@"16" },
47793 .extra_temps = .{46797 .extra_temps = .{
47794 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },46798 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
47795 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },46799 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47796 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },46800 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
47797 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },46801 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
47798 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47799 .unused,46802 .unused,
47800 .unused,46803 .unused,
47801 .unused,46804 .unused,
47802 .unused,46805 .unused,
47803 .unused,46806 .unused,
47804 .unused,46807 .unused,
47805 },
47806 .dst_temps = .{ .mem, .unused },
47807 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47808 .each = .{ .once = &.{
47809 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
47810 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
47811 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
47812 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
47813 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
47814 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
47815 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
47816 } },
47817 }, .{
47818 .required_cc_abi = .win64,
47819 .required_features = .{ .sse2, null, null, null },
47820 .src_constraints = .{
47821 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47822 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47823 .any,
47824 },
47825 .patterns = &.{
47826 .{ .src = .{ .to_mem, .to_mem, .none } },
47827 },
47828 .call_frame = .{ .alignment = .@"16" },
47829 .extra_temps = .{
47830 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
47831 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47832 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
47833 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
47834 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47835 .unused,
47836 .unused,
47837 .unused,
47838 .unused,
47839 .unused,
47840 .unused,46808 .unused,
47841 },46809 },
47842 .dst_temps = .{ .mem, .unused },46810 .dst_temps = .{ .mem, .unused },
47843 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },46811 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47844 .each = .{ .once = &.{46812 .each = .{ .once = &.{
47845 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },46813 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
47846 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },46814 .{ .@"0:", ._ps, .mova, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
47847 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },46815 .{ ._, ._ps, .mova, .tmp2x, .memi(.src1x, .tmp0), ._, ._ },
47848 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },46816 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
47849 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },46817 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp1x, ._, ._ },
47850 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },46818 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
47851 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },46819 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
47852 } },46820 } },
47853 }, .{46821 }, .{
47854 .required_cc_abi = .win64,46822 .required_cc_abi = .win64,
47855 .required_features = .{ .sse, null, null, null },
47856 .src_constraints = .{46823 .src_constraints = .{
47857 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46824 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
47858 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },46825 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -47866,8 +46833,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47866,8 +46833,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47866 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },46833 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
47867 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },46834 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47868 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },46835 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
46836 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
47869 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },46837 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
47870 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
47871 .unused,46838 .unused,
47872 .unused,46839 .unused,
47873 .unused,46840 .unused,
...@@ -47879,10 +46846,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -47879,10 +46846,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
47879 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },46846 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
47880 .each = .{ .once = &.{46847 .each = .{ .once = &.{
47881 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },46848 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
47882 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },46849 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
47883 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },46850 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
47884 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },46851 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
47885 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },46852 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
47886 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },46853 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
47887 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },46854 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
47888 } },46855 } },
...@@ -51943,7 +50910,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -51943,7 +50910,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
51943 } },50910 } },
51944 }, .{50911 }, .{
51945 .required_cc_abi = .win64,50912 .required_cc_abi = .win64,
51946 .required_features = .{ .sse, null, null, null },
51947 .src_constraints = .{50913 .src_constraints = .{
51948 .{ .scalar_float = .{ .of = .xword, .is = .xword } },50914 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
51949 .{ .scalar_float = .{ .of = .xword, .is = .xword } },50915 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -51956,6 +50922,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -51956,6 +50922,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
51956 .extra_temps = .{50922 .extra_temps = .{
51957 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },50923 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
51958 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },50924 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
50925 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
51959 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },50926 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
51960 .unused,50927 .unused,
51961 .unused,50928 .unused,
...@@ -51964,14 +50931,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -51964,14 +50931,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
51964 .unused,50931 .unused,
51965 .unused,50932 .unused,
51966 .unused,50933 .unused,
51967 .unused,
51968 },50934 },
51969 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },50935 .dst_temps = .{ .mem, .unused },
51970 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },50936 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
51971 .each = .{ .once = &.{50937 .each = .{ .once = &.{
51972 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },50938 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
51973 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },50939 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
51974 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },50940 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
50941 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
51975 } },50942 } },
51976 }, .{50943 }, .{
51977 .required_cc_abi = .sysv64,50944 .required_cc_abi = .sysv64,
...@@ -52083,79 +51050,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -52083,79 +51050,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
52083 } },51050 } },
52084 }, .{51051 }, .{
52085 .required_cc_abi = .win64,51052 .required_cc_abi = .win64,
52086 .required_features = .{ .avx, null, null, null },
52087 .src_constraints = .{
52088 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
52089 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
52090 .any,
52091 },
52092 .patterns = &.{
52093 .{ .src = .{ .to_mem, .to_mem, .none } },
52094 },
52095 .call_frame = .{ .alignment = .@"16" },
52096 .extra_temps = .{
52097 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
52098 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
52099 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
52100 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
52101 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
52102 .unused,
52103 .unused,
52104 .unused,
52105 .unused,
52106 .unused,
52107 .unused,
52108 },
52109 .dst_temps = .{ .mem, .unused },
52110 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
52111 .each = .{ .once = &.{
52112 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
52113 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
52114 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
52115 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
52116 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
52117 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
52118 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
52119 } },
52120 }, .{
52121 .required_cc_abi = .win64,
52122 .required_features = .{ .sse2, null, null, null },
52123 .src_constraints = .{
52124 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
52125 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
52126 .any,
52127 },
52128 .patterns = &.{
52129 .{ .src = .{ .to_mem, .to_mem, .none } },
52130 },
52131 .call_frame = .{ .alignment = .@"16" },
52132 .extra_temps = .{
52133 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
52134 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
52135 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
52136 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
52137 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
52138 .unused,
52139 .unused,
52140 .unused,
52141 .unused,
52142 .unused,
52143 .unused,
52144 },
52145 .dst_temps = .{ .mem, .unused },
52146 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
52147 .each = .{ .once = &.{
52148 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
52149 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
52150 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
52151 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
52152 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },
52153 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
52154 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
52155 } },
52156 }, .{
52157 .required_cc_abi = .win64,
52158 .required_features = .{ .sse, null, null, null },
52159 .src_constraints = .{51053 .src_constraints = .{
52160 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },51054 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
52161 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },51055 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -52169,8 +51063,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -52169,8 +51063,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
52169 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },51063 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
52170 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },51064 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
52171 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },51065 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
51066 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
52172 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },51067 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
52173 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
52174 .unused,51068 .unused,
52175 .unused,51069 .unused,
52176 .unused,51070 .unused,
...@@ -52182,10 +51076,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -52182,10 +51076,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
52182 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },51076 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
52183 .each = .{ .once = &.{51077 .each = .{ .once = &.{
52184 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },51078 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
52185 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },51079 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
52186 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },51080 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
52187 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },51081 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
52188 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp4x, ._, ._ },51082 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
52189 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },51083 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
52190 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },51084 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
52191 } },51085 } },
...@@ -54509,10 +53403,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -54509,10 +53403,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
54509 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },53403 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
54510 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },53404 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
54511 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },53405 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
54512 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },53406 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
54513 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },53407 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
54514 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },53408 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
54515 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },53409 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
54516 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },53410 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
54517 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },53411 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
54518 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },53412 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -54620,10 +53514,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -54620,10 +53514,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
54620 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },53514 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
54621 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },53515 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
54622 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },53516 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
54623 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },53517 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
54624 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },53518 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
54625 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },53519 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
54626 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },53520 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
54627 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },53521 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
54628 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },53522 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
54629 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },53523 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -54731,10 +53625,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -54731,10 +53625,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
54731 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },53625 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
54732 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },53626 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
54733 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },53627 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
54734 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },53628 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
54735 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },53629 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
54736 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },53630 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
54737 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },53631 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
54738 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },53632 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
54739 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },53633 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
54740 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },53634 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -54842,10 +53736,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -54842,10 +53736,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
54842 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },53736 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
54843 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },53737 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
54844 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },53738 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
54845 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },53739 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
54846 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },53740 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
54847 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },53741 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
54848 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },53742 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
54849 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },53743 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
54850 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },53744 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
54851 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },53745 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -54951,10 +53845,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -54951,10 +53845,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
54951 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },53845 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
54952 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },53846 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
54953 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },53847 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
54954 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },53848 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
54955 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },53849 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
54956 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },53850 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
54957 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },53851 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
54958 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },53852 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
54959 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },53853 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
54960 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },53854 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55066,10 +53960,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55066,10 +53960,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55066 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },53960 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55067 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },53961 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55068 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },53962 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55069 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },53963 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55070 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },53964 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
55071 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },53965 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55072 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },53966 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
55073 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },53967 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55074 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },53968 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55075 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },53969 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55181,10 +54075,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55181,10 +54075,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55181 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54075 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55182 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54076 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55183 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54077 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55184 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54078 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55185 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54079 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55186 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },54080 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
55187 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },54081 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
55188 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54082 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55189 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54083 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55190 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54084 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55296,10 +54190,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55296,10 +54190,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55296 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54190 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55297 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54191 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55298 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54192 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55299 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54193 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55300 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54194 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55301 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },54195 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
55302 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },54196 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
55303 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54197 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55304 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54198 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55305 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54199 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55411,10 +54305,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55411,10 +54305,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55411 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54305 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55412 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54306 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55413 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54307 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55414 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54308 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55415 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },54309 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
55416 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54310 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55417 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },54311 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
55418 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54312 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55419 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54313 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55420 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54314 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55532,10 +54426,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55532,10 +54426,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55532 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54426 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55533 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54427 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55534 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54428 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55535 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54429 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55536 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },54430 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
55537 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54431 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55538 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },54432 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
55539 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54433 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55540 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54434 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55541 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54435 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55653,10 +54547,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55653,10 +54547,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55653 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54547 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55654 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54548 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55655 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54549 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55656 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54550 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55657 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54551 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55658 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },54552 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
55659 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },54553 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
55660 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54554 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55661 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54555 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55662 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54556 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55774,10 +54668,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55774,10 +54668,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55774 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54668 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55775 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54669 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55776 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54670 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55777 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54671 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55778 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54672 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55779 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },54673 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
55780 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },54674 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
55781 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54675 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55782 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54676 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55783 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54677 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -55897,10 +54791,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -55897,10 +54791,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
55897 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54791 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
55898 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54792 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
55899 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54793 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
55900 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54794 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
55901 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },54795 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
55902 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54796 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
55903 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },54797 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
55904 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54798 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
55905 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54799 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
55906 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54800 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -56015,10 +54909,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -56015,10 +54909,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
56015 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },54909 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
56016 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },54910 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
56017 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },54911 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
56018 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },54912 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
56019 .{ ._, ._, .lea, .tmp8q, .memad(.src1, .add_size, -8), ._, ._ },54913 .{ ._, ._, .lea, .tmp8p, .memad(.src1, .add_size, -8), ._, ._ },
56020 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },54914 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
56021 .{ ._, ._nz, .cmov, .tmp2q, .tmp8q, ._, ._ },54915 .{ ._, ._nz, .cmov, .tmp2p, .tmp8p, ._, ._ },
56022 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },54916 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
56023 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },54917 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
56024 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },54918 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -56133,10 +55027,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -56133,10 +55027,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
56133 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },55027 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
56134 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },55028 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
56135 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },55029 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
56136 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },55030 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
56137 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },55031 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
56138 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },55032 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
56139 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },55033 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
56140 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },55034 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
56141 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },55035 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
56142 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },55036 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -56251,10 +55145,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -56251,10 +55145,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
56251 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },55145 .{ ._, ._, .xor, .tmp7d, .tmp7d, ._, ._ },
56252 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },55146 .{ ._, ._, .cmp, .tmp1b, .tmp3b, ._, ._ },
56253 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },55147 .{ ._, ._e, .j, .@"1f", ._, ._, ._ },
56254 .{ ._, ._, .lea, .tmp2q, .memad(.src0, .add_size, -8), ._, ._ },55148 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_size, -8), ._, ._ },
56255 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },55149 .{ ._, ._, .@"test", .tmp1b, .tmp1b, ._, ._ },
56256 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },55150 .{ ._, ._z, .j, .@"0f", ._, ._, ._ },
56257 .{ ._, ._, .lea, .tmp2q, .memad(.src1, .add_size, -8), ._, ._ },55151 .{ ._, ._, .lea, .tmp2p, .memad(.src1, .add_size, -8), ._, ._ },
56258 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },55152 .{ .@"0:", ._, .mov, .tmp8d, .tmp7d, ._, ._ },
56259 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },55153 .{ ._, ._, .sbb, .tmp8q, .leasi(.tmp2q, .@"8", .tmp0), ._, ._ },
56260 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },55154 .{ ._, ._, .adc, .tmp6b, .tmp6b, ._, ._ },
...@@ -67560,7 +66454,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -67560,7 +66454,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
67560 .{ ._, ._, .sub, .dst0b, .sia(32, .src0, .sub_bit_size), ._, ._ },66454 .{ ._, ._, .sub, .dst0b, .sia(32, .src0, .sub_bit_size), ._, ._ },
67561 } },66455 } },
67562 }, .{66456 }, .{
67563 .required_features = .{ .false_deps_lzcnt_tzcnt, .lzcnt, null, null },66457 .required_features = .{ .false_deps_lzcnt, .lzcnt, null, null },
67564 .src_constraints = .{ .{ .exact_int = 16 }, .any, .any },66458 .src_constraints = .{ .{ .exact_int = 16 }, .any, .any },
67565 .patterns = &.{66459 .patterns = &.{
67566 .{ .src = .{ .to_mut_gpr, .none, .none } },66460 .{ .src = .{ .to_mut_gpr, .none, .none } },
...@@ -67596,7 +66490,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -67596,7 +66490,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
67596 .{ ._, ._, .sub, .dst0b, .sia(16, .src0, .sub_bit_size), ._, ._ },66490 .{ ._, ._, .sub, .dst0b, .sia(16, .src0, .sub_bit_size), ._, ._ },
67597 } },66491 } },
67598 }, .{66492 }, .{
67599 .required_features = .{ .false_deps_lzcnt_tzcnt, .lzcnt, null, null },66493 .required_features = .{ .false_deps_lzcnt, .lzcnt, null, null },
67600 .src_constraints = .{ .{ .unsigned_int = .word }, .any, .any },66494 .src_constraints = .{ .{ .unsigned_int = .word }, .any, .any },
67601 .patterns = &.{66495 .patterns = &.{
67602 .{ .src = .{ .to_mut_gpr, .none, .none } },66496 .{ .src = .{ .to_mut_gpr, .none, .none } },
...@@ -67621,7 +66515,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -67621,7 +66515,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
67621 .{ ._, ._, .sub, .dst0b, .sia(16, .src0, .sub_bit_size), ._, ._ },66515 .{ ._, ._, .sub, .dst0b, .sia(16, .src0, .sub_bit_size), ._, ._ },
67622 } },66516 } },
67623 }, .{66517 }, .{
67624 .required_features = .{ .false_deps_lzcnt_tzcnt, .lzcnt, null, null },66518 .required_features = .{ .false_deps_lzcnt, .lzcnt, null, null },
67625 .src_constraints = .{ .{ .exact_int = 32 }, .any, .any },66519 .src_constraints = .{ .{ .exact_int = 32 }, .any, .any },
67626 .patterns = &.{66520 .patterns = &.{
67627 .{ .src = .{ .to_mut_gpr, .none, .none } },66521 .{ .src = .{ .to_mut_gpr, .none, .none } },
...@@ -67657,7 +66551,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -67657,7 +66551,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
67657 .{ ._, ._, .sub, .dst0b, .sia(32, .src0, .sub_bit_size), ._, ._ },66551 .{ ._, ._, .sub, .dst0b, .sia(32, .src0, .sub_bit_size), ._, ._ },
67658 } },66552 } },
67659 }, .{66553 }, .{
67660 .required_features = .{ .false_deps_lzcnt_tzcnt, .lzcnt, null, null },66554 .required_features = .{ .false_deps_lzcnt, .lzcnt, null, null },
67661 .src_constraints = .{ .{ .unsigned_int = .dword }, .any, .any },66555 .src_constraints = .{ .{ .unsigned_int = .dword }, .any, .any },
67662 .patterns = &.{66556 .patterns = &.{
67663 .{ .src = .{ .to_mut_gpr, .none, .none } },66557 .{ .src = .{ .to_mut_gpr, .none, .none } },
...@@ -67682,7 +66576,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -67682,7 +66576,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
67682 .{ ._, ._, .sub, .dst0b, .sia(32, .src0, .sub_bit_size), ._, ._ },66576 .{ ._, ._, .sub, .dst0b, .sia(32, .src0, .sub_bit_size), ._, ._ },
67683 } },66577 } },
67684 }, .{66578 }, .{
67685 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },66579 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
67686 .src_constraints = .{ .{ .exact_int = 64 }, .any, .any },66580 .src_constraints = .{ .{ .exact_int = 64 }, .any, .any },
67687 .patterns = &.{66581 .patterns = &.{
67688 .{ .src = .{ .to_mut_gpr, .none, .none } },66582 .{ .src = .{ .to_mut_gpr, .none, .none } },
...@@ -67720,7 +66614,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -67720,7 +66614,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
67720 .{ ._, ._, .sub, .dst0b, .sia(64, .src0, .sub_bit_size), ._, ._ },66614 .{ ._, ._, .sub, .dst0b, .sia(64, .src0, .sub_bit_size), ._, ._ },
67721 } },66615 } },
67722 }, .{66616 }, .{
67723 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },66617 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
67724 .src_constraints = .{ .{ .unsigned_int = .qword }, .any, .any },66618 .src_constraints = .{ .{ .unsigned_int = .qword }, .any, .any },
67725 .patterns = &.{66619 .patterns = &.{
67726 .{ .src = .{ .to_mut_gpr, .none, .none } },66620 .{ .src = .{ .to_mut_gpr, .none, .none } },
...@@ -68577,7 +67471,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -68577,7 +67471,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
68577 .{ ._, ._, .sub, .dst0b, .tmp0b, ._, ._ },67471 .{ ._, ._, .sub, .dst0b, .tmp0b, ._, ._ },
68578 } },67472 } },
68579 }, .{67473 }, .{
68580 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },67474 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
68581 .src_constraints = .{ .{ .unsigned_or_exact_remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },67475 .src_constraints = .{ .{ .unsigned_or_exact_remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },
68582 .patterns = &.{67476 .patterns = &.{
68583 .{ .src = .{ .to_mem, .none, .none } },67477 .{ .src = .{ .to_mem, .none, .none } },
...@@ -68705,7 +67599,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -68705,7 +67599,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
68705 .{ ._, ._, .neg, .dst0d, ._, ._, ._ },67599 .{ ._, ._, .neg, .dst0d, ._, ._, ._ },
68706 } },67600 } },
68707 }, .{67601 }, .{
68708 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },67602 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
68709 .src_constraints = .{ .{ .unsigned_or_exact_remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },67603 .src_constraints = .{ .{ .unsigned_or_exact_remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },
68710 .patterns = &.{67604 .patterns = &.{
68711 .{ .src = .{ .to_mem, .none, .none } },67605 .{ .src = .{ .to_mem, .none, .none } },
...@@ -68833,7 +67727,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -68833,7 +67727,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
68833 .{ ._, ._, .neg, .dst0d, ._, ._, ._ },67727 .{ ._, ._, .neg, .dst0d, ._, ._, ._ },
68834 } },67728 } },
68835 }, .{67729 }, .{
68836 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },67730 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
68837 .src_constraints = .{ .{ .remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },67731 .src_constraints = .{ .{ .remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },
68838 .patterns = &.{67732 .patterns = &.{
68839 .{ .src = .{ .to_mem, .none, .none } },67733 .{ .src = .{ .to_mem, .none, .none } },
...@@ -68936,7 +67830,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -68936,7 +67830,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
68936 .{ ._, ._, .neg, .dst0d, ._, ._, ._ },67830 .{ ._, ._, .neg, .dst0d, ._, ._, ._ },
68937 } },67831 } },
68938 }, .{67832 }, .{
68939 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },67833 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
68940 .src_constraints = .{ .{ .remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },67834 .src_constraints = .{ .{ .remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },
68941 .patterns = &.{67835 .patterns = &.{
68942 .{ .src = .{ .to_mem, .none, .none } },67836 .{ .src = .{ .to_mem, .none, .none } },
...@@ -70092,7 +68986,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70092,7 +68986,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70092 .{ ._, ._nz, .j, .@"0b", ._, ._, ._ },68986 .{ ._, ._nz, .j, .@"0b", ._, ._, ._ },
70093 } },68987 } },
70094 }, .{68988 }, .{
70095 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },68989 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
70096 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },68990 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },
70097 .dst_constraints = .{ .{ .scalar_int_is = .byte }, .any },68991 .dst_constraints = .{ .{ .scalar_int_is = .byte }, .any },
70098 .patterns = &.{68992 .patterns = &.{
...@@ -70115,7 +69009,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70115,7 +69009,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70115 .clobbers = .{ .eflags = true },69009 .clobbers = .{ .eflags = true },
70116 .each = .{ .once = &.{69010 .each = .{ .once = &.{
70117 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69011 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70118 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69012 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70119 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },69013 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },
70120 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69014 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70121 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69015 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70129,7 +69023,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70129,7 +69023,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70129 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69023 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70130 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69024 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70131 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },69025 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },
70132 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69026 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70133 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69027 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70134 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69028 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70135 } },69029 } },
...@@ -70157,7 +69051,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70157,7 +69051,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70157 .clobbers = .{ .eflags = true },69051 .clobbers = .{ .eflags = true },
70158 .each = .{ .once = &.{69052 .each = .{ .once = &.{
70159 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69053 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70160 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69054 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70161 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },69055 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },
70162 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69056 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70163 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69057 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70170,7 +69064,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70170,7 +69064,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70170 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69064 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70171 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69065 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70172 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },69066 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },
70173 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69067 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70174 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69068 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70175 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69069 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70176 } },69070 } },
...@@ -70198,7 +69092,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70198,7 +69092,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70198 .clobbers = .{ .eflags = true },69092 .clobbers = .{ .eflags = true },
70199 .each = .{ .once = &.{69093 .each = .{ .once = &.{
70200 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69094 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70201 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69095 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70202 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },69096 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },
70203 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69097 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70204 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69098 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70211,12 +69105,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70211,12 +69105,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70211 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },69105 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },
70212 .{ ._, ._, .neg, .tmp3b, ._, ._, ._ },69106 .{ ._, ._, .neg, .tmp3b, ._, ._, ._ },
70213 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },69107 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },
70214 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69108 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70215 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69109 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70216 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69110 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70217 } },69111 } },
70218 }, .{69112 }, .{
70219 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },69113 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
70220 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },69114 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },
70221 .dst_constraints = .{ .{ .scalar_int_is = .byte }, .any },69115 .dst_constraints = .{ .{ .scalar_int_is = .byte }, .any },
70222 .patterns = &.{69116 .patterns = &.{
...@@ -70239,7 +69133,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70239,7 +69133,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70239 .clobbers = .{ .eflags = true },69133 .clobbers = .{ .eflags = true },
70240 .each = .{ .once = &.{69134 .each = .{ .once = &.{
70241 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69135 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70242 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69136 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70243 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },69137 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },
70244 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69138 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70245 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69139 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70253,7 +69147,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70253,7 +69147,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70253 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69147 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70254 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69148 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70255 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },69149 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },
70256 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69150 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70257 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69151 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70258 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69152 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70259 } },69153 } },
...@@ -70281,7 +69175,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70281,7 +69175,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70281 .clobbers = .{ .eflags = true },69175 .clobbers = .{ .eflags = true },
70282 .each = .{ .once = &.{69176 .each = .{ .once = &.{
70283 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69177 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70284 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69178 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70285 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },69179 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },
70286 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69180 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70287 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69181 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70294,7 +69188,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70294,7 +69188,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70294 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69188 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70295 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69189 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70296 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },69190 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },
70297 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69191 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70298 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69192 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70299 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69193 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70300 } },69194 } },
...@@ -70322,7 +69216,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70322,7 +69216,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70322 .clobbers = .{ .eflags = true },69216 .clobbers = .{ .eflags = true },
70323 .each = .{ .once = &.{69217 .each = .{ .once = &.{
70324 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69218 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70325 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69219 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70326 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },69220 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },
70327 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69221 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70328 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69222 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70335,12 +69229,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70335,12 +69229,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70335 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },69229 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },
70336 .{ ._, ._, .neg, .tmp3b, ._, ._, ._ },69230 .{ ._, ._, .neg, .tmp3b, ._, ._, ._ },
70337 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },69231 .{ ._, ._, .mov, .memia(.dst0b, .tmp0, .add_len), .tmp3b, ._, ._ },
70338 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69232 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70339 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69233 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70340 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69234 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70341 } },69235 } },
70342 }, .{69236 }, .{
70343 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },69237 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
70344 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },69238 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .qword } }, .any, .any },
70345 .dst_constraints = .{ .{ .scalar_int_is = .word }, .any },69239 .dst_constraints = .{ .{ .scalar_int_is = .word }, .any },
70346 .patterns = &.{69240 .patterns = &.{
...@@ -70363,7 +69257,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70363,7 +69257,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70363 .clobbers = .{ .eflags = true },69257 .clobbers = .{ .eflags = true },
70364 .each = .{ .once = &.{69258 .each = .{ .once = &.{
70365 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69259 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70366 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69260 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70367 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },69261 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },
70368 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69262 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70369 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69263 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70377,7 +69271,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70377,7 +69271,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70377 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69271 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70378 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69272 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70379 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },69273 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },
70380 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69274 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70381 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69275 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70382 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69276 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70383 } },69277 } },
...@@ -70405,7 +69299,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70405,7 +69299,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70405 .clobbers = .{ .eflags = true },69299 .clobbers = .{ .eflags = true },
70406 .each = .{ .once = &.{69300 .each = .{ .once = &.{
70407 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69301 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70408 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69302 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70409 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },69303 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },
70410 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69304 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70411 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69305 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70418,7 +69312,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70418,7 +69312,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70418 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69312 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70419 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69313 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70420 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },69314 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },
70421 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69315 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70422 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69316 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70423 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69317 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70424 } },69318 } },
...@@ -70446,7 +69340,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70446,7 +69340,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70446 .clobbers = .{ .eflags = true },69340 .clobbers = .{ .eflags = true },
70447 .each = .{ .once = &.{69341 .each = .{ .once = &.{
70448 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69342 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70449 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69343 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70450 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },69344 .{ .@"0:", ._, .mov, .tmp2d, .sia(-16, .none, .add_src0_elem_size), ._, ._ },
70451 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69345 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70452 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69346 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70459,12 +69353,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70459,12 +69353,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70459 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },69353 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },
70460 .{ ._, ._, .neg, .tmp3d, ._, ._, ._ },69354 .{ ._, ._, .neg, .tmp3d, ._, ._, ._ },
70461 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },69355 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },
70462 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69356 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70463 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69357 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70464 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69358 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70465 } },69359 } },
70466 }, .{69360 }, .{
70467 .required_features = .{ .@"64bit", .false_deps_lzcnt_tzcnt, .lzcnt, null },69361 .required_features = .{ .@"64bit", .false_deps_lzcnt, .lzcnt, null },
70468 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },69362 .src_constraints = .{ .{ .scalar_remainder_int = .{ .of = .xword, .is = .xword } }, .any, .any },
70469 .dst_constraints = .{ .{ .scalar_int_is = .word }, .any },69363 .dst_constraints = .{ .{ .scalar_int_is = .word }, .any },
70470 .patterns = &.{69364 .patterns = &.{
...@@ -70487,7 +69381,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70487,7 +69381,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70487 .clobbers = .{ .eflags = true },69381 .clobbers = .{ .eflags = true },
70488 .each = .{ .once = &.{69382 .each = .{ .once = &.{
70489 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69383 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70490 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69384 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70491 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },69385 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },
70492 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69386 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70493 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69387 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70501,7 +69395,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70501,7 +69395,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70501 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69395 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70502 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69396 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70503 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },69397 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },
70504 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69398 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70505 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69399 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70506 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69400 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70507 } },69401 } },
...@@ -70529,7 +69423,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70529,7 +69423,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70529 .clobbers = .{ .eflags = true },69423 .clobbers = .{ .eflags = true },
70530 .each = .{ .once = &.{69424 .each = .{ .once = &.{
70531 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69425 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70532 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69426 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70533 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },69427 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },
70534 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69428 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70535 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69429 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70542,7 +69436,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70542,7 +69436,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70542 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },69436 .{ .@"1:", ._, .neg, .tmp2d, ._, ._, ._ },
70543 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },69437 .{ ._, ._, .lea, .tmp3d, .leasiad(.tmp4, .@"8", .tmp2, .add_src0_bit_size, -64), ._, ._ },
70544 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },69438 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },
70545 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69439 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70546 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69440 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70547 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69441 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70548 } },69442 } },
...@@ -70570,7 +69464,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70570,7 +69464,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70570 .clobbers = .{ .eflags = true },69464 .clobbers = .{ .eflags = true },
70571 .each = .{ .once = &.{69465 .each = .{ .once = &.{
70572 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },69466 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_len), ._, ._ },
70573 .{ ._, ._, .lea, .tmp1q, .mem(.src0), ._, ._ },69467 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
70574 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },69468 .{ .@"0:", ._, .mov, .tmp2d, .sia(-8, .none, .add_src0_elem_size), ._, ._ },
70575 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },69469 .{ ._, ._, .mov, .tmp3q, .ua(.src0, .add_umax), ._, ._ },
70576 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },69470 .{ .@"1:", ._, .@"and", .tmp3q, .leai(.tmp1q, .tmp2), ._, ._ },
...@@ -70583,7 +69477,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70583,7 +69477,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70583 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },69477 .{ .@"1:", ._, .lea, .tmp3d, .leasiad(.tmp3, .@"8", .tmp2, .sub_src0_bit_size, 1), ._, ._ },
70584 .{ ._, ._, .neg, .tmp3d, ._, ._, ._ },69478 .{ ._, ._, .neg, .tmp3d, ._, ._, ._ },
70585 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },69479 .{ ._, ._, .mov, .memsia(.dst0w, .@"2", .tmp0, .add_2_len), .tmp3w, ._, ._ },
70586 .{ ._, ._, .lea, .tmp1q, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },69480 .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_src0_elem_size), ._, ._ },
70587 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },69481 .{ ._, ._, .add, .tmp0p, .si(1), ._, ._ },
70588 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },69482 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
70589 } },69483 } },
...@@ -70649,7 +69543,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70649,7 +69543,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70649 .{ ._, ._, .tzcnt, .dst0w, .src0w, ._, ._ },69543 .{ ._, ._, .tzcnt, .dst0w, .src0w, ._, ._ },
70650 } },69544 } },
70651 }, .{69545 }, .{
70652 .required_features = .{ .bmi, .false_deps_lzcnt_tzcnt, null, null },69546 .required_features = .{ .bmi, .false_deps_tzcnt, null, null },
70653 .src_constraints = .{ .{ .exact_int = 32 }, .any, .any },69547 .src_constraints = .{ .{ .exact_int = 32 }, .any, .any },
70654 .patterns = &.{69548 .patterns = &.{
70655 .{ .src = .{ .mem, .none, .none } },69549 .{ .src = .{ .mem, .none, .none } },
...@@ -70686,7 +69580,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70686,7 +69580,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70686 .{ ._, ._, .tzcnt, .dst0d, .src0d, ._, ._ },69580 .{ ._, ._, .tzcnt, .dst0d, .src0d, ._, ._ },
70687 } },69581 } },
70688 }, .{69582 }, .{
70689 .required_features = .{ .@"64bit", .bmi, .false_deps_lzcnt_tzcnt, null },69583 .required_features = .{ .@"64bit", .bmi, .false_deps_tzcnt, null },
70690 .src_constraints = .{ .{ .exact_int = 64 }, .any, .any },69584 .src_constraints = .{ .{ .exact_int = 64 }, .any, .any },
70691 .patterns = &.{69585 .patterns = &.{
70692 .{ .src = .{ .mem, .none, .none } },69586 .{ .src = .{ .mem, .none, .none } },
...@@ -70863,7 +69757,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -70863,7 +69757,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
70863 .{ ._, ._f, .bs, .dst0q, .src0q, ._, ._ },69757 .{ ._, ._f, .bs, .dst0q, .src0q, ._, ._ },
70864 } },69758 } },
70865 }, .{69759 }, .{
70866 .required_features = .{ .@"64bit", .bmi, .false_deps_lzcnt_tzcnt, null },69760 .required_features = .{ .@"64bit", .bmi, .false_deps_tzcnt, null },
70867 .src_constraints = .{ .{ .remainder_int = .{ .of = .qword, .is = .qword } }, .any, .any },69761 .src_constraints = .{ .{ .remainder_int = .{ .of = .qword, .is = .qword } }, .any, .any },
70868 .patterns = &.{69762 .patterns = &.{
70869 .{ .src = .{ .to_mem, .none, .none } },69763 .{ .src = .{ .to_mem, .none, .none } },
...@@ -71479,13 +70373,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -71479,13 +70373,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
71479 .{ ._, ._, .mov, .tmp1q, .uia(0x33333333, .none, .repeat), ._, ._ },70373 .{ ._, ._, .mov, .tmp1q, .uia(0x33333333, .none, .repeat), ._, ._ },
71480 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },70374 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },
71481 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },70375 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },
71482 .{ ._, ._, .lea, .dst0q, .leai(.dst0, .tmp0), ._, ._ },70376 .{ ._, ._, .lea, .dst0p, .leai(.dst0, .tmp0), ._, ._ },
71483 .{ ._, ._, .mov, .tmp0q, .dst0q, ._, ._ },70377 .{ ._, ._, .mov, .tmp0q, .dst0q, ._, ._ },
71484 .{ ._, ._r, .sh, .dst0q, .ui(4), ._, ._ },70378 .{ ._, ._r, .sh, .dst0q, .ui(4), ._, ._ },
71485 .{ ._, ._, .mov, .tmp1q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },70379 .{ ._, ._, .mov, .tmp1q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },
71486 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },70380 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },
71487 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },70381 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },
71488 .{ ._, ._, .lea, .dst0q, .leai(.dst0, .tmp0), ._, ._ },70382 .{ ._, ._, .lea, .dst0p, .leai(.dst0, .tmp0), ._, ._ },
71489 .{ ._, ._, .mov, .tmp1q, .uia(0x01010101, .none, .repeat), ._, ._ },70383 .{ ._, ._, .mov, .tmp1q, .uia(0x01010101, .none, .repeat), ._, ._ },
71490 .{ ._, .i_, .mul, .dst0q, .tmp1q, ._, ._ },70384 .{ ._, .i_, .mul, .dst0q, .tmp1q, ._, ._ },
71491 .{ ._, ._r, .sh, .dst0q, .ui(64 - 8), ._, ._ },70385 .{ ._, ._r, .sh, .dst0q, .ui(64 - 8), ._, ._ },
...@@ -71523,13 +70417,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -71523,13 +70417,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
71523 .{ ._, ._, .mov, .tmp1q, .uia(0x33333333, .none, .repeat), ._, ._ },70417 .{ ._, ._, .mov, .tmp1q, .uia(0x33333333, .none, .repeat), ._, ._ },
71524 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },70418 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },
71525 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },70419 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },
71526 .{ ._, ._, .lea, .dst0q, .leai(.dst0, .tmp0), ._, ._ },70420 .{ ._, ._, .lea, .dst0p, .leai(.dst0, .tmp0), ._, ._ },
71527 .{ ._, ._, .mov, .tmp0q, .dst0q, ._, ._ },70421 .{ ._, ._, .mov, .tmp0q, .dst0q, ._, ._ },
71528 .{ ._, ._r, .sh, .dst0q, .ui(4), ._, ._ },70422 .{ ._, ._r, .sh, .dst0q, .ui(4), ._, ._ },
71529 .{ ._, ._, .mov, .tmp1q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },70423 .{ ._, ._, .mov, .tmp1q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },
71530 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },70424 .{ ._, ._, .@"and", .tmp0q, .tmp1q, ._, ._ },
71531 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },70425 .{ ._, ._, .@"and", .dst0q, .tmp1q, ._, ._ },
71532 .{ ._, ._, .lea, .dst0q, .leai(.dst0, .tmp0), ._, ._ },70426 .{ ._, ._, .lea, .dst0p, .leai(.dst0, .tmp0), ._, ._ },
71533 .{ ._, ._, .mov, .tmp1q, .uia(0x01010101, .none, .repeat), ._, ._ },70427 .{ ._, ._, .mov, .tmp1q, .uia(0x01010101, .none, .repeat), ._, ._ },
71534 .{ ._, .i_, .mul, .dst0q, .tmp1q, ._, ._ },70428 .{ ._, .i_, .mul, .dst0q, .tmp1q, ._, ._ },
71535 .{ ._, ._r, .sh, .dst0q, .ui(64 - 8), ._, ._ },70429 .{ ._, ._r, .sh, .dst0q, .ui(64 - 8), ._, ._ },
...@@ -71754,13 +70648,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -71754,13 +70648,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
71754 .{ ._, ._, .mov, .tmp3q, .uia(0x33333333, .none, .repeat), ._, ._ },70648 .{ ._, ._, .mov, .tmp3q, .uia(0x33333333, .none, .repeat), ._, ._ },
71755 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },70649 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },
71756 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },70650 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },
71757 .{ ._, ._, .lea, .tmp1q, .leai(.tmp1, .tmp2), ._, ._ },70651 .{ ._, ._, .lea, .tmp1p, .leai(.tmp1, .tmp2), ._, ._ },
71758 .{ ._, ._, .mov, .tmp2q, .tmp1q, ._, ._ },70652 .{ ._, ._, .mov, .tmp2q, .tmp1q, ._, ._ },
71759 .{ ._, ._r, .sh, .tmp1q, .ui(4), ._, ._ },70653 .{ ._, ._r, .sh, .tmp1q, .ui(4), ._, ._ },
71760 .{ ._, ._, .mov, .tmp3q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },70654 .{ ._, ._, .mov, .tmp3q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },
71761 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },70655 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },
71762 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },70656 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },
71763 .{ ._, ._, .lea, .tmp1q, .leai(.tmp1, .tmp2), ._, ._ },70657 .{ ._, ._, .lea, .tmp1p, .leai(.tmp1, .tmp2), ._, ._ },
71764 .{ ._, ._, .mov, .tmp3q, .uia(0x01010101, .none, .repeat), ._, ._ },70658 .{ ._, ._, .mov, .tmp3q, .uia(0x01010101, .none, .repeat), ._, ._ },
71765 .{ ._, .i_, .mul, .tmp1q, .tmp3q, ._, ._ },70659 .{ ._, .i_, .mul, .tmp1q, .tmp3q, ._, ._ },
71766 .{ ._, ._r, .sh, .tmp1q, .ui(64 - 8), ._, ._ },70660 .{ ._, ._r, .sh, .tmp1q, .ui(64 - 8), ._, ._ },
...@@ -71806,13 +70700,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -71806,13 +70700,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
71806 .{ ._, ._, .mov, .tmp3q, .uia(0x33333333, .none, .repeat), ._, ._ },70700 .{ ._, ._, .mov, .tmp3q, .uia(0x33333333, .none, .repeat), ._, ._ },
71807 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },70701 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },
71808 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },70702 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },
71809 .{ ._, ._, .lea, .tmp1q, .leai(.tmp1, .tmp2), ._, ._ },70703 .{ ._, ._, .lea, .tmp1p, .leai(.tmp1, .tmp2), ._, ._ },
71810 .{ ._, ._, .mov, .tmp2q, .tmp1q, ._, ._ },70704 .{ ._, ._, .mov, .tmp2q, .tmp1q, ._, ._ },
71811 .{ ._, ._r, .sh, .tmp1q, .ui(4), ._, ._ },70705 .{ ._, ._r, .sh, .tmp1q, .ui(4), ._, ._ },
71812 .{ ._, ._, .mov, .tmp3q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },70706 .{ ._, ._, .mov, .tmp3q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },
71813 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },70707 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },
71814 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },70708 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },
71815 .{ ._, ._, .lea, .tmp1q, .leai(.tmp1, .tmp2), ._, ._ },70709 .{ ._, ._, .lea, .tmp1p, .leai(.tmp1, .tmp2), ._, ._ },
71816 .{ ._, ._, .mov, .tmp3q, .uia(0x01010101, .none, .repeat), ._, ._ },70710 .{ ._, ._, .mov, .tmp3q, .uia(0x01010101, .none, .repeat), ._, ._ },
71817 .{ ._, .i_, .mul, .tmp1q, .tmp3q, ._, ._ },70711 .{ ._, .i_, .mul, .tmp1q, .tmp3q, ._, ._ },
71818 .{ ._, ._r, .sh, .tmp1q, .ui(64 - 8), ._, ._ },70712 .{ ._, ._r, .sh, .tmp1q, .ui(64 - 8), ._, ._ },
...@@ -71858,13 +70752,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -71858,13 +70752,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
71858 .{ ._, ._, .mov, .tmp3q, .uia(0x33333333, .none, .repeat), ._, ._ },70752 .{ ._, ._, .mov, .tmp3q, .uia(0x33333333, .none, .repeat), ._, ._ },
71859 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },70753 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },
71860 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },70754 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },
71861 .{ ._, ._, .lea, .tmp1q, .leai(.tmp1, .tmp2), ._, ._ },70755 .{ ._, ._, .lea, .tmp1p, .leai(.tmp1, .tmp2), ._, ._ },
71862 .{ ._, ._, .mov, .tmp2q, .tmp1q, ._, ._ },70756 .{ ._, ._, .mov, .tmp2q, .tmp1q, ._, ._ },
71863 .{ ._, ._r, .sh, .tmp1q, .ui(4), ._, ._ },70757 .{ ._, ._r, .sh, .tmp1q, .ui(4), ._, ._ },
71864 .{ ._, ._, .mov, .tmp3q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },70758 .{ ._, ._, .mov, .tmp3q, .uia(0x0f0f0f0f, .none, .repeat), ._, ._ },
71865 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },70759 .{ ._, ._, .@"and", .tmp2q, .tmp3q, ._, ._ },
71866 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },70760 .{ ._, ._, .@"and", .tmp1q, .tmp3q, ._, ._ },
71867 .{ ._, ._, .lea, .tmp1q, .leai(.tmp1, .tmp2), ._, ._ },70761 .{ ._, ._, .lea, .tmp1p, .leai(.tmp1, .tmp2), ._, ._ },
71868 .{ ._, ._, .mov, .tmp3q, .uia(0x01010101, .none, .repeat), ._, ._ },70762 .{ ._, ._, .mov, .tmp3q, .uia(0x01010101, .none, .repeat), ._, ._ },
71869 .{ ._, .i_, .mul, .tmp1q, .tmp3q, ._, ._ },70763 .{ ._, .i_, .mul, .tmp1q, .tmp3q, ._, ._ },
71870 .{ ._, ._r, .sh, .tmp1q, .ui(64 - 8), ._, ._ },70764 .{ ._, ._r, .sh, .tmp1q, .ui(64 - 8), ._, ._ },
...@@ -76474,7 +75368,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -76474,7 +75368,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
76474 } },75368 } },
76475 }, .{75369 }, .{
76476 .required_cc_abi = .win64,75370 .required_cc_abi = .win64,
76477 .required_features = .{ .sse, null, null, null },
76478 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },75371 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
76479 .patterns = &.{75372 .patterns = &.{
76480 .{ .src = .{ .to_mem, .none, .none } },75373 .{ .src = .{ .to_mem, .none, .none } },
...@@ -76482,6 +75375,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -76482,6 +75375,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
76482 .call_frame = .{ .alignment = .@"16" },75375 .call_frame = .{ .alignment = .@"16" },
76483 .extra_temps = .{75376 .extra_temps = .{
76484 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },75377 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
75378 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
76485 .{ .type = .usize, .kind = .{ .extern_func = "sqrtf128" } },75379 .{ .type = .usize, .kind = .{ .extern_func = "sqrtf128" } },
76486 .unused,75380 .unused,
76487 .unused,75381 .unused,
...@@ -76491,13 +75385,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -76491,13 +75385,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
76491 .unused,75385 .unused,
76492 .unused,75386 .unused,
76493 .unused,75387 .unused,
76494 .unused,
76495 },75388 },
76496 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },75389 .dst_temps = .{ .mem, .unused },
76497 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },75390 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
76498 .each = .{ .once = &.{75391 .each = .{ .once = &.{
76499 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },75392 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
76500 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },75393 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
75394 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
76501 } },75395 } },
76502 }, .{75396 }, .{
76503 .required_cc_abi = .sysv64,75397 .required_cc_abi = .sysv64,
...@@ -76594,69 +75488,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -76594,69 +75488,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
76594 } },75488 } },
76595 }, .{75489 }, .{
76596 .required_cc_abi = .win64,75490 .required_cc_abi = .win64,
76597 .required_features = .{ .avx, null, null, null },
76598 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
76599 .patterns = &.{
76600 .{ .src = .{ .to_mem, .none, .none } },
76601 },
76602 .call_frame = .{ .alignment = .@"16" },
76603 .extra_temps = .{
76604 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
76605 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76606 .{ .type = .usize, .kind = .{ .extern_func = "sqrtf128" } },
76607 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76608 .unused,
76609 .unused,
76610 .unused,
76611 .unused,
76612 .unused,
76613 .unused,
76614 .unused,
76615 },
76616 .dst_temps = .{ .mem, .unused },
76617 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
76618 .each = .{ .once = &.{
76619 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
76620 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
76621 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
76622 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
76623 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
76624 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
76625 } },
76626 }, .{
76627 .required_cc_abi = .win64,
76628 .required_features = .{ .sse2, null, null, null },
76629 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
76630 .patterns = &.{
76631 .{ .src = .{ .to_mem, .none, .none } },
76632 },
76633 .call_frame = .{ .alignment = .@"16" },
76634 .extra_temps = .{
76635 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
76636 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76637 .{ .type = .usize, .kind = .{ .extern_func = "sqrtf128" } },
76638 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76639 .unused,
76640 .unused,
76641 .unused,
76642 .unused,
76643 .unused,
76644 .unused,
76645 .unused,
76646 },
76647 .dst_temps = .{ .mem, .unused },
76648 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
76649 .each = .{ .once = &.{
76650 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
76651 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
76652 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
76653 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
76654 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
76655 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
76656 } },
76657 }, .{
76658 .required_cc_abi = .win64,
76659 .required_features = .{ .sse, null, null, null },
76660 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },75491 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
76661 .patterns = &.{75492 .patterns = &.{
76662 .{ .src = .{ .to_mem, .none, .none } },75493 .{ .src = .{ .to_mem, .none, .none } },
...@@ -76665,8 +75496,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -76665,8 +75496,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
76665 .extra_temps = .{75496 .extra_temps = .{
76666 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },75497 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
76667 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },75498 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
75499 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
76668 .{ .type = .usize, .kind = .{ .extern_func = "sqrtf128" } },75500 .{ .type = .usize, .kind = .{ .extern_func = "sqrtf128" } },
76669 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76670 .unused,75501 .unused,
76671 .unused,75502 .unused,
76672 .unused,75503 .unused,
...@@ -76679,9 +75510,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -76679,9 +75510,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
76679 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },75510 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
76680 .each = .{ .once = &.{75511 .each = .{ .once = &.{
76681 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },75512 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
76682 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },75513 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
76683 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },75514 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
76684 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },75515 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
76685 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },75516 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
76686 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },75517 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
76687 } },75518 } },
...@@ -77323,7 +76154,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -77323,7 +76154,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
77323 } },76154 } },
77324 }, .{76155 }, .{
77325 .required_cc_abi = .win64,76156 .required_cc_abi = .win64,
77326 .required_features = .{ .sse, null, null, null },
77327 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },76157 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
77328 .patterns = &.{76158 .patterns = &.{
77329 .{ .src = .{ .to_mem, .none, .none } },76159 .{ .src = .{ .to_mem, .none, .none } },
...@@ -77331,6 +76161,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -77331,6 +76161,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
77331 .call_frame = .{ .alignment = .@"16" },76161 .call_frame = .{ .alignment = .@"16" },
77332 .extra_temps = .{76162 .extra_temps = .{
77333 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },76163 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76164 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
77334 .{ .type = .usize, .kind = .{ .extern_func = @tagName(name) ++ "f128" } },76165 .{ .type = .usize, .kind = .{ .extern_func = @tagName(name) ++ "f128" } },
77335 .unused,76166 .unused,
77336 .unused,76167 .unused,
...@@ -77340,13 +76171,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -77340,13 +76171,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
77340 .unused,76171 .unused,
77341 .unused,76172 .unused,
77342 .unused,76173 .unused,
77343 .unused,
77344 },76174 },
77345 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },76175 .dst_temps = .{ .mem, .unused },
77346 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },76176 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
77347 .each = .{ .once = &.{76177 .each = .{ .once = &.{
77348 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },76178 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
77349 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },76179 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
76180 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
77350 } },76181 } },
77351 }, .{76182 }, .{
77352 .required_cc_abi = .sysv64,76183 .required_cc_abi = .sysv64,
...@@ -77443,69 +76274,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -77443,69 +76274,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
77443 } },76274 } },
77444 }, .{76275 }, .{
77445 .required_cc_abi = .win64,76276 .required_cc_abi = .win64,
77446 .required_features = .{ .avx, null, null, null },
77447 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
77448 .patterns = &.{
77449 .{ .src = .{ .to_mem, .none, .none } },
77450 },
77451 .call_frame = .{ .alignment = .@"16" },
77452 .extra_temps = .{
77453 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
77454 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
77455 .{ .type = .usize, .kind = .{ .extern_func = @tagName(name) ++ "f128" } },
77456 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
77457 .unused,
77458 .unused,
77459 .unused,
77460 .unused,
77461 .unused,
77462 .unused,
77463 .unused,
77464 },
77465 .dst_temps = .{ .mem, .unused },
77466 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
77467 .each = .{ .once = &.{
77468 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
77469 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
77470 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
77471 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
77472 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
77473 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
77474 } },
77475 }, .{
77476 .required_cc_abi = .win64,
77477 .required_features = .{ .sse2, null, null, null },
77478 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
77479 .patterns = &.{
77480 .{ .src = .{ .to_mem, .none, .none } },
77481 },
77482 .call_frame = .{ .alignment = .@"16" },
77483 .extra_temps = .{
77484 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
77485 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
77486 .{ .type = .usize, .kind = .{ .extern_func = @tagName(name) ++ "f128" } },
77487 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
77488 .unused,
77489 .unused,
77490 .unused,
77491 .unused,
77492 .unused,
77493 .unused,
77494 .unused,
77495 },
77496 .dst_temps = .{ .mem, .unused },
77497 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
77498 .each = .{ .once = &.{
77499 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
77500 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
77501 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
77502 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
77503 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
77504 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
77505 } },
77506 }, .{
77507 .required_cc_abi = .win64,
77508 .required_features = .{ .sse, null, null, null },
77509 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },76277 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
77510 .patterns = &.{76278 .patterns = &.{
77511 .{ .src = .{ .to_mem, .none, .none } },76279 .{ .src = .{ .to_mem, .none, .none } },
...@@ -77514,8 +76282,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -77514,8 +76282,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
77514 .extra_temps = .{76282 .extra_temps = .{
77515 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },76283 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
77516 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },76284 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
76285 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
77517 .{ .type = .usize, .kind = .{ .extern_func = @tagName(name) ++ "f128" } },76286 .{ .type = .usize, .kind = .{ .extern_func = @tagName(name) ++ "f128" } },
77518 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
77519 .unused,76287 .unused,
77520 .unused,76288 .unused,
77521 .unused,76289 .unused,
...@@ -77528,9 +76296,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -77528,9 +76296,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
77528 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },76296 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
77529 .each = .{ .once = &.{76297 .each = .{ .once = &.{
77530 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },76298 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
77531 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },76299 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
77532 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },76300 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
77533 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },76301 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
77534 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },76302 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
77535 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },76303 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
77536 } },76304 } },
...@@ -80175,7 +78943,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -80175,7 +78943,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
80175 } },78943 } },
80176 }, .{78944 }, .{
80177 .required_cc_abi = .win64,78945 .required_cc_abi = .win64,
80178 .required_features = .{ .sse, null, null, null },
80179 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },78946 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
80180 .patterns = &.{78947 .patterns = &.{
80181 .{ .src = .{ .to_mem, .none, .none } },78948 .{ .src = .{ .to_mem, .none, .none } },
...@@ -80183,6 +78950,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -80183,6 +78950,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
80183 .call_frame = .{ .alignment = .@"16" },78950 .call_frame = .{ .alignment = .@"16" },
80184 .extra_temps = .{78951 .extra_temps = .{
80185 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },78952 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
78953 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
80186 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {78954 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
80187 else => unreachable,78955 else => unreachable,
80188 .down => "floorf128",78956 .down => "floorf128",
...@@ -80197,13 +78965,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -80197,13 +78965,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
80197 .unused,78965 .unused,
80198 .unused,78966 .unused,
80199 .unused,78967 .unused,
80200 .unused,
80201 },78968 },
80202 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },78969 .dst_temps = .{ .mem, .unused },
80203 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },78970 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
80204 .each = .{ .once = &.{78971 .each = .{ .once = &.{
80205 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },78972 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
80206 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },78973 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
78974 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
80207 } },78975 } },
80208 }, .{78976 }, .{
80209 .required_cc_abi = .sysv64,78977 .required_cc_abi = .sysv64,
...@@ -80315,79 +79083,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -80315,79 +79083,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
80315 } },79083 } },
80316 }, .{79084 }, .{
80317 .required_cc_abi = .win64,79085 .required_cc_abi = .win64,
80318 .required_features = .{ .avx, null, null, null },
80319 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
80320 .patterns = &.{
80321 .{ .src = .{ .to_mem, .none, .none } },
80322 },
80323 .call_frame = .{ .alignment = .@"16" },
80324 .extra_temps = .{
80325 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
80326 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
80327 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
80328 else => unreachable,
80329 .down => "floorf128",
80330 .up => "ceilf128",
80331 .zero => "truncf128",
80332 } } },
80333 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
80334 .unused,
80335 .unused,
80336 .unused,
80337 .unused,
80338 .unused,
80339 .unused,
80340 .unused,
80341 },
80342 .dst_temps = .{ .mem, .unused },
80343 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
80344 .each = .{ .once = &.{
80345 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
80346 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
80347 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
80348 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
80349 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
80350 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
80351 } },
80352 }, .{
80353 .required_cc_abi = .win64,
80354 .required_features = .{ .sse2, null, null, null },
80355 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
80356 .patterns = &.{
80357 .{ .src = .{ .to_mem, .none, .none } },
80358 },
80359 .call_frame = .{ .alignment = .@"16" },
80360 .extra_temps = .{
80361 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
80362 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
80363 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
80364 else => unreachable,
80365 .down => "floorf128",
80366 .up => "ceilf128",
80367 .zero => "truncf128",
80368 } } },
80369 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
80370 .unused,
80371 .unused,
80372 .unused,
80373 .unused,
80374 .unused,
80375 .unused,
80376 .unused,
80377 },
80378 .dst_temps = .{ .mem, .unused },
80379 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
80380 .each = .{ .once = &.{
80381 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
80382 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
80383 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
80384 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
80385 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
80386 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
80387 } },
80388 }, .{
80389 .required_cc_abi = .win64,
80390 .required_features = .{ .sse, null, null, null },
80391 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },79086 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
80392 .patterns = &.{79087 .patterns = &.{
80393 .{ .src = .{ .to_mem, .none, .none } },79088 .{ .src = .{ .to_mem, .none, .none } },
...@@ -80396,13 +79091,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -80396,13 +79091,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
80396 .extra_temps = .{79091 .extra_temps = .{
80397 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },79092 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
80398 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },79093 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
79094 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
80399 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {79095 .{ .type = .usize, .kind = .{ .extern_func = switch (direction) {
80400 else => unreachable,79096 else => unreachable,
80401 .down => "floorf128",79097 .down => "floorf128",
80402 .up => "ceilf128",79098 .up => "ceilf128",
80403 .zero => "truncf128",79099 .zero => "truncf128",
80404 } } },79100 } } },
80405 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
80406 .unused,79101 .unused,
80407 .unused,79102 .unused,
80408 .unused,79103 .unused,
...@@ -80415,9 +79110,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -80415,9 +79110,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
80415 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },79110 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
80416 .each = .{ .once = &.{79111 .each = .{ .once = &.{
80417 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },79112 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
80418 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },79113 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
80419 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },79114 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
80420 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },79115 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
80421 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },79116 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
80422 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },79117 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
80423 } },79118 } },
...@@ -92472,6 +91167,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92472,6 +91167,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92472 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91167 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92473 } },91168 } },
92474 }, .{91169 }, .{
91170 .required_cc_abi = .sysv64,
92475 .required_features = .{ .sse, null, null, null },91171 .required_features = .{ .sse, null, null, null },
92476 .src_constraints = .{ .{ .scalar_float = .{ .of = .word, .is = .word } }, .any, .any },91172 .src_constraints = .{ .{ .scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
92477 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },91173 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92498,6 +91194,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92498,6 +91194,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92498 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },91194 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
92499 } },91195 } },
92500 }, .{91196 }, .{
91197 .required_cc_abi = .win64,
91198 .required_features = .{ .sse, null, null, null },
91199 .src_constraints = .{ .{ .scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
91200 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91201 .patterns = &.{
91202 .{ .src = .{ .{ .to_param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .none, .none } },
91203 },
91204 .call_frame = .{ .alignment = .@"16" },
91205 .extra_temps = .{
91206 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91207 .{ .type = .usize, .kind = .{ .extern_func = "__extendhftf2" } },
91208 .unused,
91209 .unused,
91210 .unused,
91211 .unused,
91212 .unused,
91213 .unused,
91214 .unused,
91215 .unused,
91216 .unused,
91217 },
91218 .dst_temps = .{ .mem, .unused },
91219 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91220 .each = .{ .once = &.{
91221 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
91222 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
91223 } },
91224 }, .{
91225 .required_cc_abi = .sysv64,
92501 .required_features = .{ .avx, null, null, null },91226 .required_features = .{ .avx, null, null, null },
92502 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },91227 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
92503 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91228 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92530,6 +91255,40 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92530,6 +91255,40 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92530 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91255 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92531 } },91256 } },
92532 }, .{91257 }, .{
91258 .required_cc_abi = .win64,
91259 .required_features = .{ .avx, null, null, null },
91260 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
91261 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91262 .patterns = &.{
91263 .{ .src = .{ .to_mem, .none, .none } },
91264 },
91265 .call_frame = .{ .alignment = .@"16" },
91266 .extra_temps = .{
91267 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
91268 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91269 .{ .type = .f16, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
91270 .{ .type = .usize, .kind = .{ .extern_func = "__extendhftf2" } },
91271 .unused,
91272 .unused,
91273 .unused,
91274 .unused,
91275 .unused,
91276 .unused,
91277 .unused,
91278 },
91279 .dst_temps = .{ .mem, .unused },
91280 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91281 .each = .{ .once = &.{
91282 .{ ._, ._, .mov, .tmp0d, .sia(-2, .src0, .add_unaligned_size), ._, ._ },
91283 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"8", .tmp0), ._, ._ },
91284 .{ ._, .vp_, .xor, .tmp2x, .tmp2x, .tmp2x, ._ },
91285 .{ ._, .vp_w, .insr, .tmp2x, .tmp2x, .memi(.src0w, .tmp0), .ui(0) },
91286 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
91287 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },
91288 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
91289 } },
91290 }, .{
91291 .required_cc_abi = .sysv64,
92533 .required_features = .{ .sse2, null, null, null },91292 .required_features = .{ .sse2, null, null, null },
92534 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },91293 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
92535 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91294 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92562,6 +91321,40 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92562,6 +91321,40 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92562 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91321 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92563 } },91322 } },
92564 }, .{91323 }, .{
91324 .required_cc_abi = .win64,
91325 .required_features = .{ .sse2, null, null, null },
91326 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
91327 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91328 .patterns = &.{
91329 .{ .src = .{ .to_mem, .none, .none } },
91330 },
91331 .call_frame = .{ .alignment = .@"16" },
91332 .extra_temps = .{
91333 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
91334 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91335 .{ .type = .f16, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
91336 .{ .type = .usize, .kind = .{ .extern_func = "__extendhftf2" } },
91337 .unused,
91338 .unused,
91339 .unused,
91340 .unused,
91341 .unused,
91342 .unused,
91343 .unused,
91344 },
91345 .dst_temps = .{ .mem, .unused },
91346 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91347 .each = .{ .once = &.{
91348 .{ ._, ._, .mov, .tmp0d, .sia(-2, .src0, .add_unaligned_size), ._, ._ },
91349 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"8", .tmp0), ._, ._ },
91350 .{ ._, .p_, .xor, .tmp2x, .tmp2x, ._, ._ },
91351 .{ ._, .p_w, .insr, .tmp2x, .memi(.src0w, .tmp0), .ui(0), ._ },
91352 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
91353 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },
91354 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
91355 } },
91356 }, .{
91357 .required_cc_abi = .sysv64,
92565 .required_features = .{ .sse, null, null, null },91358 .required_features = .{ .sse, null, null, null },
92566 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },91359 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
92567 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91360 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92594,6 +91387,40 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92594,6 +91387,40 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92594 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },91387 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },
92595 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91388 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92596 } },91389 } },
91390 }, .{
91391 .required_cc_abi = .win64,
91392 .required_features = .{ .sse, null, null, null },
91393 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .word, .is = .word } }, .any, .any },
91394 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91395 .patterns = &.{
91396 .{ .src = .{ .to_mem, .none, .none } },
91397 },
91398 .call_frame = .{ .alignment = .@"16" },
91399 .extra_temps = .{
91400 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
91401 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91402 .{ .type = .f16, .kind = .{ .reg = .ax } },
91403 .{ .type = .f32, .kind = .mem },
91404 .{ .type = .f16, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
91405 .{ .type = .usize, .kind = .{ .extern_func = "__extendhftf2" } },
91406 .unused,
91407 .unused,
91408 .unused,
91409 .unused,
91410 .unused,
91411 },
91412 .dst_temps = .{ .mem, .unused },
91413 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91414 .each = .{ .once = &.{
91415 .{ ._, ._, .mov, .tmp0d, .sia(-2, .src0, .add_unaligned_size), ._, ._ },
91416 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0x, .@"8", .tmp0), ._, ._ },
91417 .{ ._, ._, .movzx, .tmp2d, .memi(.src0w, .tmp0), ._, ._ },
91418 .{ ._, ._, .mov, .mem(.tmp3d), .tmp2d, ._, ._ },
91419 .{ ._, ._ss, .mov, .tmp4x, .mem(.tmp3d), ._, ._ },
91420 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
91421 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },
91422 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
91423 } },
92597 }, .{91424 }, .{
92598 .required_features = .{ .avx, null, null, null },91425 .required_features = .{ .avx, null, null, null },
92599 .src_constraints = .{ .{ .scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },91426 .src_constraints = .{ .{ .scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
...@@ -92833,6 +91660,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92833,6 +91660,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92833 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91660 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92834 } },91661 } },
92835 }, .{91662 }, .{
91663 .required_cc_abi = .sysv64,
92836 .required_features = .{ .sse, null, null, null },91664 .required_features = .{ .sse, null, null, null },
92837 .src_constraints = .{ .{ .scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },91665 .src_constraints = .{ .{ .scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
92838 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },91666 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92859,6 +91687,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92859,6 +91687,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92859 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },91687 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
92860 } },91688 } },
92861 }, .{91689 }, .{
91690 .required_cc_abi = .win64,
91691 .required_features = .{ .sse, null, null, null },
91692 .src_constraints = .{ .{ .scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
91693 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91694 .patterns = &.{
91695 .{ .src = .{ .{ .to_param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } }, .none, .none } },
91696 },
91697 .call_frame = .{ .alignment = .@"16" },
91698 .extra_temps = .{
91699 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91700 .{ .type = .usize, .kind = .{ .extern_func = "__extendsftf2" } },
91701 .unused,
91702 .unused,
91703 .unused,
91704 .unused,
91705 .unused,
91706 .unused,
91707 .unused,
91708 .unused,
91709 .unused,
91710 },
91711 .dst_temps = .{ .mem, .unused },
91712 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91713 .each = .{ .once = &.{
91714 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
91715 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
91716 } },
91717 }, .{
91718 .required_cc_abi = .sysv64,
92862 .required_features = .{ .avx, null, null, null },91719 .required_features = .{ .avx, null, null, null },
92863 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },91720 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
92864 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91721 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92890,6 +91747,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92890,6 +91747,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92890 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91747 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92891 } },91748 } },
92892 }, .{91749 }, .{
91750 .required_cc_abi = .win64,
91751 .required_features = .{ .avx, null, null, null },
91752 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
91753 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91754 .patterns = &.{
91755 .{ .src = .{ .to_mem, .none, .none } },
91756 },
91757 .call_frame = .{ .alignment = .@"16" },
91758 .extra_temps = .{
91759 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
91760 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91761 .{ .type = .f32, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
91762 .{ .type = .usize, .kind = .{ .extern_func = "__extendsftf2" } },
91763 .unused,
91764 .unused,
91765 .unused,
91766 .unused,
91767 .unused,
91768 .unused,
91769 .unused,
91770 },
91771 .dst_temps = .{ .mem, .unused },
91772 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91773 .each = .{ .once = &.{
91774 .{ ._, ._, .mov, .tmp0d, .sia(-4, .src0, .add_unaligned_size), ._, ._ },
91775 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"4", .tmp0), ._, ._ },
91776 .{ ._, .v_ss, .mov, .tmp2x, .memi(.src0d, .tmp0), ._, ._ },
91777 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
91778 .{ ._, ._, .sub, .tmp0d, .si(4), ._, ._ },
91779 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
91780 } },
91781 }, .{
91782 .required_cc_abi = .sysv64,
92893 .required_features = .{ .sse2, null, null, null },91783 .required_features = .{ .sse2, null, null, null },
92894 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },91784 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
92895 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91785 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92921,6 +91811,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92921,6 +91811,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92921 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91811 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92922 } },91812 } },
92923 }, .{91813 }, .{
91814 .required_cc_abi = .sysv64,
92924 .required_features = .{ .sse, null, null, null },91815 .required_features = .{ .sse, null, null, null },
92925 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },91816 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
92926 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91817 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -92951,6 +91842,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -92951,6 +91842,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
92951 .{ ._, ._, .sub, .tmp0d, .si(4), ._, ._ },91842 .{ ._, ._, .sub, .tmp0d, .si(4), ._, ._ },
92952 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91843 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92953 } },91844 } },
91845 }, .{
91846 .required_cc_abi = .win64,
91847 .required_features = .{ .sse, null, null, null },
91848 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .dword, .is = .dword } }, .any, .any },
91849 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91850 .patterns = &.{
91851 .{ .src = .{ .to_mem, .none, .none } },
91852 },
91853 .call_frame = .{ .alignment = .@"16" },
91854 .extra_temps = .{
91855 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
91856 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91857 .{ .type = .f32, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
91858 .{ .type = .usize, .kind = .{ .extern_func = "__extendsftf2" } },
91859 .unused,
91860 .unused,
91861 .unused,
91862 .unused,
91863 .unused,
91864 .unused,
91865 .unused,
91866 },
91867 .dst_temps = .{ .mem, .unused },
91868 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91869 .each = .{ .once = &.{
91870 .{ ._, ._, .mov, .tmp0d, .sia(-4, .src0, .add_unaligned_size), ._, ._ },
91871 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"4", .tmp0), ._, ._ },
91872 .{ ._, ._ss, .mov, .tmp2x, .memi(.src0d, .tmp0), ._, ._ },
91873 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
91874 .{ ._, ._, .sub, .tmp0d, .si(4), ._, ._ },
91875 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
91876 } },
92954 }, .{91877 }, .{
92955 .required_features = .{ .x87, null, null, null },91878 .required_features = .{ .x87, null, null, null },
92956 .src_constraints = .{ .{ .scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },91879 .src_constraints = .{ .{ .scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
...@@ -93006,6 +91929,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93006,6 +91929,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93006 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },91929 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93007 } },91930 } },
93008 }, .{91931 }, .{
91932 .required_cc_abi = .sysv64,
93009 .required_features = .{ .sse, null, null, null },91933 .required_features = .{ .sse, null, null, null },
93010 .src_constraints = .{ .{ .scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },91934 .src_constraints = .{ .{ .scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
93011 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },91935 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -93032,6 +91956,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93032,6 +91956,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93032 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },91956 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
93033 } },91957 } },
93034 }, .{91958 }, .{
91959 .required_cc_abi = .win64,
91960 .required_features = .{ .sse, null, null, null },
91961 .src_constraints = .{ .{ .scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
91962 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
91963 .patterns = &.{
91964 .{ .src = .{ .{ .to_param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } }, .none, .none } },
91965 },
91966 .call_frame = .{ .alignment = .@"16" },
91967 .extra_temps = .{
91968 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
91969 .{ .type = .usize, .kind = .{ .extern_func = "__extenddftf2" } },
91970 .unused,
91971 .unused,
91972 .unused,
91973 .unused,
91974 .unused,
91975 .unused,
91976 .unused,
91977 .unused,
91978 .unused,
91979 },
91980 .dst_temps = .{ .mem, .unused },
91981 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
91982 .each = .{ .once = &.{
91983 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
91984 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
91985 } },
91986 }, .{
91987 .required_cc_abi = .sysv64,
93035 .required_features = .{ .avx, null, null, null },91988 .required_features = .{ .avx, null, null, null },
93036 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },91989 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
93037 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },91990 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -93063,6 +92016,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93063,6 +92016,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93063 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },92016 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93064 } },92017 } },
93065 }, .{92018 }, .{
92019 .required_cc_abi = .win64,
92020 .required_features = .{ .avx, null, null, null },
92021 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
92022 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
92023 .patterns = &.{
92024 .{ .src = .{ .to_mem, .none, .none } },
92025 },
92026 .call_frame = .{ .alignment = .@"16" },
92027 .extra_temps = .{
92028 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
92029 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
92030 .{ .type = .f64, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
92031 .{ .type = .usize, .kind = .{ .extern_func = "__extenddftf2" } },
92032 .unused,
92033 .unused,
92034 .unused,
92035 .unused,
92036 .unused,
92037 .unused,
92038 .unused,
92039 },
92040 .dst_temps = .{ .mem, .unused },
92041 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
92042 .each = .{ .once = &.{
92043 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
92044 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"2", .tmp0), ._, ._ },
92045 .{ ._, .v_sd, .mov, .tmp2x, .memi(.src0q, .tmp0), ._, ._ },
92046 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
92047 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
92048 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92049 } },
92050 }, .{
92051 .required_cc_abi = .sysv64,
93066 .required_features = .{ .sse2, null, null, null },92052 .required_features = .{ .sse2, null, null, null },
93067 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },92053 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
93068 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },92054 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -93094,6 +92080,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93094,6 +92080,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93094 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },92080 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93095 } },92081 } },
93096 }, .{92082 }, .{
92083 .required_cc_abi = .win64,
92084 .required_features = .{ .sse2, null, null, null },
92085 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
92086 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
92087 .patterns = &.{
92088 .{ .src = .{ .to_mem, .none, .none } },
92089 },
92090 .call_frame = .{ .alignment = .@"16" },
92091 .extra_temps = .{
92092 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
92093 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
92094 .{ .type = .f64, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
92095 .{ .type = .usize, .kind = .{ .extern_func = "__extenddftf2" } },
92096 .unused,
92097 .unused,
92098 .unused,
92099 .unused,
92100 .unused,
92101 .unused,
92102 .unused,
92103 },
92104 .dst_temps = .{ .mem, .unused },
92105 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
92106 .each = .{ .once = &.{
92107 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
92108 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"2", .tmp0), ._, ._ },
92109 .{ ._, ._sd, .mov, .tmp2x, .memi(.src0q, .tmp0), ._, ._ },
92110 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
92111 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
92112 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92113 } },
92114 }, .{
92115 .required_cc_abi = .sysv64,
93097 .required_features = .{ .sse, null, null, null },92116 .required_features = .{ .sse, null, null, null },
93098 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },92117 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
93099 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },92118 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -93125,6 +92144,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93125,6 +92144,39 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93125 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },92144 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
93126 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },92145 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93127 } },92146 } },
92147 }, .{
92148 .required_cc_abi = .win64,
92149 .required_features = .{ .sse, null, null, null },
92150 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .qword, .is = .qword } }, .any, .any },
92151 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
92152 .patterns = &.{
92153 .{ .src = .{ .to_mem, .none, .none } },
92154 },
92155 .call_frame = .{ .alignment = .@"16" },
92156 .extra_temps = .{
92157 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
92158 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
92159 .{ .type = .f64, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 1 } } },
92160 .{ .type = .usize, .kind = .{ .extern_func = "__extenddftf2" } },
92161 .unused,
92162 .unused,
92163 .unused,
92164 .unused,
92165 .unused,
92166 .unused,
92167 .unused,
92168 },
92169 .dst_temps = .{ .mem, .unused },
92170 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
92171 .each = .{ .once = &.{
92172 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
92173 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"2", .tmp0), ._, ._ },
92174 .{ ._, ._ps, .xor, .tmp2x, .tmp2x, ._, ._ },
92175 .{ ._, ._ps, .movl, .tmp2x, .memi(.src0q, .tmp0), ._, ._ },
92176 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
92177 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
92178 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
92179 } },
93128 }, .{92180 }, .{
93129 .required_cc_abi = .sysv64,92181 .required_cc_abi = .sysv64,
93130 .required_features = .{ .avx, null, null, null },92182 .required_features = .{ .avx, null, null, null },
...@@ -93214,7 +92266,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93214,7 +92266,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93214 } },92266 } },
93215 }, .{92267 }, .{
93216 .required_cc_abi = .win64,92268 .required_cc_abi = .win64,
93217 .required_features = .{ .sse, null, null, null },
93218 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },92269 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
93219 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },92270 .dst_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .xword } }, .any },
93220 .patterns = &.{92271 .patterns = &.{
...@@ -93223,6 +92274,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93223,6 +92274,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93223 .call_frame = .{ .alignment = .@"16" },92274 .call_frame = .{ .alignment = .@"16" },
93224 .extra_temps = .{92275 .extra_temps = .{
93225 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },92276 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
92277 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
93226 .{ .type = .usize, .kind = .{ .extern_func = "__extendxftf2" } },92278 .{ .type = .usize, .kind = .{ .extern_func = "__extendxftf2" } },
93227 .unused,92279 .unused,
93228 .unused,92280 .unused,
...@@ -93232,13 +92284,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93232,13 +92284,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93232 .unused,92284 .unused,
93233 .unused,92285 .unused,
93234 .unused,92286 .unused,
93235 .unused,
93236 },92287 },
93237 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },92288 .dst_temps = .{ .mem, .unused },
93238 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },92289 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
93239 .each = .{ .once = &.{92290 .each = .{ .once = &.{
93240 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },92291 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
93241 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },92292 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
92293 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
93242 } },92294 } },
93243 }, .{92295 }, .{
93244 .required_cc_abi = .sysv64,92296 .required_cc_abi = .sysv64,
...@@ -93273,70 +92325,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93273,70 +92325,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93273 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },92325 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
93274 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },92326 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93275 } },92327 } },
93276 }, .{
93277 .required_cc_abi = .win64,
93278 .required_features = .{ .avx, null, null, null },
93279 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
93280 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
93281 .patterns = &.{
93282 .{ .src = .{ .to_mem, .none, .none } },
93283 },
93284 .call_frame = .{ .alignment = .@"16" },
93285 .extra_temps = .{
93286 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
93287 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
93288 .{ .type = .usize, .kind = .{ .extern_func = "__extendxftf2" } },
93289 .{ .type = .f80, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
93290 .unused,
93291 .unused,
93292 .unused,
93293 .unused,
93294 .unused,
93295 .unused,
93296 .unused,
93297 },
93298 .dst_temps = .{ .mem, .unused },
93299 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
93300 .each = .{ .once = &.{
93301 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
93302 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
93303 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
93304 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
93305 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
93306 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93307 } },
93308 }, .{
93309 .required_cc_abi = .win64,
93310 .required_features = .{ .sse2, null, null, null },
93311 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
93312 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
93313 .patterns = &.{
93314 .{ .src = .{ .to_mem, .none, .none } },
93315 },
93316 .call_frame = .{ .alignment = .@"16" },
93317 .extra_temps = .{
93318 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
93319 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
93320 .{ .type = .usize, .kind = .{ .extern_func = "__extendxftf2" } },
93321 .{ .type = .f80, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
93322 .unused,
93323 .unused,
93324 .unused,
93325 .unused,
93326 .unused,
93327 .unused,
93328 .unused,
93329 },
93330 .dst_temps = .{ .mem, .unused },
93331 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
93332 .each = .{ .once = &.{
93333 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
93334 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
93335 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
93336 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
93337 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
93338 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93339 } },
93340 }, .{92328 }, .{
93341 .required_cc_abi = .sysv64,92329 .required_cc_abi = .sysv64,
93342 .required_features = .{ .sse2, null, null, null },92330 .required_features = .{ .sse2, null, null, null },
...@@ -93405,7 +92393,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93405,7 +92393,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93405 } },92393 } },
93406 }, .{92394 }, .{
93407 .required_cc_abi = .win64,92395 .required_cc_abi = .win64,
93408 .required_features = .{ .sse, null, null, null },
93409 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },92396 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
93410 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },92397 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
93411 .patterns = &.{92398 .patterns = &.{
...@@ -93415,8 +92402,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93415,8 +92402,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93415 .extra_temps = .{92402 .extra_temps = .{
93416 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },92403 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
93417 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },92404 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
92405 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
93418 .{ .type = .usize, .kind = .{ .extern_func = "__extendxftf2" } },92406 .{ .type = .usize, .kind = .{ .extern_func = "__extendxftf2" } },
93419 .{ .type = .f80, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
93420 .unused,92407 .unused,
93421 .unused,92408 .unused,
93422 .unused,92409 .unused,
...@@ -93429,9 +92416,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -93429,9 +92416,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
93429 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },92416 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
93430 .each = .{ .once = &.{92417 .each = .{ .once = &.{
93431 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },92418 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
93432 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },92419 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
93433 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },92420 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
93434 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },92421 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
93435 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },92422 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
93436 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },92423 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
93437 } },92424 } },
...@@ -96532,7 +95519,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -96532,7 +95519,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
96532 .clobbers = .{ .eflags = true },95519 .clobbers = .{ .eflags = true },
96533 .each = .{ .once = &.{95520 .each = .{ .once = &.{
96534 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },95521 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
96535 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },95522 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
96536 .{ .@"0:", ._, .movsx, .tmp2q, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },95523 .{ .@"0:", ._, .movsx, .tmp2q, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },
96537 .{ ._, ._sq, .sto, ._, ._, ._, ._ },95524 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
96538 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },95525 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },
...@@ -96565,7 +95552,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -96565,7 +95552,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
96565 .clobbers = .{ .eflags = true },95552 .clobbers = .{ .eflags = true },
96566 .each = .{ .once = &.{95553 .each = .{ .once = &.{
96567 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },95554 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
96568 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },95555 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
96569 .{ .@"0:", ._, .movsx, .tmp2q, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },95556 .{ .@"0:", ._, .movsx, .tmp2q, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },
96570 .{ ._, ._sq, .sto, ._, ._, ._, ._ },95557 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
96571 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },95558 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },
...@@ -96598,7 +95585,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -96598,7 +95585,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
96598 .clobbers = .{ .eflags = true },95585 .clobbers = .{ .eflags = true },
96599 .each = .{ .once = &.{95586 .each = .{ .once = &.{
96600 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },95587 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
96601 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },95588 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
96602 .{ .@"0:", ._, .movzx, .tmp2d, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },95589 .{ .@"0:", ._, .movzx, .tmp2d, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },
96603 .{ ._, ._sq, .sto, ._, ._, ._, ._ },95590 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
96604 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },95591 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },
...@@ -96631,7 +95618,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -96631,7 +95618,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
96631 .clobbers = .{ .eflags = true },95618 .clobbers = .{ .eflags = true },
96632 .each = .{ .once = &.{95619 .each = .{ .once = &.{
96633 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },95620 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
96634 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },95621 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
96635 .{ .@"0:", ._, .movzx, .tmp2d, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },95622 .{ .@"0:", ._, .movzx, .tmp2d, .memia(.src0b, .tmp0, .add_unaligned_size), ._, ._ },
96636 .{ ._, ._sq, .sto, ._, ._, ._, ._ },95623 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
96637 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },95624 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },
...@@ -97484,7 +96471,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -97484,7 +96471,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
97484 .clobbers = .{ .eflags = true },96471 .clobbers = .{ .eflags = true },
97485 .each = .{ .once = &.{96472 .each = .{ .once = &.{
97486 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },96473 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
97487 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },96474 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
97488 .{ .@"0:", ._, .movsx, .tmp2q, .memia(.src0w, .tmp0, .add_unaligned_size), ._, ._ },96475 .{ .@"0:", ._, .movsx, .tmp2q, .memia(.src0w, .tmp0, .add_unaligned_size), ._, ._ },
97489 .{ ._, ._sq, .sto, ._, ._, ._, ._ },96476 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
97490 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },96477 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },
...@@ -97517,7 +96504,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -97517,7 +96504,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
97517 .clobbers = .{ .eflags = true },96504 .clobbers = .{ .eflags = true },
97518 .each = .{ .once = &.{96505 .each = .{ .once = &.{
97519 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },96506 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
97520 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },96507 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
97521 .{ .@"0:", ._, .movzx, .tmp2d, .memia(.src0w, .tmp0, .add_unaligned_size), ._, ._ },96508 .{ .@"0:", ._, .movzx, .tmp2d, .memia(.src0w, .tmp0, .add_unaligned_size), ._, ._ },
97522 .{ ._, ._sq, .sto, ._, ._, ._, ._ },96509 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
97523 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },96510 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },
...@@ -98011,7 +96998,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -98011,7 +96998,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
98011 .clobbers = .{ .eflags = true },96998 .clobbers = .{ .eflags = true },
98012 .each = .{ .once = &.{96999 .each = .{ .once = &.{
98013 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },97000 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
98014 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },97001 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
98015 .{ .@"0:", ._d, .movsx, .tmp2q, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ },97002 .{ .@"0:", ._d, .movsx, .tmp2q, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ },
98016 .{ ._, ._sq, .sto, ._, ._, ._, ._ },97003 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
98017 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },97004 .{ ._, ._r, .sa, .tmp2q, .si(63), ._, ._ },
...@@ -98044,7 +97031,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -98044,7 +97031,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
98044 .clobbers = .{ .eflags = true },97031 .clobbers = .{ .eflags = true },
98045 .each = .{ .once = &.{97032 .each = .{ .once = &.{
98046 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },97033 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
98047 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },97034 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
98048 .{ .@"0:", ._, .mov, .tmp2d, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ },97035 .{ .@"0:", ._, .mov, .tmp2d, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ },
98049 .{ ._, ._sq, .sto, ._, ._, ._, ._ },97036 .{ ._, ._sq, .sto, ._, ._, ._, ._ },
98050 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },97037 .{ ._, ._, .xor, .tmp2d, .tmp2d, ._, ._ },
...@@ -108792,7 +107779,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -108792,7 +107779,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
108792 .{ ._, ._, .@"or", .memd(.tmp2b, 1), .ui(0b000_0_11_00), ._, ._ },107779 .{ ._, ._, .@"or", .memd(.tmp2b, 1), .ui(0b000_0_11_00), ._, ._ },
108793 .{ ._, .f_cw, .ld, .tmp2w, ._, ._, ._ },107780 .{ ._, .f_cw, .ld, .tmp2w, ._, ._, ._ },
108794 .{ ._, ._, .mov, .memd(.tmp2b, 1), .dst0b, ._, ._ },107781 .{ ._, ._, .mov, .memd(.tmp2b, 1), .dst0b, ._, ._ },
108795 .{ ._, ._, .lea, .dst0q, .mem(.tmp3), ._, ._ },107782 .{ ._, ._, .lea, .dst0p, .mem(.tmp3), ._, ._ },
108796 .{ ._, .fi_p, .st, .tmp4q, ._, ._, ._ },107783 .{ ._, .fi_p, .st, .tmp4q, ._, ._, ._ },
108797 .{ ._, .f_, .sub, .lea(.dst0d), ._, ._, ._ },107784 .{ ._, .f_, .sub, .lea(.dst0d), ._, ._, ._ },
108798 .{ ._, ._, .mov, .tmp5q, .tmp4q, ._, ._ },107785 .{ ._, ._, .mov, .tmp5q, .tmp4q, ._, ._ },
...@@ -112008,7 +110995,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -112008,7 +110995,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
112008 .{ ._, ._, .@"or", .memd(.tmp2b, 1), .ui(0b000_0_11_00), ._, ._ },110995 .{ ._, ._, .@"or", .memd(.tmp2b, 1), .ui(0b000_0_11_00), ._, ._ },
112009 .{ ._, .f_cw, .ld, .tmp2w, ._, ._, ._ },110996 .{ ._, .f_cw, .ld, .tmp2w, ._, ._, ._ },
112010 .{ ._, ._, .mov, .memd(.tmp2b, 1), .dst0b, ._, ._ },110997 .{ ._, ._, .mov, .memd(.tmp2b, 1), .dst0b, ._, ._ },
112011 .{ ._, ._, .lea, .dst0q, .mem(.tmp3), ._, ._ },110998 .{ ._, ._, .lea, .dst0p, .mem(.tmp3), ._, ._ },
112012 .{ ._, .fi_p, .st, .tmp4q, ._, ._, ._ },110999 .{ ._, .fi_p, .st, .tmp4q, ._, ._, ._ },
112013 .{ ._, .f_, .sub, .lea(.dst0d), ._, ._, ._ },111000 .{ ._, .f_, .sub, .lea(.dst0d), ._, ._, ._ },
112014 .{ ._, ._, .mov, .tmp5q, .tmp4q, ._, ._ },111001 .{ ._, ._, .mov, .tmp5q, .tmp4q, ._, ._ },
...@@ -112051,7 +111038,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -112051,7 +111038,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
112051 .{ ._, ._, .@"or", .memd(.tmp2b, 1), .ui(0b000_0_11_11), ._, ._ },111038 .{ ._, ._, .@"or", .memd(.tmp2b, 1), .ui(0b000_0_11_11), ._, ._ },
112052 .{ ._, .f_cw, .ld, .tmp2w, ._, ._, ._ },111039 .{ ._, .f_cw, .ld, .tmp2w, ._, ._, ._ },
112053 .{ ._, ._, .mov, .memd(.tmp2b, 1), .dst0b, ._, ._ },111040 .{ ._, ._, .mov, .memd(.tmp2b, 1), .dst0b, ._, ._ },
112054 .{ ._, ._, .lea, .dst0q, .mem(.tmp3), ._, ._ },111041 .{ ._, ._, .lea, .dst0p, .mem(.tmp3), ._, ._ },
112055 .{ ._, .fi_p, .st, .tmp4q, ._, ._, ._ },111042 .{ ._, .fi_p, .st, .tmp4q, ._, ._, ._ },
112056 .{ ._, .f_, .sub, .lea(.dst0d), ._, ._, ._ },111043 .{ ._, .f_, .sub, .lea(.dst0d), ._, ._, ._ },
112057 .{ ._, ._, .mov, .tmp5q, .tmp4q, ._, ._ },111044 .{ ._, ._, .mov, .tmp5q, .tmp4q, ._, ._ },
...@@ -125336,6 +124323,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125336,6 +124323,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125336 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },124323 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125337 } },124324 } },
125338 }, .{124325 }, .{
124326 .required_cc_abi = .sysv64,
125339 .required_features = .{ .sse, null, null, null },124327 .required_features = .{ .sse, null, null, null },
125340 .src_constraints = .{ .{ .signed_int = .byte }, .any, .any },124328 .src_constraints = .{ .{ .signed_int = .byte }, .any, .any },
125341 .dst_constraints = .{ .{ .float = .xword }, .any },124329 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125364,6 +124352,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125364,6 +124352,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125364 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },124352 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
125365 } },124353 } },
125366 }, .{124354 }, .{
124355 .required_cc_abi = .win64,
124356 .src_constraints = .{ .{ .signed_int = .byte }, .any, .any },
124357 .dst_constraints = .{ .{ .float = .xword }, .any },
124358 .patterns = &.{
124359 .{ .src = .{ .mem, .none, .none } },
124360 .{ .src = .{ .to_gpr, .none, .none } },
124361 },
124362 .call_frame = .{ .alignment = .@"16" },
124363 .extra_temps = .{
124364 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124365 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124366 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
124367 .unused,
124368 .unused,
124369 .unused,
124370 .unused,
124371 .unused,
124372 .unused,
124373 .unused,
124374 .unused,
124375 },
124376 .dst_temps = .{ .mem, .unused },
124377 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124378 .each = .{ .once = &.{
124379 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124380 .{ ._, ._, .movsx, .tmp1d, .src0b, ._, ._ },
124381 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
124382 } },
124383 }, .{
124384 .required_cc_abi = .sysv64,
125367 .required_features = .{ .sse, null, null, null },124385 .required_features = .{ .sse, null, null, null },
125368 .src_constraints = .{ .{ .unsigned_int = .byte }, .any, .any },124386 .src_constraints = .{ .{ .unsigned_int = .byte }, .any, .any },
125369 .dst_constraints = .{ .{ .float = .xword }, .any },124387 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125392,6 +124410,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125392,6 +124410,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125392 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },124410 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
125393 } },124411 } },
125394 }, .{124412 }, .{
124413 .required_cc_abi = .win64,
124414 .src_constraints = .{ .{ .unsigned_int = .byte }, .any, .any },
124415 .dst_constraints = .{ .{ .float = .xword }, .any },
124416 .patterns = &.{
124417 .{ .src = .{ .mem, .none, .none } },
124418 .{ .src = .{ .to_gpr, .none, .none } },
124419 },
124420 .call_frame = .{ .alignment = .@"16" },
124421 .extra_temps = .{
124422 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124423 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124424 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
124425 .unused,
124426 .unused,
124427 .unused,
124428 .unused,
124429 .unused,
124430 .unused,
124431 .unused,
124432 .unused,
124433 },
124434 .dst_temps = .{ .mem, .unused },
124435 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124436 .each = .{ .once = &.{
124437 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124438 .{ ._, ._, .movzx, .tmp1d, .src0b, ._, ._ },
124439 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
124440 } },
124441 }, .{
124442 .required_cc_abi = .sysv64,
125395 .required_features = .{ .sse, null, null, null },124443 .required_features = .{ .sse, null, null, null },
125396 .src_constraints = .{ .{ .signed_int = .word }, .any, .any },124444 .src_constraints = .{ .{ .signed_int = .word }, .any, .any },
125397 .dst_constraints = .{ .{ .float = .xword }, .any },124445 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125420,6 +124468,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125420,6 +124468,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125420 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },124468 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
125421 } },124469 } },
125422 }, .{124470 }, .{
124471 .required_cc_abi = .win64,
124472 .src_constraints = .{ .{ .signed_int = .word }, .any, .any },
124473 .dst_constraints = .{ .{ .float = .xword }, .any },
124474 .patterns = &.{
124475 .{ .src = .{ .mem, .none, .none } },
124476 .{ .src = .{ .to_gpr, .none, .none } },
124477 },
124478 .call_frame = .{ .alignment = .@"16" },
124479 .extra_temps = .{
124480 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124481 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124482 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
124483 .unused,
124484 .unused,
124485 .unused,
124486 .unused,
124487 .unused,
124488 .unused,
124489 .unused,
124490 .unused,
124491 },
124492 .dst_temps = .{ .mem, .unused },
124493 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124494 .each = .{ .once = &.{
124495 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124496 .{ ._, ._, .movsx, .tmp1d, .src0w, ._, ._ },
124497 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
124498 } },
124499 }, .{
124500 .required_cc_abi = .sysv64,
125423 .required_features = .{ .sse, null, null, null },124501 .required_features = .{ .sse, null, null, null },
125424 .src_constraints = .{ .{ .unsigned_int = .word }, .any, .any },124502 .src_constraints = .{ .{ .unsigned_int = .word }, .any, .any },
125425 .dst_constraints = .{ .{ .float = .xword }, .any },124503 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125448,6 +124526,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125448,6 +124526,36 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125448 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },124526 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
125449 } },124527 } },
125450 }, .{124528 }, .{
124529 .required_cc_abi = .win64,
124530 .src_constraints = .{ .{ .unsigned_int = .word }, .any, .any },
124531 .dst_constraints = .{ .{ .float = .xword }, .any },
124532 .patterns = &.{
124533 .{ .src = .{ .mem, .none, .none } },
124534 .{ .src = .{ .to_gpr, .none, .none } },
124535 },
124536 .call_frame = .{ .alignment = .@"16" },
124537 .extra_temps = .{
124538 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124539 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124540 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
124541 .unused,
124542 .unused,
124543 .unused,
124544 .unused,
124545 .unused,
124546 .unused,
124547 .unused,
124548 .unused,
124549 },
124550 .dst_temps = .{ .mem, .unused },
124551 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124552 .each = .{ .once = &.{
124553 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124554 .{ ._, ._, .movzx, .tmp1d, .src0w, ._, ._ },
124555 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
124556 } },
124557 }, .{
124558 .required_cc_abi = .sysv64,
125451 .required_features = .{ .sse, null, null, null },124559 .required_features = .{ .sse, null, null, null },
125452 .src_constraints = .{ .{ .signed_int = .dword }, .any, .any },124560 .src_constraints = .{ .{ .signed_int = .dword }, .any, .any },
125453 .dst_constraints = .{ .{ .float = .xword }, .any },124561 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125474,6 +124582,34 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125474,6 +124582,34 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125474 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },124582 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
125475 } },124583 } },
125476 }, .{124584 }, .{
124585 .required_cc_abi = .win64,
124586 .src_constraints = .{ .{ .signed_int = .dword }, .any, .any },
124587 .dst_constraints = .{ .{ .float = .xword }, .any },
124588 .patterns = &.{
124589 .{ .src = .{ .{ .to_param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } }, .none, .none } },
124590 },
124591 .call_frame = .{ .alignment = .@"16" },
124592 .extra_temps = .{
124593 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124594 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
124595 .unused,
124596 .unused,
124597 .unused,
124598 .unused,
124599 .unused,
124600 .unused,
124601 .unused,
124602 .unused,
124603 .unused,
124604 },
124605 .dst_temps = .{ .mem, .unused },
124606 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124607 .each = .{ .once = &.{
124608 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124609 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
124610 } },
124611 }, .{
124612 .required_cc_abi = .sysv64,
125477 .required_features = .{ .sse, null, null, null },124613 .required_features = .{ .sse, null, null, null },
125478 .src_constraints = .{ .{ .unsigned_int = .dword }, .any, .any },124614 .src_constraints = .{ .{ .unsigned_int = .dword }, .any, .any },
125479 .dst_constraints = .{ .{ .float = .xword }, .any },124615 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125500,6 +124636,34 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125500,6 +124636,34 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125500 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },124636 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
125501 } },124637 } },
125502 }, .{124638 }, .{
124639 .required_cc_abi = .win64,
124640 .src_constraints = .{ .{ .unsigned_int = .dword }, .any, .any },
124641 .dst_constraints = .{ .{ .float = .xword }, .any },
124642 .patterns = &.{
124643 .{ .src = .{ .{ .to_param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } }, .none, .none } },
124644 },
124645 .call_frame = .{ .alignment = .@"16" },
124646 .extra_temps = .{
124647 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124648 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
124649 .unused,
124650 .unused,
124651 .unused,
124652 .unused,
124653 .unused,
124654 .unused,
124655 .unused,
124656 .unused,
124657 .unused,
124658 },
124659 .dst_temps = .{ .mem, .unused },
124660 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124661 .each = .{ .once = &.{
124662 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124663 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
124664 } },
124665 }, .{
124666 .required_cc_abi = .sysv64,
125503 .required_features = .{ .@"64bit", .sse, null, null },124667 .required_features = .{ .@"64bit", .sse, null, null },
125504 .src_constraints = .{ .{ .signed_int = .qword }, .any, .any },124668 .src_constraints = .{ .{ .signed_int = .qword }, .any, .any },
125505 .dst_constraints = .{ .{ .float = .xword }, .any },124669 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125526,6 +124690,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125526,6 +124690,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125526 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },124690 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
125527 } },124691 } },
125528 }, .{124692 }, .{
124693 .required_cc_abi = .win64,
124694 .required_features = .{ .@"64bit", null, null, null },
124695 .src_constraints = .{ .{ .signed_int = .qword }, .any, .any },
124696 .dst_constraints = .{ .{ .float = .xword }, .any },
124697 .patterns = &.{
124698 .{ .src = .{ .{ .to_param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } }, .none, .none } },
124699 },
124700 .call_frame = .{ .alignment = .@"16" },
124701 .extra_temps = .{
124702 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124703 .{ .type = .usize, .kind = .{ .extern_func = "__floatditf" } },
124704 .unused,
124705 .unused,
124706 .unused,
124707 .unused,
124708 .unused,
124709 .unused,
124710 .unused,
124711 .unused,
124712 .unused,
124713 },
124714 .dst_temps = .{ .mem, .unused },
124715 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124716 .each = .{ .once = &.{
124717 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124718 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
124719 } },
124720 }, .{
124721 .required_cc_abi = .sysv64,
125529 .required_features = .{ .@"64bit", .sse, null, null },124722 .required_features = .{ .@"64bit", .sse, null, null },
125530 .src_constraints = .{ .{ .unsigned_int = .qword }, .any, .any },124723 .src_constraints = .{ .{ .unsigned_int = .qword }, .any, .any },
125531 .dst_constraints = .{ .{ .float = .xword }, .any },124724 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125551,6 +124744,34 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125551,6 +124744,34 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125551 .each = .{ .once = &.{124744 .each = .{ .once = &.{
125552 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },124745 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
125553 } },124746 } },
124747 }, .{
124748 .required_cc_abi = .win64,
124749 .required_features = .{ .@"64bit", null, null, null },
124750 .src_constraints = .{ .{ .unsigned_int = .qword }, .any, .any },
124751 .dst_constraints = .{ .{ .float = .xword }, .any },
124752 .patterns = &.{
124753 .{ .src = .{ .{ .to_param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } }, .none, .none } },
124754 },
124755 .call_frame = .{ .alignment = .@"16" },
124756 .extra_temps = .{
124757 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124758 .{ .type = .usize, .kind = .{ .extern_func = "__floatunditf" } },
124759 .unused,
124760 .unused,
124761 .unused,
124762 .unused,
124763 .unused,
124764 .unused,
124765 .unused,
124766 .unused,
124767 .unused,
124768 },
124769 .dst_temps = .{ .mem, .unused },
124770 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124771 .each = .{ .once = &.{
124772 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124773 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },
124774 } },
125554 }, .{124775 }, .{
125555 .required_cc_abi = .sysv64,124776 .required_cc_abi = .sysv64,
125556 .required_features = .{ .sse, null, null, null },124777 .required_features = .{ .sse, null, null, null },
...@@ -125580,7 +124801,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125580,7 +124801,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125580 } },124801 } },
125581 }, .{124802 }, .{
125582 .required_cc_abi = .win64,124803 .required_cc_abi = .win64,
125583 .required_features = .{ .sse, null, null, null },
125584 .src_constraints = .{ .{ .signed_int = .xword }, .any, .any },124804 .src_constraints = .{ .{ .signed_int = .xword }, .any, .any },
125585 .dst_constraints = .{ .{ .float = .xword }, .any },124805 .dst_constraints = .{ .{ .float = .xword }, .any },
125586 .patterns = &.{124806 .patterns = &.{
...@@ -125589,6 +124809,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125589,6 +124809,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125589 .call_frame = .{ .alignment = .@"16" },124809 .call_frame = .{ .alignment = .@"16" },
125590 .extra_temps = .{124810 .extra_temps = .{
125591 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },124811 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124812 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
125592 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },124813 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },
125593 .unused,124814 .unused,
125594 .unused,124815 .unused,
...@@ -125598,15 +124819,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125598,15 +124819,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125598 .unused,124819 .unused,
125599 .unused,124820 .unused,
125600 .unused,124821 .unused,
125601 .unused,
125602 },124822 },
125603 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },124823 .dst_temps = .{ .mem, .unused },
125604 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },124824 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125605 .each = .{ .once = &.{124825 .each = .{ .once = &.{
125606 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },124826 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
125607 .{ ._, ._, .call, .tmp1d, ._, ._, ._ },124827 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
124828 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
125608 } },124829 } },
125609 }, .{124830 }, .{
124831 .required_cc_abi = .sysv64,
125610 .required_features = .{ .sse, null, null, null },124832 .required_features = .{ .sse, null, null, null },
125611 .src_constraints = .{ .{ .unsigned_int = .xword }, .any, .any },124833 .src_constraints = .{ .{ .unsigned_int = .xword }, .any, .any },
125612 .dst_constraints = .{ .{ .float = .xword }, .any },124834 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125633,6 +124855,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125633,6 +124855,35 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125633 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },124855 .{ ._, ._, .call, .tmp0d, ._, ._, ._ },
125634 } },124856 } },
125635 }, .{124857 }, .{
124858 .required_cc_abi = .win64,
124859 .src_constraints = .{ .{ .unsigned_int = .xword }, .any, .any },
124860 .dst_constraints = .{ .{ .float = .xword }, .any },
124861 .patterns = &.{
124862 .{ .src = .{ .to_mem, .none, .none } },
124863 },
124864 .call_frame = .{ .alignment = .@"16" },
124865 .extra_temps = .{
124866 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124867 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124868 .{ .type = .usize, .kind = .{ .extern_func = "__floatuntitf" } },
124869 .unused,
124870 .unused,
124871 .unused,
124872 .unused,
124873 .unused,
124874 .unused,
124875 .unused,
124876 .unused,
124877 },
124878 .dst_temps = .{ .mem, .unused },
124879 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124880 .each = .{ .once = &.{
124881 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124882 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
124883 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
124884 } },
124885 }, .{
124886 .required_cc_abi = .sysv64,
125636 .required_features = .{ .@"64bit", .sse, null, null },124887 .required_features = .{ .@"64bit", .sse, null, null },
125637 .src_constraints = .{ .{ .remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },124888 .src_constraints = .{ .{ .remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
125638 .dst_constraints = .{ .{ .float = .xword }, .any },124889 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125661,6 +124912,37 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125661,6 +124912,37 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125661 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },124912 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
125662 } },124913 } },
125663 }, .{124914 }, .{
124915 .required_cc_abi = .win64,
124916 .required_features = .{ .@"64bit", null, null, null },
124917 .src_constraints = .{ .{ .remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
124918 .dst_constraints = .{ .{ .float = .xword }, .any },
124919 .patterns = &.{
124920 .{ .src = .{ .to_mem, .none, .none } },
124921 },
124922 .call_frame = .{ .alignment = .@"16" },
124923 .extra_temps = .{
124924 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124925 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124926 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
124927 .{ .type = .usize, .kind = .{ .extern_func = "__floateitf" } },
124928 .unused,
124929 .unused,
124930 .unused,
124931 .unused,
124932 .unused,
124933 .unused,
124934 .unused,
124935 },
124936 .dst_temps = .{ .mem, .unused },
124937 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124938 .each = .{ .once = &.{
124939 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124940 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
124941 .{ ._, ._, .mov, .tmp2d, .sa(.src0, .add_bit_size), ._, ._ },
124942 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
124943 } },
124944 }, .{
124945 .required_cc_abi = .sysv64,
125664 .required_features = .{ .@"64bit", .sse, null, null },124946 .required_features = .{ .@"64bit", .sse, null, null },
125665 .src_constraints = .{ .{ .remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },124947 .src_constraints = .{ .{ .remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
125666 .dst_constraints = .{ .{ .float = .xword }, .any },124948 .dst_constraints = .{ .{ .float = .xword }, .any },
...@@ -125689,6 +124971,37 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125689,6 +124971,37 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125689 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },124971 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
125690 } },124972 } },
125691 }, .{124973 }, .{
124974 .required_cc_abi = .win64,
124975 .required_features = .{ .@"64bit", null, null, null },
124976 .src_constraints = .{ .{ .remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
124977 .dst_constraints = .{ .{ .float = .xword }, .any },
124978 .patterns = &.{
124979 .{ .src = .{ .to_mem, .none, .none } },
124980 },
124981 .call_frame = .{ .alignment = .@"16" },
124982 .extra_temps = .{
124983 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
124984 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
124985 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
124986 .{ .type = .usize, .kind = .{ .extern_func = "__floatuneitf" } },
124987 .unused,
124988 .unused,
124989 .unused,
124990 .unused,
124991 .unused,
124992 .unused,
124993 .unused,
124994 },
124995 .dst_temps = .{ .mem, .unused },
124996 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
124997 .each = .{ .once = &.{
124998 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
124999 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
125000 .{ ._, ._, .mov, .tmp2d, .sa(.src0, .add_bit_size), ._, ._ },
125001 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125002 } },
125003 }, .{
125004 .required_cc_abi = .sysv64,
125692 .required_features = .{ .avx, .slow_incdec, null, null },125005 .required_features = .{ .avx, .slow_incdec, null, null },
125693 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },125006 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125694 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125007 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -125722,6 +125035,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125722,6 +125035,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125722 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125035 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125723 } },125036 } },
125724 }, .{125037 }, .{
125038 .required_cc_abi = .sysv64,
125725 .required_features = .{ .avx, null, null, null },125039 .required_features = .{ .avx, null, null, null },
125726 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },125040 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125727 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125041 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -125749,13 +125063,150 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125749,13 +125063,150 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125749 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125063 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125750 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125064 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125751 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125065 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125752 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125066 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125067 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125068 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
125069 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
125070 } },
125071 }, .{
125072 .required_cc_abi = .sysv64,
125073 .required_features = .{ .sse2, .slow_incdec, null, null },
125074 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125075 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125076 .patterns = &.{
125077 .{ .src = .{ .to_mem, .none, .none } },
125078 },
125079 .call_frame = .{ .alignment = .@"16" },
125080 .extra_temps = .{
125081 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125082 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125083 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125084 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125085 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125086 .unused,
125087 .unused,
125088 .unused,
125089 .unused,
125090 .unused,
125091 .unused,
125092 },
125093 .dst_temps = .{ .mem, .unused },
125094 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125095 .each = .{ .once = &.{
125096 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125097 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125098 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125099 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125100 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125101 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125102 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
125103 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125104 } },
125105 }, .{
125106 .required_cc_abi = .sysv64,
125107 .required_features = .{ .sse2, null, null, null },
125108 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125109 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125110 .patterns = &.{
125111 .{ .src = .{ .to_mem, .none, .none } },
125112 },
125113 .call_frame = .{ .alignment = .@"16" },
125114 .extra_temps = .{
125115 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125116 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125117 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125118 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125119 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125120 .unused,
125121 .unused,
125122 .unused,
125123 .unused,
125124 .unused,
125125 .unused,
125126 },
125127 .dst_temps = .{ .mem, .unused },
125128 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125129 .each = .{ .once = &.{
125130 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125131 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125132 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125133 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125134 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125135 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125136 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
125137 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
125138 } },
125139 }, .{
125140 .required_cc_abi = .sysv64,
125141 .required_features = .{ .sse, .slow_incdec, null, null },
125142 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125143 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125144 .patterns = &.{
125145 .{ .src = .{ .to_mem, .none, .none } },
125146 },
125147 .call_frame = .{ .alignment = .@"16" },
125148 .extra_temps = .{
125149 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125150 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125151 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125152 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125153 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125154 .unused,
125155 .unused,
125156 .unused,
125157 .unused,
125158 .unused,
125159 .unused,
125160 },
125161 .dst_temps = .{ .mem, .unused },
125162 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125163 .each = .{ .once = &.{
125164 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125165 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125166 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125167 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125168 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },
125169 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125170 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
125171 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125172 } },
125173 }, .{
125174 .required_cc_abi = .sysv64,
125175 .required_features = .{ .sse, null, null, null },
125176 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125177 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125178 .patterns = &.{
125179 .{ .src = .{ .to_mem, .none, .none } },
125180 },
125181 .call_frame = .{ .alignment = .@"16" },
125182 .extra_temps = .{
125183 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125184 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125185 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125186 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125187 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125188 .unused,
125189 .unused,
125190 .unused,
125191 .unused,
125192 .unused,
125193 .unused,
125194 },
125195 .dst_temps = .{ .mem, .unused },
125196 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125197 .each = .{ .once = &.{
125198 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125199 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125200 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125201 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125202 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },
125753 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125203 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125754 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },125204 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
125755 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },125205 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
125756 } },125206 } },
125757 }, .{125207 }, .{
125758 .required_features = .{ .sse2, .slow_incdec, null, null },125208 .required_cc_abi = .win64,
125209 .required_features = .{ .slow_incdec, null, null, null },
125759 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },125210 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125760 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125211 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125761 .patterns = &.{125212 .patterns = &.{
...@@ -125765,9 +125216,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125765,9 +125216,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125765 .extra_temps = .{125216 .extra_temps = .{
125766 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },125217 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125767 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },125218 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125768 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },125219 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125220 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
125769 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },125221 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125770 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125771 .unused,125222 .unused,
125772 .unused,125223 .unused,
125773 .unused,125224 .unused,
...@@ -125780,15 +125231,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125780,15 +125231,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125780 .each = .{ .once = &.{125231 .each = .{ .once = &.{
125781 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },125232 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125782 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125233 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125783 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125234 .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ },
125784 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125235 .{ ._, ._, .movsx, .tmp3d, .memi(.src0b, .tmp0), ._, ._ },
125785 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125236 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
125786 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125237 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125787 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },125238 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
125788 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125239 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125789 } },125240 } },
125790 }, .{125241 }, .{
125791 .required_features = .{ .sse2, null, null, null },125242 .required_cc_abi = .win64,
125792 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },125243 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125793 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125244 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125794 .patterns = &.{125245 .patterns = &.{
...@@ -125798,9 +125249,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125798,9 +125249,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125798 .extra_temps = .{125249 .extra_temps = .{
125799 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },125250 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125800 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },125251 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125801 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },125252 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125253 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
125802 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },125254 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125803 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125804 .unused,125255 .unused,
125805 .unused,125256 .unused,
125806 .unused,125257 .unused,
...@@ -125813,16 +125264,17 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125813,16 +125264,17 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125813 .each = .{ .once = &.{125264 .each = .{ .once = &.{
125814 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },125265 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125815 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125266 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125816 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125267 .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ },
125817 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125268 .{ ._, ._, .movsx, .tmp3d, .memi(.src0b, .tmp0), ._, ._ },
125818 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125269 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
125819 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125270 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125820 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },125271 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
125821 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },125272 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
125822 } },125273 } },
125823 }, .{125274 }, .{
125824 .required_features = .{ .sse, .slow_incdec, null, null },125275 .required_cc_abi = .sysv64,
125825 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },125276 .required_features = .{ .avx, .slow_incdec, null, null },
125277 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125826 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125278 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125827 .patterns = &.{125279 .patterns = &.{
125828 .{ .src = .{ .to_mem, .none, .none } },125280 .{ .src = .{ .to_mem, .none, .none } },
...@@ -125831,8 +125283,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125831,8 +125283,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125831 .extra_temps = .{125283 .extra_temps = .{
125832 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },125284 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125833 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },125285 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125834 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },125286 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125835 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },125287 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
125836 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },125288 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125837 .unused,125289 .unused,
125838 .unused,125290 .unused,
...@@ -125846,16 +125298,17 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125846,16 +125298,17 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125846 .each = .{ .once = &.{125298 .each = .{ .once = &.{
125847 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },125299 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125848 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125300 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125849 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125301 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125850 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125302 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125851 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },125303 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125852 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125304 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125853 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },125305 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
125854 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125306 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125855 } },125307 } },
125856 }, .{125308 }, .{
125857 .required_features = .{ .sse, null, null, null },125309 .required_cc_abi = .sysv64,
125858 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .byte, .is = .byte } }, .any, .any },125310 .required_features = .{ .avx, null, null, null },
125311 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125859 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125312 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125860 .patterns = &.{125313 .patterns = &.{
125861 .{ .src = .{ .to_mem, .none, .none } },125314 .{ .src = .{ .to_mem, .none, .none } },
...@@ -125864,8 +125317,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125864,8 +125317,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125864 .extra_temps = .{125317 .extra_temps = .{
125865 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },125318 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125866 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },125319 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
125867 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },125320 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125868 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },125321 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
125869 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },125322 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125870 .unused,125323 .unused,
125871 .unused,125324 .unused,
...@@ -125879,15 +125332,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125879,15 +125332,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125879 .each = .{ .once = &.{125332 .each = .{ .once = &.{
125880 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },125333 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
125881 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125334 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125882 .{ .@"0:", ._, .movsx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125335 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125883 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125336 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125884 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },125337 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125885 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125338 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125886 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },125339 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
125887 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },125340 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
125888 } },125341 } },
125889 }, .{125342 }, .{
125890 .required_features = .{ .avx, .slow_incdec, null, null },125343 .required_cc_abi = .sysv64,
125344 .required_features = .{ .sse2, .slow_incdec, null, null },
125891 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },125345 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125892 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125346 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125893 .patterns = &.{125347 .patterns = &.{
...@@ -125914,13 +125368,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125914,13 +125368,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125914 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125368 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125915 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125369 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125916 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125370 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125917 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125371 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125918 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125372 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125919 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },125373 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
125920 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125374 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125921 } },125375 } },
125922 }, .{125376 }, .{
125923 .required_features = .{ .avx, null, null, null },125377 .required_cc_abi = .sysv64,
125378 .required_features = .{ .sse2, null, null, null },
125924 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },125379 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125925 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125380 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125926 .patterns = &.{125381 .patterns = &.{
...@@ -125947,13 +125402,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125947,13 +125402,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125947 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125402 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125948 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125403 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125949 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125404 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125950 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125405 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },
125951 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125406 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125952 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },125407 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
125953 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },125408 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
125954 } },125409 } },
125955 }, .{125410 }, .{
125956 .required_features = .{ .sse2, .slow_incdec, null, null },125411 .required_cc_abi = .sysv64,
125412 .required_features = .{ .sse, .slow_incdec, null, null },
125957 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },125413 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125958 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125414 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125959 .patterns = &.{125415 .patterns = &.{
...@@ -125980,13 +125436,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -125980,13 +125436,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
125980 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125436 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
125981 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125437 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
125982 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125438 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125983 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125439 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },
125984 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125440 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
125985 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },125441 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
125986 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125442 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125987 } },125443 } },
125988 }, .{125444 }, .{
125989 .required_features = .{ .sse2, null, null, null },125445 .required_cc_abi = .sysv64,
125446 .required_features = .{ .sse, null, null, null },
125990 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },125447 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
125991 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125448 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125992 .patterns = &.{125449 .patterns = &.{
...@@ -126013,13 +125470,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126013,13 +125470,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126013 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125470 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
126014 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125471 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },
126015 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125472 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
126016 .{ ._, ._dqa, .mov, .lea(.tmp1x), .tmp4x, ._, ._ },125473 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },
126017 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125474 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
126018 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },125475 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
126019 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },125476 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
126020 } },125477 } },
126021 }, .{125478 }, .{
126022 .required_features = .{ .sse, .slow_incdec, null, null },125479 .required_cc_abi = .win64,
125480 .required_features = .{ .slow_incdec, null, null, null },
126023 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },125481 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
126024 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125482 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126025 .patterns = &.{125483 .patterns = &.{
...@@ -126029,9 +125487,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126029,9 +125487,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126029 .extra_temps = .{125487 .extra_temps = .{
126030 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },125488 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126031 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },125489 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
126032 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },125490 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125491 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126033 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },125492 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
126034 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126035 .unused,125493 .unused,
126036 .unused,125494 .unused,
126037 .unused,125495 .unused,
...@@ -126044,15 +125502,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126044,15 +125502,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126044 .each = .{ .once = &.{125502 .each = .{ .once = &.{
126045 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },125503 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
126046 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125504 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
126047 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125505 .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ },
126048 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125506 .{ ._, ._, .movzx, .tmp3d, .memi(.src0b, .tmp0), ._, ._ },
126049 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },125507 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
126050 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125508 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
126051 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },125509 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
126052 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125510 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126053 } },125511 } },
126054 }, .{125512 }, .{
126055 .required_features = .{ .sse, null, null, null },125513 .required_cc_abi = .win64,
126056 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },125514 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .byte, .is = .byte } }, .any, .any },
126057 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125515 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126058 .patterns = &.{125516 .patterns = &.{
...@@ -126062,9 +125520,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126062,9 +125520,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126062 .extra_temps = .{125520 .extra_temps = .{
126063 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },125521 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126064 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },125522 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
126065 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },125523 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125524 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126066 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },125525 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
126067 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126068 .unused,125526 .unused,
126069 .unused,125527 .unused,
126070 .unused,125528 .unused,
...@@ -126077,14 +125535,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126077,14 +125535,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126077 .each = .{ .once = &.{125535 .each = .{ .once = &.{
126078 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },125536 .{ ._, ._, .mov, .tmp0d, .sia(-1, .src0, .add_unaligned_size), ._, ._ },
126079 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },125537 .{ ._, ._, .lea, .tmp1p, .memad(.dst0, .add_unaligned_size, -16), ._, ._ },
126080 .{ .@"0:", ._, .movzx, .tmp2d, .memi(.src0b, .tmp0), ._, ._ },125538 .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ },
126081 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },125539 .{ ._, ._, .movzx, .tmp3d, .memi(.src0b, .tmp0), ._, ._ },
126082 .{ ._, ._ps, .mova, .lea(.tmp1x), .tmp4x, ._, ._ },125540 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
126083 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },125541 .{ ._, ._, .lea, .tmp1p, .lead(.tmp1, -16), ._, ._ },
126084 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },125542 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
126085 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },125543 .{ ._, ._ns, .j, .@"0b", ._, ._, ._ },
126086 } },125544 } },
126087 }, .{125545 }, .{
125546 .required_cc_abi = .sysv64,
126088 .required_features = .{ .avx, null, null, null },125547 .required_features = .{ .avx, null, null, null },
126089 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },125548 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },
126090 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125549 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126116,6 +125575,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126116,6 +125575,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126116 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125575 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126117 } },125576 } },
126118 }, .{125577 }, .{
125578 .required_cc_abi = .sysv64,
126119 .required_features = .{ .sse2, null, null, null },125579 .required_features = .{ .sse2, null, null, null },
126120 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },125580 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },
126121 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125581 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126147,6 +125607,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126147,6 +125607,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126147 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125607 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126148 } },125608 } },
126149 }, .{125609 }, .{
125610 .required_cc_abi = .sysv64,
126150 .required_features = .{ .sse, null, null, null },125611 .required_features = .{ .sse, null, null, null },
126151 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },125612 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },
126152 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125613 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126178,6 +125639,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126178,6 +125639,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126178 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125639 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126179 } },125640 } },
126180 }, .{125641 }, .{
125642 .required_cc_abi = .win64,
125643 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .word, .is = .word } }, .any, .any },
125644 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125645 .patterns = &.{
125646 .{ .src = .{ .to_mem, .none, .none } },
125647 },
125648 .call_frame = .{ .alignment = .@"16" },
125649 .extra_temps = .{
125650 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125651 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125652 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
125653 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125654 .unused,
125655 .unused,
125656 .unused,
125657 .unused,
125658 .unused,
125659 .unused,
125660 .unused,
125661 },
125662 .dst_temps = .{ .mem, .unused },
125663 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125664 .each = .{ .once = &.{
125665 .{ ._, ._, .mov, .tmp0d, .sia(-2, .src0, .add_unaligned_size), ._, ._ },
125666 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"8", .tmp0), ._, ._ },
125667 .{ ._, ._, .movsx, .tmp2d, .memi(.src0w, .tmp0), ._, ._ },
125668 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125669 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },
125670 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125671 } },
125672 }, .{
125673 .required_cc_abi = .sysv64,
126181 .required_features = .{ .avx, null, null, null },125674 .required_features = .{ .avx, null, null, null },
126182 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },125675 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },
126183 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125676 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126209,6 +125702,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126209,6 +125702,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126209 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125702 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126210 } },125703 } },
126211 }, .{125704 }, .{
125705 .required_cc_abi = .sysv64,
126212 .required_features = .{ .sse2, null, null, null },125706 .required_features = .{ .sse2, null, null, null },
126213 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },125707 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },
126214 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125708 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126240,6 +125734,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126240,6 +125734,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126240 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125734 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126241 } },125735 } },
126242 }, .{125736 }, .{
125737 .required_cc_abi = .sysv64,
126243 .required_features = .{ .sse, null, null, null },125738 .required_features = .{ .sse, null, null, null },
126244 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },125739 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },
126245 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125740 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126271,6 +125766,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126271,6 +125766,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126271 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125766 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126272 } },125767 } },
126273 }, .{125768 }, .{
125769 .required_cc_abi = .win64,
125770 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .word, .is = .word } }, .any, .any },
125771 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125772 .patterns = &.{
125773 .{ .src = .{ .to_mem, .none, .none } },
125774 },
125775 .call_frame = .{ .alignment = .@"16" },
125776 .extra_temps = .{
125777 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125778 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125779 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
125780 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
125781 .unused,
125782 .unused,
125783 .unused,
125784 .unused,
125785 .unused,
125786 .unused,
125787 .unused,
125788 },
125789 .dst_temps = .{ .mem, .unused },
125790 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125791 .each = .{ .once = &.{
125792 .{ ._, ._, .mov, .tmp0d, .sia(-2, .src0, .add_unaligned_size), ._, ._ },
125793 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"8", .tmp0), ._, ._ },
125794 .{ ._, ._, .movzx, .tmp2d, .memi(.src0w, .tmp0), ._, ._ },
125795 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125796 .{ ._, ._, .sub, .tmp0d, .si(2), ._, ._ },
125797 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125798 } },
125799 }, .{
125800 .required_cc_abi = .sysv64,
126274 .required_features = .{ .avx, null, null, null },125801 .required_features = .{ .avx, null, null, null },
126275 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },125802 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126276 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125803 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126302,6 +125829,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126302,6 +125829,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126302 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125829 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126303 } },125830 } },
126304 }, .{125831 }, .{
125832 .required_cc_abi = .sysv64,
126305 .required_features = .{ .sse2, null, null, null },125833 .required_features = .{ .sse2, null, null, null },
126306 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },125834 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126307 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125835 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126333,6 +125861,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126333,6 +125861,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126333 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125861 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126334 } },125862 } },
126335 }, .{125863 }, .{
125864 .required_cc_abi = .sysv64,
126336 .required_features = .{ .sse, null, null, null },125865 .required_features = .{ .sse, null, null, null },
126337 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },125866 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126338 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125867 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126364,6 +125893,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126364,6 +125893,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126364 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125893 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126365 } },125894 } },
126366 }, .{125895 }, .{
125896 .required_cc_abi = .win64,
125897 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
125898 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
125899 .patterns = &.{
125900 .{ .src = .{ .to_mem, .none, .none } },
125901 },
125902 .call_frame = .{ .alignment = .@"16" },
125903 .extra_temps = .{
125904 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
125905 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
125906 .{ .type = .i32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
125907 .{ .type = .usize, .kind = .{ .extern_func = "__floatsitf" } },
125908 .unused,
125909 .unused,
125910 .unused,
125911 .unused,
125912 .unused,
125913 .unused,
125914 .unused,
125915 },
125916 .dst_temps = .{ .mem, .unused },
125917 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
125918 .each = .{ .once = &.{
125919 .{ ._, ._, .mov, .tmp0d, .sia(-4, .src0, .add_unaligned_size), ._, ._ },
125920 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"4", .tmp0), ._, ._ },
125921 .{ ._, ._, .mov, .tmp2d, .memi(.src0d, .tmp0), ._, ._ },
125922 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
125923 .{ ._, ._, .sub, .tmp0d, .si(4), ._, ._ },
125924 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
125925 } },
125926 }, .{
125927 .required_cc_abi = .sysv64,
126367 .required_features = .{ .avx, null, null, null },125928 .required_features = .{ .avx, null, null, null },
126368 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },125929 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126369 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125930 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126395,6 +125956,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126395,6 +125956,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126395 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125956 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126396 } },125957 } },
126397 }, .{125958 }, .{
125959 .required_cc_abi = .sysv64,
126398 .required_features = .{ .sse2, null, null, null },125960 .required_features = .{ .sse2, null, null, null },
126399 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },125961 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126400 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125962 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126426,6 +125988,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126426,6 +125988,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126426 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },125988 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126427 } },125989 } },
126428 }, .{125990 }, .{
125991 .required_cc_abi = .sysv64,
126429 .required_features = .{ .sse, null, null, null },125992 .required_features = .{ .sse, null, null, null },
126430 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },125993 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126431 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },125994 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126457,6 +126020,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126457,6 +126020,38 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126457 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126020 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126458 } },126021 } },
126459 }, .{126022 }, .{
126023 .required_cc_abi = .win64,
126024 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126025 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126026 .patterns = &.{
126027 .{ .src = .{ .to_mem, .none, .none } },
126028 },
126029 .call_frame = .{ .alignment = .@"16" },
126030 .extra_temps = .{
126031 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126032 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126033 .{ .type = .u32, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126034 .{ .type = .usize, .kind = .{ .extern_func = "__floatunsitf" } },
126035 .unused,
126036 .unused,
126037 .unused,
126038 .unused,
126039 .unused,
126040 .unused,
126041 .unused,
126042 },
126043 .dst_temps = .{ .mem, .unused },
126044 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126045 .each = .{ .once = &.{
126046 .{ ._, ._, .mov, .tmp0d, .sia(-4, .src0, .add_unaligned_size), ._, ._ },
126047 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"4", .tmp0), ._, ._ },
126048 .{ ._, ._, .mov, .tmp2d, .memi(.src0d, .tmp0), ._, ._ },
126049 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
126050 .{ ._, ._, .sub, .tmp0d, .si(4), ._, ._ },
126051 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126052 } },
126053 }, .{
126054 .required_cc_abi = .sysv64,
126460 .required_features = .{ .@"64bit", .avx, null, null },126055 .required_features = .{ .@"64bit", .avx, null, null },
126461 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },126056 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126462 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126057 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126483,12 +126078,45 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126483,12 +126078,45 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126483 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },126078 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
126484 .{ .@"0:", ._, .mov, .tmp1q, .memi(.src0q, .tmp0), ._, ._ },126079 .{ .@"0:", ._, .mov, .tmp1q, .memi(.src0q, .tmp0), ._, ._ },
126485 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126080 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126486 .{ ._, .v_dqa, .mov, .memsi(.dst0x, .@"2", .tmp0), .tmp3x, ._, ._ },126081 .{ ._, .v_dqa, .mov, .memsi(.dst0x, .@"2", .tmp0), .tmp3x, ._, ._ },
126082 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
126083 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126084 } },
126085 }, .{
126086 .required_cc_abi = .sysv64,
126087 .required_features = .{ .@"64bit", .sse2, null, null },
126088 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126089 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126090 .patterns = &.{
126091 .{ .src = .{ .to_mem, .none, .none } },
126092 },
126093 .call_frame = .{ .alignment = .@"16" },
126094 .extra_temps = .{
126095 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126096 .{ .type = .i64, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126097 .{ .type = .usize, .kind = .{ .extern_func = "__floatditf" } },
126098 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126099 .unused,
126100 .unused,
126101 .unused,
126102 .unused,
126103 .unused,
126104 .unused,
126105 .unused,
126106 },
126107 .dst_temps = .{ .mem, .unused },
126108 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126109 .each = .{ .once = &.{
126110 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
126111 .{ .@"0:", ._, .mov, .tmp1q, .memi(.src0q, .tmp0), ._, ._ },
126112 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126113 .{ ._, ._dqa, .mov, .memsi(.dst0x, .@"2", .tmp0), .tmp3x, ._, ._ },
126487 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },126114 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
126488 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126115 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126489 } },126116 } },
126490 }, .{126117 }, .{
126491 .required_features = .{ .@"64bit", .sse2, null, null },126118 .required_cc_abi = .sysv64,
126119 .required_features = .{ .@"64bit", .sse, null, null },
126492 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },126120 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126493 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126121 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126494 .patterns = &.{126122 .patterns = &.{
...@@ -126514,12 +126142,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126514,12 +126142,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126514 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },126142 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
126515 .{ .@"0:", ._, .mov, .tmp1q, .memi(.src0q, .tmp0), ._, ._ },126143 .{ .@"0:", ._, .mov, .tmp1q, .memi(.src0q, .tmp0), ._, ._ },
126516 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126144 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126517 .{ ._, ._dqa, .mov, .memsi(.dst0x, .@"2", .tmp0), .tmp3x, ._, ._ },126145 .{ ._, ._ps, .mova, .memsi(.dst0x, .@"2", .tmp0), .tmp3x, ._, ._ },
126518 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },126146 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
126519 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126147 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126520 } },126148 } },
126521 }, .{126149 }, .{
126522 .required_features = .{ .@"64bit", .sse, null, null },126150 .required_cc_abi = .win64,
126151 .required_features = .{ .@"64bit", null, null, null },
126523 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },126152 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126524 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126153 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126525 .patterns = &.{126154 .patterns = &.{
...@@ -126528,9 +126157,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126528,9 +126157,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126528 .call_frame = .{ .alignment = .@"16" },126157 .call_frame = .{ .alignment = .@"16" },
126529 .extra_temps = .{126158 .extra_temps = .{
126530 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126159 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126531 .{ .type = .i64, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },126160 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126161 .{ .type = .i64, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126532 .{ .type = .usize, .kind = .{ .extern_func = "__floatditf" } },126162 .{ .type = .usize, .kind = .{ .extern_func = "__floatditf" } },
126533 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126534 .unused,126163 .unused,
126535 .unused,126164 .unused,
126536 .unused,126165 .unused,
...@@ -126543,13 +126172,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126543,13 +126172,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126543 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126172 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126544 .each = .{ .once = &.{126173 .each = .{ .once = &.{
126545 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },126174 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
126546 .{ .@"0:", ._, .mov, .tmp1q, .memi(.src0q, .tmp0), ._, ._ },126175 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"2", .tmp0), ._, ._ },
126547 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126176 .{ ._, ._, .mov, .tmp2q, .memi(.src0q, .tmp0), ._, ._ },
126548 .{ ._, ._ps, .mova, .memsi(.dst0x, .@"2", .tmp0), .tmp3x, ._, ._ },126177 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
126549 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },126178 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
126550 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126179 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126551 } },126180 } },
126552 }, .{126181 }, .{
126182 .required_cc_abi = .sysv64,
126553 .required_features = .{ .@"64bit", .avx, null, null },126183 .required_features = .{ .@"64bit", .avx, null, null },
126554 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },126184 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126555 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126185 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126581,6 +126211,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126581,6 +126211,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126581 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126211 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126582 } },126212 } },
126583 }, .{126213 }, .{
126214 .required_cc_abi = .sysv64,
126584 .required_features = .{ .@"64bit", .sse2, null, null },126215 .required_features = .{ .@"64bit", .sse2, null, null },
126585 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },126216 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126586 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126217 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126612,6 +126243,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126612,6 +126243,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126612 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126243 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126613 } },126244 } },
126614 }, .{126245 }, .{
126246 .required_cc_abi = .sysv64,
126615 .required_features = .{ .@"64bit", .sse, null, null },126247 .required_features = .{ .@"64bit", .sse, null, null },
126616 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },126248 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126617 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126249 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126643,9 +126275,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126643,9 +126275,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126643 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126275 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126644 } },126276 } },
126645 }, .{126277 }, .{
126646 .required_cc_abi = .sysv64,126278 .required_cc_abi = .win64,
126647 .required_features = .{ .avx, null, null, null },126279 .required_features = .{ .@"64bit", null, null, null },
126648 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },126280 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .qword, .is = .qword } }, .any, .any },
126649 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126281 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126650 .patterns = &.{126282 .patterns = &.{
126651 .{ .src = .{ .to_mem, .none, .none } },126283 .{ .src = .{ .to_mem, .none, .none } },
...@@ -126653,9 +126285,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126653,9 +126285,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126653 .call_frame = .{ .alignment = .@"16" },126285 .call_frame = .{ .alignment = .@"16" },
126654 .extra_temps = .{126286 .extra_temps = .{
126655 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126287 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126656 .{ .type = .i128, .kind = .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } } },126288 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126657 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },126289 .{ .type = .u64, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126658 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },126290 .{ .type = .usize, .kind = .{ .extern_func = "__floatunditf" } },
126659 .unused,126291 .unused,
126660 .unused,126292 .unused,
126661 .unused,126293 .unused,
...@@ -126667,16 +126299,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126667,16 +126299,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126667 .dst_temps = .{ .mem, .unused },126299 .dst_temps = .{ .mem, .unused },
126668 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126300 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126669 .each = .{ .once = &.{126301 .each = .{ .once = &.{
126670 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },126302 .{ ._, ._, .mov, .tmp0d, .sia(-8, .src0, .add_unaligned_size), ._, ._ },
126671 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },126303 .{ .@"0:", ._, .lea, .tmp1p, .memsi(.dst0, .@"2", .tmp0), ._, ._ },
126672 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },126304 .{ ._, ._, .mov, .tmp2q, .memi(.src0q, .tmp0), ._, ._ },
126673 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126305 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
126674 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },126306 .{ ._, ._, .sub, .tmp0d, .si(8), ._, ._ },
126675 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126676 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126307 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126677 } },126308 } },
126678 }, .{126309 }, .{
126679 .required_cc_abi = .win64,126310 .required_cc_abi = .sysv64,
126680 .required_features = .{ .avx, null, null, null },126311 .required_features = .{ .avx, null, null, null },
126681 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },126312 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126682 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126313 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126686,7 +126317,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126686,7 +126317,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126686 .call_frame = .{ .alignment = .@"16" },126317 .call_frame = .{ .alignment = .@"16" },
126687 .extra_temps = .{126318 .extra_temps = .{
126688 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126319 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126689 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },126320 .{ .type = .i128, .kind = .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126690 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },126321 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },
126691 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },126322 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126692 .unused,126323 .unused,
...@@ -126701,7 +126332,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126701,7 +126332,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126701 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126332 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126702 .each = .{ .once = &.{126333 .each = .{ .once = &.{
126703 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },126334 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
126704 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },126335 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },
126336 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },
126705 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126337 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126706 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },126338 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126707 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126339 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
...@@ -126741,8 +126373,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126741,8 +126373,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126741 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126373 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126742 } },126374 } },
126743 }, .{126375 }, .{
126744 .required_cc_abi = .win64,126376 .required_cc_abi = .sysv64,
126745 .required_features = .{ .sse2, null, null, null },126377 .required_features = .{ .sse, null, null, null },
126746 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },126378 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126747 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126379 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126748 .patterns = &.{126380 .patterns = &.{
...@@ -126751,7 +126383,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126751,7 +126383,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126751 .call_frame = .{ .alignment = .@"16" },126383 .call_frame = .{ .alignment = .@"16" },
126752 .extra_temps = .{126384 .extra_temps = .{
126753 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126385 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126754 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },126386 .{ .type = .u128, .kind = .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126755 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },126387 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },
126756 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },126388 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126757 .unused,126389 .unused,
...@@ -126766,15 +126398,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126766,15 +126398,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126766 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126398 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126767 .each = .{ .once = &.{126399 .each = .{ .once = &.{
126768 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },126400 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
126769 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },126401 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },
126402 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },
126770 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126403 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126771 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },126404 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126772 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126405 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126773 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126406 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126774 } },126407 } },
126775 }, .{126408 }, .{
126776 .required_cc_abi = .sysv64,126409 .required_cc_abi = .win64,
126777 .required_features = .{ .sse, null, null, null },
126778 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },126410 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126779 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126411 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126780 .patterns = &.{126412 .patterns = &.{
...@@ -126783,9 +126415,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126783,9 +126415,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126783 .call_frame = .{ .alignment = .@"16" },126415 .call_frame = .{ .alignment = .@"16" },
126784 .extra_temps = .{126416 .extra_temps = .{
126785 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126417 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126786 .{ .type = .u128, .kind = .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } } },126418 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126419 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126787 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },126420 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },
126788 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126789 .unused,126421 .unused,
126790 .unused,126422 .unused,
126791 .unused,126423 .unused,
...@@ -126798,17 +126430,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126798,17 +126430,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126798 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126430 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126799 .each = .{ .once = &.{126431 .each = .{ .once = &.{
126800 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },126432 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
126801 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },126433 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
126802 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },126434 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
126803 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126435 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
126804 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126805 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126436 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126806 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126437 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126807 } },126438 } },
126808 }, .{126439 }, .{
126809 .required_cc_abi = .win64,126440 .required_cc_abi = .sysv64,
126810 .required_features = .{ .sse, null, null, null },126441 .required_features = .{ .avx, null, null, null },
126811 .src_constraints = .{ .{ .multiple_scalar_signed_int = .{ .of = .xword, .is = .xword } }, .any, .any },126442 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126812 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126443 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126813 .patterns = &.{126444 .patterns = &.{
126814 .{ .src = .{ .to_mem, .none, .none } },126445 .{ .src = .{ .to_mem, .none, .none } },
...@@ -126816,8 +126447,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126816,8 +126447,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126816 .call_frame = .{ .alignment = .@"16" },126447 .call_frame = .{ .alignment = .@"16" },
126817 .extra_temps = .{126448 .extra_temps = .{
126818 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126449 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126819 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },126450 .{ .type = .u128, .kind = .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126820 .{ .type = .usize, .kind = .{ .extern_func = "__floattitf" } },126451 .{ .type = .usize, .kind = .{ .extern_func = "__floatuntitf" } },
126821 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },126452 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126822 .unused,126453 .unused,
126823 .unused,126454 .unused,
...@@ -126831,14 +126462,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126831,14 +126462,16 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126831 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126462 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126832 .each = .{ .once = &.{126463 .each = .{ .once = &.{
126833 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },126464 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
126834 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },126465 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },
126466 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },
126835 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126467 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126836 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },126468 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126837 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126469 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126838 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126470 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126839 } },126471 } },
126840 }, .{126472 }, .{
126841 .required_features = .{ .avx, null, null, null },126473 .required_cc_abi = .sysv64,
126474 .required_features = .{ .sse2, null, null, null },
126842 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },126475 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126843 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126476 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126844 .patterns = &.{126477 .patterns = &.{
...@@ -126865,12 +126498,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126865,12 +126498,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126865 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },126498 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },
126866 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },126499 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },
126867 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126500 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126868 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },126501 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126869 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126502 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126870 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126503 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126871 } },126504 } },
126872 }, .{126505 }, .{
126873 .required_features = .{ .sse2, null, null, null },126506 .required_cc_abi = .sysv64,
126507 .required_features = .{ .sse, null, null, null },
126874 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },126508 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126875 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126509 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126876 .patterns = &.{126510 .patterns = &.{
...@@ -126897,12 +126531,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126897,12 +126531,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126897 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },126531 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },
126898 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },126532 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },
126899 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126533 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
126900 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },126534 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126901 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126535 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126902 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126536 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126903 } },126537 } },
126904 }, .{126538 }, .{
126905 .required_features = .{ .sse, null, null, null },126539 .required_cc_abi = .win64,
126906 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },126540 .src_constraints = .{ .{ .multiple_scalar_unsigned_int = .{ .of = .xword, .is = .xword } }, .any, .any },
126907 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126541 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126908 .patterns = &.{126542 .patterns = &.{
...@@ -126911,9 +126545,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126911,9 +126545,9 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126911 .call_frame = .{ .alignment = .@"16" },126545 .call_frame = .{ .alignment = .@"16" },
126912 .extra_temps = .{126546 .extra_temps = .{
126913 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126547 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126914 .{ .type = .u128, .kind = .{ .param_gpr_pair = .{ .cc = .ccc, .after = 0, .at = 0 } } },126548 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126549 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126915 .{ .type = .usize, .kind = .{ .extern_func = "__floatuntitf" } },126550 .{ .type = .usize, .kind = .{ .extern_func = "__floatuntitf" } },
126916 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126917 .unused,126551 .unused,
126918 .unused,126552 .unused,
126919 .unused,126553 .unused,
...@@ -126926,14 +126560,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126926,14 +126560,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126926 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },126560 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126927 .each = .{ .once = &.{126561 .each = .{ .once = &.{
126928 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },126562 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
126929 .{ .@"0:", ._, .mov, .tmp1q0, .memi(.src0q, .tmp0), ._, ._ },126563 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
126930 .{ ._, ._, .mov, .tmp1q1, .memid(.src0q, .tmp0, 8), ._, ._ },126564 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
126931 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },126565 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
126932 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp3x, ._, ._ },
126933 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },126566 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
126934 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126567 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126935 } },126568 } },
126936 }, .{126569 }, .{
126570 .required_cc_abi = .sysv64,
126937 .required_features = .{ .@"64bit", .avx, null, null },126571 .required_features = .{ .@"64bit", .avx, null, null },
126938 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },126572 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126939 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126573 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -126968,6 +126602,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -126968,6 +126602,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
126968 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126602 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126969 } },126603 } },
126970 }, .{126604 }, .{
126605 .required_cc_abi = .sysv64,
126971 .required_features = .{ .@"64bit", .sse2, null, null },126606 .required_features = .{ .@"64bit", .sse2, null, null },
126972 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },126607 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126973 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126608 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
...@@ -127002,41 +126637,148 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -127002,41 +126637,148 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
127002 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126637 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
127003 } },126638 } },
127004 }, .{126639 }, .{
126640 .required_cc_abi = .sysv64,
126641 .required_features = .{ .@"64bit", .sse, null, null },
126642 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126643 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126644 .patterns = &.{
126645 .{ .src = .{ .to_mem, .none, .none } },
126646 },
126647 .call_frame = .{ .alignment = .@"16" },
126648 .extra_temps = .{
126649 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
126650 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126651 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126652 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126653 .{ .type = .usize, .kind = .{ .extern_func = "__floateitf" } },
126654 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126655 .unused,
126656 .unused,
126657 .unused,
126658 .unused,
126659 .unused,
126660 },
126661 .dst_temps = .{ .mem, .unused },
126662 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126663 .each = .{ .once = &.{
126664 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
126665 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
126666 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },
126667 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },
126668 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
126669 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },
126670 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
126671 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
126672 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126673 } },
126674 }, .{
126675 .required_cc_abi = .win64,
126676 .required_features = .{ .@"64bit", null, null, null },
126677 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126678 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126679 .patterns = &.{
126680 .{ .src = .{ .to_mem, .none, .none } },
126681 },
126682 .call_frame = .{ .alignment = .@"16" },
126683 .extra_temps = .{
126684 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
126685 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126686 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126687 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126688 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
126689 .{ .type = .usize, .kind = .{ .extern_func = "__floateitf" } },
126690 .unused,
126691 .unused,
126692 .unused,
126693 .unused,
126694 .unused,
126695 },
126696 .dst_temps = .{ .mem, .unused },
126697 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126698 .each = .{ .once = &.{
126699 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
126700 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
126701 .{ .@"0:", ._, .lea, .tmp2p, .memi(.dst0, .tmp1), ._, ._ },
126702 .{ ._, ._, .mov, .tmp3p, .tmp0p, ._, ._ },
126703 .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_bit_size), ._, ._ },
126704 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
126705 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
126706 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
126707 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126708 } },
126709 }, .{
126710 .required_cc_abi = .sysv64,
126711 .required_features = .{ .@"64bit", .avx, null, null },
126712 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126713 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126714 .patterns = &.{
126715 .{ .src = .{ .to_mem, .none, .none } },
126716 },
126717 .call_frame = .{ .alignment = .@"16" },
126718 .extra_temps = .{
126719 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
126720 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126721 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126722 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126723 .{ .type = .usize, .kind = .{ .extern_func = "__floatuneitf" } },
126724 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126725 .unused,
126726 .unused,
126727 .unused,
126728 .unused,
126729 .unused,
126730 },
126731 .dst_temps = .{ .mem, .unused },
126732 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126733 .each = .{ .once = &.{
126734 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
126735 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
126736 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },
126737 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },
126738 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
126739 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },
126740 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
126741 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
126742 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126743 } },
126744 }, .{
126745 .required_cc_abi = .sysv64,
126746 .required_features = .{ .@"64bit", .sse2, null, null },
126747 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
126748 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
126749 .patterns = &.{
126750 .{ .src = .{ .to_mem, .none, .none } },
126751 },
126752 .call_frame = .{ .alignment = .@"16" },
126753 .extra_temps = .{
126754 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
126755 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
126756 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126757 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126758 .{ .type = .usize, .kind = .{ .extern_func = "__floatuneitf" } },
126759 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
126760 .unused,
126761 .unused,
126762 .unused,
126763 .unused,
126764 .unused,
126765 },
126766 .dst_temps = .{ .mem, .unused },
126767 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
126768 .each = .{ .once = &.{
126769 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
126770 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
126771 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },
126772 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },
126773 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
126774 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },
126775 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
126776 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
126777 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
126778 } },
126779 }, .{
126780 .required_cc_abi = .sysv64,
127005 .required_features = .{ .@"64bit", .sse, null, null },126781 .required_features = .{ .@"64bit", .sse, null, null },
127006 .src_constraints = .{ .{ .scalar_remainder_signed_int = .{ .of = .dword, .is = .dword } }, .any, .any },
127007 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
127008 .patterns = &.{
127009 .{ .src = .{ .to_mem, .none, .none } },
127010 },
127011 .call_frame = .{ .alignment = .@"16" },
127012 .extra_temps = .{
127013 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
127014 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
127015 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
127016 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
127017 .{ .type = .usize, .kind = .{ .extern_func = "__floateitf" } },
127018 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
127019 .unused,
127020 .unused,
127021 .unused,
127022 .unused,
127023 .unused,
127024 },
127025 .dst_temps = .{ .mem, .unused },
127026 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
127027 .each = .{ .once = &.{
127028 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
127029 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
127030 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },
127031 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },
127032 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
127033 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },
127034 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
127035 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
127036 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
127037 } },
127038 }, .{
127039 .required_features = .{ .@"64bit", .avx, null, null },
127040 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },126782 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
127041 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126783 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
127042 .patterns = &.{126784 .patterns = &.{
...@@ -127064,47 +126806,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -127064,47 +126806,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
127064 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },126806 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },
127065 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },126807 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },
127066 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },126808 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
127067 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },126809 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },
127068 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
127069 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
127070 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
127071 } },
127072 }, .{
127073 .required_features = .{ .@"64bit", .sse2, null, null },
127074 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
127075 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
127076 .patterns = &.{
127077 .{ .src = .{ .to_mem, .none, .none } },
127078 },
127079 .call_frame = .{ .alignment = .@"16" },
127080 .extra_temps = .{
127081 .{ .type = .usize, .kind = .{ .rc = .general_purpose } },
127082 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
127083 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
127084 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
127085 .{ .type = .usize, .kind = .{ .extern_func = "__floatuneitf" } },
127086 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
127087 .unused,
127088 .unused,
127089 .unused,
127090 .unused,
127091 .unused,
127092 },
127093 .dst_temps = .{ .mem, .unused },
127094 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
127095 .each = .{ .once = &.{
127096 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
127097 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
127098 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },
127099 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },
127100 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
127101 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },
127102 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },126810 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
127103 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },126811 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
127104 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126812 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
127105 } },126813 } },
127106 }, .{126814 }, .{
127107 .required_features = .{ .@"64bit", .sse, null, null },126815 .required_cc_abi = .win64,
126816 .required_features = .{ .@"64bit", null, null, null },
127108 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },126817 .src_constraints = .{ .{ .scalar_remainder_unsigned_int = .{ .of = .dword, .is = .dword } }, .any, .any },
127109 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },126818 .dst_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any },
127110 .patterns = &.{126819 .patterns = &.{
...@@ -127116,8 +126825,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -127116,8 +126825,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
127116 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },126825 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
127117 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },126826 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
127118 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },126827 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
126828 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
127119 .{ .type = .usize, .kind = .{ .extern_func = "__floatuneitf" } },126829 .{ .type = .usize, .kind = .{ .extern_func = "__floatuneitf" } },
127120 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
127121 .unused,126830 .unused,
127122 .unused,126831 .unused,
127123 .unused,126832 .unused,
...@@ -127129,10 +126838,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -127129,10 +126838,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
127129 .each = .{ .once = &.{126838 .each = .{ .once = &.{
127130 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },126839 .{ ._, ._, .lea, .tmp0p, .mema(.src0, .add_unaligned_size_sub_elem_size), ._, ._ },
127131 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },126840 .{ ._, ._, .mov, .tmp1d, .sia(-16, .dst0, .add_unaligned_size), ._, ._ },
127132 .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ },126841 .{ .@"0:", ._, .lea, .tmp2p, .memi(.dst0, .tmp1), ._, ._ },
127133 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ },126842 .{ ._, ._, .mov, .tmp3p, .tmp0p, ._, ._ },
127134 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },126843 .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_bit_size), ._, ._ },
127135 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp1), .tmp5x, ._, ._ },126844 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
127136 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },126845 .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .sub_src0_elem_size), ._, ._ },
127137 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },126846 .{ ._, ._, .sub, .tmp1d, .si(16), ._, ._ },
127138 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },126847 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
...@@ -132481,7 +132190,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -132481,7 +132190,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
132481 .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_size_div_8), ._, ._ },132190 .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_size_div_8), ._, ._ },
132482 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },132191 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },
132483 .{ .@"0:", ._, .mov, .tmp1d, .sia(-8, .dst0, .add_size), ._, ._ },132192 .{ .@"0:", ._, .mov, .tmp1d, .sia(-8, .dst0, .add_size), ._, ._ },
132484 .{ ._, ._, .lea, .tmp2q, .memi(.src0, .tmp0), ._, ._ },132193 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
132485 .{ .@"1:", ._, .mov, .tmp3q, .leai(.tmp2q, .tmp1), ._, ._ },132194 .{ .@"1:", ._, .mov, .tmp3q, .leai(.tmp2q, .tmp1), ._, ._ },
132486 .{ ._, ._, mir_tag, .memi(.dst0q, .tmp1), .tmp3q, ._, ._ },132195 .{ ._, ._, mir_tag, .memi(.dst0q, .tmp1), .tmp3q, ._, ._ },
132487 .{ ._, ._, .sub, .tmp1d, .si(8), ._, ._ },132196 .{ ._, ._, .sub, .tmp1d, .si(8), ._, ._ },
...@@ -142586,75 +142295,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -142586,75 +142295,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
142586 } },142295 } },
142587 }, .{142296 }, .{
142588 .required_cc_abi = .win64,142297 .required_cc_abi = .win64,
142589 .required_features = .{ .avx, null, null, null },
142590 .dst_constraints = .{ .{ .float = .xword }, .any },
142591 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
142592 .patterns = &.{
142593 .{ .src = .{ .to_mem, .none, .none } },
142594 },
142595 .call_frame = .{ .alignment = .@"16" },
142596 .extra_temps = .{
142597 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
142598 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
142599 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
142600 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
142601 .{ .type = .f128, .kind = .mem },
142602 .unused,
142603 .unused,
142604 .unused,
142605 .unused,
142606 .unused,
142607 .unused,
142608 },
142609 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
142610 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
142611 .each = .{ .once = &.{
142612 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
142613 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
142614 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
142615 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
142616 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
142617 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
142618 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
142619 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
142620 } },
142621 }, .{
142622 .required_cc_abi = .win64,
142623 .required_features = .{ .sse2, null, null, null },
142624 .dst_constraints = .{ .{ .float = .xword }, .any },
142625 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
142626 .patterns = &.{
142627 .{ .src = .{ .to_mem, .none, .none } },
142628 },
142629 .call_frame = .{ .alignment = .@"16" },
142630 .extra_temps = .{
142631 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
142632 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
142633 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
142634 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
142635 .{ .type = .f128, .kind = .mem },
142636 .unused,
142637 .unused,
142638 .unused,
142639 .unused,
142640 .unused,
142641 .unused,
142642 },
142643 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
142644 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
142645 .each = .{ .once = &.{
142646 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
142647 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
142648 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
142649 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
142650 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
142651 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
142652 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
142653 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
142654 } },
142655 }, .{
142656 .required_cc_abi = .win64,
142657 .required_features = .{ .sse2, null, null, null },
142658 .dst_constraints = .{ .{ .float = .xword }, .any },142298 .dst_constraints = .{ .{ .float = .xword }, .any },
142659 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },142299 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
142660 .patterns = &.{142300 .patterns = &.{
...@@ -142665,8 +142305,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -142665,8 +142305,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
142665 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },142305 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
142666 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },142306 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
142667 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },142307 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
142308 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
142668 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },142309 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
142669 .{ .type = .f128, .kind = .mem },
142670 .unused,142310 .unused,
142671 .unused,142311 .unused,
142672 .unused,142312 .unused,
...@@ -142674,15 +142314,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -142674,15 +142314,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
142674 .unused,142314 .unused,
142675 .unused,142315 .unused,
142676 },142316 },
142677 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },142317 .dst_temps = .{ .mem, .unused },
142678 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },142318 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
142679 .each = .{ .once = &.{142319 .each = .{ .once = &.{
142680 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },142320 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
142681 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },142321 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
142682 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },142322 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
142683 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },142323 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
142684 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },142324 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
142685 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },142325 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
142686 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },142326 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
142687 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },142327 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
142688 } },142328 } },
...@@ -152819,75 +152459,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -152819,75 +152459,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
152819 } },152459 } },
152820 }, .{152460 }, .{
152821 .required_cc_abi = .win64,152461 .required_cc_abi = .win64,
152822 .required_features = .{ .avx, null, null, null },
152823 .dst_constraints = .{ .{ .float = .xword }, .any },
152824 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
152825 .patterns = &.{
152826 .{ .src = .{ .to_mem, .none, .none } },
152827 },
152828 .call_frame = .{ .alignment = .@"16" },
152829 .extra_temps = .{
152830 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
152831 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
152832 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
152833 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
152834 .{ .type = .f128, .kind = .mem },
152835 .unused,
152836 .unused,
152837 .unused,
152838 .unused,
152839 .unused,
152840 .unused,
152841 },
152842 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
152843 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
152844 .each = .{ .once = &.{
152845 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
152846 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
152847 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
152848 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
152849 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
152850 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
152851 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
152852 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
152853 } },
152854 }, .{
152855 .required_cc_abi = .win64,
152856 .required_features = .{ .sse2, null, null, null },
152857 .dst_constraints = .{ .{ .float = .xword }, .any },
152858 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
152859 .patterns = &.{
152860 .{ .src = .{ .to_mem, .none, .none } },
152861 },
152862 .call_frame = .{ .alignment = .@"16" },
152863 .extra_temps = .{
152864 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
152865 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
152866 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
152867 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
152868 .{ .type = .f128, .kind = .mem },
152869 .unused,
152870 .unused,
152871 .unused,
152872 .unused,
152873 .unused,
152874 .unused,
152875 },
152876 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
152877 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
152878 .each = .{ .once = &.{
152879 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
152880 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
152881 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
152882 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
152883 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
152884 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
152885 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
152886 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
152887 } },
152888 }, .{
152889 .required_cc_abi = .win64,
152890 .required_features = .{ .sse2, null, null, null },
152891 .dst_constraints = .{ .{ .float = .xword }, .any },152462 .dst_constraints = .{ .{ .float = .xword }, .any },
152892 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },152463 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
152893 .patterns = &.{152464 .patterns = &.{
...@@ -152898,8 +152469,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -152898,8 +152469,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
152898 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },152469 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
152899 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },152470 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
152900 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },152471 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
152472 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
152901 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },152473 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
152902 .{ .type = .f128, .kind = .mem },
152903 .unused,152474 .unused,
152904 .unused,152475 .unused,
152905 .unused,152476 .unused,
...@@ -152907,15 +152478,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -152907,15 +152478,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
152907 .unused,152478 .unused,
152908 .unused,152479 .unused,
152909 },152480 },
152910 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },152481 .dst_temps = .{ .mem, .unused },
152911 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },152482 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
152912 .each = .{ .once = &.{152483 .each = .{ .once = &.{
152913 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },152484 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
152914 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },152485 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
152915 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },152486 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
152916 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },152487 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
152917 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },152488 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
152918 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },152489 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
152919 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },152490 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
152920 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },152491 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
152921 } },152492 } },
...@@ -156644,7 +156215,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -156644,7 +156215,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
156644 .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_size_div_8), ._, ._ },156215 .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_size_div_8), ._, ._ },
156645 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },156216 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },
156646 .{ .@"0:", ._, .mov, .tmp1p, .sa(.dst0, .sub_size_div_8), ._, ._ },156217 .{ .@"0:", ._, .mov, .tmp1p, .sa(.dst0, .sub_size_div_8), ._, ._ },
156647 .{ ._, ._, .lea, .tmp2q, .memi(.src0, .tmp0), ._, ._ },156218 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
156648 .{ ._, ._c, .cl, ._, ._, ._, ._ },156219 .{ ._, ._c, .cl, ._, ._, ._, ._ },
156649 .{ .@"1:", ._, .mov, .tmp3q, .leasia(.tmp2q, .@"8", .tmp1, .add_src0_elem_size), ._, ._ },156220 .{ .@"1:", ._, .mov, .tmp3q, .leasia(.tmp2q, .@"8", .tmp1, .add_src0_elem_size), ._, ._ },
156650 .{ ._, ._, .adc, .memsia(.dst0q, .@"8", .tmp1, .add_size), .tmp3q, ._, ._ },156221 .{ ._, ._, .adc, .memsia(.dst0q, .@"8", .tmp1, .add_size), .tmp3q, ._, ._ },
...@@ -157503,47 +157074,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -157503,47 +157074,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157503 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },157074 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
157504 .each = .{ .once = &.{157075 .each = .{ .once = &.{
157505 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },157076 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
157506 .{ ._, ._dqa, .mov, .dst0x, .mem(.src0x), ._, ._ },157077 .{ ._, ._dqa, .mov, .dst0x, .mem(.src0x), ._, ._ },
157507 .{ .@"0:", ._dqa, .mov, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },157078 .{ .@"0:", ._dqa, .mov, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },
157508 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
157509 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
157510 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
157511 } },
157512 }, .{
157513 .required_cc_abi = .sysv64,
157514 .required_features = .{ .sse, null, null, null },
157515 .dst_constraints = .{ .{ .float = .xword }, .any },
157516 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
157517 .patterns = &.{
157518 .{ .src = .{ .to_mem, .none, .none } },
157519 },
157520 .call_frame = .{ .alignment = .@"16" },
157521 .extra_temps = .{
157522 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
157523 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
157524 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
157525 .unused,
157526 .unused,
157527 .unused,
157528 .unused,
157529 .unused,
157530 .unused,
157531 .unused,
157532 .unused,
157533 },
157534 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
157535 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
157536 .each = .{ .once = &.{
157537 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
157538 .{ ._, ._ps, .mova, .dst0x, .mem(.src0x), ._, ._ },
157539 .{ .@"0:", ._ps, .mova, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },
157540 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },157079 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
157541 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },157080 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
157542 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },157081 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
157543 } },157082 } },
157544 }, .{157083 }, .{
157545 .required_cc_abi = .win64,157084 .required_cc_abi = .sysv64,
157546 .required_features = .{ .avx, null, null, null },157085 .required_features = .{ .sse, null, null, null },
157547 .dst_constraints = .{ .{ .float = .xword }, .any },157086 .dst_constraints = .{ .{ .float = .xword }, .any },
157548 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },157087 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
157549 .patterns = &.{157088 .patterns = &.{
...@@ -157552,47 +157091,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -157552,47 +157091,13 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157552 .call_frame = .{ .alignment = .@"16" },157091 .call_frame = .{ .alignment = .@"16" },
157553 .extra_temps = .{157092 .extra_temps = .{
157554 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },157093 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
157555 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },157094 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
157556 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
157557 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },157095 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
157558 .{ .type = .f128, .kind = .mem },
157559 .unused,
157560 .unused,157096 .unused,
157561 .unused,157097 .unused,
157562 .unused,157098 .unused,
157563 .unused,157099 .unused,
157564 .unused,157100 .unused,
157565 },
157566 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
157567 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
157568 .each = .{ .once = &.{
157569 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
157570 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
157571 .{ .@"0:", ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },
157572 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
157573 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
157574 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
157575 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
157576 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
157577 } },
157578 }, .{
157579 .required_cc_abi = .win64,
157580 .required_features = .{ .sse2, null, null, null },
157581 .dst_constraints = .{ .{ .float = .xword }, .any },
157582 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
157583 .patterns = &.{
157584 .{ .src = .{ .to_mem, .none, .none } },
157585 },
157586 .call_frame = .{ .alignment = .@"16" },
157587 .extra_temps = .{
157588 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
157589 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
157590 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
157591 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
157592 .{ .type = .f128, .kind = .mem },
157593 .unused,
157594 .unused,
157595 .unused,
157596 .unused,157101 .unused,
157597 .unused,157102 .unused,
157598 .unused,157103 .unused,
...@@ -157601,17 +157106,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -157601,17 +157106,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157601 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },157106 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
157602 .each = .{ .once = &.{157107 .each = .{ .once = &.{
157603 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },157108 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
157604 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },157109 .{ ._, ._ps, .mova, .dst0x, .mem(.src0x), ._, ._ },
157605 .{ .@"0:", ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },157110 .{ .@"0:", ._ps, .mova, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },
157606 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },157111 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
157607 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
157608 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
157609 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },157112 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
157610 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },157113 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
157611 } },157114 } },
157612 }, .{157115 }, .{
157613 .required_cc_abi = .win64,157116 .required_cc_abi = .win64,
157614 .required_features = .{ .sse, null, null, null },
157615 .dst_constraints = .{ .{ .float = .xword }, .any },157117 .dst_constraints = .{ .{ .float = .xword }, .any },
157616 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },157118 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
157617 .patterns = &.{157119 .patterns = &.{
...@@ -157622,8 +157124,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -157622,8 +157124,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157622 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },157124 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
157623 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },157125 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
157624 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },157126 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
157127 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
157625 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },157128 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
157626 .{ .type = .f128, .kind = .mem },
157627 .unused,157129 .unused,
157628 .unused,157130 .unused,
157629 .unused,157131 .unused,
...@@ -157631,15 +157133,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -157631,15 +157133,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
157631 .unused,157133 .unused,
157632 .unused,157134 .unused,
157633 },157135 },
157634 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },157136 .dst_temps = .{ .mem, .unused },
157635 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },157137 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
157636 .each = .{ .once = &.{157138 .each = .{ .once = &.{
157637 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },157139 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
157638 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },157140 .{ ._, ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
157639 .{ .@"0:", ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },157141 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
157640 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },157142 .{ ._, ._, .lea, .tmp3p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },
157641 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },157143 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
157642 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },157144 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
157643 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },157145 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
157644 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },157146 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
157645 } },157147 } },
...@@ -161226,75 +160728,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -161226,75 +160728,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
161226 } },160728 } },
161227 }, .{160729 }, .{
161228 .required_cc_abi = .win64,160730 .required_cc_abi = .win64,
161229 .required_features = .{ .avx, null, null, null },
161230 .dst_constraints = .{ .{ .float = .xword }, .any },
161231 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
161232 .patterns = &.{
161233 .{ .src = .{ .to_mem, .none, .none } },
161234 },
161235 .call_frame = .{ .alignment = .@"16" },
161236 .extra_temps = .{
161237 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
161238 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
161239 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
161240 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
161241 .{ .type = .f128, .kind = .mem },
161242 .unused,
161243 .unused,
161244 .unused,
161245 .unused,
161246 .unused,
161247 .unused,
161248 },
161249 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
161250 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
161251 .each = .{ .once = &.{
161252 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
161253 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
161254 .{ .@"0:", ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },
161255 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
161256 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
161257 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
161258 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
161259 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
161260 } },
161261 }, .{
161262 .required_cc_abi = .win64,
161263 .required_features = .{ .sse2, null, null, null },
161264 .dst_constraints = .{ .{ .float = .xword }, .any },
161265 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
161266 .patterns = &.{
161267 .{ .src = .{ .to_mem, .none, .none } },
161268 },
161269 .call_frame = .{ .alignment = .@"16" },
161270 .extra_temps = .{
161271 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
161272 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
161273 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
161274 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
161275 .{ .type = .f128, .kind = .mem },
161276 .unused,
161277 .unused,
161278 .unused,
161279 .unused,
161280 .unused,
161281 .unused,
161282 },
161283 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
161284 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
161285 .each = .{ .once = &.{
161286 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
161287 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
161288 .{ .@"0:", ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },
161289 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
161290 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
161291 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
161292 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
161293 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
161294 } },
161295 }, .{
161296 .required_cc_abi = .win64,
161297 .required_features = .{ .sse, null, null, null },
161298 .dst_constraints = .{ .{ .float = .xword }, .any },160731 .dst_constraints = .{ .{ .float = .xword }, .any },
161299 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },160732 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
161300 .patterns = &.{160733 .patterns = &.{
...@@ -161305,8 +160738,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -161305,8 +160738,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
161305 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },160738 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
161306 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },160739 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
161307 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },160740 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
160741 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
161308 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },160742 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
161309 .{ .type = .f128, .kind = .mem },
161310 .unused,160743 .unused,
161311 .unused,160744 .unused,
161312 .unused,160745 .unused,
...@@ -161314,15 +160747,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -161314,15 +160747,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
161314 .unused,160747 .unused,
161315 .unused,160748 .unused,
161316 },160749 },
161317 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },160750 .dst_temps = .{ .mem, .unused },
161318 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },160751 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
161319 .each = .{ .once = &.{160752 .each = .{ .once = &.{
161320 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },160753 .{ ._, ._, .mov, .tmp0p, .sia(16, .src0, .sub_unaligned_size), ._, ._ },
161321 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },160754 .{ ._, ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
161322 .{ .@"0:", ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },160755 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
161323 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },160756 .{ ._, ._, .lea, .tmp3p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ },
161324 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },160757 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
161325 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },160758 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
161326 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },160759 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
161327 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },160760 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
161328 } },160761 } },
...@@ -163053,75 +162486,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -163053,75 +162486,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
163053 } },162486 } },
163054 }, .{162487 }, .{
163055 .required_cc_abi = .win64,162488 .required_cc_abi = .win64,
163056 .required_features = .{ .avx, null, null, null },
163057 .dst_constraints = .{ .{ .float = .xword }, .any },
163058 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
163059 .patterns = &.{
163060 .{ .src = .{ .to_mem, .none, .none } },
163061 },
163062 .call_frame = .{ .alignment = .@"16" },
163063 .extra_temps = .{
163064 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
163065 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
163066 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
163067 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
163068 .{ .type = .f128, .kind = .mem },
163069 .unused,
163070 .unused,
163071 .unused,
163072 .unused,
163073 .unused,
163074 .unused,
163075 },
163076 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
163077 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
163078 .each = .{ .once = &.{
163079 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
163080 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
163081 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
163082 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
163083 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
163084 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
163085 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
163086 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
163087 } },
163088 }, .{
163089 .required_cc_abi = .win64,
163090 .required_features = .{ .sse2, null, null, null },
163091 .dst_constraints = .{ .{ .float = .xword }, .any },
163092 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
163093 .patterns = &.{
163094 .{ .src = .{ .to_mem, .none, .none } },
163095 },
163096 .call_frame = .{ .alignment = .@"16" },
163097 .extra_temps = .{
163098 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
163099 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
163100 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
163101 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
163102 .{ .type = .f128, .kind = .mem },
163103 .unused,
163104 .unused,
163105 .unused,
163106 .unused,
163107 .unused,
163108 .unused,
163109 },
163110 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
163111 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
163112 .each = .{ .once = &.{
163113 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
163114 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
163115 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
163116 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
163117 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
163118 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
163119 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
163120 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
163121 } },
163122 }, .{
163123 .required_cc_abi = .win64,
163124 .required_features = .{ .sse2, null, null, null },
163125 .dst_constraints = .{ .{ .float = .xword }, .any },162489 .dst_constraints = .{ .{ .float = .xword }, .any },
163126 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },162490 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
163127 .patterns = &.{162491 .patterns = &.{
...@@ -163132,8 +162496,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -163132,8 +162496,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
163132 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },162496 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
163133 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },162497 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
163134 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },162498 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
162499 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
163135 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },162500 .{ .type = .usize, .kind = .{ .extern_func = "fminf128" } },
163136 .{ .type = .f128, .kind = .mem },
163137 .unused,162501 .unused,
163138 .unused,162502 .unused,
163139 .unused,162503 .unused,
...@@ -163141,15 +162505,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -163141,15 +162505,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
163141 .unused,162505 .unused,
163142 .unused,162506 .unused,
163143 },162507 },
163144 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },162508 .dst_temps = .{ .mem, .unused },
163145 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },162509 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
163146 .each = .{ .once = &.{162510 .each = .{ .once = &.{
163147 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },162511 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
163148 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },162512 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
163149 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },162513 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
163150 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },162514 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
163151 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },162515 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
163152 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },162516 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
163153 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },162517 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
163154 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },162518 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
163155 } },162519 } },
...@@ -164778,79 +164142,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164778,79 +164142,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164778 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },164142 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
164779 .each = .{ .once = &.{164143 .each = .{ .once = &.{
164780 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },164144 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
164781 .{ ._, .v_dqa, .mov, .dst0x, .memad(.src0x, .add_unaligned_size, -16), ._, ._ },164145 .{ ._, .v_dqa, .mov, .dst0x, .memad(.src0x, .add_unaligned_size, -16), ._, ._ },
164782 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },164146 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
164783 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
164784 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
164785 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
164786 } },
164787 }, .{
164788 .required_cc_abi = .sysv64,
164789 .required_features = .{ .sse2, null, null, null },
164790 .dst_constraints = .{ .{ .float = .xword }, .any },
164791 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
164792 .patterns = &.{
164793 .{ .src = .{ .to_mem, .none, .none } },
164794 },
164795 .call_frame = .{ .alignment = .@"16" },
164796 .extra_temps = .{
164797 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
164798 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164799 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
164800 .unused,
164801 .unused,
164802 .unused,
164803 .unused,
164804 .unused,
164805 .unused,
164806 .unused,
164807 .unused,
164808 },
164809 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
164810 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
164811 .each = .{ .once = &.{
164812 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
164813 .{ ._, ._dqa, .mov, .dst0x, .memad(.src0x, .add_unaligned_size, -16), ._, ._ },
164814 .{ .@"0:", ._dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
164815 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
164816 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
164817 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
164818 } },
164819 }, .{
164820 .required_cc_abi = .sysv64,
164821 .required_features = .{ .sse, null, null, null },
164822 .dst_constraints = .{ .{ .float = .xword }, .any },
164823 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
164824 .patterns = &.{
164825 .{ .src = .{ .to_mem, .none, .none } },
164826 },
164827 .call_frame = .{ .alignment = .@"16" },
164828 .extra_temps = .{
164829 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
164830 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164831 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
164832 .unused,
164833 .unused,
164834 .unused,
164835 .unused,
164836 .unused,
164837 .unused,
164838 .unused,
164839 .unused,
164840 },
164841 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
164842 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
164843 .each = .{ .once = &.{
164844 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
164845 .{ ._, ._ps, .mova, .dst0x, .memad(.src0x, .add_unaligned_size, -16), ._, ._ },
164846 .{ .@"0:", ._ps, .mova, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
164847 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },164147 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
164848 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },164148 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
164849 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },164149 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
164850 } },164150 } },
164851 }, .{164151 }, .{
164852 .required_cc_abi = .win64,164152 .required_cc_abi = .sysv64,
164853 .required_features = .{ .avx, null, null, null },164153 .required_features = .{ .sse2, null, null, null },
164854 .dst_constraints = .{ .{ .float = .xword }, .any },164154 .dst_constraints = .{ .{ .float = .xword }, .any },
164855 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },164155 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
164856 .patterns = &.{164156 .patterns = &.{
...@@ -164859,10 +164159,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164859,10 +164159,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164859 .call_frame = .{ .alignment = .@"16" },164159 .call_frame = .{ .alignment = .@"16" },
164860 .extra_temps = .{164160 .extra_temps = .{
164861 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },164161 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
164862 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },164162 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164863 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164864 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },164163 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
164865 .{ .type = .f128, .kind = .mem },164164 .unused,
164165 .unused,
164866 .unused,164166 .unused,
164867 .unused,164167 .unused,
164868 .unused,164168 .unused,
...@@ -164874,17 +164174,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164874,17 +164174,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164874 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },164174 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
164875 .each = .{ .once = &.{164175 .each = .{ .once = &.{
164876 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },164176 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
164877 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },164177 .{ ._, ._dqa, .mov, .dst0x, .memad(.src0x, .add_unaligned_size, -16), ._, ._ },
164878 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },164178 .{ .@"0:", ._dqa, .mov, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
164879 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },164179 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
164880 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
164881 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
164882 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },164180 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
164883 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },164181 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
164884 } },164182 } },
164885 }, .{164183 }, .{
164886 .required_cc_abi = .win64,164184 .required_cc_abi = .sysv64,
164887 .required_features = .{ .sse2, null, null, null },164185 .required_features = .{ .sse, null, null, null },
164888 .dst_constraints = .{ .{ .float = .xword }, .any },164186 .dst_constraints = .{ .{ .float = .xword }, .any },
164889 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },164187 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
164890 .patterns = &.{164188 .patterns = &.{
...@@ -164893,10 +164191,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164893,10 +164191,10 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164893 .call_frame = .{ .alignment = .@"16" },164191 .call_frame = .{ .alignment = .@"16" },
164894 .extra_temps = .{164192 .extra_temps = .{
164895 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },164193 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
164896 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },164194 .{ .type = .f128, .kind = .{ .param_sse = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164897 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164898 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },164195 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
164899 .{ .type = .f128, .kind = .mem },164196 .unused,
164197 .unused,
164900 .unused,164198 .unused,
164901 .unused,164199 .unused,
164902 .unused,164200 .unused,
...@@ -164908,17 +164206,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164908,17 +164206,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164908 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },164206 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
164909 .each = .{ .once = &.{164207 .each = .{ .once = &.{
164910 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },164208 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
164911 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },164209 .{ ._, ._ps, .mova, .dst0x, .memad(.src0x, .add_unaligned_size, -16), ._, ._ },
164912 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },164210 .{ .@"0:", ._ps, .mova, .tmp1x, .memi(.src0x, .tmp0), ._, ._ },
164913 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },164211 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
164914 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
164915 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
164916 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },164212 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
164917 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },164213 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
164918 } },164214 } },
164919 }, .{164215 }, .{
164920 .required_cc_abi = .win64,164216 .required_cc_abi = .win64,
164921 .required_features = .{ .sse2, null, null, null },
164922 .dst_constraints = .{ .{ .float = .xword }, .any },164217 .dst_constraints = .{ .{ .float = .xword }, .any },
164923 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },164218 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
164924 .patterns = &.{164219 .patterns = &.{
...@@ -164929,8 +164224,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164929,8 +164224,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164929 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },164224 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
164930 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },164225 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
164931 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },164226 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
164227 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
164932 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },164228 .{ .type = .usize, .kind = .{ .extern_func = "fmaxf128" } },
164933 .{ .type = .f128, .kind = .mem },
164934 .unused,164229 .unused,
164935 .unused,164230 .unused,
164936 .unused,164231 .unused,
...@@ -164938,15 +164233,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -164938,15 +164233,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
164938 .unused,164233 .unused,
164939 .unused,164234 .unused,
164940 },164235 },
164941 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },164236 .dst_temps = .{ .mem, .unused },
164942 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },164237 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
164943 .each = .{ .once = &.{164238 .each = .{ .once = &.{
164944 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },164239 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
164945 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },164240 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
164946 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },164241 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
164947 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },164242 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
164948 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },164243 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
164949 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },164244 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
164950 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },164245 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
164951 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },164246 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
164952 } },164247 } },
...@@ -167253,75 +166548,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -167253,75 +166548,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
167253 } },166548 } },
167254 }, .{166549 }, .{
167255 .required_cc_abi = .win64,166550 .required_cc_abi = .win64,
167256 .required_features = .{ .avx, null, null, null },
167257 .dst_constraints = .{ .{ .float = .xword }, .any },
167258 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
167259 .patterns = &.{
167260 .{ .src = .{ .to_mem, .none, .none } },
167261 },
167262 .call_frame = .{ .alignment = .@"16" },
167263 .extra_temps = .{
167264 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
167265 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
167266 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
167267 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
167268 .{ .type = .f128, .kind = .mem },
167269 .unused,
167270 .unused,
167271 .unused,
167272 .unused,
167273 .unused,
167274 .unused,
167275 },
167276 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
167277 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
167278 .each = .{ .once = &.{
167279 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
167280 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
167281 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
167282 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
167283 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
167284 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
167285 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
167286 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
167287 } },
167288 }, .{
167289 .required_cc_abi = .win64,
167290 .required_features = .{ .sse2, null, null, null },
167291 .dst_constraints = .{ .{ .float = .xword }, .any },
167292 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
167293 .patterns = &.{
167294 .{ .src = .{ .to_mem, .none, .none } },
167295 },
167296 .call_frame = .{ .alignment = .@"16" },
167297 .extra_temps = .{
167298 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
167299 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
167300 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
167301 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
167302 .{ .type = .f128, .kind = .mem },
167303 .unused,
167304 .unused,
167305 .unused,
167306 .unused,
167307 .unused,
167308 .unused,
167309 },
167310 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
167311 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
167312 .each = .{ .once = &.{
167313 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
167314 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
167315 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
167316 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
167317 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
167318 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
167319 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
167320 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
167321 } },
167322 }, .{
167323 .required_cc_abi = .win64,
167324 .required_features = .{ .sse, null, null, null },
167325 .dst_constraints = .{ .{ .float = .xword }, .any },166551 .dst_constraints = .{ .{ .float = .xword }, .any },
167326 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },166552 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
167327 .patterns = &.{166553 .patterns = &.{
...@@ -167332,8 +166558,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -167332,8 +166558,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
167332 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },166558 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
167333 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },166559 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
167334 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },166560 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
166561 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
167335 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },166562 .{ .type = .usize, .kind = .{ .extern_func = "__addtf3" } },
167336 .{ .type = .f128, .kind = .mem },
167337 .unused,166563 .unused,
167338 .unused,166564 .unused,
167339 .unused,166565 .unused,
...@@ -167341,15 +166567,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -167341,15 +166567,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
167341 .unused,166567 .unused,
167342 .unused,166568 .unused,
167343 },166569 },
167344 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },166570 .dst_temps = .{ .mem, .unused },
167345 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },166571 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
167346 .each = .{ .once = &.{166572 .each = .{ .once = &.{
167347 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },166573 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
167348 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },166574 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
167349 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },166575 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
167350 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },166576 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
167351 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },166577 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
167352 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },166578 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
167353 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },166579 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
167354 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },166580 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
167355 } },166581 } },
...@@ -168940,75 +168166,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -168940,75 +168166,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
168940 } },168166 } },
168941 }, .{168167 }, .{
168942 .required_cc_abi = .win64,168168 .required_cc_abi = .win64,
168943 .required_features = .{ .avx, null, null, null },
168944 .dst_constraints = .{ .{ .float = .xword }, .any },
168945 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
168946 .patterns = &.{
168947 .{ .src = .{ .to_mem, .none, .none } },
168948 },
168949 .call_frame = .{ .alignment = .@"16" },
168950 .extra_temps = .{
168951 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
168952 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
168953 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
168954 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
168955 .{ .type = .f128, .kind = .mem },
168956 .unused,
168957 .unused,
168958 .unused,
168959 .unused,
168960 .unused,
168961 .unused,
168962 },
168963 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
168964 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
168965 .each = .{ .once = &.{
168966 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
168967 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
168968 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
168969 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
168970 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
168971 .{ ._, .v_dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
168972 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
168973 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
168974 } },
168975 }, .{
168976 .required_cc_abi = .win64,
168977 .required_features = .{ .sse2, null, null, null },
168978 .dst_constraints = .{ .{ .float = .xword }, .any },
168979 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
168980 .patterns = &.{
168981 .{ .src = .{ .to_mem, .none, .none } },
168982 },
168983 .call_frame = .{ .alignment = .@"16" },
168984 .extra_temps = .{
168985 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
168986 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
168987 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
168988 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
168989 .{ .type = .f128, .kind = .mem },
168990 .unused,
168991 .unused,
168992 .unused,
168993 .unused,
168994 .unused,
168995 .unused,
168996 },
168997 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },
168998 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
168999 .each = .{ .once = &.{
169000 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
169001 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
169002 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
169003 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
169004 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },
169005 .{ ._, ._dqa, .mov, .lea(.tmp1x), .dst0x, ._, ._ },
169006 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
169007 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
169008 } },
169009 }, .{
169010 .required_cc_abi = .win64,
169011 .required_features = .{ .sse, null, null, null },
169012 .dst_constraints = .{ .{ .float = .xword }, .any },168169 .dst_constraints = .{ .{ .float = .xword }, .any },
169013 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },168170 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } }, .any, .any },
169014 .patterns = &.{168171 .patterns = &.{
...@@ -169019,8 +168176,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -169019,8 +168176,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
169019 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },168176 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
169020 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },168177 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
169021 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },168178 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
168179 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
169022 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },168180 .{ .type = .usize, .kind = .{ .extern_func = "__multf3" } },
169023 .{ .type = .f128, .kind = .mem },
169024 .unused,168181 .unused,
169025 .unused,168182 .unused,
169026 .unused,168183 .unused,
...@@ -169028,15 +168185,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -169028,15 +168185,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
169028 .unused,168185 .unused,
169029 .unused,168186 .unused,
169030 },168187 },
169031 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },168188 .dst_temps = .{ .mem, .unused },
169032 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },168189 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
169033 .each = .{ .once = &.{168190 .each = .{ .once = &.{
169034 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },168191 .{ ._, ._, .mov, .tmp0d, .sia(-32, .src0, .add_unaligned_size), ._, ._ },
169035 .{ ._, ._, .lea, .tmp1p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },168192 .{ ._, ._, .lea, .tmp2p, .memad(.src0, .add_unaligned_size, -16), ._, ._ },
169036 .{ .@"0:", ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },168193 .{ .@"0:", ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
169037 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },168194 .{ ._, ._, .lea, .tmp3p, .memi(.src0, .tmp0), ._, ._ },
169038 .{ ._, ._, .lea, .tmp1p, .mem(.tmp4), ._, ._ },168195 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
169039 .{ ._, ._ps, .mova, .lea(.tmp1x), .dst0x, ._, ._ },168196 .{ ._, ._, .lea, .tmp2p, .mem(.dst0), ._, ._ },
169040 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },168197 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
169041 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },168198 .{ ._, ._nb, .j, .@"0b", ._, ._, ._ },
169042 } },168199 } },
...@@ -169093,7 +168250,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -169093,7 +168250,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
169093 .each = .{ .once = &.{168250 .each = .{ .once = &.{
169094 .{ ._, ._, .bt, .src0d, .si(0), ._, ._ },168251 .{ ._, ._, .bt, .src0d, .si(0), ._, ._ },
169095 .{ ._, ._, .sbb, .tmp1b, .tmp1b, ._, ._ },168252 .{ ._, ._, .sbb, .tmp1b, .tmp1b, ._, ._ },
169096 .{ ._, ._, .lea, .tmp0q, .dst0b, ._, ._ },168253 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
169097 .{ ._, ._, .mov, .tmp2d, .sia(1, .dst0, .add_bit_size_sub_1_div_8_down_1), ._, ._ },168254 .{ ._, ._, .mov, .tmp2d, .sia(1, .dst0, .add_bit_size_sub_1_div_8_down_1), ._, ._ },
169098 .{ ._, .@"rep _sb", .sto, ._, ._, ._, ._ },168255 .{ ._, .@"rep _sb", .sto, ._, ._, ._, ._ },
169099 .{ ._, ._, .@"and", .memad(.dst0b, .add_bit_size_sub_1_div_8_down_1, 0), .ua(.dst0, .bit_size_last_byte_mask), ._, ._ },168256 .{ ._, ._, .@"and", .memad(.dst0b, .add_bit_size_sub_1_div_8_down_1, 0), .ua(.dst0, .bit_size_last_byte_mask), ._, ._ },
...@@ -170845,8 +170002,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -170845,8 +170002,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
170845 .dst_temps = .{ .mem, .unused },170002 .dst_temps = .{ .mem, .unused },
170846 .each = .{ .once = &.{170003 .each = .{ .once = &.{
170847 .{ ._, ._, .mov, .tmp0d, .sa(.dst0, .add_len), ._, ._ },170004 .{ ._, ._, .mov, .tmp0d, .sa(.dst0, .add_len), ._, ._ },
170848 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },170005 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
170849 .{ .@"0:", ._, .lea, .tmp2q, .mem(.src0), ._, ._ },170006 .{ .@"0:", ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
170850 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_size_div_8), ._, ._ },170007 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_size_div_8), ._, ._ },
170851 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },170008 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },
170852 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },170009 .{ ._, ._, .sub, .tmp0d, .si(1), ._, ._ },
...@@ -170875,8 +170032,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -170875,8 +170032,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
170875 .dst_temps = .{ .mem, .unused },170032 .dst_temps = .{ .mem, .unused },
170876 .each = .{ .once = &.{170033 .each = .{ .once = &.{
170877 .{ ._, ._, .mov, .tmp0d, .sa(.dst0, .add_len), ._, ._ },170034 .{ ._, ._, .mov, .tmp0d, .sa(.dst0, .add_len), ._, ._ },
170878 .{ ._, ._, .lea, .tmp1q, .mem(.dst0), ._, ._ },170035 .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ },
170879 .{ .@"0:", ._, .lea, .tmp2q, .mem(.src0), ._, ._ },170036 .{ .@"0:", ._, .lea, .tmp2p, .mem(.src0), ._, ._ },
170880 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_size_div_8), ._, ._ },170037 .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_size_div_8), ._, ._ },
170881 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },170038 .{ ._, .@"rep _sq", .mov, ._, ._, ._, ._ },
170882 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },170039 .{ ._, ._c, .de, .tmp0d, ._, ._, ._ },
...@@ -172770,7 +171927,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -172770,7 +171927,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
172770 } },171927 } },
172771 }, .{171928 }, .{
172772 .required_cc_abi = .win64,171929 .required_cc_abi = .win64,
172773 .required_features = .{ .sse, null, null, null },
172774 .src_constraints = .{171930 .src_constraints = .{
172775 .{ .scalar_float = .{ .of = .xword, .is = .xword } },171931 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
172776 .{ .scalar_float = .{ .of = .xword, .is = .xword } },171932 .{ .scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -172784,6 +171940,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -172784,6 +171940,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
172784 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },171940 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
172785 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },171941 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
172786 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },171942 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
171943 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 3, .at = 3 } } },
172787 .{ .type = .usize, .kind = .{ .extern_func = "fmaf128" } },171944 .{ .type = .usize, .kind = .{ .extern_func = "fmaf128" } },
172788 .unused,171945 .unused,
172789 .unused,171946 .unused,
...@@ -172791,15 +171948,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -172791,15 +171948,15 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
172791 .unused,171948 .unused,
172792 .unused,171949 .unused,
172793 .unused,171950 .unused,
172794 .unused,
172795 },171951 },
172796 .dst_temps = .{ .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } }, .unused },171952 .dst_temps = .{ .mem, .unused },
172797 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },171953 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
172798 .each = .{ .once = &.{171954 .each = .{ .once = &.{
172799 .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ },171955 .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ },
172800 .{ ._, ._, .lea, .tmp1p, .mem(.src1), ._, ._ },171956 .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ },
172801 .{ ._, ._, .lea, .tmp2p, .mem(.src2), ._, ._ },171957 .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ },
172802 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },171958 .{ ._, ._, .lea, .tmp3p, .mem(.src2), ._, ._ },
171959 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
172803 } },171960 } },
172804 }, .{171961 }, .{
172805 .required_cc_abi = .sysv64,171962 .required_cc_abi = .sysv64,
...@@ -172914,81 +172071,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -172914,81 +172071,6 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
172914 } },172071 } },
172915 }, .{172072 }, .{
172916 .required_cc_abi = .win64,172073 .required_cc_abi = .win64,
172917 .required_features = .{ .avx, null, null, null },
172918 .src_constraints = .{
172919 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172920 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172921 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172922 },
172923 .patterns = &.{
172924 .{ .src = .{ .to_mem, .to_mem, .to_mem } },
172925 },
172926 .call_frame = .{ .alignment = .@"16" },
172927 .extra_temps = .{
172928 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
172929 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
172930 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
172931 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
172932 .{ .type = .usize, .kind = .{ .extern_func = "fmaf128" } },
172933 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
172934 .unused,
172935 .unused,
172936 .unused,
172937 .unused,
172938 .unused,
172939 },
172940 .dst_temps = .{ .mem, .unused },
172941 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
172942 .each = .{ .once = &.{
172943 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
172944 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
172945 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
172946 .{ ._, ._, .lea, .tmp3p, .memi(.src2, .tmp0), ._, ._ },
172947 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
172948 .{ ._, .v_dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
172949 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
172950 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
172951 } },
172952 }, .{
172953 .required_cc_abi = .win64,
172954 .required_features = .{ .sse2, null, null, null },
172955 .src_constraints = .{
172956 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172957 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172958 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172959 },
172960 .patterns = &.{
172961 .{ .src = .{ .to_mem, .to_mem, .to_mem } },
172962 },
172963 .call_frame = .{ .alignment = .@"16" },
172964 .extra_temps = .{
172965 .{ .type = .u32, .kind = .{ .rc = .general_purpose } },
172966 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
172967 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
172968 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
172969 .{ .type = .usize, .kind = .{ .extern_func = "fmaf128" } },
172970 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
172971 .unused,
172972 .unused,
172973 .unused,
172974 .unused,
172975 .unused,
172976 },
172977 .dst_temps = .{ .mem, .unused },
172978 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
172979 .each = .{ .once = &.{
172980 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
172981 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },
172982 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },
172983 .{ ._, ._, .lea, .tmp3p, .memi(.src2, .tmp0), ._, ._ },
172984 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },
172985 .{ ._, ._dqa, .mov, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },
172986 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
172987 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
172988 } },
172989 }, .{
172990 .required_cc_abi = .win64,
172991 .required_features = .{ .sse, null, null, null },
172992 .src_constraints = .{172074 .src_constraints = .{
172993 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },172075 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
172994 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },172076 .{ .multiple_scalar_float = .{ .of = .xword, .is = .xword } },
...@@ -173003,8 +172085,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -173003,8 +172085,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
173003 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },172085 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 0, .at = 0 } } },
173004 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },172086 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 1, .at = 1 } } },
173005 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },172087 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 2, .at = 2 } } },
172088 .{ .type = .usize, .kind = .{ .param_gpr = .{ .cc = .ccc, .after = 3, .at = 3 } } },
173006 .{ .type = .usize, .kind = .{ .extern_func = "fmaf128" } },172089 .{ .type = .usize, .kind = .{ .extern_func = "fmaf128" } },
173007 .{ .type = .f128, .kind = .{ .ret_sse = .{ .cc = .ccc, .after = 0, .at = 0 } } },
173008 .unused,172090 .unused,
173009 .unused,172091 .unused,
173010 .unused,172092 .unused,
...@@ -173015,11 +172097,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -173015,11 +172097,11 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
173015 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },172097 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
173016 .each = .{ .once = &.{172098 .each = .{ .once = &.{
173017 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },172099 .{ ._, ._, .mov, .tmp0d, .sia(-16, .src0, .add_unaligned_size), ._, ._ },
173018 .{ .@"0:", ._, .lea, .tmp1p, .memi(.src0, .tmp0), ._, ._ },172100 .{ .@"0:", ._, .lea, .tmp1p, .memi(.dst0, .tmp0), ._, ._ },
173019 .{ ._, ._, .lea, .tmp2p, .memi(.src1, .tmp0), ._, ._ },172101 .{ ._, ._, .lea, .tmp2p, .memi(.src0, .tmp0), ._, ._ },
173020 .{ ._, ._, .lea, .tmp3p, .memi(.src2, .tmp0), ._, ._ },172102 .{ ._, ._, .lea, .tmp3p, .memi(.src1, .tmp0), ._, ._ },
173021 .{ ._, ._, .call, .tmp4d, ._, ._, ._ },172103 .{ ._, ._, .lea, .tmp4p, .memi(.src2, .tmp0), ._, ._ },
173022 .{ ._, ._ps, .mova, .memi(.dst0x, .tmp0), .tmp5x, ._, ._ },172104 .{ ._, ._, .call, .tmp5d, ._, ._, ._ },
173023 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },172105 .{ ._, ._, .sub, .tmp0d, .si(16), ._, ._ },
173024 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },172106 .{ ._, ._ae, .j, .@"0b", ._, ._, ._ },
173025 } },172107 } },
...@@ -182472,12 +181554,13 @@ fn hasFeature(cg: *CodeGen, feature: std.Target.x86.Feature) bool {...@@ -182472,12 +181554,13 @@ fn hasFeature(cg: *CodeGen, feature: std.Target.x86.Feature) bool {
182472 .x86_64 => true,181554 .x86_64 => true,
182473 },181555 },
182474 .false_deps_getmant,181556 .false_deps_getmant,
182475 .false_deps_lzcnt_tzcnt,181557 .false_deps_lzcnt,
182476 .false_deps_mulc,181558 .false_deps_mulc,
182477 .false_deps_mullq,181559 .false_deps_mullq,
182478 .false_deps_perm,181560 .false_deps_perm,
182479 .false_deps_popcnt,181561 .false_deps_popcnt,
182480 .false_deps_range,181562 .false_deps_range,
181563 .false_deps_tzcnt,
182481 .slow_3ops_lea,181564 .slow_3ops_lea,
182482 .slow_incdec,181565 .slow_incdec,
182483 .slow_lea,181566 .slow_lea,
...@@ -192323,10 +191406,7 @@ const Select = struct {...@@ -192323,10 +191406,7 @@ const Select = struct {
192323 const RefImm = switch (size) {191406 const RefImm = switch (size) {
192324 else => comptime unreachable,191407 else => comptime unreachable,
192325 .none => Imm,191408 .none => Imm,
192326 .byte, .word, .dword, .qword => @Int(191409 .byte, .word, .dword, .qword => @Int(@typeInfo(Imm).int.signedness, size.bitSize(undefined)),
192327 @typeInfo(Imm).int.signedness,
192328 size.bitSize(undefined),
192329 ),
192330 };191410 };
192331 break :lhs @bitCast(@as(Imm, @intCast(@as(RefImm, switch (adjust) {191411 break :lhs @bitCast(@as(Imm, @intCast(@as(RefImm, switch (adjust) {
192332 else => comptime unreachable,191412 else => comptime unreachable,
src/codegen/x86_64/abi.zig+1-2
...@@ -131,8 +131,7 @@ pub fn classifyWindows(init_ty: Type, zcu: *Zcu, target: *const std.Target, ctx:...@@ -131,8 +131,7 @@ pub fn classifyWindows(init_ty: Type, zcu: *Zcu, target: *const std.Target, ctx:
131 .float => switch (ty.floatBits(target)) {131 .float => switch (ty.floatBits(target)) {
132 else => unreachable,132 else => unreachable,
133 16, 32, 64 => if (target.cpu.has(.x86, .soft_float)) .integer else .sse,133 16, 32, 64 => if (target.cpu.has(.x86, .soft_float)) .integer else .sse,
134 80 => .memory,134 80, 128 => .memory,
135 128 => if (target.cpu.has(.x86, .soft_float)) .memory else .win_i128,
136 },135 },
137 .vector => {136 .vector => {
138 const len = ty.vectorLen(zcu);137 const len = ty.vectorLen(zcu);
src/libs/libcxx.zig+3-2
...@@ -82,6 +82,7 @@ const libcxx_base_files = [_][]const u8{...@@ -82,6 +82,7 @@ const libcxx_base_files = [_][]const u8{
82 "src/support/win32/locale_win32.cpp",82 "src/support/win32/locale_win32.cpp",
83 "src/support/win32/support.cpp",83 "src/support/win32/support.cpp",
84 "src/system_error.cpp",84 "src/system_error.cpp",
85 "src/text_encoding.cpp",
85 "src/typeinfo.cpp",86 "src/typeinfo.cpp",
86 "src/valarray.cpp",87 "src/valarray.cpp",
87 "src/variant.cpp",88 "src/variant.cpp",
...@@ -214,7 +215,7 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!...@@ -214,7 +215,7 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
214 try cflags.append("-faligned-allocation");215 try cflags.append("-faligned-allocation");
215216
216 try cflags.append("-nostdinc++");217 try cflags.append("-nostdinc++");
217 try cflags.append("-std=c++23");218 try cflags.append("-std=c++26");
218219
219 // These depend on only the zig lib directory file path, which is220 // These depend on only the zig lib directory file path, which is
220 // purposefully either in the cache or not in the cache. The decision221 // purposefully either in the cache or not in the cache. The decision
...@@ -402,7 +403,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -402,7 +403,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
402403
403 try cflags.append("-nostdinc++");404 try cflags.append("-nostdinc++");
404 try cflags.append("-fstrict-aliasing");405 try cflags.append("-fstrict-aliasing");
405 try cflags.append("-std=c++23");406 try cflags.append("-std=c++26");
406407
407 // These depend on only the zig lib directory file path, which is408 // These depend on only the zig lib directory file path, which is
408 // purposefully either in the cache or not in the cache. The decision409 // purposefully either in the cache or not in the cache. The decision
src/libs/libtsan.zig+1
...@@ -350,6 +350,7 @@ fn addCcArgs(target: *const std.Target, args: *std.array_list.Managed([]const u8...@@ -350,6 +350,7 @@ fn addCcArgs(target: *const std.Target, args: *std.array_list.Managed([]const u8
350}350}
351351
352const tsan_sources = [_][]const u8{352const tsan_sources = [_][]const u8{
353 "tsan_adaptive_delay.cpp",
353 "tsan_debugging.cpp",354 "tsan_debugging.cpp",
354 "tsan_external.cpp",355 "tsan_external.cpp",
355 "tsan_fd.cpp",356 "tsan_fd.cpp",
src/libs/libunwind.zig+3
...@@ -124,6 +124,9 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -124,6 +124,9 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
124 if (!comp.config.any_non_single_threaded) {124 if (!comp.config.any_non_single_threaded) {
125 try cflags.append("-D_LIBUNWIND_HAS_NO_THREADS");125 try cflags.append("-D_LIBUNWIND_HAS_NO_THREADS");
126 }126 }
127 if (target.os.tag == .haiku) {
128 try cflags.append("-D_LIBUNWIND_USE_HAIKU_BSD_LIB");
129 }
127 if (target.cpu.arch.isArm() and target.abi.float() == .hard) {130 if (target.cpu.arch.isArm() and target.abi.float() == .hard) {
128 try cflags.append("-DCOMPILER_RT_ARMHF_TARGET");131 try cflags.append("-DCOMPILER_RT_ARMHF_TARGET");
129 }132 }
src/link/Dwarf.zig+3
...@@ -4189,6 +4189,9 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co...@@ -4189,6 +4189,9 @@ fn updateConstInner(dwarf: *Dwarf, pt: Zcu.PerThread, debug_const_index: link.Co
4189 .riscv32_ilp32_v,4189 .riscv32_ilp32_v,
4190 => .LLVM_RISCVVectorCall,4190 => .LLVM_RISCVVectorCall,
41914191
4192 .loongarch32_preserve_none => .LLVM_PreserveNone,
4193 .loongarch64_preserve_none => .LLVM_PreserveNone,
4194
4192 .m68k_rtd => .LLVM_M68kRTD,4195 .m68k_rtd => .LLVM_M68kRTD,
41934196
4194 .sh_renesas => .GNU_renesas_sh,4197 .sh_renesas => .GNU_renesas_sh,
src/link/Wasm.zig+3
...@@ -3238,6 +3238,7 @@ pub const Feature = packed struct(u8) {...@@ -3238,6 +3238,7 @@ pub const Feature = packed struct(u8) {
3238 @"tail-call",3238 @"tail-call",
3239 @"shared-mem",3239 @"shared-mem",
3240 @"wide-arithmetic",3240 @"wide-arithmetic",
3241 @"relaxed-atomics",
32413242
3242 pub fn fromCpuFeature(feature: std.Target.wasm.Feature) Tag {3243 pub fn fromCpuFeature(feature: std.Target.wasm.Feature) Tag {
3243 return switch (feature) {3244 return switch (feature) {
...@@ -3255,6 +3256,7 @@ pub const Feature = packed struct(u8) {...@@ -3255,6 +3256,7 @@ pub const Feature = packed struct(u8) {
3255 .nontrapping_bulk_memory_len0 => .@"nontrapping-bulk-memory-len0", // Zig extension.3256 .nontrapping_bulk_memory_len0 => .@"nontrapping-bulk-memory-len0", // Zig extension.
3256 .nontrapping_fptoint => .@"nontrapping-fptoint",3257 .nontrapping_fptoint => .@"nontrapping-fptoint",
3257 .reference_types => .@"reference-types",3258 .reference_types => .@"reference-types",
3259 .relaxed_atomics => .@"relaxed-atomics",
3258 .relaxed_simd => .@"relaxed-simd",3260 .relaxed_simd => .@"relaxed-simd",
3259 .sign_ext => .@"sign-ext",3261 .sign_ext => .@"sign-ext",
3260 .simd128 => .simd128,3262 .simd128 => .simd128,
...@@ -3280,6 +3282,7 @@ pub const Feature = packed struct(u8) {...@@ -3280,6 +3282,7 @@ pub const Feature = packed struct(u8) {
3280 .@"nontrapping-bulk-memory-len0" => .nontrapping_bulk_memory_len0, // Zig extension.3282 .@"nontrapping-bulk-memory-len0" => .nontrapping_bulk_memory_len0, // Zig extension.
3281 .@"nontrapping-fptoint" => .nontrapping_fptoint,3283 .@"nontrapping-fptoint" => .nontrapping_fptoint,
3282 .@"reference-types" => .reference_types,3284 .@"reference-types" => .reference_types,
3285 .@"relaxed-atomics" => .relaxed_atomics,
3283 .@"relaxed-simd" => .relaxed_simd,3286 .@"relaxed-simd" => .relaxed_simd,
3284 .@"sign-ext" => .sign_ext,3287 .@"sign-ext" => .sign_ext,
3285 .simd128 => .simd128,3288 .simd128 => .simd128,
src/target.zig+3
...@@ -423,6 +423,9 @@ pub fn hasDebugInfo(target: *const std.Target) bool {...@@ -423,6 +423,9 @@ pub fn hasDebugInfo(target: *const std.Target) bool {
423 .ptx87,423 .ptx87,
424 .ptx88,424 .ptx88,
425 .ptx90,425 .ptx90,
426 .ptx91,
427 .ptx92,
428 .ptx93,
426 }),429 }),
427 .bpfel, .bpfeb => false,430 .bpfel, .bpfeb => false,
428 else => true,431 else => true,
src/zig_clang_cc1_main.cpp+14-21
...@@ -144,13 +144,13 @@ static int PrintSupportedExtensions(std::string TargetStr) {...@@ -144,13 +144,13 @@ static int PrintSupportedExtensions(std::string TargetStr) {
144 std::unique_ptr<llvm::TargetMachine> TheTargetMachine(144 std::unique_ptr<llvm::TargetMachine> TheTargetMachine(
145 TheTarget->createTargetMachine(Triple, "", "", Options, std::nullopt));145 TheTarget->createTargetMachine(Triple, "", "", Options, std::nullopt));
146 const llvm::Triple &MachineTriple = TheTargetMachine->getTargetTriple();146 const llvm::Triple &MachineTriple = TheTargetMachine->getTargetTriple();
147 const llvm::MCSubtargetInfo *MCInfo = TheTargetMachine->getMCSubtargetInfo();147 const llvm::MCSubtargetInfo &MCInfo = TheTargetMachine->getMCSubtargetInfo();
148 const llvm::ArrayRef<llvm::SubtargetFeatureKV> Features =148 const llvm::ArrayRef<llvm::SubtargetFeatureKV> Features =
149 MCInfo->getAllProcessorFeatures();149 MCInfo.getAllProcessorFeatures();
150150
151 llvm::StringMap<llvm::StringRef> DescMap;151 llvm::StringMap<llvm::StringRef> DescMap;
152 for (const llvm::SubtargetFeatureKV &feature : Features)152 for (const llvm::SubtargetFeatureKV &feature : Features)
153 DescMap.insert({feature.Key, feature.Desc});153 DescMap.insert({feature.key(), feature.desc()});
154154
155 if (MachineTriple.isRISCV())155 if (MachineTriple.isRISCV())
156 llvm::RISCVISAInfo::printSupportedExtensions(DescMap);156 llvm::RISCVISAInfo::printSupportedExtensions(DescMap);
...@@ -187,23 +187,23 @@ static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {...@@ -187,23 +187,23 @@ static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
187 TheTarget->createTargetMachine(Triple, TargetOpts.CPU, FeaturesStr,187 TheTarget->createTargetMachine(Triple, TargetOpts.CPU, FeaturesStr,
188 BackendOptions, std::nullopt));188 BackendOptions, std::nullopt));
189 const llvm::Triple &MachineTriple = TheTargetMachine->getTargetTriple();189 const llvm::Triple &MachineTriple = TheTargetMachine->getTargetTriple();
190 const llvm::MCSubtargetInfo *MCInfo = TheTargetMachine->getMCSubtargetInfo();190 const llvm::MCSubtargetInfo &MCInfo = TheTargetMachine->getMCSubtargetInfo();
191191
192 // Extract the feature names that are enabled for the given target.192 // Extract the feature names that are enabled for the given target.
193 // We do that by capturing the key from the set of SubtargetFeatureKV entries193 // We do that by capturing the key from the set of SubtargetFeatureKV entries
194 // provided by MCSubtargetInfo, which match the '-target-feature' values.194 // provided by MCSubtargetInfo, which match the '-target-feature' values.
195 const std::vector<llvm::SubtargetFeatureKV> Features =195 const std::vector<const llvm::SubtargetFeatureKV *> Features =
196 MCInfo->getEnabledProcessorFeatures();196 MCInfo.getEnabledProcessorFeatures();
197 std::set<llvm::StringRef> EnabledFeatureNames;197 std::set<llvm::StringRef> EnabledFeatureNames;
198 for (const llvm::SubtargetFeatureKV &feature : Features)198 for (const llvm::SubtargetFeatureKV *feature : Features)
199 EnabledFeatureNames.insert(feature.Key);199 EnabledFeatureNames.insert(feature->key());
200200
201 if (MachineTriple.isAArch64())201 if (MachineTriple.isAArch64())
202 llvm::AArch64::printEnabledExtensions(EnabledFeatureNames);202 llvm::AArch64::printEnabledExtensions(EnabledFeatureNames);
203 else if (MachineTriple.isRISCV()) {203 else if (MachineTriple.isRISCV()) {
204 llvm::StringMap<llvm::StringRef> DescMap;204 llvm::StringMap<llvm::StringRef> DescMap;
205 for (const llvm::SubtargetFeatureKV &feature : Features)205 for (const llvm::SubtargetFeatureKV *feature : Features)
206 DescMap.insert({feature.Key, feature.Desc});206 DescMap.insert({feature->key(), feature->desc()});
207 llvm::RISCVISAInfo::printEnabledExtensions(MachineTriple.isArch64Bit(),207 llvm::RISCVISAInfo::printEnabledExtensions(MachineTriple.isArch64Bit(),
208 EnabledFeatureNames, DescMap);208 EnabledFeatureNames, DescMap);
209 } else {209 } else {
...@@ -289,20 +289,11 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -289,20 +289,11 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
289 static_cast<void*>(&Clang->getDiagnostics()));289 static_cast<void*>(&Clang->getDiagnostics()));
290290
291 DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());291 DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());
292 if (!Success) {292 if (!Success)
293 Clang->getDiagnosticClient().finish();
294 return 1;293 return 1;
295 }
296294
297 // Execute the frontend actions.295 // Execute the frontend actions.
298 {296 Success = ExecuteCompilerInvocation(Clang.get());
299 llvm::TimeTraceScope TimeScope("ExecuteCompiler");
300 bool TimePasses = Clang->getCodeGenOpts().TimePasses;
301 if (TimePasses)
302 Clang->createFrontendTimer();
303 llvm::TimeRegion Timer(TimePasses ? &Clang->getFrontendTimer() : nullptr);
304 Success = ExecuteCompilerInvocation(Clang.get());
305 }
306297
307 // If any timers were active but haven't been destroyed yet, print their298 // If any timers were active but haven't been destroyed yet, print their
308 // results now. This happens in -disable-free mode.299 // results now. This happens in -disable-free mode.
...@@ -339,6 +330,8 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -339,6 +330,8 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
339330
340 // When running with -disable-free, don't do any destruction or shutdown.331 // When running with -disable-free, don't do any destruction or shutdown.
341 if (Clang->getFrontendOpts().DisableFree) {332 if (Clang->getFrontendOpts().DisableFree) {
333 // DiagnosticConsumer must be always destroyed.
334 Clang->getDiagnosticClient().~DiagnosticConsumer();
342 llvm::BuryPointer(std::move(Clang));335 llvm::BuryPointer(std::move(Clang));
343 return !Success;336 return !Success;
344 }337 }
src/zig_clang_cc1as_main.cpp+12-4
...@@ -177,6 +177,8 @@ struct AssemblerInvocation {...@@ -177,6 +177,8 @@ struct AssemblerInvocation {
177 LLVM_PREFERRED_TYPE(bool)177 LLVM_PREFERRED_TYPE(bool)
178 unsigned X86Sse2Avx : 1;178 unsigned X86Sse2Avx : 1;
179179
180 RelocSectionSymType RelocSectionSym = RelocSectionSymType::All;
181
180 /// The name of the relocation model to use.182 /// The name of the relocation model to use.
181 std::string RelocationModel;183 std::string RelocationModel;
182184
...@@ -387,6 +389,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -387,6 +389,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
387 llvm::StringSwitch<EmitDwarfUnwindType>(A->getValue())389 llvm::StringSwitch<EmitDwarfUnwindType>(A->getValue())
388 .Case("always", EmitDwarfUnwindType::Always)390 .Case("always", EmitDwarfUnwindType::Always)
389 .Case("no-compact-unwind", EmitDwarfUnwindType::NoCompactUnwind)391 .Case("no-compact-unwind", EmitDwarfUnwindType::NoCompactUnwind)
392 .Case("dwarf-only", EmitDwarfUnwindType::DwarfOnly)
390 .Case("default", EmitDwarfUnwindType::Default);393 .Case("default", EmitDwarfUnwindType::Default);
391 }394 }
392395
...@@ -394,6 +397,12 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -394,6 +397,12 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
394 Args.hasArg(OPT_femit_compact_unwind_non_canonical);397 Args.hasArg(OPT_femit_compact_unwind_non_canonical);
395 Opts.EmitSFrameUnwind = Args.hasArg(OPT_gsframe);398 Opts.EmitSFrameUnwind = Args.hasArg(OPT_gsframe);
396 Opts.Crel = Args.hasArg(OPT_crel);399 Opts.Crel = Args.hasArg(OPT_crel);
400 Opts.RelocSectionSym = RelocSectionSymType::All;
401 if (auto *A = Args.getLastArg(OPT_reloc_section_sym))
402 Opts.RelocSectionSym = StringSwitch<RelocSectionSymType>(A->getValue())
403 .Case("internal", RelocSectionSymType::Internal)
404 .Case("none", RelocSectionSymType::None)
405 .Default(RelocSectionSymType::All);
397 Opts.ImplicitMapsyms = Args.hasArg(OPT_mmapsyms_implicit);406 Opts.ImplicitMapsyms = Args.hasArg(OPT_mmapsyms_implicit);
398 Opts.X86RelaxRelocations = !Args.hasArg(OPT_mrelax_relocations_no);407 Opts.X86RelaxRelocations = !Args.hasArg(OPT_mrelax_relocations_no);
399 Opts.X86Sse2Avx = Args.hasArg(OPT_msse2avx);408 Opts.X86Sse2Avx = Args.hasArg(OPT_msse2avx);
...@@ -461,6 +470,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -461,6 +470,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
461 MCOptions.EmitSFrameUnwind = Opts.EmitSFrameUnwind;470 MCOptions.EmitSFrameUnwind = Opts.EmitSFrameUnwind;
462 MCOptions.MCSaveTempLabels = Opts.SaveTemporaryLabels;471 MCOptions.MCSaveTempLabels = Opts.SaveTemporaryLabels;
463 MCOptions.Crel = Opts.Crel;472 MCOptions.Crel = Opts.Crel;
473 MCOptions.RelocSectionSym = Opts.RelocSectionSym;
464 MCOptions.ImplicitMapSyms = Opts.ImplicitMapsyms;474 MCOptions.ImplicitMapSyms = Opts.ImplicitMapsyms;
465 MCOptions.X86RelaxRelocations = Opts.X86RelaxRelocations;475 MCOptions.X86RelaxRelocations = Opts.X86RelaxRelocations;
466 MCOptions.X86Sse2Avx = Opts.X86Sse2Avx;476 MCOptions.X86Sse2Avx = Opts.X86Sse2Avx;
...@@ -497,8 +507,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -497,8 +507,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
497 << Opts.CPU << FS.empty() << FS;507 << Opts.CPU << FS.empty() << FS;
498 }508 }
499509
500 MCContext Ctx(Triple(Opts.Triple), MAI.get(), MRI.get(), STI.get(), &SrcMgr,510 MCContext Ctx(Triple(Opts.Triple), *MAI, *MRI, *STI, &SrcMgr);
501 &MCOptions);
502511
503 bool PIC = false;512 bool PIC = false;
504 if (Opts.RelocationModel == "static") {513 if (Opts.RelocationModel == "static") {
...@@ -617,9 +626,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,...@@ -617,9 +626,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
617 std::unique_ptr<MCAsmParser> Parser(626 std::unique_ptr<MCAsmParser> Parser(
618 createMCAsmParser(SrcMgr, Ctx, *Str, *MAI));627 createMCAsmParser(SrcMgr, Ctx, *Str, *MAI));
619628
620 // FIXME: init MCTargetOptions from sanitizer flags here.
621 std::unique_ptr<MCTargetAsmParser> TAP(629 std::unique_ptr<MCTargetAsmParser> TAP(
622 TheTarget->createMCAsmParser(*STI, *Parser, *MCII, MCOptions));630 TheTarget->createMCAsmParser(*STI, *Parser, *MCII));
623 if (!TAP)631 if (!TAP)
624 Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple.str();632 Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple.str();
625633
src/zig_clang_driver.cpp+37-8
...@@ -55,6 +55,10 @@...@@ -55,6 +55,10 @@
55#include <optional>55#include <optional>
56#include <set>56#include <set>
57#include <system_error>57#include <system_error>
58// zig patch: don't rely on LLVM_ON_UNIX that comes from the build system
59#if !defined(_WIN32)
60#include <signal.h>
61#endif
5862
59using namespace clang;63using namespace clang;
60using namespace clang::driver;64using namespace clang::driver;
...@@ -223,6 +227,7 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,...@@ -223,6 +227,7 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,
223 return cc1_main(ArrayRef(ArgV).slice(1), ArgV[0], GetExecutablePathVP);227 return cc1_main(ArrayRef(ArgV).slice(1), ArgV[0], GetExecutablePathVP);
224 if (Tool == "-cc1as")228 if (Tool == "-cc1as")
225 return cc1as_main(ArrayRef(ArgV).slice(2), ArgV[0], GetExecutablePathVP);229 return cc1as_main(ArrayRef(ArgV).slice(2), ArgV[0], GetExecutablePathVP);
230 // zig patch: no -cc1gen-reproducer
226 // Reject unknown tools.231 // Reject unknown tools.
227 llvm::errs()232 llvm::errs()
228 << "error: unknown integrated tool '" << Tool << "'. "233 << "error: unknown integrated tool '" << Tool << "'. "
...@@ -230,11 +235,13 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,...@@ -230,11 +235,13 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,
230 return 1;235 return 1;
231}236}
232237
238// zig patch: use custom entry point
233static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContext) {239static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContext) {
234 noteBottomOfStack();240 noteBottomOfStack();
235 llvm::setBugReportMsg("PLEASE submit a bug report to " BUG_REPORT_URL241 llvm::setBugReportMsg("PLEASE submit a bug report to " BUG_REPORT_URL
236 " and include the crash backtrace, preprocessed "242 " and include the crash backtrace and"
237 "source, and associated run script.\n");243 " dumped files.\n");
244 // zig patch: fix argv offset
238 size_t argv_offset = (strcmp(Argv[1], "-cc1") == 0 || strcmp(Argv[1], "-cc1as") == 0) ? 0 : 1;245 size_t argv_offset = (strcmp(Argv[1], "-cc1") == 0 || strcmp(Argv[1], "-cc1as") == 0) ? 0 : 1;
239 SmallVector<const char *, 256> Args(Argv + argv_offset, Argv + Argc);246 SmallVector<const char *, 256> Args(Argv + argv_offset, Argv + Argc);
240247
...@@ -373,7 +380,8 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -373,7 +380,8 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
373 if (!UseNewCC1Process) {380 if (!UseNewCC1Process) {
374 TheDriver.CC1Main = ExecuteCC1WithContext;381 TheDriver.CC1Main = ExecuteCC1WithContext;
375 // Ensure the CC1Command actually catches cc1 crashes382 // Ensure the CC1Command actually catches cc1 crashes
376 llvm::CrashRecoveryContext::Enable();383 llvm::CrashRecoveryContext::Enable(
384 /*NeedsPOSIXUtilitySignalHandling=*/true);
377 }385 }
378386
379 std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(Args));387 std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(Args));
...@@ -402,6 +410,7 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -402,6 +410,7 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
402 Driver::CommandStatus CommandStatus = Driver::CommandStatus::Ok;410 Driver::CommandStatus CommandStatus = Driver::CommandStatus::Ok;
403 // Pretend the first command failed if ReproStatus is Always.411 // Pretend the first command failed if ReproStatus is Always.
404 const Command *FailingCommand = nullptr;412 const Command *FailingCommand = nullptr;
413 int CommandRes = 0;
405 if (!C->getJobs().empty())414 if (!C->getJobs().empty())
406 FailingCommand = &*C->getJobs().begin();415 FailingCommand = &*C->getJobs().begin();
407 if (C && !C->containsError()) {416 if (C && !C->containsError()) {
...@@ -409,7 +418,7 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -409,7 +418,7 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
409 Res = TheDriver.ExecuteCompilation(*C, FailingCommands);418 Res = TheDriver.ExecuteCompilation(*C, FailingCommands);
410419
411 for (const auto &P : FailingCommands) {420 for (const auto &P : FailingCommands) {
412 int CommandRes = P.first;421 CommandRes = P.first;
413 FailingCommand = P.second;422 FailingCommand = P.second;
414 if (!Res)423 if (!Res)
415 Res = CommandRes;424 Res = CommandRes;
...@@ -421,8 +430,8 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -421,8 +430,8 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
421 IsCrash = CommandRes < 0 || CommandRes == 70;430 IsCrash = CommandRes < 0 || CommandRes == 70;
422#ifdef _WIN32431#ifdef _WIN32
423 IsCrash |= CommandRes == 3;432 IsCrash |= CommandRes == 3;
424#endif433// zig patch: don't rely on LLVM_ON_UNIX that comes from the build system
425#if LLVM_ON_UNIX434#else
426 // When running in integrated-cc1 mode, the CrashRecoveryContext returns435 // When running in integrated-cc1 mode, the CrashRecoveryContext returns
427 // the same codes as if the program crashed. See section "Exit Status for436 // the same codes as if the program crashed. See section "Exit Status for
428 // Commands":437 // Commands":
...@@ -445,8 +454,6 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -445,8 +454,6 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
445 *C, *FailingCommand))454 *C, *FailingCommand))
446 Res = 1;455 Res = 1;
447456
448 Diags.getClient()->finish();
449
450 if (!UseNewCC1Process && IsCrash) {457 if (!UseNewCC1Process && IsCrash) {
451 // When crashing in -fintegrated-cc1 mode, bury the timer pointers, because458 // When crashing in -fintegrated-cc1 mode, bury the timer pointers, because
452 // the internal linked list might point to already released stack frames.459 // the internal linked list might point to already released stack frames.
...@@ -464,6 +471,28 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex...@@ -464,6 +471,28 @@ static int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContex
464 // propagated.471 // propagated.
465 if (Res < 0)472 if (Res < 0)
466 Res = 1;473 Res = 1;
474// zig patch: don't rely on LLVM_ON_UNIX that comes from the build system
475#else
476 // On Unix, signals are represented by return codes of 128 plus the signal
477 // number. If the return code indicates it was from a signal handler, raise
478 // the signal so that the exit code includes the signal number, as required
479 // by POSIX. Return code 255 is excluded because some tools, such as
480 // llvm-ifs, exit with code 255 (-1) on failure.
481 if (CommandRes > 128 && CommandRes != 255) {
482 llvm::sys::unregisterHandlers();
483 // DiagnosticConsumer must be always destroyed.
484 Diags.getClient()->~DiagnosticConsumer();
485 raise(CommandRes - 128);
486 }
487 // When cc1 runs out-of-process (CLANG_SPAWN_CC1), ExecuteAndWait returns -2
488 // if the child was killed by a signal. The signal number is not preserved,
489 // so resignal with SIGABRT to ensure the driver exits via signal.
490 if (CommandRes == -2) {
491 llvm::sys::unregisterHandlers();
492 // DiagnosticConsumer must be always destroyed.
493 Diags.getClient()->~DiagnosticConsumer();
494 raise(SIGABRT);
495 }
467#endif496#endif
468497
469 // If we have multiple failing commands, we return the result of the first498 // If we have multiple failing commands, we return the result of the first
src/zig_llvm-ar.cpp+33-8
...@@ -83,6 +83,7 @@ static void printArHelp(StringRef ToolName) {...@@ -83,6 +83,7 @@ static void printArHelp(StringRef ToolName) {
83 =darwin - darwin83 =darwin - darwin
84 =bsd - bsd84 =bsd - bsd
85 =bigarchive - big archive (AIX OS)85 =bigarchive - big archive (AIX OS)
86 =zos - zos archive (z/OS OS)
86 =coff - coff87 =coff - coff
87 --plugin=<string> - ignored for compatibility88 --plugin=<string> - ignored for compatibility
88 -h --help - display this help and exit89 -h --help - display this help and exit
...@@ -195,7 +196,16 @@ static SmallVector<const char *, 256> PositionalArgs;...@@ -195,7 +196,16 @@ static SmallVector<const char *, 256> PositionalArgs;
195static bool MRI;196static bool MRI;
196197
197namespace {198namespace {
198enum Format { Default, GNU, COFF, BSD, DARWIN, BIGARCHIVE, Unknown };199enum Format {
200 Default,
201 GNU,
202 COFF,
203 BSD,
204 DARWIN,
205 BIGARCHIVE,
206 ZOSARCHIVE,
207 Unknown
208};
199}209}
200210
201static Format FormatType = Default;211static Format FormatType = Default;
...@@ -713,8 +723,11 @@ static void performReadOperation(ArchiveOperation Operation,...@@ -713,8 +723,11 @@ static void performReadOperation(ArchiveOperation Operation,
713 });723 });
714 if (I == Members.end())724 if (I == Members.end())
715 continue;725 continue;
716 if (CountParam && ++MemberCount[Name] != CountParam)726 if (CountParam) {
717 continue;727 std::string CountKey = normalizePath(*I);
728 if (++MemberCount[CountKey] != CountParam)
729 continue;
730 }
718 Members.erase(I);731 Members.erase(I);
719 }732 }
720733
...@@ -854,14 +867,19 @@ static InsertAction computeInsertAction(ArchiveOperation Operation,...@@ -854,14 +867,19 @@ static InsertAction computeInsertAction(ArchiveOperation Operation,
854 if (Operation == QuickAppend || Members.empty())867 if (Operation == QuickAppend || Members.empty())
855 return IA_AddOldMember;868 return IA_AddOldMember;
856869
857 auto MI = find_if(Members, [Name](StringRef Path) {870 std::string CountKey;
871 auto MI = find_if(Members, [Name, &CountKey](StringRef Path) {
872 SmallString<128> MatchPath(Path);
858 if (Thin && !sys::path::is_absolute(Path)) {873 if (Thin && !sys::path::is_absolute(Path)) {
859 Expected<std::string> PathOrErr =874 Expected<std::string> PathOrErr =
860 computeArchiveRelativePath(ArchiveName, Path);875 computeArchiveRelativePath(ArchiveName, Path);
861 return comparePaths(Name, PathOrErr ? *PathOrErr : Path);876 if (PathOrErr)
862 } else {877 MatchPath = *PathOrErr;
863 return comparePaths(Name, Path);
864 }878 }
879 if (!comparePaths(Name, MatchPath))
880 return false;
881 CountKey = normalizePath(MatchPath);
882 return true;
865 });883 });
866884
867 if (MI == Members.end())885 if (MI == Members.end())
...@@ -870,7 +888,7 @@ static InsertAction computeInsertAction(ArchiveOperation Operation,...@@ -870,7 +888,7 @@ static InsertAction computeInsertAction(ArchiveOperation Operation,
870 Pos = MI;888 Pos = MI;
871889
872 if (Operation == Delete) {890 if (Operation == Delete) {
873 if (CountParam && ++MemberCount[Name] != CountParam)891 if (CountParam && ++MemberCount[CountKey] != CountParam)
874 return IA_AddOldMember;892 return IA_AddOldMember;
875 return IA_Delete;893 return IA_Delete;
876 }894 }
...@@ -1071,6 +1089,11 @@ static void performWriteOperation(ArchiveOperation Operation,...@@ -1071,6 +1089,11 @@ static void performWriteOperation(ArchiveOperation Operation,
1071 fail("only the gnu format has a thin mode");1089 fail("only the gnu format has a thin mode");
1072 Kind = object::Archive::K_AIXBIG;1090 Kind = object::Archive::K_AIXBIG;
1073 break;1091 break;
1092 case ZOSARCHIVE:
1093 if (Thin)
1094 fail("only the gnu format has a thin mode");
1095 Kind = object::Archive::K_ZOS;
1096 break;
1074 case Unknown:1097 case Unknown:
1075 llvm_unreachable("");1098 llvm_unreachable("");
1076 }1099 }
...@@ -1389,6 +1412,7 @@ static int ar_main(int argc, char **argv) {...@@ -1389,6 +1412,7 @@ static int ar_main(int argc, char **argv) {
1389 .Case("bsd", BSD)1412 .Case("bsd", BSD)
1390 .Case("bigarchive", BIGARCHIVE)1413 .Case("bigarchive", BIGARCHIVE)
1391 .Case("coff", COFF)1414 .Case("coff", COFF)
1415 .Case("zos", ZOSARCHIVE)
1392 .Default(Unknown);1416 .Default(Unknown);
1393 if (FormatType == Unknown)1417 if (FormatType == Unknown)
1394 fail(std::string("Invalid format ") + Match);1418 fail(std::string("Invalid format ") + Match);
...@@ -1509,6 +1533,7 @@ static int ranlib_main(int argc, char **argv) {...@@ -1509,6 +1533,7 @@ static int ranlib_main(int argc, char **argv) {
1509 return 0;1533 return 0;
1510}1534}
15111535
1536// zig patch: use custom entry point
1512static int llvm_ar_main(int argc, char **argv, const llvm::ToolContext &) {1537static int llvm_ar_main(int argc, char **argv, const llvm::ToolContext &) {
1513 ToolName = argv[0];1538 ToolName = argv[0];
15141539
src/zig_llvm.cpp+2-2
...@@ -285,7 +285,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi...@@ -285,7 +285,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi
285 PipelineTuningOptions pipeline_opts;285 PipelineTuningOptions pipeline_opts;
286 pipeline_opts.LoopUnrolling = !options->is_debug;286 pipeline_opts.LoopUnrolling = !options->is_debug;
287 pipeline_opts.SLPVectorization = !options->is_debug;287 pipeline_opts.SLPVectorization = !options->is_debug;
288 pipeline_opts.LoopVectorization = false; // https://github.com/llvm/llvm-project/issues/186922288 pipeline_opts.LoopVectorization = !options->is_debug;
289 pipeline_opts.LoopInterleaving = !options->is_debug;289 pipeline_opts.LoopInterleaving = !options->is_debug;
290 pipeline_opts.MergeFunctions = !options->is_debug;290 pipeline_opts.MergeFunctions = !options->is_debug;
291291
...@@ -373,7 +373,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi...@@ -373,7 +373,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi
373 if (options->is_debug)373 if (options->is_debug)
374 opt_level = OptimizationLevel::O0;374 opt_level = OptimizationLevel::O0;
375 else if (options->is_small)375 else if (options->is_small)
376 opt_level = OptimizationLevel::Oz;376 opt_level = OptimizationLevel::O2;
377 else377 else
378 opt_level = OptimizationLevel::O3;378 opt_level = OptimizationLevel::O3;
379379
stage1/zig.h-25
...@@ -5874,27 +5874,12 @@ typedef __float128 zig_f128;...@@ -5874,27 +5874,12 @@ typedef __float128 zig_f128;
5874#define zig_make_special_f128(sign, name, arg, repr) sign __builtin_##name##f128(arg)5874#define zig_make_special_f128(sign, name, arg, repr) sign __builtin_##name##f128(arg)
5875#else5875#else
5876#undef zig_has_f1285876#undef zig_has_f128
5877#if defined(zig_x86_64) && defined(ZIG_TARGET_ABI_MSVC)
5878#if defined(zig_msvc) && !defined(__clang__)
5879#include <emmintrin.h>
5880typedef __m128i zig_f128;
5881#define zig_init_repr_f128(hi, lo) { .m128i_u64 = { lo, hi } }
5882#define zig_lo_repr_f128(arg) (arg).m128i_u64[0]
5883#define zig_hi_repr_f128(arg) (arg).m128i_u64[1]
5884#else
5885typedef __attribute__((__vector_size__(2 * sizeof(uint64_t)))) uint64_t zig_f128;
5886#define zig_init_repr_f128(hi, lo) { lo, hi }
5887#define zig_lo_repr_f128(arg) (arg)[0]
5888#define zig_hi_repr_f128(arg) (arg)[1]
5889#endif
5890#else
5891typedef zig_u128 zig_f128;5877typedef zig_u128 zig_f128;
5892#define zig_init_repr_f128(hi, lo) zig_init_u128(hi, lo)5878#define zig_init_repr_f128(hi, lo) zig_init_u128(hi, lo)
5893#define zig_make_repr_f128(hi, lo) zig_make_u128(hi, lo)5879#define zig_make_repr_f128(hi, lo) zig_make_u128(hi, lo)
5894#define zig_lo_repr_f128(arg) zig_lo_u128(arg)5880#define zig_lo_repr_f128(arg) zig_lo_u128(arg)
5895#define zig_hi_repr_f128(arg) zig_hi_u128(arg)5881#define zig_hi_repr_f128(arg) zig_hi_u128(arg)
5896#endif5882#endif
5897#endif
5898#ifndef zig_has_f1285883#ifndef zig_has_f128
5899#define zig_has_f128 05884#define zig_has_f128 0
5900#define zig_make_f128(fp, repr) repr5885#define zig_make_f128(fp, repr) repr
...@@ -6182,16 +6167,6 @@ static inline zig_f128 zig_floatuntitf(zig_u128 arg) {...@@ -6182,16 +6167,6 @@ static inline zig_f128 zig_floatuntitf(zig_u128 arg) {
6182 extern zig_f128 __floatuntitf(zig_f128 arg);6167 extern zig_f128 __floatuntitf(zig_f128 arg);
6183 return __floatuntitf(zig_f128_bitCast_u128(arg));6168 return __floatuntitf(zig_f128_bitCast_u128(arg));
6184}6169}
6185#elif defined(zig_x86_64) && defined(zig_windows)
6186zig_common_float_builtins(128)
6187static inline zig_f128 zig_floattitf(zig_i128 arg) {
6188 extern zig_f128 __floattitf(zig_i128 arg);
6189 return __floattitf(arg);
6190}
6191static inline zig_f128 zig_floatuntitf(zig_u128 arg) {
6192 extern zig_f128 __floatuntitf(uint64_t arg_lo, uint64_t arg_hi);
6193 return __floatuntitf(zig_lo_u128(arg), zig_hi_u128(arg));
6194}
6195#else6170#else
6196zig_float_builtins(128)6171zig_float_builtins(128)
6197#endif6172#endif
test/behavior/floatop.zig-3
...@@ -234,7 +234,6 @@ test "vector cmp f32" {...@@ -234,7 +234,6 @@ test "vector cmp f32" {
234 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest;234 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest;
235 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765235 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765
236 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765236 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765
237 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/214198
238 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;237 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
239238
240 try testCmpVector(f32);239 try testCmpVector(f32);
...@@ -258,7 +257,6 @@ test "vector cmp f128" {...@@ -258,7 +257,6 @@ test "vector cmp f128" {
258 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO257 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
259 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;258 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
260 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;259 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
261 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/214198
262 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;260 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
263261
264 try testCmpVector(f128);262 try testCmpVector(f128);
...@@ -268,7 +266,6 @@ test "vector cmp f128" {...@@ -268,7 +266,6 @@ test "vector cmp f128" {
268test "vector cmp f80/c_longdouble" {266test "vector cmp f80/c_longdouble" {
269 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;267 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
270 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;268 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
271 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/214198
272 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;269 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
273 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;270 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
274271
test/c_abi/cfuncs.c+1-1
...@@ -16624,7 +16624,7 @@ struct ByRef __attribute__((sysv_abi)) c_explict_sys_v(struct ByRef in) {...@@ -16624,7 +16624,7 @@ struct ByRef __attribute__((sysv_abi)) c_explict_sys_v(struct ByRef in) {
16624}16624}
16625#endif16625#endif
1662616626
16627#if defined __x86_64__ || defined __aarch64__16627#if defined __x86_64__ || defined __aarch64__ || defined __loongarch__
16628int __attribute__((preserve_none)) c_preserve_none(int x) {16628int __attribute__((preserve_none)) c_preserve_none(int x) {
16629 return x + 1;16629 return x + 1;
16630}16630}
test/c_abi/main.zig+3
...@@ -18045,6 +18045,9 @@ const preserve_none_cc: ?std.lang.CallingConvention = if (builtin.zig_backend !=...@@ -18045,6 +18045,9 @@ const preserve_none_cc: ?std.lang.CallingConvention = if (builtin.zig_backend !=
18045else switch (builtin.cpu.arch) {18045else switch (builtin.cpu.arch) {
18046 .x86_64 => .{ .x86_64_preserve_none = .{} },18046 .x86_64 => .{ .x86_64_preserve_none = .{} },
18047 .aarch64, .aarch64_be => .{ .aarch64_preserve_none = .{} },18047 .aarch64, .aarch64_be => .{ .aarch64_preserve_none = .{} },
18048 // Supported in LLVM but not yet wired up in Clang.
18049 // .loongarch32 => .{ .loongarch32_preserve_none = .{} },
18050 // .loongarch64 => .{ .loongarch64_preserve_none = .{} },
18048 else => null,18051 else => null,
18049};18052};
1805018053
test/libc.zig+4-4
...@@ -190,7 +190,7 @@ pub fn addCases(cases: *tests.LibcContext) void {...@@ -190,7 +190,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
190 cases.addLibcTestCase("math/exp2f.c", .{});190 cases.addLibcTestCase("math/exp2f.c", .{});
191 cases.addLibcTestCase("math/exp2l.c", .{});191 cases.addLibcTestCase("math/exp2l.c", .{});
192 cases.addLibcTestCase("math/expf.c", .{});192 cases.addLibcTestCase("math/expf.c", .{});
193 cases.addLibcTestCase("math/expl.c", .{});193 // cases.addLibcTestCase("math/expl.c", .{});
194 // cases.addLibcTestCase("math/expm1.c", .{});194 // cases.addLibcTestCase("math/expm1.c", .{});
195 // cases.addLibcTestCase("math/expm1f.c", .{});195 // cases.addLibcTestCase("math/expm1f.c", .{});
196 // cases.addLibcTestCase("math/expm1l.c", .{});196 // cases.addLibcTestCase("math/expm1l.c", .{});
...@@ -258,9 +258,9 @@ pub fn addCases(cases: *tests.LibcContext) void {...@@ -258,9 +258,9 @@ pub fn addCases(cases: *tests.LibcContext) void {
258 cases.addLibcTestCase("math/log2.c", .{});258 cases.addLibcTestCase("math/log2.c", .{});
259 cases.addLibcTestCase("math/log2f.c", .{});259 cases.addLibcTestCase("math/log2f.c", .{});
260 cases.addLibcTestCase("math/log2l.c", .{});260 cases.addLibcTestCase("math/log2l.c", .{});
261 cases.addLibcTestCase("math/logb.c", .{});261 // cases.addLibcTestCase("math/logb.c", .{});
262 cases.addLibcTestCase("math/logbf.c", .{});262 // cases.addLibcTestCase("math/logbf.c", .{});
263 cases.addLibcTestCase("math/logbl.c", .{});263 // cases.addLibcTestCase("math/logbl.c", .{});
264 cases.addLibcTestCase("math/logf.c", .{});264 cases.addLibcTestCase("math/logf.c", .{});
265 cases.addLibcTestCase("math/logl.c", .{});265 cases.addLibcTestCase("math/logl.c", .{});
266 cases.addLibcTestCase("math/lrint.c", .{});266 cases.addLibcTestCase("math/lrint.c", .{});
test/llvm_targets.zig+1
...@@ -231,6 +231,7 @@ const targets = [_]std.Target.Query{...@@ -231,6 +231,7 @@ const targets = [_]std.Target.Query{
231 .{ .cpu_arch = .riscv64, .os_tag = .fuchsia, .abi = .none },231 .{ .cpu_arch = .riscv64, .os_tag = .fuchsia, .abi = .none },
232 .{ .cpu_arch = .riscv64, .os_tag = .haiku, .abi = .none },232 .{ .cpu_arch = .riscv64, .os_tag = .haiku, .abi = .none },
233 .{ .cpu_arch = .riscv64, .os_tag = .hermit, .abi = .none },233 .{ .cpu_arch = .riscv64, .os_tag = .hermit, .abi = .none },
234 .{ .cpu_arch = .riscv64, .os_tag = .hurd, .abi = .gnu },
234 .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .android },235 .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .android },
235 .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .gnu },236 .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .gnu },
236 .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .musl },237 .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .musl },
test/src/Libc.zig+3-2
...@@ -45,8 +45,9 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {...@@ -45,8 +45,9 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
45 } else false;45 } else false;
46 if (!want_debug) return;46 if (!want_debug) return;
4747
48 const triple_txt = target.query.zigTriple(libc.b.allocator) catch @panic("OOM");
49
48 if (libc.options.test_target_filters.len > 0) {50 if (libc.options.test_target_filters.len > 0) {
49 const triple_txt = target.query.zigTriple(libc.b.allocator) catch @panic("OOM");
50 for (libc.options.test_target_filters) |filter| {51 for (libc.options.test_target_filters) |filter| {
51 if (std.mem.find(u8, triple_txt, filter)) |_| break;52 if (std.mem.find(u8, triple_txt, filter)) |_| break;
52 } else return;53 } else return;
...@@ -75,7 +76,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {...@@ -75,7 +76,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
75 });76 });
7677
77 for (libc.test_cases.items) |*test_case| {78 for (libc.test_cases.items) |*test_case| {
78 const annotated_case_name = libc.b.fmt("run libc-test {s}", .{test_case.name});79 const annotated_case_name = libc.b.fmt("run libc-test {s} ({s})", .{ test_case.name, triple_txt });
79 for (libc.options.test_filters) |test_filter| {80 for (libc.options.test_filters) |test_filter| {
80 if (std.mem.find(u8, annotated_case_name, test_filter)) |_| break;81 if (std.mem.find(u8, annotated_case_name, test_filter)) |_| break;
81 } else if (libc.options.test_filters.len > 0) continue;82 } else if (libc.options.test_filters.len > 0) continue;
test/tests.zig+12-9
...@@ -2377,13 +2377,17 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std...@@ -2377,13 +2377,17 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std
2377 .@"16bit_mode",2377 .@"16bit_mode",
2378 .@"32bit_mode",2378 .@"32bit_mode",
2379 .@"64bit",2379 .@"64bit",
2380 .false_deps_bls,
2381 .false_deps_compress,
2382 .false_deps_expand,
2380 .false_deps_getmant,2383 .false_deps_getmant,
2381 .false_deps_lzcnt_tzcnt,2384 .false_deps_lzcnt,
2382 .false_deps_mulc,2385 .false_deps_mulc,
2383 .false_deps_mullq,2386 .false_deps_mullq,
2384 .false_deps_perm,2387 .false_deps_perm,
2385 .false_deps_popcnt,2388 .false_deps_popcnt,
2386 .false_deps_range,2389 .false_deps_range,
2390 .false_deps_tzcnt,
2387 .fast_11bytenop,2391 .fast_11bytenop,
2388 .fast_15bytenop,2392 .fast_15bytenop,
2389 .fast_7bytenop,2393 .fast_7bytenop,
...@@ -2411,10 +2415,12 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std...@@ -2411,10 +2415,12 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std
2411 .prefer_legacy_setcc,2415 .prefer_legacy_setcc,
2412 .prefer_mask_registers,2416 .prefer_mask_registers,
2413 .prefer_movmsk_over_vtest,2417 .prefer_movmsk_over_vtest,
2418 .prefer_ndd_mem,
2414 .prefer_no_gather,2419 .prefer_no_gather,
2415 .prefer_no_scatter,2420 .prefer_no_scatter,
2416 .slow_3ops_lea,2421 .slow_3ops_lea,
2417 .slow_incdec,2422 .slow_incdec,
2423 .slow_indirect_call,
2418 .slow_lea,2424 .slow_lea,
2419 .slow_pmaddwd,2425 .slow_pmaddwd,
2420 .slow_pmulld,2426 .slow_pmulld,
...@@ -2426,10 +2432,13 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std...@@ -2426,10 +2432,13 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std
2426 }),2432 }),
2427 .aarch64, .aarch64_be => std.Target.aarch64.featureSet(&.{2433 .aarch64, .aarch64_be => std.Target.aarch64.featureSet(&.{
2428 .addr_lsl_slow_14,2434 .addr_lsl_slow_14,
2435 .align_cmp_csel_pairs,
2429 .alu_lsl_fast,2436 .alu_lsl_fast,
2430 .avoid_ldapur,2437 .avoid_ldapur,
2431 .disable_fast_inc_vl,2438 .disable_fast_inc_vl,
2432 .exynos_cheap_as_move,2439 .exynos_cheap_as_move,
2440 .fast_ld1_single,
2441 .fixed_load_latency_4,
2433 .fuse_address,2442 .fuse_address,
2434 .fuse_addsub_2reg_const1,2443 .fuse_addsub_2reg_const1,
2435 .fuse_adrp_add,2444 .fuse_adrp_add,
...@@ -2438,7 +2447,9 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std...@@ -2438,7 +2447,9 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std
2438 .fuse_crypto_eor,2447 .fuse_crypto_eor,
2439 .fuse_csel,2448 .fuse_csel,
2440 .fuse_cset,2449 .fuse_cset,
2450 .fuse_fcsel,
2441 .fuse_literals,2451 .fuse_literals,
2452 .has_limited_64bit_vector_mul_bandwidth,
2442 .predictable_select_expensive,2453 .predictable_select_expensive,
2443 .slow_misaligned_128store,2454 .slow_misaligned_128store,
2444 .slow_paired_128,2455 .slow_paired_128,
...@@ -2908,14 +2919,6 @@ fn addOneModuleTest(...@@ -2908,14 +2919,6 @@ fn addOneModuleTest(
2908 });2919 });
2909 these_tests.linkage = test_target.linkage;2920 these_tests.linkage = test_target.linkage;
2910 these_tests.use_new_linker = test_target.new_linker;2921 these_tests.use_new_linker = test_target.new_linker;
2911 // https://codeberg.org/ziglang/zig/issues/31701
2912 if (!(mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "libc"))) {
2913 if (options.no_builtin) these_tests.root_module.no_builtin = true;
2914 }
2915 // https://codeberg.org/ziglang/zig/issues/31702
2916 if (mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "libc")) {
2917 these_tests.root_module.stack_protector = false;
2918 }
2919 // https://github.com/llvm/llvm-project/issues/1955612922 // https://github.com/llvm/llvm-project/issues/195561
2920 if (target.cpu.arch.isPowerPC()) {2923 if (target.cpu.arch.isPowerPC()) {
2921 these_tests.root_module.stack_protector = false;2924 these_tests.root_module.stack_protector = false;
tools/macos-headers.c+1
...@@ -190,6 +190,7 @@...@@ -190,6 +190,7 @@
190#include <libkern/OSTypes.h>190#include <libkern/OSTypes.h>
191#include <MacTypes.h>191#include <MacTypes.h>
192#include <os/lock.h>192#include <os/lock.h>
193#include <os/os_sync_wait_on_address.h>
193#include <simd/simd.h>194#include <simd/simd.h>
194#include <xpc/xpc.h>195#include <xpc/xpc.h>
195#include <CommonCrypto/CommonCrypto.h>196#include <CommonCrypto/CommonCrypto.h>
tools/update_clang_options.zig+1-1
...@@ -681,7 +681,7 @@ pub fn main(init: std.process.Init) !void {...@@ -681,7 +681,7 @@ pub fn main(init: std.process.Init) !void {
681 "--dump-json",681 "--dump-json",
682 try std.fmt.allocPrint(arena, "{s}/clang/include/clang/Options/Options.td", .{llvm_src_root}),682 try std.fmt.allocPrint(arena, "{s}/clang/include/clang/Options/Options.td", .{llvm_src_root}),
683 try std.fmt.allocPrint(arena, "-I={s}/llvm/include", .{llvm_src_root}),683 try std.fmt.allocPrint(arena, "-I={s}/llvm/include", .{llvm_src_root}),
684 try std.fmt.allocPrint(arena, "-I={s}/clang/include/clang/Driver", .{llvm_src_root}),684 try std.fmt.allocPrint(arena, "-I={s}/clang/include/clang/Options", .{llvm_src_root}),
685 };685 };
686686
687 const child_result = try std.process.run(arena, io, .{687 const child_result = try std.process.run(arena, io, .{
tools/update_cpu_features.zig+46-99
...@@ -131,6 +131,14 @@ const targets = [_]ArchTarget{...@@ -131,6 +131,14 @@ const targets = [_]ArchTarget{
131 .zig_name = "contextidr_el2",131 .zig_name = "contextidr_el2",
132 .desc = "Enable RW operand Context ID Register (EL2)",132 .desc = "Enable RW operand Context ID Register (EL2)",
133 },133 },
134 .{
135 .llvm_name = "hip12",
136 .flatten = true,
137 },
138 .{
139 .llvm_name = "mca-streaming-sched",
140 .omit = true,
141 },
134 .{142 .{
135 .llvm_name = "neoversee1",143 .llvm_name = "neoversee1",
136 .flatten = true,144 .flatten = true,
...@@ -1481,6 +1489,42 @@ const targets = [_]ArchTarget{...@@ -1481,6 +1489,42 @@ const targets = [_]ArchTarget{
1481 .omit = true,1489 .omit = true,
1482 },1490 },
1483 },1491 },
1492 .extra_cpus = &.{
1493 .{
1494 .llvm_name = null,
1495 .zig_name = "cell",
1496 .features = &.{
1497 "64bit_support",
1498 "altivec",
1499 "fres",
1500 "frsqrte",
1501 "fsqrt",
1502 "mfocrf",
1503 "stfiwx",
1504 },
1505 },
1506 .{
1507 .llvm_name = null,
1508 .zig_name = "e500v2",
1509 .features = &.{
1510 "efpu2",
1511 "isel",
1512 "msync",
1513 },
1514 },
1515 .{
1516 .llvm_name = null,
1517 .zig_name = "e6500",
1518 .features = &.{
1519 "64bit_support",
1520 "altivec",
1521 "booke",
1522 "isel",
1523 "mfocrf",
1524 "stfiwx",
1525 },
1526 },
1527 },
1484 .omit_cpus = &.{1528 .omit_cpus = &.{
1485 "ppc32",1529 "ppc32",
1486 },1530 },
...@@ -1553,103 +1597,6 @@ const targets = [_]ArchTarget{...@@ -1553,103 +1597,6 @@ const targets = [_]ArchTarget{
1553 .zig_name = "baseline_rv64",1597 .zig_name = "baseline_rv64",
1554 .features = &.{ "64bit", "a", "c", "d", "f", "i", "m" },1598 .features = &.{ "64bit", "a", "c", "d", "f", "i", "m" },
1555 },1599 },
1556 .{
1557 .llvm_name = null,
1558 .zig_name = "spacemit_a100",
1559 .features = &.{
1560 "64bit",
1561 "a",
1562 "b",
1563 "c",
1564 "dlen_factor_2",
1565 "i",
1566 "m",
1567 "optimized_nf2_segment_load_store",
1568 "optimized_nf3_segment_load_store",
1569 "optimized_nf4_segment_load_store",
1570 "smepmp",
1571 "smnpm",
1572 "smstateen",
1573 "ssccptr",
1574 "sscofpmf",
1575 "sscounterenw",
1576 "ssnpm",
1577 "sspm",
1578 "sstc",
1579 "sstvala",
1580 "sstvecd",
1581 "ssu64xl",
1582 "supm",
1583 "svade",
1584 "svbare",
1585 "svinval",
1586 "svnapot",
1587 "svpbmt",
1588 "unaligned_scalar_mem",
1589 "v",
1590 "vxrm_pipeline_flush",
1591 "za64rs",
1592 "zawrs",
1593 "zbc",
1594 "zbkc",
1595 "zcb",
1596 "zcmop",
1597 "zfa",
1598 "zfh",
1599 "zic64b",
1600 "zicbom",
1601 "zicbop",
1602 "zicboz",
1603 "ziccamoa",
1604 "ziccif",
1605 "zicclsm",
1606 "ziccrse",
1607 "zicntr",
1608 "zicond",
1609 "zifencei",
1610 "zihintntl",
1611 "zihintpause",
1612 "zihpm",
1613 "zimop",
1614 "zkt",
1615 "zvbb",
1616 "zvfbfwma",
1617 "zvfh",
1618 "zvkng",
1619 "zvknha",
1620 "zvksc",
1621 "zvksg",
1622 "zvl1024b",
1623 },
1624 },
1625 .{
1626 .llvm_name = null,
1627 .zig_name = "spacemit_x100",
1628 .features = &.{
1629 "dlen_factor_2",
1630 "optimized_nf2_segment_load_store",
1631 "optimized_nf3_segment_load_store",
1632 "optimized_nf4_segment_load_store",
1633 "rva23s64",
1634 "smepmp",
1635 "smnpm",
1636 "smstateen",
1637 "sspm",
1638 "unaligned_scalar_mem",
1639 "vxrm_pipeline_flush",
1640 "xsmtvdot",
1641 "zbc",
1642 "zbkc",
1643 "zfh",
1644 "zvfbfwma",
1645 "zvfh",
1646 "zvkng",
1647 "zvknha",
1648 "zvksc",
1649 "zvksg",
1650 "zvl256b",
1651 },
1652 },
1653 },1600 },
1654 },1601 },
1655 .{1602 .{
...@@ -2450,7 +2397,7 @@ fn processOneTargetInner(io: Io, job: Job) !void {...@@ -2450,7 +2397,7 @@ fn processOneTargetInner(io: Io, job: Job) !void {
2450 for (all_features.items) |feature| {2397 for (all_features.items) |feature| {
2451 if (feature.llvm_name) |llvm_name| {2398 if (feature.llvm_name) |llvm_name| {
2452 try w.print(2399 try w.print(
2453 \\ result[@intFromEnum(Feature.{f})] = .{{2400 \\ result[@backingInt(Feature.{f})] = .{{
2454 \\ .llvm_name = "{f}",2401 \\ .llvm_name = "{f}",
2455 \\ .description = "{f}",2402 \\ .description = "{f}",
2456 \\ .dependencies = featureSet(&[_]Feature{{2403 \\ .dependencies = featureSet(&[_]Feature{{
...@@ -2463,7 +2410,7 @@ fn processOneTargetInner(io: Io, job: Job) !void {...@@ -2463,7 +2410,7 @@ fn processOneTargetInner(io: Io, job: Job) !void {
2463 );2410 );
2464 } else {2411 } else {
2465 try w.print(2412 try w.print(
2466 \\ result[@intFromEnum(Feature.{f})] = .{{2413 \\ result[@backingInt(Feature.{f})] = .{{
2467 \\ .llvm_name = null,2414 \\ .llvm_name = null,
2468 \\ .description = "{f}",2415 \\ .description = "{f}",
2469 \\ .dependencies = featureSet(&[_]Feature{{2416 \\ .dependencies = featureSet(&[_]Feature{{